Skip to content

Phylogenetics, Comparative Genomics, Gene Annotation and Genetic Variation

Tree building (UPGMA, NJ, parsimony, ML, Bayesian), bootstrap, JC distance, synteny and pan-genomes, gene prediction, variant calling and GWAS for CSIR NET.

  • 20 min read
  • Updated
On this page · 13 sections
  1. Prerequisites
  2. The Hook: A Dentist, a Virus and a Tree
  3. Part 1: Phylogenetics
  4. Part 2: Comparative Genomics
  5. Part 3: Gene Annotation
  6. Part 4: Genetic Variation
  7. Memory Tricks
  8. Don’t Confuse
  9. Common Mistakes
  10. Practice
  11. Quick Revision Table
  12. Key Takeaways
  13. What’s Next

Prerequisites

The Hook: A Dentist, a Virus and a Tree

How CSIR NET asks it. New unit, no past CSIR papers. Expect Part B on which tree method assumes a clock, the number of possible trees, bootstrap meaning, ortholog detection, gene-finding signals and variant types. Expect Part C to give a distance matrix to cluster, sequence differences to correct, gene-prediction counts to score, or a case–control allele table to evaluate.


Part 1: Phylogenetics

Tree vocabulary

TermMeaning
Leaf / tip (OTU)A sampled sequence or taxon
Internal node (HTU)A hypothetical ancestor
Branch lengthAmount of change (substitutions per site) or time
RootThe common ancestor of all leaves; gives the direction of time
CladeAn ancestor and all its descendants (monophyletic group)
TopologyThe branching pattern alone
Cladogram / phylogram / chronogramTopology only / branch lengths = change / branch lengths = time (ultrametric: all tips equidistant from the root)
Newick formatText tree with brackets: ((A,B),(C,D));

Groups. Monophyletic = ancestor + all descendants (birds within dinosaurs). Paraphyletic = ancestor + some descendants (“reptiles” excluding birds). Polyphyletic = members from different ancestors grouped by convergent traits (“warm-blooded animals”).

Rooting. Most methods give unrooted trees. Root with an outgroup (a taxon known to have branched off earlier) or by the midpoint (assumes roughly equal rates).

Gene tree vs species tree. A gene tree can differ from the species tree because of gene duplication and loss (paralogues mistaken for orthologues), horizontal gene transfer, or incomplete lineage sorting (ancestral polymorphism sorted differently in descendant lineages).

How many trees are there?

For n taxa:

$$\text{Unrooted} = (2n-5)!! = 1\times3\times5\times\cdots\times(2n-5), \qquad \text{Rooted} = (2n-3)!!$$
nUnrootedRooted
313
4315
515105
6105945
102,027,02534,459,425

The count explodes, so exhaustive search is possible only for small n. Larger problems use heuristic tree searches (nearest-neighbour interchange, subtree pruning and regrafting, tree bisection and reconnection).

The workflow

graph LR
    A["Choose homologous
sequences
(orthologues for a
species tree)"] --> B["Multiple
alignment;
trim poor columns"] B --> C["Choose a
substitution model
(AIC / BIC / LRT)"] C --> D["Infer tree:
distance, parsimony,
ML or Bayesian"] D --> E["Assess support:
bootstrap or
posterior probability"] E --> F["Root, date,
interpret"]

Correcting distances for multiple hits

The observed fraction of differing sites, the p-distance, underestimates true change because a site can change more than once (A → G → A leaves no trace). Models correct for this.

Jukes–Cantor (JC69): all substitutions equally likely, equal base frequencies.

$$\boxed{d = -\tfrac{3}{4}\ln\!\left(1 - \tfrac{4}{3}p\right)}$$

For p = 0.10, d = 0.107; for p = 0.30, d = 0.383; for p = 0.60, d = 1.207. The correction grows with p, and the formula fails as p approaches 0.75, the difference expected between two random DNA sequences (saturation).

Kimura two-parameter (K2P): separate rates for transitions (purine ↔ purine, pyrimidine ↔ pyrimidine) and transversions, since transitions are usually more frequent. With P = transition fraction and Q = transversion fraction:

$$d = -\tfrac12\ln(1-2P-Q) - \tfrac14\ln(1-2Q)$$

More general models: F81 (unequal base frequencies), HKY85, GTR (general time-reversible, six rates); add +Γ (rate variation among sites, gamma distribution) and +I (a proportion of invariant sites). For proteins: empirical models such as JTT, WAG and LG. Models are chosen by likelihood-ratio tests, AIC or BIC.

Tree-building methods

MethodTypeOptimality / ideaAssumptions and notes
UPGMADistance, clusteringRepeatedly join the closest pair; average distancesAssumes a constant molecular clock; gives a rooted, ultrametric tree; wrong when rates differ
Neighbour-joining (NJ) (Saitou and Nei, 1987)Distance, clusteringJoins pairs that minimise total tree length, correcting for each taxon’s average divergenceNo clock assumption; unrooted; fast; good for large data
Minimum evolution, Fitch–MargoliashDistance, optimalityShortest total tree / best fit to distances—
Maximum parsimony (MP)CharacterTree requiring the fewest changesOnly parsimony-informative sites count (at least two states, each in at least two taxa); prone to long-branch attraction
Maximum likelihood (ML) (Felsenstein)Character, model-basedTree and parameters that make the observed data most probable: \(L = P(\text{data} \mid \text{tree, model})\)Statistically consistent with a good model; computationally heavy; RAxML, IQ-TREE, PhyML
Bayesian inferenceCharacter, model-basedPosterior probability of trees given data and priors, sampled by MCMCGives clade posterior probabilities; MrBayes, BEAST (dated trees)

Long-branch attraction. Two fast-evolving lineages accumulate chance parallel changes, and parsimony (and poorly-modelled analyses) group them together even if they are not relatives. Better models, more taxa that break up long branches, and removing fast sites reduce it.

How confident is a branch? The bootstrap

Bootstrapping (Felsenstein, 1985) resamples alignment columns with replacement to make many pseudo-alignments of the same length (typically 100–1,000), builds a tree from each, and reports for each clade the percentage of replicates that contain it. High values (often ≥70%, more cautiously ≥95%) mean the clade is consistently supported by the data, not that it is 95% likely to be true. Jackknifing resamples without replacement (dropping a fraction of columns). Bayesian analyses report posterior probabilities, which tend to be higher than bootstrap values for the same clade.

Molecular clocks and selection

  • Molecular clock (Zuckerkandl and Pauling): substitutions accumulate roughly linearly with time for a given gene. For two lineages that split t years ago, each accumulating r substitutions per site per year, the distance between them is \(d = 2rt\), so \(t = d/2r\). Example: d = 0.06, r = 1 × 10⁻⁹ per site per year → t = 3 × 10⁷ years (30 million years). Clocks are calibrated with fossils or dated events; relaxed clocks allow rates to vary between branches.
  • dN/dS (ω) compares non-synonymous substitutions per non-synonymous site with synonymous substitutions per synonymous site: ω < 1 purifying (negative) selection (most genes), ω ≈ 1 neutral evolution (pseudogenes), ω > 1 positive (diversifying) selection (for example some immune and pathogen-surface genes).

Part 2: Comparative Genomics

Comparative genomics compares whole genomes to find what is shared, what is unique, and how genomes changed.

ConceptWhat it means
Synteny / collinearityConserved gene content (synteny, strictly “on the same chromosome”) and conserved order (collinearity) between species; dot plots of two genomes show syntenic blocks as diagonals
RearrangementsInversions (diagonal flips in the dot plot), translocations, fusions, fissions
Orthologue detectionReciprocal best hits (gene A’s best hit in genome 2 is B, and B’s best hit in genome 1 is A), or tree-based methods; databases COG, eggNOG, OrthoDB, OMA
Gene family evolutionExpansions and contractions (duplication, loss); lineage-specific expansions often track adaptation
Conserved non-coding elementsNon-coding regions conserved across distant species, often enhancers; finding them by cross-species alignment is phylogenetic footprinting
Horizontal gene transferFlagged by atypical GC content or codon usage, unusual phylogenetic placement, or genomic islands
Pan-genomeCore genome (genes in all strains) + accessory/dispensable genome (some strains) + strain-specific genes. Open pan-genome: new genes keep appearing as strains are added (many bacteria with frequent HGT); closed: it plateaus
Genome sizeDoes not track organismal complexity (the C-value paradox); much of the variation is repeats and non-coding DNA
Species delineation in prokaryotesWhole-genome average nucleotide identity (ANI) has largely replaced DNA–DNA hybridisation

Applications: identifying virulence genes by comparing pathogenic and non-pathogenic strains, reverse vaccinology (screening a pathogen genome for surface-exposed candidates), choosing drug targets present in a pathogen but absent from the host, tracing outbreaks, and finding conserved regulatory elements.


Part 3: Gene Annotation

Annotation = attaching biological information to a sequence. Two layers:

  • Structural annotation: where the genes, exons, UTRs, non-coding RNAs, repeats and regulatory elements are.
  • Functional annotation: what the products do (homology, domains, GO terms, pathways).
graph TD
    A["Assembled genome"] --> R["Mask repeats
(RepeatMasker)"] R --> AB["Ab initio prediction
signals + content
(HMMs)"] R --> EV["Evidence alignment
RNA-seq, cDNA/ESTs,
proteins from relatives"] AB --> C["Combine into
consensus gene models"] EV --> C C --> NC["Non-coding RNAs
tRNAscan-SE, Rfam"] C --> F["Functional annotation
BLAST, InterProScan,
GO, KEGG"] F --> Q["Quality check
e.g. completeness of
conserved single-copy genes"]

Prokaryotic gene finding

  • Genes are dense, mostly without introns: the task is choosing the right ORF and start codon.
  • Signals: start codon (ATG, also GTG, TTG), stop codons (TAA, TAG, TGA), the Shine–Dalgarno ribosome-binding site upstream of the start, promoter elements.
  • Content: codon usage and nucleotide composition modelled by Markov models (GeneMark) or interpolated Markov models (Glimmer); Prodigal is another widely used finder.
  • Why long ORFs signal genes: in random sequence with equal base frequencies, 3 of 64 codons are stops, so the chance that a given codon is not a stop is 61/64. The probability of 100 consecutive non-stop codons is \((61/64)^{100} \approx 0.008\). The expected ORF length in random sequence is about 64/3 ≈ 21 codons. Long ORFs are therefore unlikely by chance.

Eukaryotic gene finding

Harder: genes are split by introns, coding density is low, and alternative splicing makes several transcripts per gene.

Signal / contentWhat finders use
Splice sitesGT–AG rule (intron starts GT, ends AG) plus surrounding consensus and branch point
Translation startKozak context around ATG
Promoter regionTATA box, CpG islands upstream of many genes
3’ endPolyadenylation signal (AATAAA)
Coding contentCodon bias, hexamer frequencies, 3-base periodicity of coding sequence
  • Ab initio finders use generalised (semi-Markov) HMMs whose states are exons, introns and intergenic regions: GENSCAN, AUGUSTUS, FGENESH, GeneMark-ES.
  • Evidence-based annotation aligns RNA-seq reads, full-length cDNAs and proteins from related species; it is the most reliable.
  • Pipelines combine both (MAKER, BRAKER, the Ensembl and NCBI annotation pipelines).

Evaluating a gene finder against a trusted reference, at the nucleotide, exon or gene level:

$$\text{Sensitivity (Sn)} = \frac{TP}{TP + FN}, \qquad \text{Specificity in gene-finding usage (Sp)} = \frac{TP}{TP + FP}$$

(In gene-prediction papers, “specificity” is traditionally TP/(TP + FP), which statisticians call precision.)

Pitfalls: pseudogenes mistaken for genes; short genes and small proteins missed; wrong start codons; transitive annotation errors (a wrong label copied from one entry to its homologues, and on down the chain).


Part 4: Genetic Variation

Types of variant

VariantDescription
SNV / SNPSingle-nucleotide change; called a polymorphism (SNP) when common, conventionally minor allele frequency ≥ 1%
IndelSmall insertion or deletion; in coding sequence, frameshift unless a multiple of 3
MNVAdjacent multi-nucleotide change
STR / microsatelliteVariable number of short tandem repeats; forensics, linkage markers
CNVCopy-number gain or loss of a segment (kilobases or more)
Structural variantLarge deletions, duplications, inversions, translocations

Coding consequences: synonymous, missense, nonsense (stop gained), frameshift, in-frame indel, splice-site, start lost; non-coding variants in promoters, enhancers and UTRs can change expression (eQTLs). Germline variants are inherited; somatic variants arise in a tissue (cancer).

HGVS nomenclature names variants by reference: c. coding DNA, g. genomic, p. protein. The common cystic fibrosis allele is written c.1521_1523delCTT, p.(Phe508del).

From reads to variants

graph LR
    A["FASTQ reads"] --> B["Quality control
and trimming"] B --> C["Align to reference
(BWA, Bowtie2)
→ SAM/BAM"] C --> D["Sort, mark
duplicates,
recalibrate"] D --> E["Call variants
(GATK, bcftools,
FreeBayes) → VCF"] E --> F["Filter and annotate
(VEP, SnpEff,
ANNOVAR)"] F --> G["Interpret:
population frequency,
prediction, clinical DBs"]

Predicting impact: SIFT (based on conservation in an alignment; scores ≤ 0.05 predicted deleterious), PolyPhen-2 (conservation plus structure), CADD (integrated score). Clinical interpretation follows the ACMG/AMP evidence framework and uses ClinVar and gnomAD frequencies.

Population-level analysis

  • Allele frequency p, and Hardy–Weinberg expectations p², 2pq, q² (deviations flag genotyping error or selection).
  • Linkage disequilibrium (LD): non-random association of alleles at two loci. \(D = p_{AB} - p_A p_B\); \(D' = D/D_{max}\); \(r^2 = D^2/(p_A p_a p_B p_b)\). High LD lets one tag SNP stand for many neighbours, which is why genotyping arrays work.
  • GWAS (genome-wide association study): test each SNP for association with a trait (case–control χ² or regression), plot −log₁₀ P along the genome (Manhattan plot), check inflation with a QQ plot, and correct for population stratification (principal components of ancestry). The conventional genome-wide significance threshold is P < 5 × 10⁻⁸, roughly a Bonferroni correction of 0.05 for about a million independent common-variant tests.
  • Effect size: the odds ratio (OR) for an allele: \((a \cdot d)/(b \cdot c)\) from a 2 × 2 allele-count table. Most common-variant ORs are small (often below 1.5). A GWAS hit marks a region in LD with the causal variant, which still has to be found by fine-mapping and experiments.

Memory Tricks

Don’t Confuse

ThisvsThat
UPGMA: clock, rooted, ultrametricvsNJ: no clock, unrooted
Parsimony: fewest changes, no explicit modelvsML: most probable data under a model
Bootstrap %: repeatability under resamplingvsPosterior probability: Bayesian probability given model and priors
p-distance: observedvsJC / K2P distance: corrected for multiple hits
Transition: purine ↔ purinevsTransversion: purine ↔ pyrimidine
Synteny: same chromosome / shared gene setvsCollinearity: same order
Core genome: all strainsvsAccessory genome: some strains
Structural annotation: where genes arevsFunctional annotation: what they do
Ab initio: signals and statisticsvsEvidence-based: transcripts and proteins
Gene-finding Sp = TP/(TP+FP)vsClinical specificity = TN/(TN+FP)
Association (GWAS hit)vsCausal variant (needs fine-mapping)

Common Mistakes


Practice

All questions below are original practice questions written in CSIR NET style. They are not previous-year questions; this unit is new in the revised syllabus.

Level 1: Foundation

  1. Which distance method assumes a constant molecular clock?
  2. How many distinct unrooted bifurcating trees exist for 5 taxa?
  3. What does dN/dS > 1 indicate?
Answers
  1. UPGMA.
  2. 15 (1 × 3 × 5).
  3. Positive (diversifying) selection.

Level 2: Part B Style

Q1 (practice). Two aligned DNA sequences differ at 30% of sites. The Jukes–Cantor distance is closest to:

  • (a) 0.30
  • (b) 0.38
  • (c) 0.45
  • (d) 0.75
Answer and explanation

(b). \(d = -0.75\ln(1 - 0.4) = -0.75 \times (-0.511) = 0.383\) substitutions per site. The corrected distance exceeds the observed 0.30 because some sites changed more than once.

Q2 (practice). A gene finder is tested on a region where the reference annotation has 1,000 coding nucleotides. The prediction covers 1,200 nucleotides, of which 900 are truly coding. Nucleotide-level sensitivity and specificity (gene-finding definition) are:

  • (a) 0.90 and 0.75
  • (b) 0.75 and 0.90
  • (c) 0.90 and 0.90
  • (d) 0.83 and 0.75
Answer and explanation

(a). TP = 900, FN = 1,000 − 900 = 100, FP = 1,200 − 900 = 300. Sn = 900/1,000 = 0.90. Sp = TP/(TP + FP) = 900/1,200 = 0.75. The finder over-predicts.

Q3 (practice). The genome-wide significance threshold P < 5 × 10⁻⁸ corresponds to a Bonferroni correction of α = 0.05 for approximately:

  • (a) 10⁴ independent tests
  • (b) 10⁶ independent tests
  • (c) 10⁸ independent tests
  • (d) 5 × 10⁸ independent tests
Answer and explanation

(b). 0.05/10⁶ = 5 × 10⁻⁸. About a million independent tests approximates the number of independent common-variant LD blocks in the genome.

Q4 (practice). Which pair is correctly matched?

  • (a) Maximum parsimony: tree that maximises the probability of the data under a substitution model
  • (b) Bootstrap: resampling alignment columns with replacement
  • (c) UPGMA: unrooted tree without a clock assumption
  • (d) Bayesian inference: tree with the fewest character changes
Answer and explanation

(b). (a) describes ML, (c) describes NJ, and (d) describes parsimony.

Level 3: Part C Style

Q1 (practice). Four sequences give the distance matrix below (substitutions per 100 sites).

ABCD
A–4812
B–1014
C–10
D–

(i) Build the UPGMA tree with node heights. (ii) How would neighbour-joining treat this matrix differently from UPGMA? (iii) If the substitution rate is 1 per 100 sites per 10 million years per lineage, when did D diverge from the rest?

Answer and worked solution
  1. Join A–B (4) at height 2; d(AB,C) = 9, d(AB,D) = 13. Join AB–C (9) at height 4.5; d(ABC,D) = (2 × 13 + 10)/3 = 12. Join D at height 6. Tree (((A,B),C),D);.
  2. The data are not ultrametric (in the triplet A, B, C the two largest distances, 8 and 10, are unequal), so the clock fails. They are, however, additive: the four-point sums are AB + CD = 14, AC + BD = 22 and AD + BC = 22, so the unrooted topology is AB | CD, and NJ recovers it exactly with branch lengths A = 1, B = 3, C = 3, D = 7 and an internal branch of 4 (UPGMA gives the same unrooted topology). The difference is in the branch lengths and the root: NJ shows D on a much longer branch (7) than A (1), whereas UPGMA forces every tip to 6 units from the root and so misrepresents unequal rates.
  3. The root height is 6 substitutions per 100 sites per lineage. At 1 per 100 sites per 10 Myr per lineage, t = 6 × 10 Myr = 60 million years (here the height is already half the pairwise distance, i.e. per-lineage change, so no further division by 2 is needed).

Q2 (practice). A case–control study genotypes one SNP. Allele counts: cases, risk allele A = 300 and other allele a = 700; controls, A = 200 and a = 800. In controls, the risk allele has frequency \(p_A\) = 200/1,000 = 0.2; allele B of a nearby marker has frequency \(p_B\) = 0.5, and the AB haplotype has frequency \(p_{AB}\) = 0.15.

(i) Calculate the allelic odds ratio. (ii) Calculate the allelic χ² (1 d.f.). (iii) Calculate D, D′ and r² between the two loci. (iv) Is the SNP genome-wide significant if its P value is about 3 × 10⁻⁷?

Answer and worked solution
  1. \(OR = (300 \times 800)/(700 \times 200) = 240{,}000/140{,}000 = 1.71\).
  2. With N = 2,000: \(\chi^2 = N(ad - bc)^2/[(a+b)(c+d)(a+c)(b+d)] = 2000 \times (240{,}000 - 140{,}000)^2 / (1000 \times 1000 \times 500 \times 1500) = 26.7\).
  3. \(D = 0.15 - 0.2\times0.5 = 0.05\). For D > 0, \(D_{max} = \min(p_A p_b, p_a p_B) = \min(0.2\times0.5, 0.8\times0.5) = 0.10\), so \(D' = 0.5\). \(r^2 = 0.05^2/(0.2\times0.8\times0.5\times0.5) = 0.0025/0.04 = 0.0625\).
  4. No. 3 × 10⁻⁷ (consistent with χ² = 26.7 on 1 d.f.) is larger than 5 × 10⁻⁸. It is “suggestive” and needs replication or a larger sample. Note also that r² ≈ 0.06 with B means B would be a poor proxy (tag) for this SNP, even though D′ is 0.5.

Q3 (practice). A newly assembled bacterial contig has 50% GC and equal base frequencies. Consider:

(A) In random sequence, the probability that 100 consecutive codons in one frame contain no stop codon is about 0.008. (B) An ORF of 300 codons is therefore very unlikely to arise by chance in one frame. (C) Codon usage typical of the host genome in a long ORF supports a real gene, but an island of atypical GC and codon usage may indicate horizontal transfer. (D) The longest ORF in each region must be annotated as the gene, with the first ATG as its start.

  • (a) A, B and C only
  • (b) A and D only
  • (c) B, C and D only
  • (d) A, B, C and D
Answer and worked solution

(a) A, B and C.

  • (A) \((61/64)^{100} \approx 0.0082\). Correct.
  • (B) \((61/64)^{300} \approx 5.6\times10^{-7}\): very unlikely by chance. Correct.
  • (C) Correct: composition is both a gene-finding signal and an HGT flag.
  • (D) Wrong: overlapping ORFs in other frames or on the other strand can be longer by chance; starts may be GTG or TTG; and the correct start is chosen using the Shine–Dalgarno site and homology, not simply the first ATG.

Quick Revision Table

ItemFact
GroupsMonophyletic (clade), paraphyletic, polyphyletic
RootingOutgroup or midpoint
Tree countsUnrooted (2n − 5)!!; rooted (2n − 3)!!; 4 taxa: 3 / 15
JC69d = −¾ ln(1 − 4p/3); saturates at p = 0.75
K2PSeparate transition and transversion rates
ModelsJC, K2P, F81, HKY, GTR, +Γ, +I; chosen by AIC/BIC/LRT
UPGMAClock, rooted, ultrametric
NJSaitou and Nei 1987; no clock; unrooted
ParsimonyFewest changes; informative sites; long-branch attraction
ML / BayesianP(data given tree) / posterior via MCMC
BootstrapColumns resampled with replacement; % of replicates
Clockt = d/(2r) for pairwise d
dN/dS< 1 purifying, ≈ 1 neutral, > 1 positive
Comparative genomicsSynteny, collinearity, reciprocal best hits, CNEs, pan-genome (core + accessory)
Prokaryotic gene findingORFs, Shine–Dalgarno; GeneMark, Glimmer, Prodigal
Eukaryotic gene findingGT–AG, Kozak, CpG, AATAAA; GENSCAN, AUGUSTUS; RNA-seq evidence
Random ORFP(no stop in n codons) = (61/64)ⁿ; mean about 21 codons
Sn / Sp (gene finding)TP/(TP + FN) / TP/(TP + FP)
VariantsSNV, indel, STR, CNV, SV; HGVS c./g./p.
Variant pipelineFASTQ → BAM → VCF → annotation (VEP, SnpEff)
LDD = p_AB − p_A p_B; D′ = D/D_max; r²
GWASP < 5 × 10⁻⁸; Manhattan and QQ plots; PCA for stratification; OR = ad/bc

Key Takeaways

What’s Next