Service
Table of Contents
Packages
- Codon
Classes
- ChaosGameRepresentationCalculator
- Migrated from biotools' ChaosGameRepresentationManager, whose computation was tangled with the
drawing of the images. The chaos game (Jeffrey, 1990) starts at the centre of a unit square whose
corners stand for the bases ; each base moves the point half-way to its corner. The corners are
biotools', y growing downward as in an image : C top left (0, 0), G top right (1, 0), A bottom left
(0, 1), T bottom right (1, 1). A symbol other than A, C, G or T moves nothing and leaves no point.
- CpGIslandFinder
- Net-new (present in neither BioPHP nor biotools). Implements the classic Gardiner-Garden & Frommer
(1987) criteria : a window qualifies when its GC content and its observed/expected CpG ratio -
Obs/Exp = (CpG count * window length) / (C count * G count), the standard formula - both clear
their threshold. Every scanned window is independent ; consecutive or overlapping qualifying
windows are then merged into a single island, whose own gcContent/observedToExpectedRatio are
recomputed over its full merged span rather than inherited from whichever window first qualified,
so they describe the island actually reported. Reuses SkewCalculator for the GC content half of
the criteria rather than re-counting bases a second time.
- GeneticsFunctions
- Class NucleotidsManager
- MathematicsFunctions
- Class MathematicsManager
- MeltingTemperatureCalculator
- Migrated from biotools' Service/MeltingTemperatureManager.php. calculateMinimumTm()/
calculateMaximumTm() resolve a degenerate primer into its two extreme single-symbol readings -
every ambiguous base collapsed to "A" (weak, A/T-like) or "G" (strong, C/G-like) depending on
whether it could possibly BE an A/T or is guaranteed C/G/S - then apply the classic Wallace-style
count formula (2 degrees per weak base + 4 per strong base under 14 bases, the empirical long-
primer formula from 14 bases up). calculateNearestNeighborTm() is SantaLucia (1998)'s unified
nearest-neighbor thermodynamics : Tm = dH / (dS + R ln(Ct/x)), x = 4 for two complementary strands
at equal concentration, x = 1 (plus a -1.4 e.u. symmetry term) for a self-complementary primer,
whose two strands are the same molecule. Mg2+ is converted into its sodium equivalent,
[Na+] + 120 x sqrt([Mg2+]) in mM (von Ahsen et al., Clin Chem 2001), then corrects the entropy by
0.368 x (N - 1) x ln[Na+] (SantaLucia 1998) ; the results agree with Biopython's Tm_NN (DNA_NN3,
saltcorr=5). The legacy biotools version used Ct/2 and 140 x [Mg2+]. Unlike it, which returned a
sentinel array of nulls plus a message for a degenerate primer, this throws - the nearest-neighbor
method has no defined thermodynamic parameters for an ambiguous base pair, so there is no result
to return. A primer may be written in lower case.
- OligosManager
- Class OligosManager
- OrfFinder
- Migrated from biotools' Service/DnaToProteinManager.php::findORF(), which was not actually a
coordinate-returning ORF finder : it translated up to six frames into peptide strings and then
highlighted the coding stretches (uppercasing a "*"-delimited segment long enough, optionally
trimmed to its first Met) purely for display. That highlighting behavior stays a presentational
concern of biotools. This class reuses the same core idea - the longest ORF in each stop-delimited
segment starts at that segment's first Met - but implements it as a proper library service that
returns real OpenReadingFrame coordinates, via SequenceInterface::translateCodon() (the project's
own already-wired standard genetic code) rather than biotools' separate TripletApiAdapter/
TripletSpecieApiAdapter machinery, the same reuse CodonAdaptationIndexCalculator already makes.
- ProteinPropertiesCalculator
- The net charge is the sum of the partial charges of the groups that carry one - the N-terminus,
Lys, Arg and His (positive), the C-terminus, Asp, Glu, Cys and Tyr (negative) - each given by the
Henderson-Hasselbalch equation, 1 / (1 + 10^(pH - pK)) for a base and 1 / (1 + 10^(pK - pH)) for an
acid. The pK values are the caller's (bioapi serves three sets : EMBOSS, DTASelect, Solomon) : a
protein has no isoelectric point of its own, only one for a given set. The isoelectric point is the
pH where that charge is zero, found by bisection - the charge falls as the pH rises, always, so it
crosses zero once. The terminal groups are the ones of the set, not residue-specific ones.
- SkewCalculator
- Migrated from biotools' Service/SkewsManager.php::computeImage() : the four per-window base-
composition metrics it fed into its SVG plot, extracted as pure math with no rendering attached -
that SVG plotting stays a biotools/UI concern. Unlike the legacy version, a window with an
undefined denominator (e.g. no G or C at all, for GC-skew) returns 0.0 rather than dividing by
zero - under PHP 8, int/int division by a zero denominator throws a DivisionByZeroError, which the
legacy code would actually have hit for such a window ; this is a real, not hypothetical, edge
case a sliding window can land on at a sequence's A/T-only stretch.