fasta-0.10.3.0: A simple, mindless parser for fasta files.

Safe HaskellSafe
LanguageHaskell98

Data.Fasta.String.Translation

Description

Collects all functions pertaining to the translation of nucleotides to amino acids for strings.

Synopsis

Documentation

codon2aa :: Codon -> Either String AA Source #

Converts a codon to an amino acid Remember, if there is an N in that DNA sequence, then it is translated as an X, an unknown amino acid.

customCodon2aa :: [(Codon, Char)] -> Codon -> Either String AA Source #

Translate a codon using a custom table

translate :: Int -> FastaSequence -> Either String FastaSequence Source #

Translates a string of nucleotides given a reading frame (1, 2, or 3) -- drops the first 0, 1, or 2 nucleotides respectively. Returns a string with the error if the codon is invalid.

customTranslate :: [(Codon, AA)] -> Int -> FastaSequence -> Either String FastaSequence Source #

Translates a string of nucleotides given a reading frame (1, 2, or 3) -- drops the first 0, 1, or 2 nucleotides respectively. Returns a string with the error if the codon is invalid. Also has customized codon translations as well overriding the defaults.