Each codon (3-base unit) is translated with the standard genetic code. A random point mutation at a random codon position is either synonymous (same amino acid — "silent") or nonsynonymous (changes the amino acid, or creates a premature stop = nonsense). Nei & Gojobori's method scores every codon site by the fraction of its possible mutations that are synonymous, giving the potential synonymous (S) and nonsynonymous (N) site counts for the whole gene.
dS = Sd / S (synonymous substitutions per synonymous site)
dN = Nd / N (nonsynonymous substitutions per nonsynonymous site)
ω = dN / dS
Because synonymous changes rarely affect protein function, they fix at close to the neutral mutation rate. This simulator makes the fixation ("acceptance") probability of a candidate mutation depend on your ω dial: p(synonymous) = 1/max(1,ω) and p(nonsynonymous) = ω/max(1,ω) — so the expected long-run dN/dS converges on the ω you set, exactly mirroring the population-genetic result that a mutation's fixation probability scales with its selection coefficient (Kimura, 1977).
- ω < 1 — purifying selection. Most amino-acid-changing mutations are deleterious and purged; this is the overwhelming majority of real protein-coding genes (typical ω ≈ 0.05–0.3).
- ω ≈ 1 — neutral evolution. Amino-acid changes fix as often as silent ones (pseudogenes, many synonymous-site studies).
- ω > 1 — positive (diversifying) selection. Amino-acid change is actively favoured — seen in antigen-recognition genes, viral surface proteins, and immune-receptor loci under an evolutionary arms race.
Nonsense mutations (premature stop codons) are treated as especially deleterious and fix far less often than missense changes, matching their near-universal removal by purifying selection in coding genes.