Difference between revisions of "YMS HW1"

From Biolecture.org
imported>윤명서
imported>윤명서
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<p>This is Myungseo Yoon&#39;s&nbsp;result of the Homework, &quot;Make a Perl program translating &#39;all&#39; combinations of triple bases into amino acids.&quot;</p>
 +
 +
<p>&nbsp;</p>
 +
 
<h1><strong>Perl Code</strong></h1>
 
<h1><strong>Perl Code</strong></h1>
  
Line 26: Line 30:
 
<h1><strong>Output</strong></h1>
 
<h1><strong>Output</strong></h1>
  
<p>$ perl 1.translation.pl&nbsp;<br />
+
<p><span style="font-family:courier new,courier,monospace">$ perl 1.translation.pl&nbsp;</span><br />
 
<span style="font-family:courier new,courier,monospace">Trial for Homework &quot;Make a Perl program translating &#39;all&#39; combinations of triple bases into amino acids&quot;<br />
 
<span style="font-family:courier new,courier,monospace">Trial for Homework &quot;Make a Perl program translating &#39;all&#39; combinations of triple bases into amino acids&quot;<br />
 
aaa&nbsp;&nbsp; &nbsp;K&nbsp;&nbsp; &nbsp;aat&nbsp;&nbsp; &nbsp;N&nbsp;&nbsp; &nbsp;aag&nbsp;&nbsp; &nbsp;K&nbsp;&nbsp; &nbsp;aac&nbsp;&nbsp; &nbsp;N&nbsp;&nbsp; &nbsp;<br />
 
aaa&nbsp;&nbsp; &nbsp;K&nbsp;&nbsp; &nbsp;aat&nbsp;&nbsp; &nbsp;N&nbsp;&nbsp; &nbsp;aag&nbsp;&nbsp; &nbsp;K&nbsp;&nbsp; &nbsp;aac&nbsp;&nbsp; &nbsp;N&nbsp;&nbsp; &nbsp;<br />

Latest revision as of 15:50, 20 May 2016

This is Myungseo Yoon's result of the Homework, "Make a Perl program translating 'all' combinations of triple bases into amino acids."

 

Perl Code

#!/bin/perl -w

use Bio::Seq;

print "Trial for Homework \"Make a Perl program translating 'all' combinations of triple bases into amino acids\"\n";

@bases=("a","t","g","c");
foreach $first(@bases) {
foreach $second(@bases) {
foreach $third(@bases) {

        $codon=$first.$second.$third;
        $seq_codon = Bio::Seq->new(-seq => $codon,-alphabet => 'dna' );
        $aa_letter = $seq_codon->translate;
        print "$codon\t",$aa_letter->seq,"\t";

}
print "\n";
}
}

 

Output

$ perl 1.translation.pl 
Trial for Homework "Make a Perl program translating 'all' combinations of triple bases into amino acids"
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