Skip to main content

No project description provided

Project description

moments: tools for diversity statistics and inference

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

moments implements methods for demographic history and selection inference from genetic data, based on diffusion approximations to the allele frequency spectrum. moments is based on the ∂a∂i open source package developed by Ryan Gutenkunst. We largely reuse ∂a∂i's interface but introduced a new simulation engine. This new method is based on the direct computation of the frequency spectrum without solving the diffusion system. Consequently we circumvent the numerical PDE approximations and we get rid of the frequency grids used in ∂a∂i.

moments.LD implements methods for computing linkage disequilibrium statistics and running multi-population demographic inference using patterns of LD.

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 Simon Gravel's group in the Human Genetics department at McGill University, with with ongoing maintenance and development by the Gravel Lab and Aaron Ragsdale.

Getting started

moments now supports python 3. Because python is soon discontinuing support for python 2, we do not actively ensure that moments remains fully compatable with python 2, and strongly recommend using python 3.

The simplest way to install moments is using pip. Note that numpy and cython are install requirements, but installing moments directly from the git repository using pip should install these dependencies automatically:

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

or install the development branch 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 numpy, cython, scipy, mpmath
pip install .

If you use conda, moments is available via bioconda:

conda config --add channels bioconda
conda install moments

Dependencies and details

moments and moments.LD requires a number of dependencies. At a minimum, these include

  • numpy

  • scipy

  • cython

  • mpmath

Dependencies can be installed using pip. For example to install cython,

pip install cython

Depending on the python distribution you use, it may be useful to add the directory to cython in your python path.

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

or, alternatively,

pip install -r 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, type 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

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.2.0a1.tar.gz (4.2 MB view hashes)

Uploaded Source

Built Distributions

moments_popgen-1.2.0a1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view hashes)

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

moments_popgen-1.2.0a1-cp312-cp312-macosx_11_0_arm64.whl (1.6 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

moments_popgen-1.2.0a1-cp312-cp312-macosx_10_9_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

moments_popgen-1.2.0a1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view hashes)

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

moments_popgen-1.2.0a1-cp311-cp311-macosx_11_0_arm64.whl (1.6 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

moments_popgen-1.2.0a1-cp311-cp311-macosx_10_9_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

moments_popgen-1.2.0a1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view hashes)

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

moments_popgen-1.2.0a1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view hashes)

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

moments_popgen-1.2.0a1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view hashes)

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

Supported by

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