Difference between revisions of "Perl change DNA to AA"

From Biolecture.org
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...")
(No difference)

Revision as of 23:09, 22 May 2016

#!/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";}

 

 

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