Package: hstrat
hstratenables phylogenetic inference on distributed digital evolution populationsFree software: MIT licenseDocumentation:https://hstrat.readthedocs.ioRepository:https://github.com/mmore500/hstratInstallpython3 -m pip install hstratFeatureshstratserves to enablerobust, efficient extraction of evolutionary historyfrom evolutionary simulations where centralized, direct phylogenetic tracking is not feasible.
Namely, in large-scale,decentralized parallel/distributed evolutionary simulations, where agents' evolutionary lineages migrate among many cooperating processors over the course of simulation.hstratcanaccurately estimatetime since MRCAamong two or several digital agents, even for uneven branch lengthsreconstruct phylogenetic treesfor entire populations of evolving digital agentsserialize genome annotationsto/from text and binary formatsprovidelow-footprintgenome annotations (e.g., reasonably as low as64 bitseach)be directly configured to satisfymemory use limitsand/orinference accuracy requirementshstrat operates just as well in single-processor simulation, but direct phylogenetic tracking using a tool likephylotrackpyshould usually be preferred in such cases due to its capability for perfect record-keeping given centralized global simulation observability.Example UsageThis code briefly demonstrates,initialization of a population ofHereditaryStratigraphicColumnof objects,generation-to-generation transmission ofHereditaryStratigraphicColumnobjects with simple synchronous turnover, and thenreconstruction of phylogenetic history from the final population ofHereditaryStratigraphicColumnobjects.fromrandomimportchoiceasrchoiceimportalifedata_phyloinformatics_convertasapcfromhstratimporthstrat;print(f"{hstrat.__version__=}")# when last ran?fromhstrat._auxiliary_libimportseed_random;seed_random(1)# reproducibility# initialize a small population of hstrat instrumentation# (in full simulations, each column would be attached to an individual genome)population=[hstrat.HereditaryStratigraphicColumn()for__inrange(5)]# evolve population for 40 generations under driftfor_generationinrange(40):population=[rchoice(population).CloneDescendant()for__inpopulation]# reconstruct estimate of phylogenetic historyalifestd_df=hstrat.build_tree(population,version_pin=hstrat.__version__)tree_ascii=apc.RosettaTree(alifestd_df).as_dendropy.as_ascii_plot(width=20)print(tree_ascii)hstrat.__version__='1.8.8'
              /--- 1
          /---+
       /--+   \--- 3
       |  |
   /---+  \------- 2
   |   |
+--+   \---------- 0
   |
   \-------------- 4Inactual usage, eachhstratcolumn would be bundled with underlying genetic material of interest in the simulation --- entire genomes or, in systems with sexual recombination, individual genes.
Thehstratcolumns are designed to operate as a neutral genetic annotation, enhancing observability of the simulation but not affecting its outcome.How it WorksIn order to enable phylogenetic inference over fully-distributed evolutionary simulation, hereditary stratigraphy adopts a paradigm akin to phylogenetic work in natural history/biology.
In these fields, phylogenetic history is inferred through comparisons among genetic material of extant organisms, with --- in broad terms --- phylogenetic relatedness established through the extent of genetic similarity between organisms.
Phylogenetic tracking throughhstrat, similarly, is achieved through analysis of similarity/dissimilarity among genetic material sampled over populations of interest.Rather than random mutation as with natural genetic material, however, genetic material used byhstratis structured throughhereditary stratigraphy.
This methodology, described fully in our documentation, provides strong guarantees on phylogenetic inferential power, minimizes memory footprint, and allows efficient reconstruction procedures.Seeherefor more detail on underlying hereditary stratigraphy methodology.Getting StartedRefer to our documentation for aquickstart guideand anannotated end-to-end usage example.Theexamples/folder provides extensive usage examples, includingincorporation of hstrat annotations into a custom genome class,automatic stratum retention policy parameterization,pairwise and population-level phylogenetic inference, andphylogenetic tree reconstruction.Interested users can find an explanation of how hereditary stratigraphy methodology implemented byhstratworks "under the hood," information on project-specifichstratconfiguration, and full API listing for thehstratpackage inthe documentation.CitingIfhstratsoftware or hereditary stratigraphy methodology contributes to a scholarly work, please cite it according to references providedhere.
We would love to list your project usinghstratin our documentation, see morehere.CreditsThis package was created with Cookiecutter and theaudreyr/cookiecutter-pypackageproject template.hcat