Open main menu

Biolecture.org β

Changes

2.Install perl and run the program

661 bytes added, 13:56, 26 May 2016
Created page with "<p> </p> <p><기본 format></p> <p>#!/usr/bin/perl<br /> # Translate DNA into protein</p> <p>use strict;<br /> use warnings;<br /> use BeginPerlBioinfo;  &nbsp..."
<p>&nbsp;</p>

<p>&lt;기본 format&gt;</p>

<p>#!/usr/bin/perl<br />
# Translate DNA into protein</p>

<p>use strict;<br />
use warnings;<br />
use BeginPerlBioinfo; &nbsp;&nbsp;</p>

<p># Initialize variables<br />
my $dna = &#39;&#39;;<br />
my $protein = &#39;&#39;;<br />
my $codon;</p>

<p># Translate each three-base codon into an amino acid, and append to a protein&nbsp;<br />
for(my $i=0; $i &lt; (length($dna) - 2) ; $i += 3) {<br />
&nbsp; &nbsp; $codon = substr($dna,$i,3);<br />
&nbsp; &nbsp; $protein .= codon2aa($codon);<br />
}</p>

<p>print &quot;I translated the DNA\n\n$dna\n\n &nbsp;into the protein\n\n$protein\n\n&quot;;</p>

<p>exit;</p>
Anonymous user