Difference between revisions of "Perl change codon to AA"
imported>Park SeongWan |
imported>Park SeongWan |
||
Line 12: | Line 12: | ||
"V","V","V","V","A","A","A","A","D","D","E","E","G","G","G","G");</p> | "V","V","V","V","A","A","A","A","D","D","E","E","G","G","G","G");</p> | ||
− | <p><br /> | + | <p>my %codon;<br /> |
− | for (my $i=0;$i<4;$i++) {<br /> | + | my $var;<br /> |
+ | my %result;</p> | ||
+ | |||
+ | <p>for (my $i=0;$i<4;$i++) {<br /> | ||
for (my $j=0;$j<4;$j++) {<br /> | for (my $j=0;$j<4;$j++) {<br /> | ||
− | for (my $k=0;$k<4;$k++) {</p> | + | for (my $k=0;$k<4;$k++) {<br /> |
+ | $var=$bases[$i]. $bases[$j]. $bases[$k];<br /> | ||
+ | $codon{$var} = $AA[16*($i)+4*($j)+($k)];</p> | ||
+ | |||
+ | <p>}}}</p> | ||
<p><br /> | <p><br /> | ||
− | + | print %codon , "\n";</p> | |
− | + | ||
− | print " | + | <p>print $codon{"uuu"};</p> |
<p> </p> | <p> </p> | ||
Line 27: | Line 34: | ||
<hr /> | <hr /> | ||
− | <p> | + | <p>gggGuucFgguGaugMccaPauuIaacNccuPggaGacuTucuSgcuAcuuLcguRuuuFguuVgccAcuaLaucIggcGgagE</p> |
− | + | ||
− | + | <p>aauNcugLgauDaccTaagKuga.cgaRgcgAuuaLuaa.acgTgugVcauHuguCgcaAgucVuccSuacYagcSuauYucaS</p> | |
− | + | ||
+ | <p>acaTuugLauaIccgPcacHgaaEgacDcagQcggRcccPaggRaguSuag.cgcRguaVuggWugcCucgSagaRcucLaaaKcaaQ</p> | ||
+ | |||
+ | <p>F</p> | ||
<p> </p> | <p> </p> |
Latest revision as of 18:57, 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");
my %codon;
my $var;
my %result;
for (my $i=0;$i<4;$i++) {
for (my $j=0;$j<4;$j++) {
for (my $k=0;$k<4;$k++) {
$var=$bases[$i]. $bases[$j]. $bases[$k];
$codon{$var} = $AA[16*($i)+4*($j)+($k)];
}}}
print %codon , "\n";
print $codon{"uuu"};
Result
gggGuucFgguGaugMccaPauuIaacNccuPggaGacuTucuSgcuAcuuLcguRuuuFguuVgccAcuaLaucIggcGgagE
aauNcugLgauDaccTaagKuga.cgaRgcgAuuaLuaa.acgTgugVcauHuguCgcaAgucVuccSuacYagcSuauYucaS
acaTuugLauaIccgPcacHgaaEgacDcagQcggRcccPaggRaguSuag.cgcRguaVuggWugcCucgSagaRcucLaaaKcaaQ
F