Skip to main content

Module translation

Module translation 

Source
Expand description

Translation of DNA to protein and open-reading-frame discovery.

Genetic codes are the pinned NCBI tables in [crate::genetic_codes]. Translation is IUPAC-aware: a codon translates to an amino acid only when every expansion of its ambiguity codes agrees (otherwise X); a stop requires every expansion to be a stop; starts must be exact. Coordinates are zero-based reference positions on the forward strand. Multipart features are spliced in source order; reverse-strand features are the reverse complement of that splice (GenBank complement(join(...))). Nothing here infers genes, splicing, frames beyond the declared inputs, or experimental validity.

Structs§

Codon
One translated codon with the reference positions of its three coding bases (in coding order, so they decrease on the reverse strand and may jump at joins).
FrameTranslation
One reading frame of the whole molecule for display: codon i covers forward positions first + 3i .. first + 3i + 3 (forward) or first - 3i - 2 ..= first - 3i (reverse; first is the 5′ base on the reverse strand). Codons that would cross the origin are omitted.
GeneticCode
A pinned NCBI translation table.
ImportedComparison
Comparison between the computed protein and an imported translation.
Orf
One complete open reading frame (start codon through stop codon).
OrfOptions
Explicit ORF search parameters.
OrfScan
ORF search result with the effective parameters.
Translation
Translation of an explicit coding sequence.

Enums§

CodingStrand
Coding direction relative to the forward reference.
StartPolicy
Which codons may open an ORF.
TranslationError
Errors raised by translation requests.

Constants§

GC_PRT_SHA256
GC_PRT_VERSION

Functions§

compare_imported
Compare with an imported translation, ignoring one terminal stop on either side.
feature_translation_qualifiers
Parsed codon_start (default 1) and transl_table (default: none) qualifiers.
find_orfs
Six-frame search for complete ORFs: the longest ORF per stop codon (first start after the previous in-frame stop), at least min_codons amino acids. On circular molecules ORFs may wrap the origin but never exceed one molecule length; frames without any stop are not reported.
imported_translation
Imported translation qualifier with SnapGene’s per-part commas and whitespace removed.
six_frames
Six-frame translation for display, frames +1..+3 then -1..-3.
translate_feature
Translate a feature’s spliced coding sequence. table overrides transl_table.
translate_range
Translate the forward-coordinate range [start, end) (on circular molecules end < start wraps through the origin) on either strand, skipping frame (0–2) bases from the 5′ end of the coding strand.