Difference between revisions of "Perl change DNA to AA"
imported>Park SeongWan (Created page with "<p>#!/usr/bin/perl<br /> use strict;<br /> use warnings;</p> <p><br /> my @bases=("a","t","g","c");<br /> my @AA=("K","N&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> </p> | + | <p><strong> Result</strong></p> |
+ | <hr /> | ||
<p>aaa K aat N aag K aac N ata I att I atg M atc I aga R agt S agg R agc S aca T act T acg T acc T<br /> | <p>aaa K aat N aag K aac N ata I att I atg M atc I aga R agt S agg R agc S aca T act T acg T acc T<br /> | ||
taa . tat Y tag . tac Y tta L ttt F ttg L ttc F tga . tgt C tgg W tgc C tca S tct S tcg S tcc S<br /> | taa . tat Y tag . tac Y tta L ttt F ttg L ttc F tga . tgt C tgg W tgc C tca S tct S tcg S tcc S<br /> | ||
gaa E gat D gag E gac D gta V gtt V gtg V gtc V gga G ggt G ggg G ggc G gca A gct A gcg A gcc A<br /> | gaa E gat D gag E gac D gta V gtt V gtg V gtc V gga G ggt G ggg G ggc G gca A gct A gcg A gcc A<br /> | ||
caa Q cat H cag Q cac H cta L ctt L ctg L ctc L cga R cgt R cgg R cgc R cca P cct P ccg P ccc P</p> | caa Q cat H cag Q cac H cta L ctt L ctg L ctc L cga R cgt R cgg R cgc R cca P cct P ccg P ccc P</p> |
Latest revision as of 16:55, 23 May 2016
CODE
#!/usr/bin/perl
use strict;
use warnings;
my @bases=("a","t","g","c");
my @AA=("K","N","K","N","I","I","M","I","R","S","R","S","T","T","T","T",".","Y",".","Y","L","F","L","F",
".","C","W","C","S","S","S","S","E","D","E","D","V","V","V","V","G","G","G","G","A","A","A","A",
"Q","H","Q","H","L","L","L","L","R","R","R","R","P","P","P","P");
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
aaa K aat N aag K aac N ata I att I atg M atc I aga R agt S agg R agc S aca T act T acg T acc T
taa . tat Y tag . tac Y tta L ttt F ttg L ttc F tga . tgt C tgg W tgc C tca S tct S tcg S tcc S
gaa E gat D gag E gac D gta V gtt V gtg V gtc V gga G ggt G ggg G ggc G gca A gct A gcg A gcc A
caa Q cat H cag Q cac H cta L ctt L ctg L ctc L cga R cgt R cgg R cgc R cca P cct P ccg P ccc P