AlternateGeneticCodeTranslator
in package
implements
AlternateGeneticCodeTranslatorInterface
Every alternate table is stored as an OVERLAY of differences from the standard genetic code (SequenceInterface::translateCodon()'s own, already-wired code, reused rather than duplicated - the same reuse CodonAdaptationIndexCalculator, OrfFinder and CodonOptimizer already make), exactly the way NCBI itself documents each alternate table : as a short list of codons that differ from the standard, not a second full 64-entry table. A codon not present in a table's overlay falls back to the standard translation.
The overlays were generated from NCBI's gc.prt (version 4.6) and checked, codon by codon, against Biopython's CodonTable. They cover every table whose stop codons do not depend on their context (see GeneticCodeTable) ; adding a table means adding its overlay here and its id and name there. Class AlternateGeneticCodeTranslator
Tags
Table of Contents
Interfaces
- AlternateGeneticCodeTranslatorInterface
- Interface AlternateGeneticCodeTranslatorInterface - translates a codon under a specific NCBI genetic code table (see GeneticCodeTable::SUPPORTED_TABLES). Only the single-letter amino acid output SequenceInterface::translateCodon()'s format=1 already uses is supported here ; the 3-letter format has no current caller and was left out to keep this service's scope tight.
Constants
- IUPAC : array<string|int, string> = ["A" => "A", "C" => "C", "G" => "G", "T" => "T"...
- OVERLAYS : array<int, array<string, string>> = [2 => ["TGA" => "W", "ATA" => "M", "AGA" => "*"...
Properties
Methods
- __construct() : mixed
- AlternateGeneticCodeTranslator constructor.
- translateCodon() : string
- translateAmbiguousCodon() : string
Constants
IUPAC
private
array<string|int, string>
IUPAC
= ["A" => "A", "C" => "C", "G" => "G", "T" => "T", "R" => "AG", "Y" => "CT", "S" => "CG", "W" => "AT", "K" => "GT", "M" => "AC", "B" => "CGT", "D" => "AGT", "H" => "ACT", "V" => "ACG", "N" => "ACGT"]
The bases each IUPAC nucleotide code stands for
OVERLAYS
private
array<int, array<string, string>>
OVERLAYS
= [2 => ["TGA" => "W", "ATA" => "M", "AGA" => "*", "AGG" => "*"], 3 => ["TGA" => "W", "CTT" => "T", "CTC" => "T", "CTA" => "T", "CTG" => "T", "ATA" => "M"], 4 => ["TGA" => "W"], 5 => ["TGA" => "W", "ATA" => "M", "AGA" => "S", "AGG" => "S"], 6 => ["TAA" => "Q", "TAG" => "Q"], 9 => ["TGA" => "W", "AAA" => "N", "AGA" => "S", "AGG" => "S"], 10 => ["TGA" => "C"], 11 => [], 12 => ["CTG" => "S"], 13 => ["TGA" => "W", "ATA" => "M", "AGA" => "G", "AGG" => "G"], 14 => ["TAA" => "Y", "TGA" => "W", "AAA" => "N", "AGA" => "S", "AGG" => "S"], 15 => ["TAG" => "Q"], 16 => ["TAG" => "L"], 21 => ["TGA" => "W", "ATA" => "M", "AAA" => "N", "AGA" => "S", "AGG" => "S"], 22 => ["TCA" => "*", "TAG" => "L"], 23 => ["TTA" => "*"], 24 => ["TGA" => "W", "AGA" => "S", "AGG" => "K"], 25 => ["TGA" => "G"], 26 => ["CTG" => "A"], 29 => ["TAA" => "Y", "TAG" => "Y"], 30 => ["TAA" => "E", "TAG" => "E"], 32 => ["TAG" => "W"], 33 => ["TAA" => "Y", "TGA" => "W", "AGA" => "S", "AGG" => "K"]]
Per table, the codons it reads differently from the standard code (gc.prt, version 4.6)
Properties
$sequenceManager
private
SequenceInterface
$sequenceManager
Methods
__construct()
AlternateGeneticCodeTranslator constructor.
public
__construct(SequenceInterface $oSequenceManager) : mixed
Parameters
- $oSequenceManager : SequenceInterface
translateCodon()
public
translateCodon(string $sCodon, int $iTableId) : string
Parameters
- $sCodon : string
- $iTableId : int
Return values
stringtranslateAmbiguousCodon()
private
translateAmbiguousCodon(string $sCodon, array<string|int, mixed> $aOverlay) : string
Parameters
- $sCodon : string
-
DNA codon holding at least one IUPAC ambiguity code
- $aOverlay : array<string|int, mixed>
-
The codons this table reads differently from the standard code
Return values
string —The amino acid, "X" when the covered codons disagree