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;