Skip to content
Dave Walker edited this page Jul 6, 2026 · 6 revisions

A Python toolkit for simulating sequence evolution, exploring molecular clock models and implementing phylogenetic reconstruction algorithms from first principles.

Overview

Molecular clocks use DNA sequence variation to estimate evolutionary relationships and divergence times between species.

This project explores the computational foundations of molecular clock analysis by building the core algorithms from first principles. Rather than relying on existing phylogenetics libraries, the aim is to understand how evolutionary histories are simulated, represented, reconstructed and ultimately interpreted.

The repository combines a reusable simulation library, a command-line interface for generating synthetic datasets, and an interactive explorer for experimenting with molecular clock models.

The project is intended both as an educational resource and as a computational laboratory for investigating phylogenetic algorithms.

Current Features

Strict Molecular Clock Simulation

The core simulator implements a strict molecular clock capable of generating complete synthetic evolutionary datasets.

Features include:

  • Random ancestral DNA sequence generation
  • Rooted phylogenetic tree generation
  • Balanced and random branching models
  • Ultrametric tree calibration
  • DNA sequence evolution along each branch
  • Complete evolutionary history tracking
  • Export of simulated datasets in FASTA, Newick and JSON formats

These datasets provide known ground truth against which future phylogenetic reconstruction algorithms can be evaluated.

Strict Molecular Clock Explorer

Version 0.2.0 introduces the Strict Molecular Clock Explorer, an interactive Streamlit application built directly on top of the simulation engine.

The explorer allows simulation parameters to be adjusted interactively before generating a new evolutionary history and visualising the resulting phylogenetic tree.

The command-line interface remains fully supported and continues to provide reproducible dataset generation for downstream analysis.

Clone this wiki locally