{"id":24076,"library":"msprime","title":"msprime","description":"msprime is a fast, scalable Python library for simulating genealogical trees and genomic sequence data under population genetic models using the coalescent with recombination. Current version 1.4.1 supports Python >=3.11. Released under GPL, maintained by the TSKIT team with regular updates.","status":"active","version":"1.4.1","language":"python","source_language":"en","source_url":"https://github.com/tskit-dev/msprime","tags":["population-genetics","coalescent","simulation","tree-sequences","genomics"],"install":[{"cmd":"pip install msprime","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for numerical operations.","package":"numpy","optional":false},{"reason":"Required for tree sequence data structures and analysis.","package":"tskit","optional":false}],"imports":[{"wrong":"import msprime as ms","symbol":"simulate","correct":"from msprime import simulate"},{"symbol":"AncestryModel","correct":"from msprime import AncestryModel"},{"symbol":"Demography","correct":"from msprime import Demography"}],"quickstart":{"code":"import msprime\n# Simulate a coalescent sample of 10 chromosomes\nrecombination_rate = 1e-8\nsequence_length = 1e4\nts = msprime.simulate(\n    sample_size=10,\n    recombination_rate=recombination_rate,\n    length=sequence_length,\n    random_seed=42\n)\nprint(ts.num_trees, ts.num_samples)","lang":"python","description":"Simulate a basic coalescent tree sequence with recombination."},"warnings":[{"fix":"Replace `Ne=X` with `population_size=X`. Ensure you use msprime 1.x imports.","message":"In msprime 1.0, the API was overhauled: `msprime.simulate()` replaces `msprime.simulate()` from older versions (no change in name but parameter changes). The `Ne` parameter is no longer accepted; use `population_size`.","severity":"breaking","affected_versions":">=0.7.0, <1.0"},{"fix":"Run `ts = msprime.simulate(...)` then `ts = msprime.mutate(ts, rate=1e-8)`. See docs for details.","message":"`msprime.simulate()` with mutation_rate parameter is deprecated in favor of `msprime.mutate()` applied to a tree sequence.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Use different seeds (e.g., derived from process ID) when running parallel simulations.","message":"Setting `random_seed` to the same value will produce identical results. For parallel simulations, ensure each process uses a unique seed.","severity":"gotcha","affected_versions":"all"},{"fix":"Pass a list: `sample_size=[5,5]` for two populations. Do not pass total 10.","message":"When using `msprime.simulate()` with multiple populations, the `sample_size` parameter expects a list of sample sizes per population, not the total. Incorrect usage leads to confusing errors.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Upgrade Python to 3.11 or later.","message":"Support for Python 3.8 and 3.9 dropped in msprime 1.4.0. Requires Python >=3.11 as of 1.4.1.","severity":"breaking","affected_versions":">=1.4.0"}],"env_vars":null,"search_vec":"'1.4.1':28 '3.11':31 'coalesc':23,46 'current':26 'data':16 'fast':5 'genealog':11 'genet':19,45 'genom':14,51 'gpl':34 'librari':8 'maintain':35 'model':20 'msprime':1,2 'popul':18,44 'population-genet':43 'python':7,30 'recombin':25 'regular':41 'releas':32 'scalabl':6 'sequenc':15,50 'simul':10,47 'support':29 'team':39 'tree':12,49 'tree-sequ':48 'tskit':38 'updat':42 'use':21 'version':27","created_at":"2026-05-01T08:11:10.125468+00:00","updated_at":"2026-05-01T08:11:10.125468+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.4.2","cli_name":"msp","cli_version":"msp 1.4.1","type":"library","homepage":"https://tskit.dev/msprime","github":"https://github.com/tskit-dev/msprime","docs":"https://tskit.dev/msprime/docs/stable","changelog":"https://tskit.dev/msprime/docs/stable/CHANGELOG.html","pypi":"https://pypi.org/project/msprime/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}