Open main menu

Biolecture.org β

Changes

YMS HW1

4,216 bytes added, 15:36, 20 May 2016
Created page with "<p>==Perl Code==</p> <p><span style="font-family:courier new,courier,monospace">#!/bin/perl -w</span></p> <p><span style="font-family:courier new,courier,monospace">use Bio::Se..."
<p>==Perl Code==</p>

<p><span style="font-family:courier new,courier,monospace">#!/bin/perl -w</span></p>

<p><span style="font-family:courier new,courier,monospace">use Bio::Seq;</span></p>

<p><span style="font-family:courier new,courier,monospace">print &quot;Trial for Homework \&quot;Make a Perl program translating &#39;all&#39; combinations of triple bases into amino acids\&quot;\n&quot;;</span></p>

<p><span style="font-family:courier new,courier,monospace">@bases=(&quot;a&quot;,&quot;t&quot;,&quot;g&quot;,&quot;c&quot;);<br />
foreach $first(@bases) {<br />
foreach $second(@bases) {<br />
foreach $third(@bases) {</span></p>

<p><span style="font-family:courier new,courier,monospace">&nbsp; &nbsp; &nbsp; &nbsp; $codon=$first.$second.$third;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $seq_codon = Bio::Seq-&gt;new(-seq =&gt; $codon,-alphabet =&gt; &#39;dna&#39; );<br />
&nbsp; &nbsp; &nbsp; &nbsp; $aa_letter = $seq_codon-&gt;translate;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;$codon\t&quot;,$aa_letter-&gt;seq,&quot;\t&quot;;</span></p>

<p><span style="font-family:courier new,courier,monospace">}</span><br />
print &quot;\n&quot;;<br />
}<br />
}<br />
==Output==</p>

<p>$ perl 1.translation.pl&nbsp;<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 />
ata&nbsp;&nbsp; &nbsp;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