ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/guiblast/winblast.py
Revision: 1.1.1.1 (vendor branch)
Committed: Sun Jul 27 00:44:58 2003 UTC (18 years, 6 months ago) by rgwoodley
Branch: MAIN
CVS Tags: HEAD, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
Initial checkin for GuiBlast

Line File contents
1 #!/usr/bin/python
2
3 """
4 __version__ = "$Revision: 1.6 $"
5 __date__ = "$Date: 2002/07/29 17:44:55 $"
6 """
7
8 from PythonCardPrototype import model
9 import webbrowser
10 from Bio.Blast import NCBIStandalone
11
12 #variables mias.
13 blastexe="c:\\bioinfo-adv\\blast\\blastall.exe"
14 pathdb="c:\\bioinfo-adv\\blast\\data\\" # aca hay que agregar cada base en part.
15 tempdir="c:\\bioinfo-adv\\temp\\"
16
17 class WinBlast(model.Background):
18
19 def on_menuFileExit_select(self, event):
20 self.Close()
21 def on_incrBtn_mouseClick(self, event):
22 startValue = int(self.components.field1.text)
23 endValue = startValue + 1
24 self.components.field1.text = str(endValue)
25 def on_decrBtn_mouseClick(self, event):
26 startValue = int(self.components.field1.text)
27 endValue = startValue - 1
28 self.components.field1.text = str(endValue)
29 def on_resetBtn_mouseClick(self, event):
30 self.components.field1.text = "0"
31
32 def on_SliderWordSize_mouseClick(self, event):
33 pass
34 #startValue = int(self.components.field1.text)
35 #self.components.field1.text = str(endValue)
36 def on_ComboBox1_selected(self, event):
37 pass
38 def on_Btnrunblast_mouseClick(self, event):
39 if self.components.ComboDB.text=='nr':
40 base='nr'
41 elif self.components.ComboDB.text=='Arabidopsis Thaliana':
42 base='atal.faa'
43 elif self.components.ComboDB.text=='E.Coli':
44 if (self.components.ComboBox1.text==('blastp'))|(self.components.ComboBox1.text==('blastx')):
45 base='ecoli.aa'
46 else:
47 base='ecoli.nt'
48
49 else:
50 base='nr.aa' # warning about this.
51 print "BLAST: "
52 print self.components.ComboBox1.text
53 print pathdb+base
54 print self.components.seqinput.text
55 archentrada=open(tempdir+"input.txt",'w')
56 archentrada.writelines(self.components.seqinput.text)
57 archentrada.close()
58 blast_out, error_info = NCBIStandalone.blastall(blastexe, self.components.ComboBox1.text, pathdb+base, tempdir+'input.txt', expectation=5, html='T')
59 f=open(tempdir+"tempblast.htm", 'w')
60 f.writelines(blast_out)
61 f.close()
62 webbrowser.open(tempdir+"tempblast.htm")
63 # esto se tiene que habilitar solo con el texto lleno.
64
65
66 if __name__ == '__main__':
67 app = model.PythonCardApp(WinBlast)
68 app.MainLoop()