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/11/06 09:59] – 172.26.0.166 | bio:tools:codonopttable [2010/06/30 19:52] (current) – 172.26.15.75 | ||
---|---|---|---|
Line 10: | Line 10: | ||
Installation from cpan | Installation from cpan | ||
< | < | ||
- | depends on GD::Graph and Bio::Perl | + | depends on **GD::Graph** and **Bio::Perl** |
http:// | http:// | ||
+ | |||
+ | ====USES or Examples==== | ||
+ | |||
+ | You can use this module in the following ways | ||
+ | < | ||
+ | use Bio:: | ||
+ | |||
+ | my $seqobj = Bio:: | ||
+ | |||
+ | -id => ' | ||
+ | -accession_number => ' | ||
+ | -alphabet => ' | ||
+ | -is_circular => 1, | ||
+ | -genetic_code => 1, | ||
+ | ); | ||
+ | </ | ||
+ | B<#If you wanna read from file> | ||
+ | < | ||
+ | my $seqobj = Bio:: | ||
+ | |||
+ | | ||
+ | | ||
+ | ); | ||
+ | </ | ||
+ | B<#If you have Accession number and want to get file from NCBI> < | ||
+ | |||
+ | -genetic_code => 1,); | ||
+ | |||
+ | my $myCodons = $seqobj-> | ||
+ | |||
+ | if($myCodons) | ||
+ | |||
+ | { | ||
+ | for my $each_aa (@$myCodons) | ||
+ | { | ||
+ | print " | ||
+ | print " | ||
+ | print " | ||
+ | print "RSCU Value : ", | ||
+ | print "RAC Value : ", | ||
+ | print " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | B<# To get the prefered codon list based on RSCU & RAC Values >< | ||
+ | |||
+ | while ( my ($amino_acid, | ||
+ | |||
+ | print " | ||
+ | </ | ||
+ | B<# To produce a graph between RSCU & RAC> # Graph output file extension should be GIF, we support GIF only | ||
+ | < | ||
+ | $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.txt · Last modified: 2010/06/30 19:52 by 172.26.15.75