BioSequenceTranslate[bioseq]
translates a DNA or RNA sequence bioseq to a peptide sequence.
BioSequenceTranslate[bioseq,gtt]
uses the genetic translation table gtt.
BioSequenceTranslate[bioseq,gtt,startspec]
treats start codons in bioseq according to the specification startspec.
BioSequenceTranslate
BioSequenceTranslate[bioseq]
translates a DNA or RNA sequence bioseq to a peptide sequence.
BioSequenceTranslate[bioseq,gtt]
uses the genetic translation table gtt.
BioSequenceTranslate[bioseq,gtt,startspec]
treats start codons in bioseq according to the specification startspec.
Details
- The genetic translation table gtt can be specified as follows:
-
Automatic the standard code (default) "name" standard name of a "GeneticTranslationTable" entity Entity["GeneticTranslationTable",…] "GeneticTranslationTable" entity n NCBI genetic code number "AAAA…" length-64 NCBI codon translation string <|"cod1""tran1","cod2""tran2",…|> explicit codon translation table - The start codon specification startspec specifies what translation should be used for the first codon in bioseq. If no startspec is given, the first codon will be treated as a start codon only if bioseq can be identified as corresponding to a complete protein.
- The following forms for startspec can be used to specific how to treat the first codon in bioseq:
-
Automatic treat as start codon only for complete proteins False never treat as start codon True always treat as start code - The following additional forms for startspec can be used to define start codon behavior, overriding the specification implied by the genetic translation table gtt:
-
n use NCBI genetic code number start codon specification "AAAA…" use length-64 NCBI start codon translation string <|"cod1""tran1","cod2""tran2",…|> explicit specify start codon translations
Examples
open all close allBasic Examples (1)
Scope (8)
BioSequenceTranslate[BioSequence["RNA", "CUGAUAUAC"]]Translate using a "GeneticTranslationTable" entity:
BioSequenceTranslate[BioSequence["DNA", "CTGATATAC"], Entity["GeneticTranslationTable", "VertebrateMitochondrial"]]Translate using the table corresponding to a NCBI genetic code number:
BioSequenceTranslate[BioSequence["DNA", "CTGATATAC"], 2]Use an Association to specify the translation table:
BioSequenceTranslate[BioSequence["DNA", "CTGATATAC"], <|"TTT" -> "F", "TTC" -> "F", "TTA" -> "L", "TTG" -> "L", "TCT" -> "S", "TCC" -> "S", "TCA" -> "S", "TCG" -> "S", "TAT" -> "Y", "TAC" -> "S", "TAA" -> "*", "TAG" -> "*", "TGT" -> "C", "TGC" -> "C", "TGA" -> "W", "TGG" -> "W", "CTT" -> "L", "CTC" -> "L", "CTA" -> "L", "CTG" -> "L", "CCT" -> "P", "CCC" -> "P", "CCA" -> "P", "CCG" -> "P", "CAT" -> "H", "CAC" -> "H", "CAA" -> "Q", "CAG" -> "Q", "CGT" -> "R", "CGC" -> "R", "CGA" -> "R", "CGG" -> "R", "ATT" -> "I", "ATC" -> "I", "ATA" -> "I", "ATG" -> "M", "ACT" -> "T", "ACC" -> "T", "ACA" -> "T", "ACG" -> "T", "AAT" -> "N", "AAC" -> "N", "AAA" -> "K", "AAG" -> "K", "AGT" -> "S", "AGC" -> "S", "AGA" -> "*", "AGG" -> "*", "GTT" -> "V", "GTC" -> "V", "GTA" -> "V", "GTG" -> "V", "GCT" -> "A", "GCC" -> "A", "GCA" -> "A", "GCG" -> "A", "GAT" -> "D", "GAC" -> "D", "GAA" -> "E", "GAG" -> "E", "GGT" -> "G", "GGC" -> "G", "GGA" -> "G", "GGG" -> "G"|>]Use an arbitrary NCBI translation table:
BioSequenceTranslate[BioSequence["DNA", "CTGATATAC"], "GGGGEEDDAAAAVVVVRRSSKKNNTTTTMIIIRRRRQQHHPPPPLLLLW*CC**YYSSSSLLFF"]Use the start translation of the automatically selected translation table:
BioSequenceTranslate[BioSequence["CTGATATAC"], Automatic, True]Specify start codon translations with an association of the changed start codons:
BioSequenceTranslate[BioSequence["DNA", "CTGATATAC"], Automatic, <|"CTG" -> "R"|>]Use NCBI notation to specify the start codon translation:
BioSequenceTranslate[BioSequence["DNA", "CTGATATAG"], Automatic, "GGGGEEDDAAAAVVVVRRSSKKNNTTTTMIIIRRRRQQHHPPPPLLLLW*CC**YYSSSSLLFF"]Applications (2)
The translations to selenocysteine (U) and pyrrolysine (O) only happen in particular chemical contexts that are distinct from the translation system for a particular organism. One way to incorporate them is to change the codon translation association:
standardTranslations = Entity["GeneticTranslationTable", "Standard"]["CodonTranslations"];
BioSequenceTranslate[BioSequence["DNA", "GGCTGATAGTAA"],
AssociateTo[standardTranslations,
specialRules = {"TGA" -> "U", "TAG" -> "O"}]]After splicing together coding sequences, translation yields the same sequence as the protein:
hbbBioSeq = BioSequence[Interpreter["Gene"]["human hbb gene"]];
spliced = StringJoin@@StringTake[hbbBioSeq, {{51, 142}, {273, 495}, {1346, 1474}}];
translated = BioSequenceModify[BioSequenceTranslate[spliced, Automatic, True], "DropFromStopLetter"]targetProtein = BioSequence[Interpreter["Protein"]["hbb"]]SequenceAlignment[targetProtein, translated]Possible Issues (2)
Inputs with degenerate letters may have multiple possible translations with no single generalization:
BioSequenceTranslate[BioSequence["RNA", "SUGAUAUAC"]]Using BioSequenceInstances first will avoid ambiguous results:
BioSequenceTranslate /@ BioSequenceInstances[BioSequence["RNA", "SUGAUAUAC"]]If the length of a DNA or RNA sequence is not a multiple of three, then the remaining letters after constructing codons are discarded from the end of the sequence:
BioSequenceTranslate[BioSequence["DNA", "CTGATATACGG"]]Neat Examples (2)
See the peptides resulting from translation:
acgt = {"A", "C", "G", "T"};
Graphics3D[Table[aa = BioSequenceTranslate[dna = BioSequence["DNA", StringJoin[acgt[[{i1, i2, i3}]]]]];
mol = If[aa =!= BioSequence["Peptide", "."], Molecule[aa], Null];
molpl = If[aa =!= BioSequence["Peptide", "."], MoleculePlot3D[mol], "STOP"];
Inset[Tooltip[Rasterize[molpl, ImageSize -> 40, Background -> None], Column[{CommonName[Entity["BioSequenceType", "Peptide"]["AlphabetRules"][aa["SequenceString"]]]//Quiet, aa, mol, dna}]], {i1, i2, i3}], {i1, 4}, {i2, 4}, {i3, 4}], Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, 0}, Ticks -> Table[Transpose[{Range[4], Style[#, Bold]& /@ acgt}], {3}]]Reveal a phrase encoded in DNA:
BioSequenceTranslate[BioSequence["DNA", "GGAGAAAACGAAACAATATGCAGC"]]See Also
BioSequence BioSequenceBackTranslateList BioSequenceTranscribe BioSequenceInstances
Entity Types: GeneticTranslationTable
Function Repository: NCBITranslationTableConvert
Related Guides
History
Text
Wolfram Research (2020), BioSequenceTranslate, Wolfram Language function, https://reference.wolfram.com/language/ref/BioSequenceTranslate.html.
CMS
Wolfram Language. 2020. "BioSequenceTranslate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BioSequenceTranslate.html.
APA
Wolfram Language. (2020). BioSequenceTranslate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BioSequenceTranslate.html
BibTeX
@misc{reference.wolfram_2026_biosequencetranslate, author="Wolfram Research", title="{BioSequenceTranslate}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/BioSequenceTranslate.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_biosequencetranslate, organization={Wolfram Research}, title={BioSequenceTranslate}, year={2020}, url={https://reference.wolfram.com/language/ref/BioSequenceTranslate.html}, note=[Accessed: 12-June-2026]}