Skip to main content

Population genetic statistics for evolutionary inference

Project description

moments: population genetic analyses and inference using diversity statistics

Please see the documentation for more details, examples, tutorials and API usage.

moments provides a suite of methods for demographic history and selection inference from genetic data, based on diffusion approximations to the one- and two-locus allele frequency spectrum. moments is modeled after the ∂a∂i open source package developed by Ryan Gutenkunst. For SFS-based methdos, we largely reuse ∂a∂i's API, but introduce a new simulation engine. This new method is based on the direct computation of the frequency spectrum without solving the diffusion system, removing the need for frequency grids as used in ∂a∂i. moments.LD, packaged within moments, implements methods for computing linkage disequilibrium statistics and running multi-population demographic inference using patterns of LD.

Getting started

moments now supports Python 3, and we no longer guarantee compatibility with Python 2.

The simplest way to install moments is using pip:

pip install moments-popgen

moments can then be imported using import moments. Important note: pip install moments installs a different package named moments, and our pypi package is named moments-popgen.

We can install the development branch directly from Github by running

pip install git+https://github.com/MomentsLD/moments.git@devel

Alternatively, you can clone the git repository to make an editable or development build.

git clone https://github.com/MomentsLD/moments.git

and then from within the moments directory (cd moments), run

pip install -r requirements.txt
pip install .

If you use conda, moments is available via bioconda:

conda config --add channels bioconda
conda install moments

Citing moments

If you use moments in your research, please cite:

  • Jouganous, J., Long, W., Ragsdale, A. P., & Gravel, S. (2017). Inferring the joint demographic history of multiple populations: beyond the diffusion approximation. Genetics, 206(3), 1549-1567.

If you use moments.LD in your research, please cite:

  • Ragsdale, A. P. & Gravel, S. (2019). Models of archaic admixture and recent history from two-locus statistics. PLoS Genetics, 15(6), e1008204.

  • Ragsdale, A. P. & Gravel, S. (2020). Unbiased estimation of linkage disequilibrium from unphased data. Mol Biol Evol, 37(3), 923-932.

If you use moments.TwoLocus in your research, please cite:

moments is developed in the Simon Gravel and Aaron Ragsdale research groups, at McGill University and UW-Madison, respectively. For any issues, questions or bug reports, please open an issue on Github.

Dependencies

If you install moments from source (e.g., after cloning the repository), you will need to install the dependencies. These are all listed in requirements.txt, and can be installed via pip after navigating to the moments directory:

pip install -r requirements.txt

A few more details: moments and moments.LD requires a handful of dependencies. At a minimum, these include

  • numpy

  • scipy

  • cython

  • mpmath

  • demes

We also strongly recommend installing ipython.

If you are using conda, all dependencies can be installed by navigating to the moments directory and then running

conda install --file requirements.txt

Once dependencies are installed, to install moments, run the following command in the moments directory:

python -m pip install -e .

You should then be able to import moments in your python scripts. Entering an ipython or python session, try to import moments. More details on installation can be found in the documentation. If, for any reason, you have trouble installing moments after following these steps, please submit an issue.

If you use Parsing from moments.LD, which reads VCF files and computes LD statistics to compare to predictions from moments.LD, you will need to additionally install

  • hdf5

  • scikit-allel

  • pandas

Changelog

All changes are detailed in the documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moments_popgen-1.4.2.tar.gz (4.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

moments_popgen-1.4.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.4.2-cp313-cp313-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

moments_popgen-1.4.2-cp313-cp313-macosx_10_13_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

moments_popgen-1.4.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.4.2-cp312-cp312-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

moments_popgen-1.4.2-cp312-cp312-macosx_10_13_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

moments_popgen-1.4.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

moments_popgen-1.4.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file moments_popgen-1.4.2.tar.gz.

File metadata

  • Download URL: moments_popgen-1.4.2.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for moments_popgen-1.4.2.tar.gz
Algorithm Hash digest
SHA256 e24bd1ed8ba1c6cf5a056ab4471cb0d8f1397acc7206e3a7bac20ed1295ba006
MD5 6918c8fb0afd91d834555dfccb39c3a0
BLAKE2b-256 0fc35d1496f33b78fb62f96ba9c97df4ffb8f385581462696c9af643be2811ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.2.tar.gz:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.4.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 03e23b6cab1422ee52d2acb11839068ac5a7c95104f8efbec3f433380af1d6f5
MD5 b1c065f6c52690ebad0c6718de5e4f54
BLAKE2b-256 063ca8f93bdfa8ac40dc868ad60b97c7cab50234846e0236d39f653f20116dfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.2-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.4.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 72d548ea925e38a49f0bbf6b3f290994953a6c3546545f34a3cfe9539dc2c3ce
MD5 158dd449d148a00cca4f2f5a16883f66
BLAKE2b-256 0d95f70b7d64ce77e4996f0f2c2e65ae6224d38a52ac528eb6ee0ab30cb2267f

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.2-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.4.2-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.2-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 7e44bdef7dffa17eb943d20f94889835af497f71c8e8221a690e58c84fc1b738
MD5 27332a62d6109017d6380e8900b772be
BLAKE2b-256 35b883403321dd797f257cf972526890f334d3863ab59015fad01c1848b9c3fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.2-cp313-cp313-macosx_10_13_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.4.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35813b2e07af5a3f28c723b076e793fdaae658680cd726fc46e4da07b59ff1d5
MD5 31d2c01df9844e98cf4287fbcac7391b
BLAKE2b-256 94ea2b77546c4d7f932be4e41bbd0e60879e64989b705cbd780f0ad1e3aa8b15

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.4.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b715e331088a2507f6a22074f9e046083d9f78316cc8fdd051bad9f4c60dc07a
MD5 3653dc1b309e35b039716dbc1c89ab04
BLAKE2b-256 601ed06145eea7a59e71049ccfab1602ff0b64e8d98c85e141ff2af7f3d18e44

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.2-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.4.2-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.2-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 003d17ddadfca2a2404e2199e52ca5a92d31bf5af0c0e5daaf7a5e1c5527ff96
MD5 e09d99d8b622573cc6661c4aefe7518d
BLAKE2b-256 ae9165e0090713be2ef7cb9f3c49555fe5fca064772b2bd2965b1566f5901108

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.2-cp312-cp312-macosx_10_13_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.4.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ec85e6b1983b01bdaba6044fcc5b7ad25dbcf621c0f6a9558f27242a3b7c8daa
MD5 a28473dce9fcad9964931ecc4eb01ac8
BLAKE2b-256 d980b93270de1a0b99322badec6acb92db5a83a5838da82d2d2e0cdad26ab079

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moments_popgen-1.4.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moments_popgen-1.4.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40f15faa5486792ada090ec71bce9b9b6739cb163de35896aacb781ab0989d5d
MD5 f9a34f5f4b4907ec663d99fc2f177f22
BLAKE2b-256 79e197433405a581acef5e061f9674a1f43b01483b808b8f5ea684348afeef03

See more details on using hashes here.

Provenance

The following attestation bundles were made for moments_popgen-1.4.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on MomentsLD/moments

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page