Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

DNA is LIFE

Desc:
You have to know that in biology DNA CODE (ATCG)
is converted into Aminoacids with a code like GGA - G
Transform your name in DNA!
Usage:
perl dna.pl yourname
Spiral algorhitm from How to (ab)use substr, but is not a clone!
#!/usr/bin/perl use strict; $_=' @I NC=s plit (/ /,uc( $AR GV[0 ]));o pen( DATA," <$0" );und ef$/ ;$_=<D ATA>;$_=~s/(.*)GGG/GG G/gsm;$/="\n";forea ch$_(keys%ENV){del ete$ENV{$_};}for each(@_= sp lit(/\./, $_)){@AR GV=split(/$ "/)unless($_Zeq Z1);$A RGV[1]=~s/\ s//Zif($ARGV[1]);$A RGV[0]=~s/\s//Zif($A RGV [0]);$_=r and ;nextZi f$_ >0.5and$ ARGV [1]andZe xists $ENV{ $ARGV[1]};$ ENV{$ARGV [1]}=$AR GV[0]if($AR GV[0]and$ARGV[1 ]);} @ARGV=();f oreach(@INC){push( @ARGV,Z$EN V{$_}) ;}f ore ach ("@ARGV"x 3)Z{ @_=split (//,$_);fo reach(@ _){$^O= $"x75;if($ _Zn eZ$"){su bst r($^O,sin (++ $a/8)*32 +32,1)=$_;tr/ATGC/ TACG/;substr($^O ,sin($a/4)* 14+32,1) =$_;pri nt"$^O $/";sel ectZ$b,$b ,$b,0.0 5;}}}'; $_=~s/\s//gm;$_=~s/Z/$"/gm;eval $_;exit; GGG G.GGA G.GGC G.GGT G.GAG E.GAA E.GAC D.GAT D.GCG A. GCA A.GCC A.GCT A.GTG V.GTA V.GTC V.GTT V.AGG R.AGA R. AGC S.AGT S.AAG K.AAA K.AAC N.AAT N.ACG T.ACA T.ACC T. ACT T.ATG M.ATA I.ATC I.ATT I.CGG R.CGA R.CGC R.CGT R. CAG Q.CAA Q.CAC H.CAT H.CCG P.CCA P.CCC P.CCT P.CTG L. CTA L.CTC L.CTT L.TGG W.TGC C.TGT C.TAC Y.TAT Y.TCG S. TCA S.TCC S.TCT S.TTG L.TTA L.TTC F.TTT F.XXX O.TGA U. TAG B.TAA Z. 1

by Tucano
You can change the genetic code if you want:
GGG G.GGA G.GGC G.GGT G.GAG E.GAA E.GAC D.GAT D.GCG A. GCA A.GCC A.GCT A.GTG V.GTA V.GTC V.GTT V.AGG R.AGA R. AGC S.AGT S.AAG K.AAA K.AAC N.AAT N.ACG T.ACA T.ACC T. ACT T.ATG M.ATA I.ATC I.ATT I.CGG R.CGA R.CGC R.CGT R. CAG Q.CAA Q.CAC H.CAT H.CCG P.CCA P.CCC P.CCT P.CTG L. CTA L.CTC L.CTT L.TGG W.TGC C.TGT C.TAC Y.TAT Y.TCG S. TCA S.TCC S.TCT S.TTG L.TTA L.TTC F.TTT F.XXX O.TGA U. TAG B.TAA Z.

other features are

  • Singular char like 'f' are converted into codons 'ACG'
  • Cause there are more codons for a single char (redundance) a rand algorhitm was implemented
  • Render algorhitm are inspired by the fantastic node: How to (ab)use substrby Erudil
    Note: to a better rendering the name are reapeted 3 times

In reply to DNA is Life by tucano

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (12)
    As of 2014-11-27 18:43 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My preferred Perl binaries come from:














      Results (186 votes), past polls