bio:tools:codonopttable
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| bio:tools:codonopttable [2009/12/17 09:47] – 172.26.15.75 | bio:tools:codonopttable [2010/06/30 19:52] (current) – 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 | ||
| + | import re | ||
| + | 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, | ||
| + | # | ||
| + | self.orig_label =wx.StaticText(panel, | ||
| + | ok_button =wx.Button(panel, | ||
| + | cancel_button =wx.Button(panel, | ||
| + | format_seq =wx.Button(panel, | ||
| + | rhead =wx.Button(panel, | ||
| + | exit_button=wx.Button(panel, | ||
| + | disp =wx.StaticText(panel, | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | |||
| + | | ||
| + | # | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | #events | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | # | ||
| + | | ||
| + | | ||
| + | | ||
| + | def clear(self, | ||
| + | self.orig_text.SetValue('' | ||
| + | def format_seq(self, | ||
| + | originator=self.orig_text.GetValue() | ||
| + | comm=re.sub(' | ||
| + | self.orig_text.SetValue(comm) | ||
| + | def rheader(self, | ||
| + | originator=self.orig_text.GetValue() | ||
| + | comm=re.sub('> | ||
| + | self.orig_text.SetValue(comm) | ||
| + | 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 sequence lines using sed: | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
bio/tools/codonopttable.1261043258.txt.gz · Last modified: (external edit)
