Simulating the evolution of species trees, genomes, sequences and traits
Project description
ZOMBI2
🌐 Website · Documentation · Manual (pdf)
Simulating the evolution of species, genomes, sequences and traits.
ZOMBI2 simulates evolution at four levels — the species tree of lineages, the genomes that evolve along it, the sequences inside each gene, and the traits a lineage carries. Use it to generate benchmark datasets with known ground truth for phylogenetic and comparative methods.
Install
pip install zombi2
Quickstart
Each level is its own subcommand. Here a dated species tree, then gene families evolving along it under duplication, transfer, loss and origination, then sequences down each gene tree:
zombi2 species out/ --birth 1 --death 0.3 --n-extant 20 --seed 1
zombi2 genomes out/ --duplication 0.2 --transfer 0.1 --seed 42
zombi2 sequences out/ --model hky85 --length 1000 --seed 1
zombi2 <command> -h documents each of species, genomes, sequences and traits, with
its own examples.
From Python, each level is one function, and the result object carries the history:
from zombi2 import species
from zombi2.genomes import simulate_genomes_unordered
sp = species.simulate_species_tree(birth=1.0, death=0.3, n_extant=20, seed=1)
g = simulate_genomes_unordered(sp, duplication=0.2, transfer=0.1, seed=42)
g.gene_trees # the true gene tree of every family
g.write("run/") # the event log and the copy-number profiles
Levels
ZOMBI2 is organized around four levels of evolution. A genome, a sequence or a trait always evolves along a species tree, so you run whichever you need, composed into one seeded, reproducible run.
- Species trees — a birth–death process with rates that can shift in time, saturate with diversity or drift down the tree, plus mass extinctions, incomplete sampling and fossils. Extinct lineages are kept, so the complete tree and the extant one are both available.
- Genomes — gene families under duplication, transfer, loss and origination, at three resolutions: unordered families, ordered chromosomes with rearrangements, and nucleotide genomes where genes are blocks of DNA.
- Sequences — nucleotide (JC69, K80, HKY85, GTR) and protein substitution models run down each gene tree, with ancestral sequences at every node.
- Traits — continuous traits that diffuse, revert to an optimum or shift at speciation, and discrete traits switching between states.
Combining levels
A level can be conditioned on another — a rate reads a value some other level produced — or
the two can be grown jointly, when neither can be simulated first because each drives the
other. Both are one mechanism, DrivenBy(source, mapping), on any rate. See
conditioning and joining.
Citation
A dedicated ZOMBI2 paper is in preparation. Until then, cite the original ZOMBI.
License
ZOMBI2 is released under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zombi2-0.7.0.tar.gz.
File metadata
- Download URL: zombi2-0.7.0.tar.gz
- Upload date:
- Size: 2.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2acf2f8faf7b680fa9a1d81d2e4cf8231025cd3cf26abbdb9a92c562b85c73b3
|
|
| MD5 |
fe1443f29d15f4bbe707f9db5c39f9df
|
|
| BLAKE2b-256 |
026651d6cf2af879f23a6ad425bbdc41e87a2a0592c64490d40cc41ca13fad27
|
Provenance
The following attestation bundles were made for zombi2-0.7.0.tar.gz:
Publisher:
release.yml on AADavin/zombi2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zombi2-0.7.0.tar.gz -
Subject digest:
2acf2f8faf7b680fa9a1d81d2e4cf8231025cd3cf26abbdb9a92c562b85c73b3 - Sigstore transparency entry: 2256259657
- Sigstore integration time:
-
Permalink:
AADavin/zombi2@eaa91a2484cb60a880ef9a45554a3cfa4fe93ce7 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/AADavin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eaa91a2484cb60a880ef9a45554a3cfa4fe93ce7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file zombi2-0.7.0-py3-none-any.whl.
File metadata
- Download URL: zombi2-0.7.0-py3-none-any.whl
- Upload date:
- Size: 254.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac1cff8910e1d5154231cd0cfbbfd3ee2e29bc20b71c19ced8a99ac8442892e1
|
|
| MD5 |
83436350c0d3bedf2e3f8cb2291a6e9d
|
|
| BLAKE2b-256 |
ac3a7e97350cb5b69cf9e2da7de6ec515ff77a790abea50d96d3b1a49e2a93ff
|
Provenance
The following attestation bundles were made for zombi2-0.7.0-py3-none-any.whl:
Publisher:
release.yml on AADavin/zombi2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zombi2-0.7.0-py3-none-any.whl -
Subject digest:
ac1cff8910e1d5154231cd0cfbbfd3ee2e29bc20b71c19ced8a99ac8442892e1 - Sigstore transparency entry: 2256259663
- Sigstore integration time:
-
Permalink:
AADavin/zombi2@eaa91a2484cb60a880ef9a45554a3cfa4fe93ce7 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/AADavin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eaa91a2484cb60a880ef9a45554a3cfa4fe93ce7 -
Trigger Event:
release
-
Statement type: