{"id":17122235,"url":"https://github.com/ashander/ftprime","last_synced_at":"2026-01-27T21:41:52.567Z","repository":{"id":141822908,"uuid":"72480698","full_name":"ashander/ftprime","owner":"ashander","description":"Forward-time simulation of the msprime data structure (for development)","archived":false,"fork":false,"pushed_at":"2018-10-18T20:28:24.000Z","size":1279,"stargazers_count":2,"open_issues_count":15,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T08:39:21.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-31T21:47:37.000Z","updated_at":"2018-10-18T20:28:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"781132d0-6c03-47df-9eb8-c7affff199af","html_url":"https://github.com/ashander/ftprime","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashander%2Fftprime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashander%2Fftprime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashander%2Fftprime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashander%2Fftprime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashander","download_url":"https://codeload.github.com/ashander/ftprime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247425575,"owners_count":20936977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T18:06:51.513Z","updated_at":"2026-01-27T21:41:52.526Z","avatar_url":"https://github.com/ashander.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"ftprime\n======\n\nAn earlier version of this code was mentioned during the Evolution 2017 talk:\n\u003e Ashander, McCartney-Melstad, Ralph, Shaffer (2017) \"Using Genomic Data to Inform Population Viability in a Long-Lived Endangered Vertebrate\". \n\nNote the code is pre-production but if you're building on the ideas here please cite this repository using the DOI: [![DOI](https://zenodo.org/badge/72480698.svg)](https://zenodo.org/badge/latestdoi/72480698)\n\nThe current version of this package (on `HEAD`) works with msprime version 0.6.1 (current as of Oct 17 2018).\nFor the earlier version, used in [the paper](https://www.biorxiv.org/content/early/2018/06/07/248500), get [tag 0.0.6](https://github.com/ashander/ftprime/tree/0.0.6).\n\n\nContents\n--------\n\nThe purpose of this package is to provide python code to easily store ancestry information from a forwards-time, \nindividual-based simulation, using [msprime](https://github.com/jeromekelleher/msprime)'s \"tree sequence\" data format, so that after the simulation,\nwe can\n\n1. have the entire tree sequence (equivalent to the ARG) of the final generation:w\n2. put down neutral mutations on the tree sequence afterwards without carrying them along in the simulation, and\n3. use [msprime](https://github.com/jeromekelleher/msprime) to efficiently store results and quickly compute statistics.\n\nWe also provide a class to facilitate doing this with [simuPOP](https://github.com/BoPeng/simuPOP).\n\n[Core module:](ftprime/)\n\n-  [ftprime/argrecorder.py](ftprime/argrecorder.py): Provides `ARGrecorder`, which records haploid parentage and crossing over events.\n\n-  [ftprime/recomb_collector.py](ftprime/recomb_collector.py): Provides `RecombCollector`, which does the bookkeeping to use ARGrecorder\n    with a diploid simulation with discrete loci, whose function `collect_recombs` can be used as output for simuPOP's `Recombinator` operator.\n\n\nTests:\n\n-  [tests/wf/](test/wf/__init__.py): Very simple forwards-time Wright-Fisher simulation that uses the underlying machinery to the `ARGrecorder`.\n-  [tests/test_with_wf.py](tests/test_with_wf.py): Example of using the Wright-Fisher interface.\n-  [examples/](examples/): more complex examples using `RecombCollector`.\n\n\nDevelopment\n-----------\n\nTest status and code coverage:\n\n[![CircleCI](https://circleci.com/gh/ashander/ftprime/tree/master.svg?style=svg)](https://circleci.com/gh/ashander/ftprime/tree/master) [![Coverage Status](https://coveralls.io/repos/github/ashander/ftprime/badge.svg?branch=master)](https://coveralls.io/github/ashander/ftprime?branch=master) [![codecov](https://codecov.io/gh/ashander/ftprime/branch/master/graph/badge.svg)](https://codecov.io/gh/ashander/ftprime)\n\n\nClone:\n\n    git clone https://github.com/ashander/ftprime.git\n    cd ftprime\n\nFor best results, use [miniconda](https://conda.io/miniconda.html),\nwhich provides the command line dependency manager `conda`.\nOnce you have it installed, make a new environment to do development:\n\n    conda config --add channels conda-forge\n    conda env create -f environment.yml -n ftprime python=3.5\n    source activate ftprime  # Enter the development environment\n\nInstall ``tortoisim`` in locally editable (``-e``) mode and run the tests.\nAfter the ``pip`` command you should see a bunch of messages about requirements\nalready satisfied (because you've installed them with ``conda``, above):\n\n    pip install -e .[dev]  # Don't need the [dev] if you used conda above\n    pytest\n\nEarlier work\n------------\n\nLegacy interface:\n\n-  [attic/meiosistagger.py](attic/meiosistagger.py): Provides `MeiosisTagger`, which can be used as an IdTagger in simuPOP\n    with the side effect of simulating recombination events and storing everything in an `ARGrecorder`.\n\n[Documentation of the problem and the methods:](writeups/)\n\nSince there are many different ways to store an ARG as a set of coalescence records,\na good deal of this is devoted to describing and verifying msprime's requirements\nfor such a set, and thinking about different ways to do it.\n\n-  [writeups/forwards_algorithm.md](writeups/forwards_algorithm.md): Description of the algorithm for outputting a valid tree sequence from a forwards-time simulation.\n-  [writeups/algorithm-notes.md](writeups/algorithm-notes.md): A writeup of algorithmic considerations.\n-  [devel/test_msprime.py](devel/test_msprime.py): An exploration of the capabilities of msprime to digest various notions of a tree sequence.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashander%2Fftprime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashander%2Fftprime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashander%2Fftprime/lists"}