Back to index

python-biopython  1.60
Public Member Functions | Public Attributes | Private Member Functions
xbb_blast.BlastIt Class Reference

List of all members.

Public Member Functions

def __init__
def GetBlasts
def Choices
def Validate
def Update
def oldRun
def Run
def Exit

Public Attributes

 seq
 parent
 toplevel
 pin
 nin
 cf
 dbs
 blasts
 alternative_f
 alternative
 ok
 command
 notepad
 pipe

Private Member Functions

def _Run

Detailed Description

Definition at line 17 of file xbb_blast.py.


Constructor & Destructor Documentation

def xbb_blast.BlastIt.__init__ (   self,
  seq,
  parent = None 
)

Definition at line 18 of file xbb_blast.py.

00018 
00019     def __init__(self, seq, parent = None):
00020         self.seq = seq
00021         self.parent = parent
00022         self.toplevel = Toplevel(parent)
00023         Pmw.initialise(parent)
00024         self.GetBlasts()
00025         self.Choices()
        

Member Function Documentation

def xbb_blast.BlastIt._Run (   self) [private]

Definition at line 87 of file xbb_blast.py.

00087 
00088     def _Run(self):
00089         alternative_command = self.alternative.get()
00090         if len(alternative_command.strip()):
00091             self.command = alternative_command.strip()
00092         else:
00093             db = self.dbs.get()
00094             prog = self.blasts.get()
00095             self.command = 'echo %s | nice blastall -d %s -p %s' % (self.seq, db, prog)
00096 
00097         self.Run()

def xbb_blast.BlastIt.Choices (   self)

Definition at line 43 of file xbb_blast.py.

00043 
00044     def Choices(self):
00045         self.GetBlasts()
00046         self.cf = Frame(self.toplevel)
00047         self.cf.pack(side = TOP, expand = 1, fill = X)
00048         self.dbs = Pmw.ComboBox(self.cf,
00049                                 label_text = 'Blast Databases:',
00050                                 labelpos = 'nw',
00051                                 scrolledlist_items = self.nin + self.pin,
00052                                 selectioncommand = self.Validate
00053                                 )
00054         self.blasts = Pmw.ComboBox(self.cf,
00055                                    label_text = 'Blast Programs:',
00056                                    labelpos = 'nw',
00057                                    scrolledlist_items = ['blastn', 'blastp', 'blastx', 'tblastn', 'tblastx'],
00058                                    selectioncommand = self.Validate
00059                                    )
00060         self.dbs.pack(side = LEFT, expand = 1, fill = X)
00061         self.blasts.pack(side = LEFT, expand = 1, fill = X)
00062 
00063         self.alternative_f = Frame(self.cf)
00064         self.alternative = Entry(self.alternative_f)
00065         self.alternative_f.pack(side = TOP, fill = X, expand = 1)
00066         self.alternative.pack(side = LEFT, fill = X, expand = 1)
00067         self.ok = Button(self.alternative_f, text = 'Run',
00068                          command = self._Run)
00069         self.ok.pack(side = RIGHT)
00070         
00071         self.dbs.selectitem(0)
00072         self.blasts.selectitem(0)
00073         self.Validate()
        

Here is the call graph for this function:

def xbb_blast.BlastIt.Exit (   self,
  args 
)

Definition at line 143 of file xbb_blast.py.

00143 
00144     def Exit(self, *args):
00145 
00146         try:
00147             self.pipe.close()
00148             del(pipe)
00149         except:
00150             pass
00151         self.notepad.destroy()
00152 
00153         sys.exit(0)
00154         
00155 
00156 

Here is the caller graph for this function:

Definition at line 26 of file xbb_blast.py.

00026 
00027     def GetBlasts(self):
00028         pin, nin = [],[]
00029         try:
00030             pin.extend(glob.glob(os.environ['BLASTDB'] + '/*.pin'))
00031         except:
00032             pass
00033         pin.extend(glob.glob('*.pin'))
00034         
00035         try:
00036             nin.extend(glob.glob(os.environ['BLASTDB'] + '/*.nin'))
00037         except:
00038             pass
00039         nin.extend(glob.glob('*.nin'))
00040 
00041         self.pin = map(lambda x: os.path.splitext(x)[0],pin)
00042         self.nin = map(lambda x: os.path.splitext(x)[0],nin)

Here is the caller graph for this function:

def xbb_blast.BlastIt.oldRun (   self)

Definition at line 103 of file xbb_blast.py.

00103 
00104     def oldRun(self):
00105         self.notepad = NotePad()
00106         self.notepad.menubar.configure(bg='red')
00107         self.notepad.bind('<Destroy>', self.Exit)
00108 
00109         self.Update()
00110         
00111         print self.command
00112         self.pipe = posix.popen(self.command)
00113         while 1:
00114             try:
00115                 char = self.pipe.read(1)
00116                 self.notepad.insert(END,char)
00117                 self.notepad.update()
00118                                 
00119             except:
00120                 break
00121             if not char: break
00122             
00123         try:
00124             self.notepad.menubar.configure(bg='green')
00125         except:
00126             pass

def xbb_blast.BlastIt.Run (   self)

Definition at line 127 of file xbb_blast.py.

00127 
00128     def Run(self):
00129         self.notepad = NotePad()
00130         tid = self.notepad.tid
00131         self.notepad.menubar.configure(bg='red')
00132 
00133         self.toplevel.destroy()
00134         blastbg = xbb_blastbg.BlastDisplayer(self.command, tid)
00135         blastbg.RunCommand()
00136 
00137         # indicate the finished run by changing color
00138         try:
00139             self.notepad.menubar.configure(bg='green4')
00140         except:
00141             pass
00142         
        
def xbb_blast.BlastIt.Update (   self)

Definition at line 98 of file xbb_blast.py.

00098 
00099     def Update(self):
00100         self.notepad.update()
00101         #print '.',
00102         self.notepad.after(1, self.Update)
        

Here is the call graph for this function:

Here is the caller graph for this function:

def xbb_blast.BlastIt.Validate (   self,
  args 
)

Definition at line 74 of file xbb_blast.py.

00074 
00075     def Validate(self, *args):
00076         db = self.dbs.get()
00077         prog = self.blasts.get()
00078         color = 'red'
00079         if (prog in ['blastn', 'tblastx', 'tblastn']) == (db in self.nin):
00080             color = 'green'
00081         elif (prog in ['blastp', 'blastx']) == (db in self.pin):
00082             color = 'green'
00083 
00084         self.dbs.component('entry').configure(bg = color)
00085         self.blasts.component('entry').configure(bg = color)
00086 
            

Member Data Documentation

Definition at line 63 of file xbb_blast.py.

Definition at line 62 of file xbb_blast.py.

Definition at line 53 of file xbb_blast.py.

Definition at line 45 of file xbb_blast.py.

Definition at line 90 of file xbb_blast.py.

Definition at line 47 of file xbb_blast.py.

Definition at line 41 of file xbb_blast.py.

Definition at line 104 of file xbb_blast.py.

Definition at line 66 of file xbb_blast.py.

Definition at line 20 of file xbb_blast.py.

Definition at line 40 of file xbb_blast.py.

Definition at line 111 of file xbb_blast.py.

Definition at line 19 of file xbb_blast.py.

Definition at line 21 of file xbb_blast.py.


The documentation for this class was generated from the following file: