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:
- Ragsdale, A. P. (2021). Can we distinguish modes of selective interactions from linkage disequilibrium? BioRxiv, doi: https://doi.org/10.1101/2021.03.25.437004
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moments_popgen-1.5.3.tar.gz.
File metadata
- Download URL: moments_popgen-1.5.3.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c1c0de283bfc85ebca9858fd391676731e9560f5d8c731b79672f7e4b7ae221
|
|
| MD5 |
062a348a1655c75441c05c5746b6fb26
|
|
| BLAKE2b-256 |
b86d366d3d5929123201102899ac75abdea294843fd6196ed510ea195f4e88ab
|
Provenance
The following attestation bundles were made for moments_popgen-1.5.3.tar.gz:
Publisher:
wheels.yml on MomentsLD/moments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moments_popgen-1.5.3.tar.gz -
Subject digest:
1c1c0de283bfc85ebca9858fd391676731e9560f5d8c731b79672f7e4b7ae221 - Sigstore transparency entry: 1318619857
- Sigstore integration time:
-
Permalink:
MomentsLD/moments@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Branch / Tag:
refs/tags/v1.5.3 - Owner: https://github.com/MomentsLD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Trigger Event:
release
-
Statement type:
File details
Details for the file moments_popgen-1.5.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: moments_popgen-1.5.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.14, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4cb899e73b19436f378f03fe97e4c80d908e5fe94e828f6b5c5536a506730de
|
|
| MD5 |
7f2386bb25065564e21f4e77fa58e3f4
|
|
| BLAKE2b-256 |
071dccf4496e912fe6bdcc8a62b78b0d87dd52763ea7e06d9af93d220317ca4c
|
Provenance
The following attestation bundles were made for moments_popgen-1.5.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:
Publisher:
wheels.yml on MomentsLD/moments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moments_popgen-1.5.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
f4cb899e73b19436f378f03fe97e4c80d908e5fe94e828f6b5c5536a506730de - Sigstore transparency entry: 1318620353
- Sigstore integration time:
-
Permalink:
MomentsLD/moments@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Branch / Tag:
refs/tags/v1.5.3 - Owner: https://github.com/MomentsLD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Trigger Event:
release
-
Statement type:
File details
Details for the file moments_popgen-1.5.3-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: moments_popgen-1.5.3-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae4fbba614ad71082b8b3d2195ef6a9cb52a7cced5e9776c3e3c10a9c599d995
|
|
| MD5 |
672cd0cb1b70397c0cb548f61c832634
|
|
| BLAKE2b-256 |
db1c5fa1e9b18975633d63a6466515d898b2b391c763f62ebbbead03d21df5e6
|
Provenance
The following attestation bundles were made for moments_popgen-1.5.3-cp314-cp314-macosx_11_0_arm64.whl:
Publisher:
wheels.yml on MomentsLD/moments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moments_popgen-1.5.3-cp314-cp314-macosx_11_0_arm64.whl -
Subject digest:
ae4fbba614ad71082b8b3d2195ef6a9cb52a7cced5e9776c3e3c10a9c599d995 - Sigstore transparency entry: 1318620083
- Sigstore integration time:
-
Permalink:
MomentsLD/moments@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Branch / Tag:
refs/tags/v1.5.3 - Owner: https://github.com/MomentsLD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Trigger Event:
release
-
Statement type:
File details
Details for the file moments_popgen-1.5.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: moments_popgen-1.5.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f32f219bbc9ceb9ce779a350104c6e2dc3eb034aa3c3ec553ed48716940adae8
|
|
| MD5 |
7fa37dac175a664dab6c265d21aa94c1
|
|
| BLAKE2b-256 |
6b135935adeecf0a181fd0d66d2cadbf34c2032345a6c7951e6685959107ed10
|
Provenance
The following attestation bundles were made for moments_popgen-1.5.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:
Publisher:
wheels.yml on MomentsLD/moments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moments_popgen-1.5.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
f32f219bbc9ceb9ce779a350104c6e2dc3eb034aa3c3ec553ed48716940adae8 - Sigstore transparency entry: 1318620007
- Sigstore integration time:
-
Permalink:
MomentsLD/moments@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Branch / Tag:
refs/tags/v1.5.3 - Owner: https://github.com/MomentsLD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Trigger Event:
release
-
Statement type:
File details
Details for the file moments_popgen-1.5.3-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: moments_popgen-1.5.3-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a62eda10ef2f1491999f20aa9ed2a3110550c6798d6179fd503a020ccc0e077f
|
|
| MD5 |
ac16562f12cc19bea8bdda991529b07d
|
|
| BLAKE2b-256 |
dcda6d02a57c39c97d60d40a66d3aaec306a84cbb1f56a954073d8708729e752
|
Provenance
The following attestation bundles were made for moments_popgen-1.5.3-cp313-cp313-macosx_11_0_arm64.whl:
Publisher:
wheels.yml on MomentsLD/moments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moments_popgen-1.5.3-cp313-cp313-macosx_11_0_arm64.whl -
Subject digest:
a62eda10ef2f1491999f20aa9ed2a3110550c6798d6179fd503a020ccc0e077f - Sigstore transparency entry: 1318620164
- Sigstore integration time:
-
Permalink:
MomentsLD/moments@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Branch / Tag:
refs/tags/v1.5.3 - Owner: https://github.com/MomentsLD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Trigger Event:
release
-
Statement type:
File details
Details for the file moments_popgen-1.5.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: moments_popgen-1.5.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04c6377939d03d2978eb045397e3a47c5552e11e2652a50a2ad20eb09203d684
|
|
| MD5 |
df5fcd158cce47d3d33063bf16499038
|
|
| BLAKE2b-256 |
d9c101503222f745f52aae7dbf6d3e0ae365e4371fda43047d507fa7b865644d
|
Provenance
The following attestation bundles were made for moments_popgen-1.5.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:
Publisher:
wheels.yml on MomentsLD/moments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moments_popgen-1.5.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
04c6377939d03d2978eb045397e3a47c5552e11e2652a50a2ad20eb09203d684 - Sigstore transparency entry: 1318619933
- Sigstore integration time:
-
Permalink:
MomentsLD/moments@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Branch / Tag:
refs/tags/v1.5.3 - Owner: https://github.com/MomentsLD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Trigger Event:
release
-
Statement type:
File details
Details for the file moments_popgen-1.5.3-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: moments_popgen-1.5.3-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8765a323e6842804ffdc5ab62ddfc3bc6e186d18841fdae1ddcedfd6b1391d8
|
|
| MD5 |
0567842780fe2d6f37a6570a130dde22
|
|
| BLAKE2b-256 |
050e31c44acda3a0d57d399d10eb512cb860216c8c00dd340882de8d869df144
|
Provenance
The following attestation bundles were made for moments_popgen-1.5.3-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
wheels.yml on MomentsLD/moments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moments_popgen-1.5.3-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
e8765a323e6842804ffdc5ab62ddfc3bc6e186d18841fdae1ddcedfd6b1391d8 - Sigstore transparency entry: 1318620239
- Sigstore integration time:
-
Permalink:
MomentsLD/moments@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Branch / Tag:
refs/tags/v1.5.3 - Owner: https://github.com/MomentsLD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Trigger Event:
release
-
Statement type:
File details
Details for the file moments_popgen-1.5.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.
File metadata
- Download URL: moments_popgen-1.5.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b824d99d5bafc92525f58d8ae5bfbcecd4c93dff0d7a48b30688dfd9576aba6b
|
|
| MD5 |
dc0797862145f2663a9e86eca6e97c05
|
|
| BLAKE2b-256 |
712b3d820cd4000107d0db7224fae03b6db8ff2c64f101a66ae1c3d64b06c79c
|
Provenance
The following attestation bundles were made for moments_popgen-1.5.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:
Publisher:
wheels.yml on MomentsLD/moments
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moments_popgen-1.5.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl -
Subject digest:
b824d99d5bafc92525f58d8ae5bfbcecd4c93dff0d7a48b30688dfd9576aba6b - Sigstore transparency entry: 1318620433
- Sigstore integration time:
-
Permalink:
MomentsLD/moments@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Branch / Tag:
refs/tags/v1.5.3 - Owner: https://github.com/MomentsLD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@7720a73dbbe46f926d29f78d49a6e9739ddd5fca -
Trigger Event:
release
-
Statement type: