ZOMBI2 · examples

Examples gallery

Species trees

6Forward birth-death trees. The run keeps the whole history, survivors and extinctions, and the diversification model shows on the tree.
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 50 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
Shape statistics over many trees

Shape statistics over many trees

Two thousand trees under each of two processes. zombi2 tools tree --gamma separates them almost perfectly.

simulation study · 4000 trees

Genomes

9Genes on chromosomes. A genome draws as a ring, and two genomes show their synteny. 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
Synteny across a whole clade

Synteny across a whole clade

Every tip's gene order beside the tree. Genes are coloured by their ancestral position, so each rearrangement is a break in the gradient.

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), transfers (arrows, donor→recipient).

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. The forward/reverse switch marks the replication origin.

phylustrator · real GFF
An inversion, before → after

An inversion, before → after

One inversion on a circular genome: the segment is reversed and its strands flip. The band marks it in both rings.

phylustrator · circular
A transfer highway between clades

A transfer highway between clades

Transfers steered to run between two clades, by topology rather than by a trait. The barplot counts them by clade pair, so A↔B towers over within-clade.

clades · transfer_to
Core and accessory, from one parameter

Core and accessory, from one parameter

Two runs at the same mean rates. Every family alike gives no core at all; letting families differ gives 28 core families and a U-shaped spectrum.

phylustrator · heterogeneity

Sequences

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

Uncorrelated lognormal clock

Every lineage draws its own rate, with no memory of its parent, so the colour is salt-and-pepper. substitution = PerSite().varying_among('lineages', LogNormal(0.0, 0.55)).

phylustrator · clocks
Uncorrelated gamma clock

Uncorrelated gamma clock

The same independent draw with a gamma instead of a lognormal. varying_among('lineages', Gamma(shape=3.31, scale=0.302)).

phylustrator · clocks
Autocorrelated clock

Autocorrelated clock

A daughter starts at its parent's rate and is nudged, so the colour moves in clades rather than branch to branch. substitution = PerSite().varying_among('lineages', Drift(LogNormal(0.0, 0.4))).

phylustrator · clocks
Discrete-bin clock

Discrete-bin clock

The same inherited drift in steps: the rate takes one of a few values and a daughter moves to a neighbouring one. varying_among('lineages', Drift(LogNormal(0.0, 0.45), bins=6)).

phylustrator · clocks
Ancestral sequences at the nodes

Ancestral sequences at the nodes

A small tree with its internal nodes numbered, and beside it the sequence at each. The rows are one per node, not aligned to the tips.

phylustrator · ancestral
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

Traits

6A trait evolving down the tree. Branches take the colour of its value. Some examples add 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
Dependent continuous traits

Dependent continuous traits

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

continuous · + scatter
Dependent discrete traits

Dependent discrete traits

Two binary characters where one's flip rate depends on the other's state. X in green, Y in purple, so you can see Y is present where X is; the 2×2 chain is the model.

discrete · dependent
A trait driving a trait

A trait driving a trait

A habitat trait sets how fast body size diffuses: twenty times faster where the habitat fluctuates. rate = PerLineage(0.25).scaled_by(habitat, {…}).

trait → trait

Conditioning

9Two runs, in order. The first run grows the driver on the tree and holds it fixed. The second run reads it. A driver is a trait, a gene family or a whole module. It drives a rate, or which lineage receives a transfer.
Genome reduction

Genome reduction

A lifestyle trait drives gene loss. Endosymbionts shed genes faster and gain fewer, so their genomes end up a fifth the size.

trait → loss
Genome expansion

Genome expansion

A selection trait drives duplication. Under relaxed selection duplicates accumulate and the genomes grow fivefold.

trait → duplication
HGT uptake by competence

HGT uptake by competence

A competence trait drives who receives a transfer rather than a rate. Competent lineages take up DNA more often.

trait → transfer uptake
A continuous driver

A continuous driver

A diffusing trait drives gene gain. A Curve turns each value into a factor, so genome size follows the trait.

continuous trait → origination
A saturating curve

A saturating curve

The same run with a different Curve. Gene gain rises with the trait and then levels off, so the factor is bounded.

continuous trait → origination
A curve of your own

A curve of your own

The response is any function you write. Here it peaks at an intermediate value, which no table of per-state multipliers can express.

continuous trait → origination
One trait drives another

One trait drives another

A temperature trait is grown first; body size then diffuses at a rate that reads it. The scale is centred on where it started, so white means it has not moved.

trait → trait
A gene drives a trait

A gene drives a trait

Carrying a toxin family makes a lineage become pathogenic forty times faster. 74% of the tips with the gene end up pathogenic, against none of those without.

gene → trait
A module, through a step

A module, through a step

How much of a four-gene module a lineage keeps decides its metabolism, through a step: lambda f: 20.0 if f > 0.5 else 1.0.

module → trait

Joining

3One run makes both. The trait sets the speciation or extinction rate of the lineage carrying it. The trait and the tree therefore come out together.
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