Synonymous Family ENC
Estimate ENC from mean synonymous-family homozygosities, without finite-sample correction; caller supplies correctly grouped standard-code families.
Description
Estimate effective codon number from supplied synonymous-family counts using uncorrected homozygosities and equal family weighting within degeneracy groups.
Synonymous codons encode the same amino acid, but a gene may use some of them more often than others. A synonymous family groups the codons for one amino acid, and its degeneracy is the number of codons in that family. For the standard genetic code, multi-codon families have degeneracies of 2, 3, 4, or 6.
Effective number of codons, often abbreviated ENC or Nc, summarizes synonymous codon preference. In the standard-code formulation, values near 20 represent strong preference for one codon per amino acid, while values near 61 represent more even use of synonymous alternatives. ENC is an effective diversity measure, not the number of codons in a sequence.1
Synonymous Family ENC starts with caller-grouped counts. It calculates each family’s homozygosity, the sum of squared within-family frequencies, and combines group averages into an ENC estimate. Its frequencies are uncorrected for finite sample size, which distinguishes this implementation from estimators using Wright’s sampling correction.2
When to summarize grouped synonymous-codon counts
Use this tool after counts have been grouped into the appropriate standard-code synonymous families. It helps inspect how within-family concentration contributes to an overall ENC-style estimate.
- Compare codon preference using the same family definitions and estimator across datasets.
- Inspect the returned family homozygosities in input order.
- Explore equal-frequency and single-codon boundary examples using synthetic counts.
How to supply families and calculate the ENC estimate
- Enter Family degeneracies as a list containing the size of each submitted synonymous family.
- Enter Codon counts as matching rows, with one nonnegative integer count per codon and a positive total in each row.
- Include at least one family for each supported degeneracy: 2, 3, 4, and 6. Keep each row aligned with its degeneracy entry.
- Run the tool and read Family homozygosities in input order, then Effective codon number.
- Family homozygosity
- For a family with total N and codon counts n_j, F = sum((n_j/N)²). A family using one codon has F = 1; equal use of d codons has F = 1/d.
- Mean homozygosity by degeneracy
- The tool groups F values by family size and takes an arithmetic mean within each group. Each family in a group has equal weight, regardless of its total count.
ENC = min(61, 2 + 9/F2 + 1/F3 + 5/F4 + 3/F6) F2, F3, F4, and F6 are the respective mean family homozygosities. The coefficients represent the standard-code family counts; the constant 2 represents the two one-codon amino acids.
The implementation validates alignment and row lengths, checks integer counts and positive totals, computes the family frequencies, and collects their homozygosities by degeneracy. It requires every degeneracy group before applying the formula and capping the result at 61. It does not identify amino acids or build the groups from a sequence.
{
"input": {
"familyDegeneracies": [
2,
3,
4,
6
],
"codonCounts": [
[
5,
5
],
[
3,
3,
3
],
[
1,
1,
1,
1
],
[
1,
1,
1,
1,
1,
1
]
]
},
"output": {
"familyHomozygosities": [
0.5,
0.3333333333333333,
0.25,
0.16666666666666666
],
"effectiveCodonNumber": 61
}
} {
"input": {
"familyDegeneracies": [
2,
3,
4,
6
],
"codonCounts": [
[
10,
0
],
[
9,
0,
0
],
[
4,
0,
0,
0
],
[
6,
0,
0,
0,
0,
0
]
]
},
"output": {
"familyHomozygosities": [
1,
1,
1,
1
],
"effectiveCodonNumber": 20
}
} Missing degeneracy groups, row-length mismatches, negative or fractional counts, and rows with zero totals produce input errors.
Limitations of uncorrected family homozygosities
- Finite-sample correction is absent. Sparse families can appear more concentrated, and comparisons with corrected ENC estimators need care.
- At least one row per degeneracy is sufficient for input validation. The tool cannot verify complete amino-acid coverage, correct grouping, duplicate families, or standard-code applicability.
- Stop codons and alternative genetic codes are not incorporated into a custom formula. The caller must supply compatible families.
- ENC does not establish expression level, translational efficiency, host adaptation, or evolutionary cause, and no uncertainty estimate is returned.
Alternative or Complementary codon-frequency analyses
Prepare counts from the intended coding sequence and reading frame, then verify family membership using the appropriate genetic code. Individual-codon frequencies and synonymous usage fractions can help explain an ENC result, but they do not automatically construct this tool’s family matrix. For short or incomplete genes, compare an estimator that explicitly handles sampling and missing families.
References
-
The effective number of codons used in a gene — Gene / Elsevier; F. Wright (1990)
-
Estimating the Effective Number of Codons: The Wright Way of Determining Codon Homozygosity Leads to Superior Estimates — Genetics; A. Fuglsang (2006)
Similar or alternative tools
- Codon Frequency
Measure one codon’s frequency among complete triplets in the supplied DNA reading frame.
- Codon Usage Bias Frequency
Calculate a codon’s frequency among supplied counts for its amino acid; this is a per-codon fraction rather than ENC.