Documentation

CodonAdaptationIndexCalculator implements CodonAdaptationIndexInterface uses TranslatesUnderGeneticCode

Reuses SequenceInterface::translateCodon() (the library's own, already-DI-wired genetic code) to decide which codons are synonymous with each other, rather than hard-coding a second copy of the genetic code here. Following Sharp & Li's original 1987 definition : a stop codon never counts towards the score, and neither does a codon for an amino acid that has no synonym under the standard genetic code (Met, Trp) - not because those two codons are special-cased by name, but because ANY amino acid with exactly one codon trivially has relative adaptiveness 1 for it, and folding those guaranteed-1 terms into the geometric mean would systematically inflate the score rather than reflect a real codon CHOICE. The remaining score is the geometric mean, across every other codon of the coding sequence, of that codon's count in the reference table divided by the highest count among its synonyms in that same table.

Class CodonAdaptationIndexCalculator

Tags
author

Amélie DUVERNET aka Amelaye amelieonline@gmail.com

Table of Contents

Interfaces

CodonAdaptationIndexInterface
Interface CodonAdaptationIndexInterface - scores how well a coding sequence's own codon choices match a reference organism's preferred codons (Sharp & Li, 1987), useful for predicting or optimizing how well a cloned insert is likely to express in a given host.

Constants

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

Properties

$geneticCodeTranslator  : AlternateGeneticCodeTranslator|null
$missingCodonWeight  : float|null
$sequenceManager  : SequenceInterface

Methods

__construct()  : mixed
CodonAdaptationIndexCalculator constructor.
calculate()  : CaiResult
assertSupportedGeneticCode()  : void
countSynonyms()  : int
How many of the 64 possible codons translate to $sAminoAcid, under the standard genetic code - not how many of them happen to appear in a reference table, which could be incomplete.
everyCodon()  : array<string|int, string>
maxReferenceCount()  : int
translateUnder()  : string

Constants

Properties

Methods

__construct()

CodonAdaptationIndexCalculator constructor.

public __construct(SequenceInterface $oSequenceManager[, float|null $fMissingCodonWeight = null ]) : mixed
Parameters
$oSequenceManager : SequenceInterface
$fMissingCodonWeight : float|null = null

The relative adaptiveness given to a codon the reference table never uses, the usual remedy for a table built from few genes (0.5 is a common choice, CodonW's). Null, the default, keeps the strict behaviour : such a codon is an error.

Tags
throws
InvalidArgumentException

When the weight is not in ]0, 1]

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

countSynonyms()

How many of the 64 possible codons translate to $sAminoAcid, under the standard genetic code - not how many of them happen to appear in a reference table, which could be incomplete.

private countSynonyms(string $sAminoAcid, int $iGeneticCode) : int
Parameters
$sAminoAcid : string

A single-letter amino acid code, as returned by translateCodon()

$iGeneticCode : int
Return values
int

everyCodon()

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

All 64 possible DNA codons

maxReferenceCount()

private maxReferenceCount(string $sAminoAcid, CodonUsageTable $oReferenceTable, int $iGeneticCode) : int
Parameters
$sAminoAcid : string
$oReferenceTable : CodonUsageTable
$iGeneticCode : int
Return values
int —

The highest reference count among every codon translating to $sAminoAcid

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