XIPERA report: Eldholm et al. (2014)

Workflow version: v0.10.3

Published

2026-08-12

Summary

Study description

  • Organism: M. tuberculosis
  • Reference: MTB_anc
  • Sequence alignment: none
  • Variant calling: freebayes (against dataset ancestor)

Sample metadata is summarised in Table 1. Figure 1 shows the structure of the dataset.

Table 1: Summary of dataset metadata and sequencing metrics.
  Sample Collection date Days Seq. length Seq. GC (%) Seq. gaps Seq. ambiguities Mapped reads % coverage (depth ≥ 4) Mean depth (depth ≥ 4) Mean baseQ (depth ≥ 4) Mean mapQ (depth ≥ 4) Mean read length (bp) Read length SD (bp) Median read length (bp)
1 MIP00022 1995-11-01 0 4411532 62.2 21505 203430 5725105 98.5 94.4 36.6 59.7 72.8 50.3 51.0
2 MIP00023 1996-07-01 243 4411532 62.2 22777 203429 5470629 98.5 87.8 36.5 59.7 70.9 47.8 51.0
3 MIP00024 1996-11-01 366 4411532 62.1 28904 203481 5500055 98.4 84.8 36.6 59.7 68.1 42.9 51.0
4 MIP00025 1997-01-01 427 4411532 62.2 22593 203411 5732091 98.5 93.3 36.5 59.7 72.0 49.8 51.0
5 MIP00026 1998-03-01 851 4411532 62.2 22872 203390 5714197 98.5 95.0 36.5 59.7 73.5 51.9 51.0
6 MIP00027 1998-06-01 943 4411532 62.2 23082 203420 5851858 98.4 93.8 36.5 59.7 70.8 47.8 51.0
7 MIP00028 1998-09-01 1035 4411532 62.2 22834 203423 5680594 98.5 92.6 36.6 59.7 72.0 49.6 51.0
8 MIP00029 1999-02-01 1188 4411532 62.2 20731 203442 5928246 98.5 99.0 36.6 59.7 73.8 51.0 51.0
9 MIP00030 1999-05-01 1277 4411532 62.2 22256 203432 5699653 98.5 94.8 36.5 59.7 73.5 51.6 51.0
Figure 1: MDS (PCoA) and MST visualization of pairwise dissimilarities between samples. Arrows indicate chronological sampling order. Percentages indicate the proportion of variation explained. Distances between points are approximately proportional to allele frequency-weighted dissimilarities between each pair of samples (see afwdist).

List of nucleotide variants

The sequence of the most recent common ancestor (MRCA) of the target samples has been built using ancestral sequence reconstruction (ASR) and compared to the mapping reference (Table 2). These variants represent fixed differences already present before the processes under study began.

To distinguish pre-existing variation from changes arising during the study period, nucleotide variants identified in the ancestor relative to the reference are reported separately from those identified in each sample relative to the ancestor, listed in Table 3.

NoteVariants on dataset ancestor (Table 2)
Table 2: Variants in the reconstructed ancestral sequence relative to the mapping reference.
Loading ITables v2.7.0 from the init_notebook_mode cell... (need help?)
NoteVariants on each sample (Table 3)
Table 3: Variants in each sample relative to the provided reference sequence.
Loading ITables v2.7.0 from the init_notebook_mode cell... (need help?)

Variants overview

A total of 66 different nucleotide variants were identified in the target samples, of which 11 were ‘Frameshift’, 1 were ‘In-frame indel’, 8 were ‘Intergenic’, 36 were ‘Non-synonymous’, 1 were ‘Other’, and 9 were ‘Synonymous’ (Figure 2).

Figure 2: Genome-wide nucleotide variant landscape and regional polymorphism enrichment. The top panel represents nucleotide variants detected across samples (ordered chronologically, earliest bottom to latest top), called against the provided reference sequence, plotted against genome position. Marker shape encodes predicted effect group; fill opacity scales with allele frequency. Subsequent panels represent posterior probabilities q_i = P(p_i > \mu \mid \text{data}) of exceeding the dataset-wide polymorphism rate \mu, estimated per gene (middle panel; Table 4) and per 8800-bp sliding window (bottom panel; Table 5). Only regions with a false discovery rate (FDR) \leq 0.05 are displayed. Grey shading indicates masked regions excluded from the provided reference sequence. For each region i (a feature or a window, modelled separately), k_i polymorphic sites (union across timepoints) out of n_i callable sites are modelled as k_i \sim \mathrm{BetaBinomial}(\alpha, \beta, n_i). Bayesian inference has been performed with PyMC and nutpie using a marginalized parametrization over parameters \mu = \alpha / (\alpha + \beta) (mean) and \phi = \alpha + \beta (concentration, inversely related to rate overdispersion), with per-region posteriors recovered analytically via the conjugate beta update.

Empirical rate p_0 = 1.54e-05, posterior mean overall polymorphism rate \bar\mu = 1.61e-05 SCI 95.0 % [1.15e-05, 2.09e-05] & MCI 95.0 % [1.18e-05, 2.14e-05], and posterior mean concentration \bar\phi = 4.19e+03 SCI 95.0 % [1.31e+03, 7.96e+03] & MCI 95.0 % [1.67e+03, 9.17e+03]. SCI: smallest credible interval, or highest density interval; MCI: median credible interval, or equal-tailed interval.

The overall convergence diagnostic has passed: 0 divergent transitions, the maximum \hat{R} is 1 (threshold: 1.05), and the minimum bulk effective sample size (ESS) is 6077.0 (threshold: 400). Global posterior predictive checks (PPC) have passed: the observed rate (p_0) falls within the 95.0 % predictive interval [1.01e-05, 2.37e-05]. Per‑observation PPC have failed: overall coverage is 98.9 %; for the 3951 observations with k=0, coverage is 100%; for the 51 observations with k>0, coverage is 15.7 %.

Table 4: Per-feature counts and posterior enrichment statistics from the Bayesian beta-binomial model (FDR ≤ 0.05).
Loading ITables v2.7.0 from the init_notebook_mode cell... (need help?)

Empirical rate p_0 = 1.61e-05, posterior mean overall polymorphism rate \bar\mu = 1.7e-05 SCI 95.0 % [1.26e-05, 2.21e-05] & MCI 95.0 % [1.26e-05, 2.21e-05], and posterior mean concentration \bar\phi = 2.96e+04 SCI 95.0 % [7.32e+03, 6.2e+04] & MCI 95.0 % [1.11e+04, 7.27e+04]. SCI: smallest credible interval, or highest density interval; MCI: median credible interval, or equal-tailed interval.

For the window‑level model, the overall convergence diagnostic has passed: 0 divergent transitions, the maximum \hat{R} is 1 (threshold: 1.05), and the minimum bulk effective sample size (ESS) is 5587.0 (threshold: 400). Global posterior predictive checks (PPC) have passed: the observed rate (p_0) falls within the 95.0 % predictive interval [1.1e-05, 2.43e-05]. Per‑observation PPC has failed: overall coverage is 98.4 %; for the 444 observations with k=0, coverage is 100 %; for the 57 observations with k>0, coverage is 86 %.

Table 5: Sliding-window counts and posterior enrichment statistics from the Bayesian beta-binomial model (FDR ≤ 0.05).
Loading ITables v2.7.0 from the init_notebook_mode cell... (need help?)

Allele frequency trajectories

The correlation of the allele frequency of each nucleotide variant with time since initial sampling has been calculated using Pearson’s correlation method (Figure 3). The graph shows which variants pass the correlation threshold (0.7), the p-value threshold (0.05), or both.

Figure 3: Correlation coefficients and adjusted p-values of allele frequencies with time. The correction method applied is Benjamini-Hochberg. Lines indicate adjusted p-value threshold and correlation thresholds. Select points to view variant information.

Selected correlated nucleotide variants are described in detail in Figure 4 and Figure 5. The visualizations are separated to differentiate variants with larger allele frequency amplitude (differences between their maximum and minimum alternate frequencies). In both cases, the plots show the alternative allele frequency across sampling days. Plot colors correspond to Figure 3, indicating whether each variant passes the correlation threshold, the p-value threshold, or both.

Figure 4: Time series of relative allele frequencies for variants above the allele frequency amplitude (Δfreq) threshold. Each subplot shows the progression of allele frequencies over time for a specific genomic position with significant correlation with time. Gaps reflect time points where sequencing was unreliable. A frequency of zero indicates confirmed absence above quality/depth filters.
Figure 5: Time series of relative allele frequencies for variants under the allele frequency amplitude (Δfreq) threshold. Each subplot shows the progression of allele frequencies over time for a specific genomic position with significant correlation with time. Gaps reflect time points where sequencing was unreliable. A frequency of zero indicates confirmed absence above quality/depth filters.

Temporal signal

To estimate the evolutionary rate based on all alleles (Figure 8), including those at low frequencies, a BIONJ (modified neighbor-joining) tree has been constructed from pairwise allele frequency-weighted distances between study samples using afwdist (Figure 6). To estimate the evolutionary rate from majority alleles (Figure 9), a maximum likelihood (ML) tree has been inferred under a GTR+F+I+G4 substitution model using IQ-TREE (Figure 7). Results are summarized in Table 6.

Table 6: Evolutionary rate estimates and temporal signal statistics. The “sites” value for the BIONJ method represents the number of sites considered for variant calling; for ML, it represents the number of non-masked sites in the genome alignment. Rates are expressed in number of changes per year; rates per site are expressed in number of changes per site and year. Both are accompanied by their 95 % confidence interval (CI).
Method Alleles Sites Rate Rate per site P
BIONJ All (weighted) 4111304 4.05 [3.31, 4.78] 9.84e-07 [8.06e-07, 1.16e-06] 0.961 < 0.001
ML Majority 4111304 2.37 [0.443, 4.29] 5.76e-07 [1.08e-07, 1.04e-06] 0.547 0.0227
Figure 6: BIONJ tree constructed from a pairwise allele frequency-weighted metric. Branch lengths are expressed in allele frequency-weighted substitutions. The reference MTB_anc has been used to root the tree (omitted from the visualization for clarity).
Figure 7: Maximum Likelihood tree constructed with IQ-TREE (GTR+F+I+G4). Branch lengths are expressed in substitutions per site. The reference MTB_anc has been used as ougroup and to root the tree (omitted from the visualization for clarity).
Figure 8: Root-to-tip distances versus days since the first sample. The line shows the linear model fit with a 95 % CI ribbon.
Figure 9: Root-to-tip distances versus days since the first sample for Maximum Likelihood tree. The line shows the linear model fit with a 95 % CI ribbon.

Evolutionary metrics

To track signatures of selection, the allele frequency-weighted rate of change per synonymous site (dS analog) and per non-synonymous site (dN analog) have been calculated for each sample relative to the provided reference sequence, together with their ratio ω (Figure 10). These metrics quantify frequency-weighted divergence across all alleles and help identify selective pressures. Frequency-weighted πN and πS of biallelic variants are reported as a metric of standing diversity (Figure 11). Rate denominators are calculated using the Nei–Gojobori (1986) method. Frequency-weighted synonymous and non-synonymous counts are reported as raw values, relative to the first sample, and as a ratio (Figure 12).

Figure 10: Time series of frequency-weighted dN and dS analogs, and their ratio (ω). Each point corresponds to a different sample, sorted in chronological order.
Figure 11: Time series of frequency-weighted πN and πS analogs, and their ratio. Only biallelic variants are considered. Each point corresponds to a different sample, sorted in chronological order.
Figure 12: Time series of non-synonymous (N) and synonymous (S) weighted counts (sum of frequencies) shown as raw values, relative to the first sample, and as a ratio. Each point corresponds to a different sample, sorted in chronological order.

The site frequency spectrum (SFS) has been calculated to help interpret the estimates above. Because alleles may occur at varying frequencies across samples, the SFS has been calculated using allele frequency bins, stratified by synonymous single-nucleotide variants (SNV), non-synonymous SNV, and all variants combined. To account for varying allele frequency trajectories across the dataset, the SFS is reported using two approaches: “exclusive”, which captures the overall distribution of within-host allele frequencies across the dataset (Figure 13), and “inclusive”, which identifies variants with globally stable frequency behavior (Figure 14).

Figure 13: Exclusive binned site frequency spectrum. Each variant observation has been assigned independently to an allele frequency bin based on its frequency in that sample. Each panel shows the number of alleles observed across a given number of samples. Variants are binned per-observation rather than globally (a variant that segregates at different frequencies across samples will contribute to multiple bins simultaneously).
Figure 14: Inclusive binned site frequency spectrum. Each variant has been assigned a single global frequency class based on the consistency of its allele frequency across all samples in which it has been detected. Variants that fall within the same bin in every sample are assigned to that bin; variants whose frequency spans multiple bins across samples are classified as “Mixed”. For each class, the plot shows the number of alleles observed across a given number of samples

Variants connectivity

Hierarchical clustering of pairwise AF correlations

To detect possible interactions between mutations, pairwise Pearson’s correlation between allele frequencies have been calculated (Figure 15). The heatmap is interactive and allows zooming into specific regions.

Figure 15: Interactive hierarchically clustered heatmap of pairwise correlation coefficients between time series of allele frequencies. Hover to view information about co-variating nucleotide variants. Includes 64 variants with the highest median coefficient (target cutoff at 100, retaining all tied values at the cutoff).

Network communities of pairwise AF correlations

Studying how variants are connected allows us to identify behavioral patterns and relate annotated variants to those lacking annotation. In this analysis, all variants are connected to one another (Figure 16), rather than being examined in pairs as in the previous approach (Figure 15).

The network representation (Figure 16) of pairwise correlations between variant allele frequencies as edge weights. Graph communities have been identified using the Louvain algorithm. Each color represents a community with its corresponding number.

Figure 16: Network visualization showing variant communities. Node fill colors represent community assignment, while border colors indicate annotation status. Edge opacity and color intensity reflect correlation coefficients. Hover over nodes for variant details and edges for exact weight values. Network indicators have been calculated: degree (number of nodes to which each node is connected), degree centrality (degree centrality indicating the proportion of nodes connected relative to the total network size), eigenvector centrality (relates a node’s importance considering the importance of neighboring nodes), betweenness centrality (number of times a node lies on the shortest paths between other nodes) and closeness centrality (how close a node is to all others, based on shortest path lengths).

Custom annotation of variants

An overview of the presence of variants with DRUG annotation is shown in Figure 17. The variation in frequency of these variants across different samples in time is shown in Figure 18. Ancestor variants have been identified by comparing to the reference sequence. Sample variants have been identified by comparing each sample to the provided reference sequence.

These represent genetic changes that arose after that ancestor. Any allele already present in the ancestor that has not been displaced is expected to persist in the samples at detectable frequency.

Figure 17: Presence and classification of detected variants across the ancestral sequence (compared to the provided reference sequence) and all samples (compared to the provided reference sequence).
Figure 18: Allele frequency trajectories for annotation-associated variants over time. Each connected group of points represents a distinct variant; gaps reflect time points where sequencing was unreliable. A frequency of zero indicates confirmed absence given the applied variant calling filters.