Documentation

CodonOptimizer implements CodonOptimizerInterface uses TranslatesUnderGeneticCode

Reuses SequenceInterface::translateCodon() to find every codon synonymous with a residue, the same reuse CodonAdaptationIndexCalculator already makes, rather than hard-coding a second copy of the genetic code. When every synonym of a residue is tied (most commonly because the reference table has no observation for any of them at all), the tie is broken deterministically by codon enumeration order (A<C<G<T, most to least significant base) - an arbitrary but reproducible choice, the same kind of tie-break already used elsewhere in this project (e.g. NeighborJoiningTreeBuilder).

Class CodonOptimizer

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Interfaces

CodonOptimizerInterface
Interface CodonOptimizerInterface - the inverse of CodonAdaptationIndexCalculator : rather than scoring an existing coding sequence against a reference codon usage table, this picks, for each residue of a target protein, the synonymous codon with the highest count in that table - the coding sequence a perfect (CAI = 1) translation of the protein would have.

Constants

BASES  : mixed = ["A", "C", "G", "T"]

Properties

$geneticCodeTranslator  : AlternateGeneticCodeTranslator|null
$sequenceManager  : SequenceInterface

Methods

__construct()  : mixed
CodonOptimizer constructor.
optimize()  : DnaSequence
assertSupportedGeneticCode()  : void
bestCodonFor()  : string
everyCodon()  : array<string|int, string>
translateUnder()  : string

Constants

Properties

Methods

assertSupportedGeneticCode()

private assertSupportedGeneticCode(int $iGeneticCode) : void
Parameters
$iGeneticCode : int

An NCBI table id (see GeneticCodeTable::SUPPORTED_TABLES)

Tags
throws
InvalidArgumentException

When the table is not supported

bestCodonFor()

private bestCodonFor(string $sResidue, CodonUsageTable $oReferenceTable, int $iGeneticCode) : string
Parameters
$sResidue : string

A single-letter amino acid code, or "*"

$oReferenceTable : CodonUsageTable
$iGeneticCode : int
Return values
string

everyCodon()

private everyCodon() : array<string|int, string>
Return values
array<string|int, string> —

All 64 possible DNA codons

translateUnder()

private translateUnder(string $sCodon, int $iGeneticCode) : string
Parameters
$sCodon : string
$iGeneticCode : int
Return values
string —

The amino acid, "*" for a stop, "X" for an ambiguous codon

On this page

Search results