Difference between revisions of "Perl change codon to AA"
imported>Park SeongWan (Created page with "<p>#!/usr/bin/perl<br /> use strict;<br /> use warnings;</p> <p><br /> my @bases=("u","c","a","g");<br /> my @AA=("F","F&q...") |
imported>Park SeongWan |
||
Line 1: | Line 1: | ||
+ | <p><strong>CODE </strong></p> | ||
+ | |||
+ | <hr /> | ||
<p>#!/usr/bin/perl<br /> | <p>#!/usr/bin/perl<br /> | ||
use strict;<br /> | use strict;<br /> | ||
Line 21: | Line 24: | ||
<p> </p> | <p> </p> | ||
+ | <p><strong>Result</strong></p> | ||
+ | |||
+ | <hr /> | ||
<p>uuu F uuc F uua L uug L ucu S ucc S uca S ucg S uau Y uac Y uaa . uag . ugu C ugc C uga . ugg W<br /> | <p>uuu F uuc F uua L uug L ucu S ucc S uca S ucg S uau Y uac Y uaa . uag . ugu C ugc C uga . ugg W<br /> | ||
cuu L cuc L cua L cug L ccu P ccc P cca P ccg P cau H cac H caa Q cag Q cgu R cgc R cga R cgg R<br /> | cuu L cuc L cua L cug L ccu P ccc P cca P ccg P cau H cac H caa Q cag Q cgu R cgc R cga R cgg R<br /> |
Revision as of 16:54, 23 May 2016
CODE
#!/usr/bin/perl
use strict;
use warnings;
my @bases=("u","c","a","g");
my @AA=("F","F","L","L","S","S","S","S","Y","Y",".",".","C","C",".","W","L","L","L","L","P","P","P","P",
"H","H","Q","Q","R","R","R","R","I","I","I","M","T","T","T","T","N","N","K","K","S","S","R","R",
"V","V","V","V","A","A","A","A","D","D","E","E","G","G","G","G");
for (my $i=0;$i<4;$i++) {
for (my $j=0;$j<4;$j++) {
for (my $k=0;$k<4;$k++) {
print $bases[$i], $bases[$j], $bases[$k], " ", $AA[16*($i)+4*($j)+($k)], " ";
}}
print "\n";}
Result
uuu F uuc F uua L uug L ucu S ucc S uca S ucg S uau Y uac Y uaa . uag . ugu C ugc C uga . ugg W
cuu L cuc L cua L cug L ccu P ccc P cca P ccg P cau H cac H caa Q cag Q cgu R cgc R cga R cgg R
auu I auc I aua I aug M acu T acc T aca T acg T aau N aac N aaa K aag K agu S agc S aga R agg R
guu V guc V gua V gug V gcu A gcc A gca A gcg A gau D gac D gaa E gag E ggu G ggc G gga G ggg G