ZOMBI2 · examples

Examples gallery

Short, runnable recipes — each simulates with ZOMBI2 and plots with Phylustrator. Click any figure for the code and a short explanation. The levels of a run: species, genomes, sequences, traits, and the joining that couples them.

◆ Every figure is built from a real ZOMBI2 run — the code shown reproduces it.

Species trees

5

Forward birth–death trees — the whole history, survivors and extinctions, with the diversification model made visible.

Yule tree

Yule tree

Pure birth, no extinction — a forward tree of 100 lineages.

pure birth (Yule)
Extinct lineages

Extinct lineages

The full history behind 100 survivors — their branches solid, extinct lineages dashed.

birth–death
Mass extinction

Mass extinction

A pulse at t = 3 culls 75% of lineages — the skyline drops sharply at the dashed line, then recovers.

mass extinction · + skyline
Rate shifts

Rate shifts

Speciation runs slow, then fast, then slow — the burst packs branches between the two dashed regime lines.

time-varying birth
Diversity-dependent

Diversity-dependent

Speciation slows as diversity fills up; the skyline rises and plateaus at the cap of 100.

birth–death · + skyline

Genomes

5

Genes on chromosomes — a genome as a ring, synteny between genomes, and gene-family events and copy number read against the species tree.

Circular genome (ordered)

Circular genome (ordered)

A genome as a ring — genes evenly spaced by rank, coloured by family, arrows by strand. plot(g, layout="circular") + genes().

phylustrator · circular
Synteny between two genomes

Synteny between two genomes

Two genomes, one per row; ribbons link same-family genes and cross where the order was rearranged. stack([a,b]) + synteny().

phylustrator · synteny
Gene-family events on the tree

Gene-family events on the tree

One family's history on the species tree: duplications (squares), losses (crosses) and transfers (arrows, donor→recipient). plot(tree) + branch_events(…).

phylustrator · events
Profile copy-number

Profile copy-number

A family × genome copy-number heatmap, its rows locked to the tips. beside(tree, heatmap(profiles)).

phylustrator
Real genome (Mycoplasma)

Real genome (Mycoplasma)

A real bacterium — Mycoplasma genitalium, 546 genes at their true base positions, coloured by strand; the forward/reverse switch marks the replication origin. read_gff(…).

phylustrator · real GFF

Sequences

2

The dated tree the sequences evolve down, and an alignment lined up row-for-row with its tips.

Sequence phylogram

Sequence phylogram

The clock tree the sequences evolve down — branch lengths are substitutions/site under an uncorrelated relaxed clock, so the tips are not level.

phylustrator · phylogram
Alignment beside the tree

Alignment beside the tree

A single-copy family across 20 species, residues coloured (with a nucleotide key), each row locked to its tip. beside(tree, alignment(aln)).

phylustrator

Trait evolution

5

A trait evolving down the tree — branches coloured by its value; some paired with a companion panel.

Brownian motion

Brownian motion

Free diffusion — sister lineages drift apart with time.

continuous
Ornstein–Uhlenbeck

Ornstein–Uhlenbeck

Pulled to an optimum: a high start (yellow) converges to blue.

continuous
Discrete states

Discrete states

A two-state trait hops between habitats; each branch is painted by its state history.

discrete · Mk
Correlated traits

Correlated traits

Two traits evolve together (r = 0.9) — two trees, coloured by each trait, and the tip scatter.

continuous · + scatter
Dependent characters

Dependent characters

Two binary characters where one's flip rate depends on the other's state — the model as a 2×2 chain (arrow width = rate), and a run: the tree painted by compound state, beside the presence/absence tips. simulate_discrete(states=("00",…), switch={…}).

discrete · dependent

Joining

3

A trait and the tree grow together — the trait drives diversification, so its state shapes the tree.

BiSSE

BiSSE

A two-state trait drives speciation — the fast state's clades take over; the inset is the state Markov chain.

trait → speciation
State-dependent extinction

State-dependent extinction

One state dies far faster; the doomed lineages (dashed) drop out.

trait → extinction
MuSSE

MuSSE

Three graded speciation rates with constant death — the fastest state fills the tree, extinct lineages dashed.

trait → speciation