zombi2 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. zombi2-0.2.0/.github/workflows/ci.yml +81 -0
  2. zombi2-0.2.0/.github/workflows/release.yml +195 -0
  3. zombi2-0.2.0/.gitignore +74 -0
  4. zombi2-0.2.0/CHANGELOG.md +43 -0
  5. zombi2-0.2.0/CITATION.cff +25 -0
  6. zombi2-0.2.0/CONTRIBUTING.md +78 -0
  7. zombi2-0.2.0/LICENSE +21 -0
  8. zombi2-0.2.0/PKG-INFO +156 -0
  9. zombi2-0.2.0/README.md +125 -0
  10. zombi2-0.2.0/analyses/README.md +13 -0
  11. zombi2-0.2.0/analyses/ecoli_nt/ecoli.gff +9531 -0
  12. zombi2-0.2.0/analyses/ecoli_nt/report.tex +161 -0
  13. zombi2-0.2.0/analyses/ecoli_nt/run_analysis.py +358 -0
  14. zombi2-0.2.0/analyses/ecoli_nt/stats.json +44 -0
  15. zombi2-0.2.0/analyses/ecoli_nt/stats.tex +42 -0
  16. zombi2-0.2.0/analyses/performance/.gitignore +8 -0
  17. zombi2-0.2.0/analyses/performance/README.md +156 -0
  18. zombi2-0.2.0/analyses/performance/benchmarks.py +615 -0
  19. zombi2-0.2.0/analyses/performance/config.py +35 -0
  20. zombi2-0.2.0/analyses/performance/figures/overview.png +0 -0
  21. zombi2-0.2.0/analyses/performance/perfkit/__init__.py +27 -0
  22. zombi2-0.2.0/analyses/performance/perfkit/environment.py +71 -0
  23. zombi2-0.2.0/analyses/performance/perfkit/io.py +85 -0
  24. zombi2-0.2.0/analyses/performance/perfkit/memory.py +87 -0
  25. zombi2-0.2.0/analyses/performance/perfkit/style.py +124 -0
  26. zombi2-0.2.0/analyses/performance/perfkit/timing.py +113 -0
  27. zombi2-0.2.0/analyses/performance/plot.py +403 -0
  28. zombi2-0.2.0/analyses/performance/report/.gitignore +8 -0
  29. zombi2-0.2.0/analyses/performance/report/report.tex +311 -0
  30. zombi2-0.2.0/analyses/performance/results/gene_families.json +288 -0
  31. zombi2-0.2.0/analyses/performance/results/memory_scaling.json +170 -0
  32. zombi2-0.2.0/analyses/performance/results/parallel_scaling.json +98 -0
  33. zombi2-0.2.0/analyses/performance/results/species_tree.json +170 -0
  34. zombi2-0.2.0/analyses/performance/results/vs_zombi1.json +187 -0
  35. zombi2-0.2.0/analyses/performance/results/vs_zombi1_fixedtree.json +65 -0
  36. zombi2-0.2.0/analyses/performance/run.py +75 -0
  37. zombi2-0.2.0/analyses/performance/vs_zombi1/GenomeParameters_bench.tsv +52 -0
  38. zombi2-0.2.0/analyses/performance/vs_zombi1/NOTES.md +168 -0
  39. zombi2-0.2.0/analyses/performance/vs_zombi1/SpeciesTreeParameters_template.tsv +39 -0
  40. zombi2-0.2.0/analyses/performance/vs_zombi1/harness.py +174 -0
  41. zombi2-0.2.0/conftest.py +2 -0
  42. zombi2-0.2.0/docs/cli.md +365 -0
  43. zombi2-0.2.0/docs/comparison.md +50 -0
  44. zombi2-0.2.0/docs/contributing/adding-a-model.md +144 -0
  45. zombi2-0.2.0/docs/contributing/conventions.md +140 -0
  46. zombi2-0.2.0/docs/contributing/model-lifecycle.md +82 -0
  47. zombi2-0.2.0/docs/contributing.md +94 -0
  48. zombi2-0.2.0/docs/cookbook.md +368 -0
  49. zombi2-0.2.0/docs/coupling_explained.tex +179 -0
  50. zombi2-0.2.0/docs/faq.md +91 -0
  51. zombi2-0.2.0/docs/guide/extending.md +78 -0
  52. zombi2-0.2.0/docs/guide/gene-families.md +139 -0
  53. zombi2-0.2.0/docs/guide/gene-trees-and-output.md +66 -0
  54. zombi2-0.2.0/docs/guide/genomes.md +40 -0
  55. zombi2-0.2.0/docs/guide/ghost-lineages.md +143 -0
  56. zombi2-0.2.0/docs/guide/growth.md +46 -0
  57. zombi2-0.2.0/docs/guide/nucleotide-genomes.md +236 -0
  58. zombi2-0.2.0/docs/guide/ordered-genomes.md +66 -0
  59. zombi2-0.2.0/docs/guide/parallel.md +48 -0
  60. zombi2-0.2.0/docs/guide/rust-engine.md +99 -0
  61. zombi2-0.2.0/docs/guide/sequences.md +218 -0
  62. zombi2-0.2.0/docs/guide/species-trees.md +213 -0
  63. zombi2-0.2.0/docs/guide/trait-linked-genomes.md +201 -0
  64. zombi2-0.2.0/docs/guide/traits.md +295 -0
  65. zombi2-0.2.0/docs/guide/transfers.md +60 -0
  66. zombi2-0.2.0/docs/img/age_crown.svg +43 -0
  67. zombi2-0.2.0/docs/img/clade_shift.svg +157 -0
  68. zombi2-0.2.0/docs/img/clads.svg +306 -0
  69. zombi2-0.2.0/docs/img/clock_cir.svg +104 -0
  70. zombi2-0.2.0/docs/img/clock_correlation.svg +393 -0
  71. zombi2-0.2.0/docs/img/clock_distributions.svg +62 -0
  72. zombi2-0.2.0/docs/img/clock_family.svg +582 -0
  73. zombi2-0.2.0/docs/img/coevolve_modes.svg +61 -0
  74. zombi2-0.2.0/docs/img/dec.svg +126 -0
  75. zombi2-0.2.0/docs/img/dec_tree.svg +97 -0
  76. zombi2-0.2.0/docs/img/diversity_dependent.svg +156 -0
  77. zombi2-0.2.0/docs/img/event_levels.svg +33 -0
  78. zombi2-0.2.0/docs/img/four_levels.svg +36 -0
  79. zombi2-0.2.0/docs/img/four_levels_dark.svg +36 -0
  80. zombi2-0.2.0/docs/img/gene_conditioned_trait.svg +83 -0
  81. zombi2-0.2.0/docs/img/gene_tree.svg +90 -0
  82. zombi2-0.2.0/docs/img/gene_tree_panels.svg +125 -0
  83. zombi2-0.2.0/docs/img/genome_circular.svg +33 -0
  84. zombi2-0.2.0/docs/img/genome_inversion.svg +64 -0
  85. zombi2-0.2.0/docs/img/genome_models.svg +66 -0
  86. zombi2-0.2.0/docs/img/genome_transposition.svg +64 -0
  87. zombi2-0.2.0/docs/img/gillespie_everywhere.svg +57 -0
  88. zombi2-0.2.0/docs/img/gillespie_loop.svg +47 -0
  89. zombi2-0.2.0/docs/img/gillespie_poisson.svg +62 -0
  90. zombi2-0.2.0/docs/img/gillespie_step.svg +53 -0
  91. zombi2-0.2.0/docs/img/key_innovation.svg +117 -0
  92. zombi2-0.2.0/docs/img/key_innovation_bw.svg +117 -0
  93. zombi2-0.2.0/docs/img/levels.svg +55 -0
  94. zombi2-0.2.0/docs/img/mass_extinction.svg +196 -0
  95. zombi2-0.2.0/docs/img/model_episodic.svg +869 -0
  96. zombi2-0.2.0/docs/img/model_fbd.svg +151 -0
  97. zombi2-0.2.0/docs/img/model_ghosts.svg +245 -0
  98. zombi2-0.2.0/docs/img/model_sampling.svg +126 -0
  99. zombi2-0.2.0/docs/img/nucleotide_events.svg +345 -0
  100. zombi2-0.2.0/docs/img/nucleotide_segments.svg +247 -0
  101. zombi2-0.2.0/docs/img/nucleotide_tree.svg +235 -0
  102. zombi2-0.2.0/docs/img/nucleotide_tree_bw.svg +235 -0
  103. zombi2-0.2.0/docs/img/nucleotide_tree_gradient.svg +308 -0
  104. zombi2-0.2.0/docs/img/punctuational_genome.svg +170 -0
  105. zombi2-0.2.0/docs/img/punctuational_genome_bw.svg +170 -0
  106. zombi2-0.2.0/docs/img/segment_length.svg +90 -0
  107. zombi2-0.2.0/docs/img/seq_chrono_phylo.svg +228 -0
  108. zombi2-0.2.0/docs/img/seq_gene_lineage.svg +291 -0
  109. zombi2-0.2.0/docs/img/seq_subst_models.svg +803 -0
  110. zombi2-0.2.0/docs/img/species_tree_events.svg +73 -0
  111. zombi2-0.2.0/docs/img/species_tree_events_multi.svg +94 -0
  112. zombi2-0.2.0/docs/img/species_tree_extinct.svg +153 -0
  113. zombi2-0.2.0/docs/img/sse.svg +121 -0
  114. zombi2-0.2.0/docs/img/sse_bw.svg +121 -0
  115. zombi2-0.2.0/docs/img/sse_cladogenetic.svg +137 -0
  116. zombi2-0.2.0/docs/img/sse_cladogenetic_bw.svg +137 -0
  117. zombi2-0.2.0/docs/img/sse_hisse.svg +135 -0
  118. zombi2-0.2.0/docs/img/sse_hisse_bw.svg +135 -0
  119. zombi2-0.2.0/docs/img/sse_quasse.svg +216 -0
  120. zombi2-0.2.0/docs/img/trait_bm.svg +438 -0
  121. zombi2-0.2.0/docs/img/trait_earlyburst.svg +446 -0
  122. zombi2-0.2.0/docs/img/trait_hiddenmk.svg +120 -0
  123. zombi2-0.2.0/docs/img/trait_hiddenmk_bw.svg +120 -0
  124. zombi2-0.2.0/docs/img/trait_linked_genes.svg +250 -0
  125. zombi2-0.2.0/docs/img/trait_mk.svg +104 -0
  126. zombi2-0.2.0/docs/img/trait_mk_bw.svg +104 -0
  127. zombi2-0.2.0/docs/img/trait_multioptimum.svg +445 -0
  128. zombi2-0.2.0/docs/img/trait_multivariate.svg +599 -0
  129. zombi2-0.2.0/docs/img/trait_ou.svg +440 -0
  130. zombi2-0.2.0/docs/img/trait_overlay.svg +46 -0
  131. zombi2-0.2.0/docs/img/trait_pagel.svg +120 -0
  132. zombi2-0.2.0/docs/img/trait_pagel_bw.svg +120 -0
  133. zombi2-0.2.0/docs/img/trait_threshold.svg +444 -0
  134. zombi2-0.2.0/docs/index.md +73 -0
  135. zombi2-0.2.0/docs/installation.md +50 -0
  136. zombi2-0.2.0/docs/models/advanced-diversification.md +148 -0
  137. zombi2-0.2.0/docs/models/biogeography.md +91 -0
  138. zombi2-0.2.0/docs/models/birth-death.md +83 -0
  139. zombi2-0.2.0/docs/models/coevolution.md +407 -0
  140. zombi2-0.2.0/docs/models/continuous-traits.md +184 -0
  141. zombi2-0.2.0/docs/models/discrete-traits.md +189 -0
  142. zombi2-0.2.0/docs/models/dna-substitution.md +168 -0
  143. zombi2-0.2.0/docs/models/gene-family.md +162 -0
  144. zombi2-0.2.0/docs/models/nucleotide.md +99 -0
  145. zombi2-0.2.0/docs/models/ordered.md +84 -0
  146. zombi2-0.2.0/docs/models/protein-substitution.md +130 -0
  147. zombi2-0.2.0/docs/models/relaxed-clocks.md +190 -0
  148. zombi2-0.2.0/docs/publishing.md +91 -0
  149. zombi2-0.2.0/docs/quickstart.md +62 -0
  150. zombi2-0.2.0/docs/reference/api.md +131 -0
  151. zombi2-0.2.0/docs/references.bib +602 -0
  152. zombi2-0.2.0/docs/references.md +214 -0
  153. zombi2-0.2.0/docs/tools/index.md +62 -0
  154. zombi2-0.2.0/docs/tools/reconciliation-likelihood.md +166 -0
  155. zombi2-0.2.0/docs/validation.md +74 -0
  156. zombi2-0.2.0/figures/STYLE.md +66 -0
  157. zombi2-0.2.0/figures/gene_tree/gene_tree.nwk +1 -0
  158. zombi2-0.2.0/figures/gene_tree_panels/complete.nwk +1 -0
  159. zombi2-0.2.0/figures/gene_tree_panels/extant.nwk +1 -0
  160. zombi2-0.2.0/figures/scripts/clock_common.py +287 -0
  161. zombi2-0.2.0/figures/scripts/colormaps.py +38 -0
  162. zombi2-0.2.0/figures/scripts/fig_age_crown.py +125 -0
  163. zombi2-0.2.0/figures/scripts/fig_clade_shift.py +206 -0
  164. zombi2-0.2.0/figures/scripts/fig_clads.py +173 -0
  165. zombi2-0.2.0/figures/scripts/fig_clock_cir.py +125 -0
  166. zombi2-0.2.0/figures/scripts/fig_clock_correlation.py +172 -0
  167. zombi2-0.2.0/figures/scripts/fig_clock_distributions.py +138 -0
  168. zombi2-0.2.0/figures/scripts/fig_clock_family.py +176 -0
  169. zombi2-0.2.0/figures/scripts/fig_coevolve_modes.py +178 -0
  170. zombi2-0.2.0/figures/scripts/fig_dec.py +162 -0
  171. zombi2-0.2.0/figures/scripts/fig_dec_tree.py +153 -0
  172. zombi2-0.2.0/figures/scripts/fig_diversity_dependent.py +149 -0
  173. zombi2-0.2.0/figures/scripts/fig_gene_conditioned_trait.py +229 -0
  174. zombi2-0.2.0/figures/scripts/fig_gene_tree.py +140 -0
  175. zombi2-0.2.0/figures/scripts/fig_gene_tree_panels.py +241 -0
  176. zombi2-0.2.0/figures/scripts/fig_genome_circular.py +117 -0
  177. zombi2-0.2.0/figures/scripts/fig_genome_circular_bw.py +70 -0
  178. zombi2-0.2.0/figures/scripts/fig_genome_events.py +107 -0
  179. zombi2-0.2.0/figures/scripts/fig_gillespie_everywhere.py +166 -0
  180. zombi2-0.2.0/figures/scripts/fig_gillespie_loop.py +130 -0
  181. zombi2-0.2.0/figures/scripts/fig_gillespie_poisson.py +88 -0
  182. zombi2-0.2.0/figures/scripts/fig_gillespie_step.py +176 -0
  183. zombi2-0.2.0/figures/scripts/fig_key_innovation.py +227 -0
  184. zombi2-0.2.0/figures/scripts/fig_mass_extinction.py +166 -0
  185. zombi2-0.2.0/figures/scripts/fig_model_episodic.py +110 -0
  186. zombi2-0.2.0/figures/scripts/fig_model_fbd.py +101 -0
  187. zombi2-0.2.0/figures/scripts/fig_model_ghosts.py +121 -0
  188. zombi2-0.2.0/figures/scripts/fig_model_sampling.py +112 -0
  189. zombi2-0.2.0/figures/scripts/fig_nucleotide.py +141 -0
  190. zombi2-0.2.0/figures/scripts/fig_nucleotide_events.py +124 -0
  191. zombi2-0.2.0/figures/scripts/fig_nucleotide_tree.py +386 -0
  192. zombi2-0.2.0/figures/scripts/fig_palette_comparison.py +64 -0
  193. zombi2-0.2.0/figures/scripts/fig_punctuational_genome.py +161 -0
  194. zombi2-0.2.0/figures/scripts/fig_segment_length.py +80 -0
  195. zombi2-0.2.0/figures/scripts/fig_seq_chrono_phylo.py +151 -0
  196. zombi2-0.2.0/figures/scripts/fig_seq_gene_lineage.py +166 -0
  197. zombi2-0.2.0/figures/scripts/fig_seq_subst_models.py +230 -0
  198. zombi2-0.2.0/figures/scripts/fig_species_tree_events.py +174 -0
  199. zombi2-0.2.0/figures/scripts/fig_species_tree_events_multi.py +249 -0
  200. zombi2-0.2.0/figures/scripts/fig_species_tree_extinct.py +169 -0
  201. zombi2-0.2.0/figures/scripts/fig_sse.py +240 -0
  202. zombi2-0.2.0/figures/scripts/fig_sse_cladogenetic.py +229 -0
  203. zombi2-0.2.0/figures/scripts/fig_sse_hisse.py +235 -0
  204. zombi2-0.2.0/figures/scripts/fig_sse_quasse.py +196 -0
  205. zombi2-0.2.0/figures/scripts/fig_trait_bm.py +123 -0
  206. zombi2-0.2.0/figures/scripts/fig_trait_diffusion.py +156 -0
  207. zombi2-0.2.0/figures/scripts/fig_trait_earlyburst.py +114 -0
  208. zombi2-0.2.0/figures/scripts/fig_trait_hiddenmk.py +206 -0
  209. zombi2-0.2.0/figures/scripts/fig_trait_linked_genes.py +224 -0
  210. zombi2-0.2.0/figures/scripts/fig_trait_markov.py +186 -0
  211. zombi2-0.2.0/figures/scripts/fig_trait_mk.py +172 -0
  212. zombi2-0.2.0/figures/scripts/fig_trait_multioptimum.py +135 -0
  213. zombi2-0.2.0/figures/scripts/fig_trait_multivariate.py +126 -0
  214. zombi2-0.2.0/figures/scripts/fig_trait_ou.py +101 -0
  215. zombi2-0.2.0/figures/scripts/fig_trait_overlay.py +147 -0
  216. zombi2-0.2.0/figures/scripts/fig_trait_pagel.py +294 -0
  217. zombi2-0.2.0/figures/scripts/fig_trait_threshold.py +129 -0
  218. zombi2-0.2.0/figures/scripts/fig_trait_threshold_liability.py +176 -0
  219. zombi2-0.2.0/figures/scripts/fig_trait_threshold_tree.py +149 -0
  220. zombi2-0.2.0/figures/scripts/model_common.py +62 -0
  221. zombi2-0.2.0/figures/scripts/zombi_style.py +87 -0
  222. zombi2-0.2.0/figures/species_tree_10/species_tree.nwk +1 -0
  223. zombi2-0.2.0/figures/species_tree_events_multi/species_tree.nwk +1 -0
  224. zombi2-0.2.0/figures/species_tree_extinct/species_tree.nwk +1 -0
  225. zombi2-0.2.0/manual/.gitignore +2 -0
  226. zombi2-0.2.0/manual/Makefile +53 -0
  227. zombi2-0.2.0/manual/README.md +69 -0
  228. zombi2-0.2.0/manual/REVISION_NOTES.md +271 -0
  229. zombi2-0.2.0/manual/callouts.lua +19 -0
  230. zombi2-0.2.0/manual/chapters/01-introduction.md +85 -0
  231. zombi2-0.2.0/manual/chapters/02-installation.md +71 -0
  232. zombi2-0.2.0/manual/chapters/03-a-first-simulation.md +153 -0
  233. zombi2-0.2.0/manual/chapters/04-birth-death-species-trees.md +124 -0
  234. zombi2-0.2.0/manual/chapters/05-diversification-models.md +240 -0
  235. zombi2-0.2.0/manual/chapters/06-ghost-lineages.md +122 -0
  236. zombi2-0.2.0/manual/chapters/07-genome-evolution-overview.md +88 -0
  237. zombi2-0.2.0/manual/chapters/08-unordered-genomes.md +212 -0
  238. zombi2-0.2.0/manual/chapters/09-gene-trees-and-output.md +178 -0
  239. zombi2-0.2.0/manual/chapters/11-ordered-genomes.md +112 -0
  240. zombi2-0.2.0/manual/chapters/12-nucleotide-genomes.md +212 -0
  241. zombi2-0.2.0/manual/chapters/13-trait-evolution.md +351 -0
  242. zombi2-0.2.0/manual/chapters/14-coevolution.md +423 -0
  243. zombi2-0.2.0/manual/chapters/15-sequence-evolution.md +219 -0
  244. zombi2-0.2.0/manual/chapters/16-molecular-clocks.md +226 -0
  245. zombi2-0.2.0/manual/chapters/A1-the-gillespie-algorithm.md +293 -0
  246. zombi2-0.2.0/manual/metadata.yaml +15 -0
  247. zombi2-0.2.0/manual/preamble.tex +41 -0
  248. zombi2-0.2.0/mkdocs.yml +100 -0
  249. zombi2-0.2.0/pyproject.toml +65 -0
  250. zombi2-0.2.0/rust/Cargo.lock +184 -0
  251. zombi2-0.2.0/rust/Cargo.toml +19 -0
  252. zombi2-0.2.0/rust/README.md +23 -0
  253. zombi2-0.2.0/rust/pyproject.toml +33 -0
  254. zombi2-0.2.0/rust/src/alelite.rs +628 -0
  255. zombi2-0.2.0/rust/src/lib.rs +1926 -0
  256. zombi2-0.2.0/tests/test_api_namespaces.py +174 -0
  257. zombi2-0.2.0/tests/test_biogeography.py +192 -0
  258. zombi2-0.2.0/tests/test_branch_rates.py +147 -0
  259. zombi2-0.2.0/tests/test_cladogenetic_genome.py +126 -0
  260. zombi2-0.2.0/tests/test_cli.py +1032 -0
  261. zombi2-0.2.0/tests/test_clocks.py +282 -0
  262. zombi2-0.2.0/tests/test_co_diversification.py +117 -0
  263. zombi2-0.2.0/tests/test_correlated_binary_k.py +365 -0
  264. zombi2-0.2.0/tests/test_episodic.py +75 -0
  265. zombi2-0.2.0/tests/test_event_trace.py +168 -0
  266. zombi2-0.2.0/tests/test_experimental.py +32 -0
  267. zombi2-0.2.0/tests/test_extensibility.py +230 -0
  268. zombi2-0.2.0/tests/test_gene_conditioned_trait.py +110 -0
  269. zombi2-0.2.0/tests/test_gene_conversion.py +261 -0
  270. zombi2-0.2.0/tests/test_gene_diversification.py +135 -0
  271. zombi2-0.2.0/tests/test_genome_dtl.py +105 -0
  272. zombi2-0.2.0/tests/test_gff.py +111 -0
  273. zombi2-0.2.0/tests/test_ghosts.py +226 -0
  274. zombi2-0.2.0/tests/test_mean_length.py +53 -0
  275. zombi2-0.2.0/tests/test_nucleotide_genes.py +346 -0
  276. zombi2-0.2.0/tests/test_nucleotide_genome.py +683 -0
  277. zombi2-0.2.0/tests/test_nucleotide_indels.py +159 -0
  278. zombi2-0.2.0/tests/test_nucleotide_rust.py +101 -0
  279. zombi2-0.2.0/tests/test_ordered_genome.py +131 -0
  280. zombi2-0.2.0/tests/test_parallel.py +51 -0
  281. zombi2-0.2.0/tests/test_parallel_profiles.py +88 -0
  282. zombi2-0.2.0/tests/test_rate_variation.py +86 -0
  283. zombi2-0.2.0/tests/test_reconciliation.py +74 -0
  284. zombi2-0.2.0/tests/test_rust.py +278 -0
  285. zombi2-0.2.0/tests/test_sampling.py +38 -0
  286. zombi2-0.2.0/tests/test_sequence_evolution.py +179 -0
  287. zombi2-0.2.0/tests/test_sequence_sim.py +438 -0
  288. zombi2-0.2.0/tests/test_sparse_profiles.py +158 -0
  289. zombi2-0.2.0/tests/test_species_bd.py +69 -0
  290. zombi2-0.2.0/tests/test_species_forward.py +576 -0
  291. zombi2-0.2.0/tests/test_species_guardrails.py +175 -0
  292. zombi2-0.2.0/tests/test_species_output.py +105 -0
  293. zombi2-0.2.0/tests/test_sse.py +400 -0
  294. zombi2-0.2.0/tests/test_tools_alelite.py +498 -0
  295. zombi2-0.2.0/tests/test_trait_coupling.py +268 -0
  296. zombi2-0.2.0/tests/test_trait_gene_feedback.py +89 -0
  297. zombi2-0.2.0/tests/test_traits.py +801 -0
  298. zombi2-0.2.0/tests/test_transfers.py +70 -0
  299. zombi2-0.2.0/tools/README.md +27 -0
  300. zombi2-0.2.0/tools/build_docs_html.py +187 -0
  301. zombi2-0.2.0/tools/sync_wiki.py +206 -0
  302. zombi2-0.2.0/zombi2/__init__.py +148 -0
  303. zombi2-0.2.0/zombi2/__main__.py +6 -0
  304. zombi2-0.2.0/zombi2/_rust.py +457 -0
  305. zombi2-0.2.0/zombi2/_sampling.py +81 -0
  306. zombi2-0.2.0/zombi2/cli.py +2195 -0
  307. zombi2-0.2.0/zombi2/coevolve/__init__.py +51 -0
  308. zombi2-0.2.0/zombi2/coevolve/cladogenetic_genome.py +183 -0
  309. zombi2-0.2.0/zombi2/coevolve/gene_conditioned_trait.py +169 -0
  310. zombi2-0.2.0/zombi2/coevolve/gene_diversification.py +416 -0
  311. zombi2-0.2.0/zombi2/coevolve/sse.py +513 -0
  312. zombi2-0.2.0/zombi2/coevolve/trait_coupling.py +443 -0
  313. zombi2-0.2.0/zombi2/coevolve/trait_gene_feedback.py +224 -0
  314. zombi2-0.2.0/zombi2/distributions.py +117 -0
  315. zombi2-0.2.0/zombi2/experimental/__init__.py +72 -0
  316. zombi2-0.2.0/zombi2/experimental/gene_conversion.py +123 -0
  317. zombi2-0.2.0/zombi2/genomes/__init__.py +44 -0
  318. zombi2-0.2.0/zombi2/genomes/events.py +212 -0
  319. zombi2-0.2.0/zombi2/genomes/genome.py +471 -0
  320. zombi2-0.2.0/zombi2/genomes/genome_sim.py +455 -0
  321. zombi2-0.2.0/zombi2/genomes/gff.py +149 -0
  322. zombi2-0.2.0/zombi2/genomes/nucleotide_genome.py +843 -0
  323. zombi2-0.2.0/zombi2/genomes/nucleotide_sim.py +638 -0
  324. zombi2-0.2.0/zombi2/genomes/profiles.py +225 -0
  325. zombi2-0.2.0/zombi2/genomes/rates.py +325 -0
  326. zombi2-0.2.0/zombi2/genomes/reconciliation.py +459 -0
  327. zombi2-0.2.0/zombi2/genomes/simulation.py +510 -0
  328. zombi2-0.2.0/zombi2/genomes/transfers.py +43 -0
  329. zombi2-0.2.0/zombi2/parallel.py +122 -0
  330. zombi2-0.2.0/zombi2/sequences/__init__.py +43 -0
  331. zombi2-0.2.0/zombi2/sequences/_aa_models.py +134 -0
  332. zombi2-0.2.0/zombi2/sequences/clocks.py +438 -0
  333. zombi2-0.2.0/zombi2/sequences/evolution.py +252 -0
  334. zombi2-0.2.0/zombi2/sequences/models.py +462 -0
  335. zombi2-0.2.0/zombi2/species/__init__.py +28 -0
  336. zombi2-0.2.0/zombi2/species/forward.py +513 -0
  337. zombi2-0.2.0/zombi2/species/ghosts.py +310 -0
  338. zombi2-0.2.0/zombi2/species/model.py +407 -0
  339. zombi2-0.2.0/zombi2/species/sim.py +161 -0
  340. zombi2-0.2.0/zombi2/tools/__init__.py +59 -0
  341. zombi2-0.2.0/zombi2/tools/reconciliation/__init__.py +159 -0
  342. zombi2-0.2.0/zombi2/tools/reconciliation/_rust.py +122 -0
  343. zombi2-0.2.0/zombi2/tools/reconciliation/dated.py +295 -0
  344. zombi2-0.2.0/zombi2/tools/reconciliation/genetree.py +104 -0
  345. zombi2-0.2.0/zombi2/tools/reconciliation/scoring.py +89 -0
  346. zombi2-0.2.0/zombi2/tools/reconciliation/species.py +96 -0
  347. zombi2-0.2.0/zombi2/tools/reconciliation/undated.py +272 -0
  348. zombi2-0.2.0/zombi2/traits/__init__.py +39 -0
  349. zombi2-0.2.0/zombi2/traits/biogeography.py +208 -0
  350. zombi2-0.2.0/zombi2/traits/models.py +1328 -0
  351. zombi2-0.2.0/zombi2/tree.py +223 -0
@@ -0,0 +1,81 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ test:
15
+ name: test (Python ${{ matrix.python-version }})
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ python-version: ["3.10", "3.11", "3.12"]
21
+ steps:
22
+ - uses: actions/checkout@v5
23
+
24
+ - name: Set up Python ${{ matrix.python-version }}
25
+ uses: actions/setup-python@v6
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+ cache: pip
29
+ cache-dependency-path: pyproject.toml
30
+
31
+ - name: Set up Rust toolchain
32
+ uses: dtolnay/rust-toolchain@stable
33
+
34
+ - name: Cache Rust build
35
+ uses: Swatinem/rust-cache@v2
36
+ with:
37
+ workspaces: rust
38
+
39
+ # Build and install the compiled engine FIRST. zombi2 pins
40
+ # zombi2_core==<version>, which is not on an index during development,
41
+ # so installing it from ./rust here satisfies that pin locally and the
42
+ # editable install below never reaches out for it.
43
+ - name: Build and install the compiled gene-family engine
44
+ run: pip install ./rust
45
+
46
+ - name: Install ZOMBI2 (with dev extras)
47
+ run: pip install -e ".[dev]"
48
+
49
+ # The built-in genome model has no pure-Python fallback, and its tests
50
+ # skip (green) when the extension is absent. Fail loudly instead, so CI
51
+ # can never pass while silently leaving the compiled path untested.
52
+ - name: Require the Rust engine (fail, don't skip)
53
+ run: python -c "import zombi2; assert zombi2.rust_available(), 'zombi2_core (Rust engine) is not built'"
54
+
55
+ - name: Run the test suite
56
+ run: pytest -q
57
+
58
+ docs:
59
+ name: docs (mkdocs --strict)
60
+ runs-on: ubuntu-latest
61
+ steps:
62
+ - uses: actions/checkout@v5
63
+
64
+ - name: Set up Python
65
+ uses: actions/setup-python@v6
66
+ with:
67
+ python-version: "3.12"
68
+ cache: pip
69
+ cache-dependency-path: pyproject.toml
70
+
71
+ # The docs build imports zombi2 (via mkdocstrings) but does not exercise
72
+ # the compiled engine -- zombi2._rust degrades gracefully when zombi2_core
73
+ # is absent. Install without deps to skip the compiled-engine pin (no Rust
74
+ # toolchain needed here), then add just what the docs build imports.
75
+ - name: Install ZOMBI2 (docs deps, engine-free)
76
+ run: |
77
+ pip install -e . --no-deps
78
+ pip install "numpy>=1.24" mkdocs-material "mkdocstrings[python]"
79
+
80
+ - name: Build the documentation (strict)
81
+ run: mkdocs build --strict
@@ -0,0 +1,195 @@
1
+ name: Release
2
+
3
+ # Builds distributions for both packages that make up ZOMBI2:
4
+ # * zombi2_core -- the compiled Rust engine, one abi3 wheel per platform
5
+ # (CPython 3.10+) built with maturin, plus an sdist source fallback.
6
+ # * zombi2 -- the pure-Python front end, a single wheel + sdist.
7
+ #
8
+ # Publishing uses PyPI Trusted Publishing (OIDC) -- no stored API token. It is
9
+ # GATED so nothing goes out by accident:
10
+ # * PyPI -- only when a GitHub Release is published.
11
+ # * TestPyPI -- only on a manual run with the `testpypi` box ticked.
12
+ # See docs/publishing.md for the one-time PyPI setup (each project needs a
13
+ # trusted publisher pointing at this workflow). Until that is configured the
14
+ # publish jobs fail safely at the OIDC step and nothing is uploaded.
15
+
16
+ on:
17
+ release:
18
+ types: [published]
19
+ workflow_dispatch:
20
+ inputs:
21
+ testpypi:
22
+ description: "Publish the built distributions to TestPyPI"
23
+ type: boolean
24
+ default: false
25
+
26
+ permissions: {}
27
+
28
+ jobs:
29
+ core-wheels:
30
+ name: core wheel (${{ matrix.platform.target }})
31
+ runs-on: ${{ matrix.platform.runner }}
32
+ permissions:
33
+ contents: read
34
+ strategy:
35
+ fail-fast: false
36
+ matrix:
37
+ platform:
38
+ - { runner: ubuntu-latest, target: x86_64, manylinux: auto }
39
+ - { runner: ubuntu-latest, target: aarch64, manylinux: auto }
40
+ # Both macOS wheels build on the Apple Silicon runner: arm64 natively
41
+ # and x86_64 cross-compiled. GitHub's Intel macos-13 runners are being
42
+ # retired and queue indefinitely, which used to stall the whole matrix.
43
+ - { runner: macos-14, target: aarch64 }
44
+ - { runner: macos-14, target: x86_64 }
45
+ - { runner: windows-latest, target: x64 }
46
+ steps:
47
+ - uses: actions/checkout@v5
48
+
49
+ - uses: actions/setup-python@v6
50
+ with:
51
+ python-version: "3.12"
52
+
53
+ # abi3-py310 (see rust/Cargo.toml) makes this one stable-ABI wheel per
54
+ # platform, usable on CPython 3.10 and newer.
55
+ - name: Build the abi3 wheel
56
+ uses: PyO3/maturin-action@v1
57
+ with:
58
+ working-directory: rust
59
+ target: ${{ matrix.platform.target }}
60
+ manylinux: ${{ matrix.platform.manylinux || 'auto' }}
61
+ args: --release --out dist
62
+ sccache: "true"
63
+
64
+ - uses: actions/upload-artifact@v4
65
+ with:
66
+ name: dist-core-${{ matrix.platform.runner }}-${{ matrix.platform.target }}
67
+ path: rust/dist/*.whl
68
+
69
+ core-sdist:
70
+ name: core sdist
71
+ runs-on: ubuntu-latest
72
+ permissions:
73
+ contents: read
74
+ steps:
75
+ - uses: actions/checkout@v5
76
+ - name: Build the sdist
77
+ uses: PyO3/maturin-action@v1
78
+ with:
79
+ working-directory: rust
80
+ command: sdist
81
+ args: --out dist
82
+ - uses: actions/upload-artifact@v4
83
+ with:
84
+ name: dist-core-sdist
85
+ path: rust/dist/*.tar.gz
86
+
87
+ zombi2-dist:
88
+ name: zombi2 wheel + sdist
89
+ runs-on: ubuntu-latest
90
+ permissions:
91
+ contents: read
92
+ steps:
93
+ - uses: actions/checkout@v5
94
+ - uses: actions/setup-python@v6
95
+ with:
96
+ python-version: "3.12"
97
+ # zombi2 is pure Python (hatchling), so it builds without numpy, the
98
+ # Rust toolchain, or zombi2_core -- those are runtime dependencies only.
99
+ - name: Build
100
+ run: |
101
+ python -m pip install --upgrade build
102
+ python -m build --outdir dist .
103
+ - uses: actions/upload-artifact@v4
104
+ with:
105
+ name: dist-zombi2
106
+ path: dist/*
107
+
108
+ # ---- publishing (gated, Trusted Publishing / OIDC) ---------------------
109
+
110
+ # Each package publishes from its own job with its own GitHub Environment.
111
+ # PyPI Trusted Publishing keys on (owner, repo, workflow, environment), and a
112
+ # *pending* publisher must be unique on those four fields -- so two
113
+ # not-yet-created projects cannot share one environment. Hence:
114
+ # zombi2 -> environments `testpypi` / `pypi`
115
+ # zombi2_core -> environments `testpypi-core` / `pypi-core`
116
+ # The zombi2 jobs wait on the core job so the exactly-pinned engine is
117
+ # already on the index before the front end that depends on it.
118
+
119
+ publish-testpypi-core:
120
+ name: publish zombi2_core to TestPyPI
121
+ if: github.event_name == 'workflow_dispatch' && inputs.testpypi
122
+ needs: [core-wheels, core-sdist]
123
+ runs-on: ubuntu-latest
124
+ environment: testpypi-core
125
+ permissions:
126
+ id-token: write
127
+ steps:
128
+ - uses: actions/download-artifact@v4
129
+ with:
130
+ pattern: dist-core-*
131
+ path: dist-core
132
+ merge-multiple: true
133
+ - name: Publish zombi2_core
134
+ uses: pypa/gh-action-pypi-publish@release/v1
135
+ with:
136
+ packages-dir: dist-core
137
+ repository-url: https://test.pypi.org/legacy/
138
+ attestations: false
139
+
140
+ publish-testpypi-zombi2:
141
+ name: publish zombi2 to TestPyPI
142
+ if: github.event_name == 'workflow_dispatch' && inputs.testpypi
143
+ needs: [zombi2-dist, publish-testpypi-core]
144
+ runs-on: ubuntu-latest
145
+ environment: testpypi
146
+ permissions:
147
+ id-token: write
148
+ steps:
149
+ - uses: actions/download-artifact@v4
150
+ with:
151
+ name: dist-zombi2
152
+ path: dist-zombi2
153
+ - name: Publish zombi2
154
+ uses: pypa/gh-action-pypi-publish@release/v1
155
+ with:
156
+ packages-dir: dist-zombi2
157
+ repository-url: https://test.pypi.org/legacy/
158
+ attestations: false
159
+
160
+ publish-pypi-core:
161
+ name: publish zombi2_core to PyPI
162
+ if: github.event_name == 'release'
163
+ needs: [core-wheels, core-sdist]
164
+ runs-on: ubuntu-latest
165
+ environment: pypi-core
166
+ permissions:
167
+ id-token: write
168
+ steps:
169
+ - uses: actions/download-artifact@v4
170
+ with:
171
+ pattern: dist-core-*
172
+ path: dist-core
173
+ merge-multiple: true
174
+ - name: Publish zombi2_core
175
+ uses: pypa/gh-action-pypi-publish@release/v1
176
+ with:
177
+ packages-dir: dist-core
178
+
179
+ publish-pypi-zombi2:
180
+ name: publish zombi2 to PyPI
181
+ if: github.event_name == 'release'
182
+ needs: [zombi2-dist, publish-pypi-core]
183
+ runs-on: ubuntu-latest
184
+ environment: pypi
185
+ permissions:
186
+ id-token: write
187
+ steps:
188
+ - uses: actions/download-artifact@v4
189
+ with:
190
+ name: dist-zombi2
191
+ path: dist-zombi2
192
+ - name: Publish zombi2
193
+ uses: pypa/gh-action-pypi-publish@release/v1
194
+ with:
195
+ packages-dir: dist-zombi2
@@ -0,0 +1,74 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+ *.so
9
+
10
+ # Rust extension build artifacts (source is committed; builds are not)
11
+ rust/target/
12
+ *.whl
13
+
14
+ # Testing / envs
15
+ .pytest_cache/
16
+ .venv/
17
+ venv/
18
+ .ipynb_checkpoints/
19
+
20
+ # Simulation outputs
21
+ out/
22
+ /tmp/
23
+
24
+ # Built docs site
25
+ site/
26
+
27
+ # Private didactic material (kept locally, not published)
28
+ docs/non_independence.pdf
29
+ docs/non_independence.tex
30
+
31
+ # Local publication-prep working files (not part of the public repo)
32
+ PUBLICATION_READINESS_REPORT.md
33
+ PUBLICATION_READINESS_REPORT.pdf
34
+ coleman_biorxiv.pdf
35
+
36
+ # --- Generated artifacts: regenerable outputs; the sources that produce them ARE tracked ---
37
+
38
+ # Offline single-file docs mirror (rebuild with tools/build_docs_html.py)
39
+ /zombi2-docs.html
40
+
41
+ # Publication figure renders — regenerate with figures/scripts/*.py
42
+ # (the scripts and the small .nwk fixtures stay tracked; docs/img/*.svg is the served copy)
43
+ figures/**/*.png
44
+ figures/**/*.svg
45
+
46
+ # Compiled analysis reports and regenerated figures
47
+ # (run scripts, *.json results and *.tex sources stay tracked)
48
+ analyses/**/*.pdf
49
+ analyses/**/figures/*.png
50
+ analyses/**/figures/*.svg
51
+ analyses/**/figs/*.png
52
+ analyses/**/figs/*.svg
53
+ # ...except the performance overview embedded in README.md
54
+ !analyses/performance/figures/overview.png
55
+
56
+ # Compiled coupling explainer (keep the .tex)
57
+ /docs/coupling_explained.pdf
58
+
59
+ # LaTeX build artifacts
60
+ *.aux
61
+ *.log
62
+ *.out
63
+ *.toc
64
+ .texmf-var/
65
+ .tmptex/
66
+
67
+ # OS
68
+ .DS_Store
69
+
70
+ # Multi-agent coordination log (shared via the working tree, not committed)
71
+ HANDOFF.md
72
+
73
+ # Phylustrator is a separate editable git checkout (figure tool), not vendored here
74
+ tools/Phylustrator/
@@ -0,0 +1,43 @@
1
+ # Changelog
2
+
3
+ All notable changes to ZOMBI2 are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this
6
+ project aims to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.2.0] - 2026-07-07
11
+
12
+ First public release. ZOMBI2 is a ground-up redesign of
13
+ [ZOMBI](https://github.com/AADavin/Zombi).
14
+
15
+ ### Added
16
+
17
+ - **Species trees** — backward (reconstructed) and forward (complete) birth–death and Yule,
18
+ episodic/skyline rate shifts, fossilized birth–death and incomplete sampling, ClaDS /
19
+ diversity-dependent / clade-shift diversification, mass extinctions, and ghost lineages.
20
+ Backward trees scale to millions of tips on a laptop via a native Rust engine.
21
+ - **Gene families** — duplication, transfer, loss and origination along a species tree, with
22
+ uniform, family-sampled and genome-wise rate models; ordered chromosomes with inversions and
23
+ transpositions; and nucleotide-resolution genomes. Output as full event logs, compact event
24
+ traces, or counts-only sparse profiles, with parallel replicates.
25
+ - **Traits** — Brownian motion, Ornstein–Uhlenbeck, early burst, Mk, threshold,
26
+ correlated-binary, hidden-state and multi-optimum models, Pagel transforms, and DEC
27
+ biogeography, evolved over a phylogeny.
28
+ - **Sequences** — a gene × lineage relaxed-clock family (strict, UCLN, UGAM, white-noise,
29
+ autocorrelated-lognormal, CIR) that rescales gene trees from time into substitutions/site,
30
+ plus nucleotide substitution models (JC, K80, HKY, GTR + Gamma).
31
+ - **Coevolution** — a unified `coevolve` command that couples species, traits and genes along
32
+ six directed edges via `--couple driver:target`.
33
+ - **Command-line interface** — `zombi2 species | genomes | trait | sequence | coevolve`, with
34
+ grouped, sectioned help and a per-run reproducibility manifest (version, seed, full command
35
+ line and resolved parameters).
36
+ - **Packaging** — MIT license, `CITATION.cff`, and PyPI metadata.
37
+
38
+ ### Notes
39
+
40
+ - ABC inference of DTL rates from an empirical copy-number profile (`zombi2.matching`) is
41
+ available as an experimental Python API but is withheld from the command line in this release.
42
+ - The default (built-in) gene-family engine is a compiled Rust extension; build it once with
43
+ maturin (see [installation](docs/installation.md)).
@@ -0,0 +1,25 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use ZOMBI2, please cite it using the metadata in this file."
3
+ title: "ZOMBI2: a phylogenetic simulator of species trees, genomes, traits and sequences"
4
+ abstract: >-
5
+ ZOMBI2 simulates evolution in two steps: it builds a species tree and then evolves
6
+ gene families along it under duplication, transfer, loss and origination, together
7
+ with phenotypic traits and molecular sequences. It is a ground-up redesign of ZOMBI,
8
+ with a fast Rust engine, a command-line interface and a composable Python library.
9
+ type: software
10
+ authors:
11
+ - given-names: "Adrián A."
12
+ family-names: "Davin"
13
+ email: "aaredav@gmail.com"
14
+ version: "0.2.0"
15
+ license: "MIT"
16
+ repository-code: "https://github.com/AADavin/zombi2"
17
+ url: "https://github.com/AADavin/zombi2"
18
+ keywords:
19
+ - phylogenetics
20
+ - simulation
21
+ - gene families
22
+ - birth-death
23
+ - evolution
24
+ # When the ZOMBI2 paper is published, add its DOI and a `preferred-citation:` block here
25
+ # so that citations resolve to the article rather than the software repository.
@@ -0,0 +1,78 @@
1
+ # Contributing to ZOMBI2
2
+
3
+ Thanks for your interest in ZOMBI2! Bug reports, feature ideas and pull requests are all
4
+ welcome.
5
+
6
+ ## Development setup
7
+
8
+ ZOMBI2 needs Python ≥ 3.10. The library itself is pure Python (only `numpy`), but the default
9
+ gene-family engine is a compiled Rust extension that you build once with
10
+ [maturin](https://www.maturin.rs/).
11
+
12
+ ```bash
13
+ git clone https://github.com/AADavin/zombi2.git
14
+ cd zombi2
15
+
16
+ # the compiled gene-family engine FIRST (needed for the default `genomes` model
17
+ # and its tests) -- zombi2 depends on zombi2_core, which isn't on an index during
18
+ # development, so building it here satisfies that pin locally
19
+ pip install ./rust
20
+
21
+ # the library + dev tools (pytest, scipy)
22
+ pip install -e ".[dev]"
23
+ ```
24
+
25
+ Species trees, traits, sequences and the flexible-rate genome models run in pure Python, but
26
+ the built-in `genomes` engine — and the tests that cover it — need the compiled extension.
27
+
28
+ ## Running the tests
29
+
30
+ ```bash
31
+ pytest
32
+ ```
33
+
34
+ The suite is deterministic (seeded) and hermetic — no network, no external data. If
35
+ `zombi2.rust_available()` is `False`, the Rust-backed tests **skip** rather than fail, so make
36
+ sure you built the engine (above) before concluding the suite passed. CI builds it and treats a
37
+ missing engine as an error, so the compiled path is always exercised there.
38
+
39
+ ## Adding a model
40
+
41
+ ZOMBI2 grows by **adding models, not editing the engine**. If you are contributing a model,
42
+ follow the contract:
43
+
44
+ - [Adding a model](docs/contributing/adding-a-model.md) — the interface for each level and the
45
+ end-to-end checklist (implement → export → CLI → validate → document).
46
+ - [Conventions](docs/contributing/conventions.md) — the names, outputs, seeding, and CLI grammar
47
+ every model follows, so the suite reads as one tool.
48
+
49
+ **The hard rule: no model enters the core without an oracle or a statistical test.** A test that
50
+ only asserts "it runs without error" is not validation — see [Validation](docs/validation.md).
51
+ This is enforced in review.
52
+
53
+ ## Documentation
54
+
55
+ ```bash
56
+ pip install -e ".[docs]"
57
+ mkdocs serve # live preview at http://127.0.0.1:8000
58
+ mkdocs build --strict # what CI runs
59
+ ```
60
+
61
+ The book-style manual lives in `manual/` (Pandoc → XeLaTeX); see `manual/README.md` for how to
62
+ build it.
63
+
64
+ ## Submitting changes
65
+
66
+ 1. Branch off `main`.
67
+ 2. Keep each pull request focused. Add or update tests for any behaviour change, and prefer
68
+ asserting real invariants — seeded determinism, conservation laws, analytic/oracle values —
69
+ over "it runs without error".
70
+ 3. Match the surrounding style: public modules, classes and functions carry docstrings.
71
+ 4. Open a pull request. CI must pass — `pytest` on Python 3.10–3.12 with the Rust engine built,
72
+ plus a strict documentation build.
73
+
74
+ ## License
75
+
76
+ ZOMBI2 is released under the **MIT License** (see
77
+ [`LICENSE`](LICENSE)). By contributing, you agree that your contributions are licensed under the
78
+ same terms.
zombi2-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adrián A. Davin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
zombi2-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,156 @@
1
+ Metadata-Version: 2.4
2
+ Name: zombi2
3
+ Version: 0.2.0
4
+ Summary: A phylogenetic simulator of species trees and gene families
5
+ Project-URL: Homepage, https://github.com/AADavin/zombi2
6
+ Project-URL: Repository, https://github.com/AADavin/zombi2
7
+ Project-URL: Issues, https://github.com/AADavin/zombi2/issues
8
+ Author: Adrian A. Davin
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: birth-death,evolution,gene families,phylogenetics,simulation
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: numpy>=1.24
22
+ Requires-Dist: zombi2-core==0.2.0
23
+ Provides-Extra: dev
24
+ Requires-Dist: pytest-cov; extra == 'dev'
25
+ Requires-Dist: pytest>=7; extra == 'dev'
26
+ Requires-Dist: scipy>=1.10; extra == 'dev'
27
+ Provides-Extra: docs
28
+ Requires-Dist: mkdocs-material; extra == 'docs'
29
+ Requires-Dist: mkdocstrings[python]; extra == 'docs'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # ZOMBI2
33
+
34
+ [![CI](https://github.com/AADavin/zombi2/actions/workflows/ci.yml/badge.svg)](https://github.com/AADavin/zombi2/actions/workflows/ci.yml)
35
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
36
+ ![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)
37
+
38
+ **A simulator suite for genome evolution.**
39
+
40
+ ZOMBI2 simulates how genomes evolve along a phylogeny across **four levels** — **species
41
+ trees**, the **genomes** (gene families) that evolve along them, phenotypic **traits**, and
42
+ molecular **sequences** — plus their **coevolution**, as one composable, seeded, fully
43
+ reproducible suite. Use it to generate benchmark datasets with known ground truth for
44
+ phylogenetic and comparative methods.
45
+
46
+ ---
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ pip install zombi2
52
+ ```
53
+
54
+ Prebuilt wheels are published for Linux, macOS, and Windows (CPython 3.10+), including the
55
+ native engine — no toolchain required. Building from source is covered in the
56
+ [installation guide](docs/installation.md).
57
+
58
+ ---
59
+
60
+ ## Quickstart
61
+
62
+ Each level is its own subcommand — run whichever you need. Here a dated species tree, then
63
+ gene families evolving along it under duplication, transfer, loss, and origination:
64
+
65
+ ```bash
66
+ zombi2 species --birth 1 --death 0.3 --tips 50 --age 5 --seed 1 -o run/
67
+ zombi2 genomes --tree run/species_tree.nwk \
68
+ --dup 0.2 --trans 0.1 --loss 0.25 --orig 0.5 --seed 42 -o run/
69
+ ```
70
+
71
+ `zombi2 <command> -h` documents each of `species`, `genomes`, `trait`, `sequence`, and
72
+ `coevolve`; see the [quickstart](docs/quickstart.md) and [CLI reference](docs/cli.md).
73
+
74
+ From Python, every model is a first-class object you can compose:
75
+
76
+ ```python
77
+ import zombi2 as z
78
+
79
+ tree = z.simulate_species_tree(z.BirthDeath(birth=1.0, death=0.3), n_tips=20, age=5.0, seed=1)
80
+ genomes = z.simulate_genomes(tree, duplication=0.2, transfer=0.1, loss=0.25,
81
+ origination=0.5, initial_families=40, seed=42)
82
+
83
+ genomes.write("run/") # gene trees, event tables, transfers, copy-number profiles
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Levels
89
+
90
+ ZOMBI2 is organized around **four levels of evolution**. Each conditions on the ones above it,
91
+ and you run whichever you need — a species tree, then genomes and/or traits along it, then
92
+ sequences along the resulting gene trees — composed into one seeded, reproducible run.
93
+
94
+ <p align="center">
95
+ <picture>
96
+ <source media="(prefers-color-scheme: dark)" srcset="docs/img/four_levels_dark.svg">
97
+ <img alt="The four levels of evolution ZOMBI2 simulates: species trees, genomes, traits, and sequences" src="docs/img/four_levels.svg" width="460">
98
+ </picture>
99
+ </p>
100
+
101
+ A broad library, grouped by the level it acts on. Each links to its guide.
102
+
103
+ - **[Species trees](docs/guide/species-trees.md)** — birth–death (backward and forward),
104
+ episodic/skyline shifts, fossilized birth–death, incomplete sampling, diversity-dependent
105
+ and per-lineage (ClaDS) diversification, mass extinctions, and ghost lineages
106
+ ([full list](docs/species_tree_models.md)).
107
+ - **[Genomes](docs/guide/genomes.md)** — gene families under duplication, transfer, loss,
108
+ and origination (DTL) with shared / family-sampled / genome-wise / per-branch rates and a full
109
+ [transfer model](docs/guide/transfers.md); plus genome **structure** —
110
+ [ordered chromosomes](docs/guide/ordered-genomes.md) with rearrangements and
111
+ [nucleotide-resolution genomes](docs/guide/nucleotide-genomes.md) where genes emerge as blocks.
112
+ - **[Traits](docs/guide/traits.md)** — Brownian motion, Ornstein–Uhlenbeck, and early burst
113
+ (continuous); Mk and threshold (discrete); DEC biogeography.
114
+ - **[Sequences](docs/guide/sequences.md)** — substitution models
115
+ (JC/K80/HKY/GTR + Gamma, and empirical amino-acid models) along the gene trees, with a family
116
+ of [relaxed molecular clocks](docs/guide/rate-variation.md) (strict, uncorrelated
117
+ lognormal/gamma, autocorrelated, Cox–Ingersoll–Ross) rescaling time into substitutions.
118
+
119
+ ---
120
+
121
+ ## Combining levels
122
+
123
+ **Coevolution** couples any two levels so they drive each other with
124
+ `coevolve --couple driver:target`: state-dependent diversification (SSE), cladogenetic change,
125
+ key innovations, and trait-linked gene families. See the
126
+ [coevolution models](docs/models/coevolution.md) guide.
127
+
128
+ ---
129
+
130
+ ## Performance
131
+
132
+ The built-in models run on a native **Rust** engine and scale to millions of tips on a
133
+ laptop: a backward species tree of 1M tips builds in ~6 s, and gene families over a 100k-tip
134
+ tree simulate in ~1 s as copy-number profiles. On one shared 1,000-tip species tree, ZOMBI2
135
+ runs the gene-family simulation **≈580× faster than ZOMBI 1** (41 s → 71 ms). Details in the
136
+ [Rust engine guide](docs/guide/rust-engine.md).
137
+
138
+ ![ZOMBI2 performance](analyses/performance/figures/overview.png)
139
+
140
+ ---
141
+
142
+ ## Documentation
143
+
144
+ Guides, a command-line reference, and the full API live in [`docs/`](docs/) (build locally
145
+ with `pip install -e ".[docs]" && mkdocs serve`); a book-style [manual](manual/) is built with
146
+ Pandoc. Start with the [quickstart](docs/quickstart.md).
147
+
148
+ ## Citation
149
+
150
+ If you use ZOMBI2, please cite it via [`CITATION.cff`](CITATION.cff) (GitHub's *Cite this
151
+ repository* button). A dedicated ZOMBI2 paper is in preparation; until then, cite the original
152
+ [ZOMBI](https://github.com/AADavin/Zombi).
153
+
154
+ ## License
155
+
156
+ ZOMBI2 is released under the [MIT License](LICENSE).