CodonAdaptationIndexCalculator.php
Codon Adaptation Index calculation Freely inspired by BioPHP's project biophp.org Created 30 September 2026 Last modified 9 October 2026
Table of Contents
Classes
- CodonAdaptationIndexCalculator
- 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.