Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Translation Substring Error (updated)

by haukex (Archbishop)
on Nov 09, 2017 at 15:47 UTC ( [id://1203051]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        my $seq = shift;
        my $amino_acid;
    ...
            $amino_acid .= $genetic_code{$codon};
        }
        return $amino_acid;
    
  2. or download this
    print OneFrameTranslation('ATGCCCGTAC'),"\n";
    print OneFrameTranslation('GCTTCCCAGCGC'),"\n";
    __END__
    MPV
    ASQR
    
  3. or download this
        my $amino_acid;
        while ($seq=~/\G(...)/sg) {
            $amino_acid .= $genetic_code{$1};
        }
        return $amino_acid;
    
  4. or download this
        # build the regex, this only needs to be done once
        my ($genetic_regex) = map qr/$_/, join '|', keys %genetic_code;
        # apply the regex
        (my $amino_acid = $seq) =~ s/($genetic_regex)/$genetic_code{$1}/g;
        return $amino_acid;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-25 15:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found