Overview

The study of molecular evolution is a central topic in biology. The molecular clock hypothesis assumes that genes accumulate mutations at a constant rate over time [8]. Moreover, under the consideration that most of the accumulated mutations are neutral, the Poisson distribution models the expected variability. The molecular clock hypothesis has become a cornerstone of modern phylogenetic techniques, which are now standard for studying the evolutionary relationships between species and organisms [9].

It has been shown, however, that the simple molecular clock model fails to universally recapitulate evolutionary trajectories. Observations revealed that in some cases mutations do not accumulate at a constant rate [1]. This led to the development of relaxed molecular clocks, in which the rates of mutation accumulation are not uniform across lineages [5]. Although these clocks have proven to be more accurate in certain cases, they still face difficulties to model, for instance, overdispersed populations [2]. A proper analysis of the time-dependent distribution of the number of mutations in the population is necessary to understand and eventually predict the evolutionary trajectories that take place in nature.

Although previous studies have attempted to abstract molecular evolution as a type of diffusion process in the sequence space [7, 8], little attention has been given to the form of the underlying stochastic process. In our previous work, we showed that non-Brownian evolutionary motions occurred within the lineages of a virus, leading to non-Poissonian distributions [6]. Here, we present PyEvoMotion, a Python tool aimed to infer a generalized molecular clock model upon bulk genomic data analysis, featuring a command-line interface and enough modularity for integration into larger Python pipelines. PyEvoMotion is intended to complement traditional phylogenetic analyses, focusing on a shorter time scale.

Traditional phylogenetic methods, while powerful, face computational limitations when applied to large datasets. Indeed, analyzing more than \(10^4\) sequences becomes impractical due to the exponential complexity of reconstructing evolutionary trees [3]. Yet, a recent advance based on maximum parsimony has allowed phylogenetic inference at a larger scale [4]. Population-based statistical approaches also provide a viable alternative [6, 10]. These methods simplify the representation of evolutionary relationships by focusing on patterns of population genetics rather than exhaustive tree reconstruction based on genetic variation. PyEvoMotion leverages stochastic mathematical modelling to assess evolutionary trends, aiming to process datasets orders of magnitude larger than those typically analyzed. This capability is essential for handling the unprecedented volume of genomic data generated by high-throughput sequencing efforts [11].

Trajectory-based analysis vs. Ensemble-based analysis

When abstracting molecular evolution by stochastic differential equations, one can either follow a single stochastic trajectory (a particular lineage’s evolution through time) or consider an ensemble of states across many lineages at a given time. Both approaches reflect the same underlying evolutionary diffusion process (governed by a particular molecular clock).

Crucially, the ensemble-based approach has some benefits in practice because obtaining longitudinal time-series data from the same lineage or population (a single trajectory) over evolutionary timescales is extremely difficult. Instead, it is relatively easy to collect cross-sectional data by sampling many individuals or parallel populations at a given time, thereby capturing an ensemble of genetic states. This means one can observe the distribution of molecular traits across a population at time \(t\) (an empirical ensemble) without needing to trace the full history of any one lineage. Indeed, attempts to use multiple replicates or time-series data are often infeasible outside of controlled laboratory evolution experiments.

By focusing on the ensemble (population-level distributions), we leverage data that are readily available (e.g. genomes from a population resulting from sequencing efforts) to infer evolutionary parameters. In essence, both trajectory and ensemble perspectives inform the same stochastic evolutionary process, but the ensemble-based approach offers practical advantages in data acquisition and inference as it circumvents the scarcity of long lineage-tracking data and instead uses the rich snapshot information across individuals to draw conclusions about the underlying SDE-governed evolutionary dynamics

Key Features

PyEvoMotion provides a comprehensive toolkit for studying evolutionary dynamics:

  1. Anomalous Diffusion Analysis: Determines whether DNA sequences evolve according to standard (\(\alpha = 1\)) or anomalous (\(\alpha \neq 1\)) diffusion processes.

  2. Large-scale Analysis: Processes datasets with thousands of sequences in a reasonable amount of time.

  3. Flexible Time Intervals: Analyze evolution over custom time periods (days, weeks, months).

  4. Mutation Type Specification: Study specific mutation types (substitutions, insertions, deletions) independently or in combination.

  5. Advanced Filtering: Filter sequences by metadata attributes, date ranges, or genome positions.

  6. Visualization: Generates plots for time series statistics and model parameters.

  7. Reproducible Analysis: Export and import analysis configurations as JSON files.

Applications

PyEvoMotion is particularly valuable for:

  • Viral Evolution Studies: Track how viruses like SARS-CoV-2 evolve over time and across different variants (see for instance [6]).

  • Comparative Genomics: Compare evolutionary patterns across different species or genes.

  • Molecular Clock Analysis: Test the validity of molecular clock assumptions in specific contexts.

  • Epidemiological Forecasting: Improve prediction models by accounting for non-Poissonian evolution.

  • Population Genetics Research: Study how mutations accumulate in populations over time.

The tool bridges the gap between traditional phylogenetic methods and statistical population genetics approaches, offering unique insights into the stochastic processes driving molecular evolution.

References

[1]

F. J. Ayala. Vagaries of the molecular clock. Proc Natl Acad Sci USA, 94(15):7776–7783, 1997. URL: https://doi.org/10.1073/pnas.94.15.7776, doi:10.1073/pnas.94.15.7776.

[2]

T. Bedford, I. Wapinski, and D. L. Hartl. Overdispersion of the molecular clock varies between yeast, drosophila and mammals. Genetics, 179(2):977–984, 2008. URL: https://doi.org/10.1534/genetics.108.089185, doi:10.1534/genetics.108.089185.

[3]

B. Chor and T. Tuller. Maximum likelihood of evolutionary trees: hardness and approximation. Bioinformatics, 21(S1):i97–i106, 2005. URL: https://doi.org/10.1093/bioinformatics/bti1027, doi:10.1093/bioinformatics/bti1027.

[4]

Nicola De Maio, Prabhav Kalaghatgi, Yatish Turakhia, Russell Corbett-Detig, Bui Quang Minh, and Nick Goldman. Maximum likelihood pandemic-scale phylogenetics. Nature Genetics, 55(5):746–752, Apr 2023.

[5]

A. J. Drummond, S. Y. W. Ho, M. J. Phillips, and A. Rambaut. Relaxed phylogenetics and dating with confidence. PLoS Biol, 4(5):e88, 2006. URL: https://doi.org/10.1371/journal.pbio.0040088, doi:10.1371/journal.pbio.0040088.

[6] (1,2,3)

L. Goiriz, R. Ruiz, Ã’. Garibo-i-Orts, J. A. Conejero, and G. Rodrigo. A variant-dependent molecular clock with anomalous diffusion models sars-cov-2 evolution in humans. Proc Natl Acad Sci USA, 120(30):e2303578120, 2023. URL: https://doi.org/10.1073/pnas.2303578120, doi:10.1073/pnas.2303578120.

[7]

M. A. Huynen, P. F. Stadler, and W. Fontana. Smoothness within ruggedness: the role of neutrality in adaptation. Proc Natl Acad Sci USA, 93(1):397–401, 1996. URL: https://doi.org/10.1073/pnas.93.1.397, doi:10.1073/pnas.93.1.397.

[8] (1,2)

M. Kimura. Molecular evolutionary clock and the neutral theory. J Mol Evol, 26(1–2):24–33, 1987. URL: https://doi.org/10.1007/bf02111279, doi:10.1007/bf02111279.

[9]

S. Kumar. Molecular clocks: four decades of evolution. Nat Rev Genet, 6(8):654–662, 2005. URL: https://doi.org/10.1038/nrg1659, doi:10.1038/nrg1659.

[10]

F. Obermeyer, M. Jankowiak, N. Barkas, S. F. Schaffner, J. D. Pyle, L. Yurkovetskiy, and et al. Analysis of 6.4 million sars-cov-2 genomes identifies mutations associated with fitness. Science, 376(6599):1327–1332, 2022. URL: https://doi.org/10.1126/science.abm1208, doi:10.1126/science.abm1208.

[11]

B. B. Oude Munnink, D. F. Nieuwenhuijse, M. Stein, A. O'Toole, M. Haverkate, M. Mollers, S. K. Kamga, C. Schapendonk, M. Pronk, P. Lexmond, and et al. Rapid sars-cov-2 whole-genome sequencing and analysis for informed public health decision-making in the netherlands. Nat Med, 26(9):1405–1410, 2020. URL: https://doi.org/10.1038/s41591-020-0997-y, doi:10.1038/s41591-020-0997-y.