Open main menu

Biolecture.org β

Changes

Perl code-CSH

2,718 bytes added, 01:09, 7 June 2016
Created page with "<p>#!/usr/bin/perl<br /> use strict;<br /> use warnings;<br /> my @Base = ("T","C","A","G");<br /> my @Prot = ("F","F"..."
<p>#!/usr/bin/perl<br />
use strict;<br />
use warnings;<br />
my @Base = (&quot;T&quot;,&quot;C&quot;,&quot;A&quot;,&quot;G&quot;);<br />
my @Prot = (&quot;F&quot;,&quot;F&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,&quot;L&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;I&quot;,&quot;I&quot;,&quot;I&quot;,&quot;M&quot;,&quot;V&quot;,&quot;V&quot;,&quot;V&quot;,&quot;V&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;S&quot;,&quot;S&quot;,&quot;S&quot;,&quot;S&quot;,&quot;P&quot;,&quot;P&quot;,&quot;P&quot;,&quot;P&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;T&quot;,&quot;T&quot;,&quot;T&quot;,&quot;T&quot;,&quot;A&quot;,&quot;A&quot;,&quot;A&quot;,&quot;A&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;Y&quot;,&quot;Y&quot;,&quot;*&quot;,&quot;*&quot;,&quot;H&quot;,&quot;H&quot;,&quot;Q&quot;,&quot;Q&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;N&quot;,&quot;N&quot;,&quot;K&quot;,&quot;K&quot;,&quot;D&quot;,&quot;D&quot;,&quot;E&quot;,&quot;E&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;C&quot;,&quot;C&quot;,&quot;*&quot;,&quot;W&quot;,&quot;R&quot;,&quot;R&quot;,&quot;R&quot;,&quot;R&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;S&quot;,&quot;S&quot;,&quot;R&quot;,&quot;R&quot;,&quot;G&quot;,&quot;G&quot;,&quot;G&quot;,&quot;G&quot;);</p>

<p>for (my $A = 0; $A &lt;=3; $A++){<br />
for (my $B = 0; $B &lt;=3; $B++){<br />
for (my $C = 0; $C &lt;=3; $C++){<br />
&nbsp; &nbsp; &nbsp; &nbsp; print(&quot;$Base[$A]&quot;,&quot;$Base[$B]&quot;,&quot;$Base[$C]&quot;,&quot;=&quot;,$Prot[16*$A+4*$B+$C],&quot;\t&quot;);<br />
}}}<br />
print(&quot;\n&quot;);</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>$ perl triplet_code.pl<br />
TTT=F &nbsp; TTC=F &nbsp; TTA=L &nbsp; TTG=L &nbsp; TCT=L &nbsp; TCC=L &nbsp; TCA=L &nbsp; TCG=L &nbsp; TAT=I &nbsp; TAC=I &nbsp; TAA=I &nbsp; TAG=M &nbsp; TGT=V &nbsp; TGC=V &nbsp; TGA=V &nbsp; TGG=V &nbsp; CTT=S &nbsp; CTC=S &nbsp; CTA=S &nbsp; CTG=S &nbsp; CCT=P &nbsp; CCC=P &nbsp; CCA=P &nbsp; CCG=P &nbsp;CAT=T &nbsp;CAC=T &nbsp;CAA=T &nbsp; CAG=T &nbsp;CGT=A &nbsp;CGC=A &nbsp;CGA=A &nbsp;CGG=A &nbsp;ATT=Y &nbsp;ATC=Y &nbsp;ATA=* &nbsp; &nbsp;ATG=* &nbsp; ACT=H &nbsp; ACC=H &nbsp; ACA=Q &nbsp;ACG=Q &nbsp;AAT=N &nbsp;AAC=N &nbsp;AAA=K &nbsp;AAG=K &nbsp; AGT=D &nbsp;AGC=D &nbsp; AGA=E &nbsp;&nbsp;AGG=E GTT=C &nbsp;GTC=C &nbsp;GTA=* &nbsp; GTG=W &nbsp;GCT=R &nbsp;GCC=R &nbsp;GCA=R &nbsp;GCG=R GAT=S &nbsp;GAC=S &nbsp; GAA=R &nbsp;GAG=R &nbsp;GGT=G &nbsp; GGC=G &nbsp; GGA=G &nbsp;GGG=G<br />
&nbsp;</p>