#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Converting dna to protein using standard genetic code.


    #!/usr/bin/perl
    use strict;
    my%std_genetic_code=("ATA"=>"ISO", "CTC"=>"LEU", "GTT"=> "VAL","TTT"=>"PHEN");
    #PROCESS INPUT DATA
    while($line=<DATA>)
    {
    print "line:$line";
    chop();
    @triplets = unpack("a4"*(lengthof($line)/3)"$line");
    for each $codon(at triplets)
    {
    print("$std_genetic_code($codon)";
    }
    print"\n\n";
    }
    #what follows is input data
    _END_
    ATTATGCATAATGCCTTCTCGTTGTCGTATTTTTCATGAAATGCATCATACTTCTCGTTCTCAATCGGATATGTTTTTT;
    ~
    ~
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Posts
    832
    Rep Power
    496
    Do you have a question?

    Or comments or explanations?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,938
    Rep Power
    1225
    Other than telling you the fact that your code doesn't compile, I have no idea what you want from us.
  6. #4
  7. 'fie' on me, allege-dly
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2003
    Location
    in da kitchen ...
    Posts
    12,889
    Rep Power
    6444
    Could this be the T-Shirt for 'spring break'?
    --Ax
    without exception, there is no rule ...
    Handmade Irish Jewellery
    Targeted Advertising Cookie Optout (TACO) extension for Firefox
    The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones


    09 F9 11 02
    9D 74 E3 5B
    D8 41 56 C5
    63 56 88 C0
    Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
    -- Jamie Zawinski
    Detavil - the devil is in the detail, allegedly, and I use the term advisedly, allegedly ... oh, no, wait I did ...
    BIT COINS ANYONE

IMN logo majestic logo threadwatch logo seochat tools logo