bio:tools:codonopttable
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
bio:tools:codonopttable [2009/12/17 09:47] – 172.26.15.75 | bio:tools:codonopttable [2010/04/15 11:34] – 172.26.15.75 | ||
---|---|---|---|
Line 66: | Line 66: | ||
< | < | ||
$seqobj-> | $seqobj-> | ||
+ | ====Creating a gui for CodonOptTable==== | ||
+ | |||
+ | Here is a python script that provides a Graphical User Interface: | ||
+ | You need to have wxpython installed on your system. | ||
+ | <code python> | ||
+ | # | ||
+ | import wx | ||
+ | import os | ||
+ | import random | ||
+ | class testgui(wx.Frame): | ||
+ | def __init__(self, | ||
+ | wx.Frame.__init__(self, | ||
+ | # Menu stuff | ||
+ | menubar =wx.MenuBar() | ||
+ | menufile =wx.Menu() | ||
+ | menuhelp =wx.Menu() | ||
+ | self.SetMenuBar(menubar) | ||
+ | menubar.Append(menufile, | ||
+ | menubar.Append(menuhelp, | ||
+ | exitmenu =menufile.Append(-1, | ||
+ | about =menuhelp.Append(-1, | ||
+ | #panel creation and sizer | ||
+ | panel =wx.Panel(self, | ||
+ | hbsizer =wx.BoxSizer(wx.VERTICAL) | ||
+ | self.orig_text =wx.TextCtrl(panel, | ||
+ | # self.orig_text =wx.TextCtrl(panel, | ||
+ | #Objects | ||
+ | self.orig_label =wx.StaticText(panel, | ||
+ | ok_button =wx.Button(panel, | ||
+ | cancel_button =wx.Button(panel, | ||
+ | exit_button=wx.Button(panel, | ||
+ | disp =wx.StaticText(panel, | ||
+ | |||
+ | vsizer1 =wx.BoxSizer(wx.HORIZONTAL) | ||
+ | vsizer4 =wx.BoxSizer(wx.HORIZONTAL) | ||
+ | vsizer5 =wx.BoxSizer(wx.HORIZONTAL) | ||
+ | vsizer6 =wx.BoxSizer(wx.HORIZONTAL) | ||
+ | vsizer2 =wx.BoxSizer(wx.HORIZONTAL) | ||
+ | |||
+ | vsizer1.Add(self.orig_label, | ||
+ | vsizer2.Add(self.orig_text, | ||
+ | |||
+ | vsizer5.Add(ok_button, | ||
+ | vsizer5.Add(cancel_button, | ||
+ | vsizer5.Add(exit_button, | ||
+ | |||
+ | vsizer6.Add(disp, | ||
+ | |||
+ | hbsizer.Add(vsizer1, | ||
+ | # | ||
+ | hbsizer.Add(vsizer2, | ||
+ | hbsizer.Add(vsizer4, | ||
+ | hbsizer.Add(vsizer5, | ||
+ | hbsizer.Add(vsizer6, | ||
+ | |||
+ | #events | ||
+ | self.Bind(wx.EVT_BUTTON, | ||
+ | self.Bind(wx.EVT_MENU, | ||
+ | self.Bind(wx.EVT_BUTTON, | ||
+ | self.Bind(wx.EVT_BUTTON, | ||
+ | # | ||
+ | panel.SetSizer(hbsizer) | ||
+ | self.Centre() | ||
+ | |||
+ | self.Show(True) | ||
+ | def clear(self, | ||
+ | self.orig_text.SetValue('' | ||
+ | |||
+ | def soja(self, event=None): | ||
+ | self.Close(True) | ||
+ | def executa(self, | ||
+ | recordid=random.randint(20, | ||
+ | originator=self.orig_text.GetValue() | ||
+ | os.system(' | ||
+ | wx.MessageBox(' | ||
+ | app =wx.App() | ||
+ | testgui(None, | ||
+ | app.MainLoop() | ||
+ | </ | ||
+ | This is used together with the perl script: | ||
+ | <code perl># | ||
+ | use Bio:: | ||
+ | $sequence = $ARGV[0]; | ||
+ | sub codon { | ||
+ | my ($mysequence)=@_; | ||
+ | print $mysequence; | ||
+ | my $seqobj = Bio:: | ||
+ | -id => ' | ||
+ | -accession_number => ' | ||
+ | -alphabet => ' | ||
+ | -is_circular => 1, | ||
+ | -genetic_code => 1, | ||
+ | ); | ||
+ | #my $seqobj = Bio:: | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # ); | ||
+ | my $myCodons = $seqobj-> | ||
+ | |||
+ | if($myCodons) | ||
+ | |||
+ | { | ||
+ | for my $each_aa (@$myCodons) | ||
+ | { | ||
+ | print " | ||
+ | print " | ||
+ | print " | ||
+ | print "RSCU Value : ", | ||
+ | print "RAC Value : ", | ||
+ | print " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | while ( my ($amino_acid, | ||
+ | |||
+ | print " | ||
+ | $seqobj-> | ||
+ | } | ||
+ | codon($sequence); | ||
+ | <note warning> Note: You have to edit the paths to suite your setup. </ | ||
+ | |||
+ | ==== Usefull ReGex ==== | ||
+ | ---- | ||
+ | merge lines sed |
bio/tools/codonopttable.txt · Last modified: 2010/06/30 19:52 by 172.26.15.75