BioPHP - Number of codons in a DNA/RNA sequence
Original code submitted by josebaCode bellow is covered by GNU GPL v2 license.
Description
Last change: 2010/10/18 17:04 | Edit description | Recent Changes | Original descriptionCounts the number of codons (trios of base-pairs) in a DNA/RNA sequence.
Code
Last change: 2010/10/18 17:04 | Edit Code | Recent Changes | Download | Original codefunction count_codons()
{
if (isset($this->features["CDS"]["/codon_start"]) == FALSE) $codstart = 1;
else $codstart = $this->features["CDS"]["/codon_start"];
$codcount = (int) (($this->seqlen() - $codstart + 1)/3);
return $codcount;
}