Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Genetic Code

by MeowChow (Vicar)
on Apr 10, 2001 at 21:54 UTC ( [id://71423]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      # "$ _" is really "$_", and change the qq to a double-quote
      $_ = 
    ...
      s|.*(\w).*(\w).*\n|$_{$-++ / 9 % 2 ? $2:$ 1}|gex;
      s|(.)(.)(.)(.)|chr (64*$1 + 16*$2 + 4*$3 + $4)|gex;
      eval
    
  2. or download this
      @_{A => C => G => T => } = 0..3;
      # is really...
      @_{'A', 'C', 'G', 'T'}   = 0..3;
    
  3. or download this
      s|
        .*      # greedily match
    ...
        # strand (see physi's comment for a visual representation of this)
        $_{$-++ / 9 % 2 ? $2:$ 1}
      |gex;
    
  4. or download this
      s|
        # store next four characters into $1,$2,$3, and $4
    ...
        # replace with a Base4-to-ASCII conversion of those characters
        chr (64*$1 + 16*$2 + 4*$3 + $4)
      |gex;
    
  5. or download this
    use strict;
    
    ...
        print "$fmt\n";
      }
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://71423]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-23 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found