Difference between revisions of "Perl change codon 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=("u","c","a","g");<br /> my @AA=("F","F&q...")
 
imported>Park SeongWan
Line 1: Line 1:
 +
<p><strong>CODE&nbsp;</strong></p>
 +
 +
<hr />
 
<p>#!/usr/bin/perl<br />
 
<p>#!/usr/bin/perl<br />
 
use strict;<br />
 
use strict;<br />
Line 21: Line 24:
 
<p>&nbsp;</p>
 
<p>&nbsp;</p>
  
 +
<p><strong>Result</strong></p>
 +
 +
<hr />
 
<p>uuu F&nbsp; uuc F&nbsp; uua L&nbsp; uug L&nbsp; ucu S&nbsp; ucc S&nbsp; uca S&nbsp; ucg S&nbsp; uau Y&nbsp; uac Y&nbsp; uaa .&nbsp; uag .&nbsp; ugu C&nbsp; ugc C&nbsp; uga .&nbsp; ugg W<br />
 
<p>uuu F&nbsp; uuc F&nbsp; uua L&nbsp; uug L&nbsp; ucu S&nbsp; ucc S&nbsp; uca S&nbsp; ucg S&nbsp; uau Y&nbsp; uac Y&nbsp; uaa .&nbsp; uag .&nbsp; ugu C&nbsp; ugc C&nbsp; uga .&nbsp; ugg W<br />
 
cuu L&nbsp; cuc L&nbsp; cua L&nbsp; cug L&nbsp; ccu P&nbsp; ccc P&nbsp; cca P&nbsp; ccg P&nbsp; cau H&nbsp; cac H&nbsp; caa Q&nbsp; cag Q&nbsp; cgu R&nbsp; cgc R&nbsp; cga R&nbsp; cgg R<br />
 
cuu L&nbsp; cuc L&nbsp; cua L&nbsp; cug L&nbsp; ccu P&nbsp; ccc P&nbsp; cca P&nbsp; ccg P&nbsp; cau H&nbsp; cac H&nbsp; caa Q&nbsp; cag Q&nbsp; cgu R&nbsp; cgc R&nbsp; cga R&nbsp; 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