Ka/Ks (dN/dS) Selection Calculator
Calculate synonymous and nonsynonymous substitution rates to detect natural selection.
Why the Ratio Detects Selection
Synonymous substitutions do not change the encoded amino acid, so selection is largely blind to them. They therefore accumulate at approximately the neutral mutation rate and serve as an internal control. Non-synonymous changes alter the protein and are visible to selection.
Dividing by the number of available sites is essential. Roughly three quarters of codon positions are non-synonymous, so raw counts would be badly skewed without normalisation.
| ω | Selection | Frequency |
|---|---|---|
| < 1 | Purifying — changes removed | The vast majority of genes |
| = 1 | Neutral | Pseudogenes |
| > 1 | Positive — changes favoured | Rare, and interesting |
Most protein-coding genes show ω well below 0.2, because most amino acid changes are mildly deleterious. Values above 1 are unusual enough that they identify genes under active adaptive pressure.
Where Positive Selection Is Found
| Gene class | Why ω > 1 |
|---|---|
| Immune recognition (MHC) | Arms race with pathogens; diversity itself is advantageous |
| Viral surface proteins | Escaping host antibody recognition |
| Reproductive proteins | Sperm–egg recognition, sexual selection |
| Toxins and venoms | Prey resistance arms race |
The common thread is antagonistic coevolution. Where an opponent is also evolving, novelty is rewarded rather than penalised.
Why Whole-Gene ω Misses Most Selection
Averaging across an entire gene almost always gives ω < 1, because a handful of positively selected sites are swamped by many conserved ones. Site-based models that allow ω to vary across codons are far more sensitive, and branch-site models further allow it to vary between lineages — detecting selection that acted on one branch of a phylogeny only.
Saturation is the other limitation. Over long divergence times, synonymous sites accumulate multiple hits and dS is underestimated, inflating ω artefactually. Correction models exist but the method degrades for deeply diverged sequences.
Worked Examples
Common Mistakes
A few positively selected sites are swamped by many conserved ones, so whole-gene values almost always fall below 1. Use site models to detect selection.
It indicates purifying selection, which is itself a strong selective force. Only ω near 1 suggests neutrality.
Multiple hits at synonymous sites underestimate dS and inflate ω. The method becomes unreliable for very distant comparisons.
About three quarters of codon positions are non-synonymous. Comparing raw substitution counts without dividing by available sites is meaningless.