Skip to main content

Library and command line scripts for inferring identity-by-descent (IBD) segments shared between siblings, imputing missing parental genotypes, and for performing family based genome-wide association and polygenic score analyses.

Project description

snipar

snipar (single nucleotide imputation of parents) is a Python package for inferring identity-by-descent (IBD) segments shared between siblings, imputing missing parental genotypes, and for performing family based genome-wide association and polygenic score analyses using observed and/or imputed parental genotypes.

The imputation method and the family-based GWAS and polygenic score models are described in Young et al. 2022.

Main features:

Infer identity-by-descent segments shared between siblings (ibd.py).

Impute missing parental genotypes given the observed genotypes in a nuclear family (impute.py).

Perform family based GWAS using observed and imputed parental genotypes (gwas.py).

Compute polygenic scores for probands, siblings, and parents from SNP weights using observed/imputed parental genotypes, and perform family based analysis of polygenic scores (pgs.py script).

Compute genome-wide correlations between different effects estimated by gwas.py (correlate.py).

Documentation

Documentation: https://snipar.rtfd.io/

It is recommended to read the guide: https://snipar.rtfd.io/en/latest/guide.html

And to work through the tutorial: https://snipar.rtfd.io/en/latest/tutorial.html

Installing Using pip

snipar currently supports Python 3.7-3.9 on Linux, Windows, and Mac OSX. We recommend using a python distribution such as Anaconda 3 (https://store.continuum.io/cshop/anaconda/).

The easiest way to install is using pip:

pip install snipar

Sometimes this may not work because the pip in the system is outdated. You can upgrade your pip using:

pip install --upgrade pip

Virtual Environment

You may encounter problems with the installation due to Python version incompatability or package conflicts with your existing Python environment. To overcome this, you can try installing in a virtual environment. In a bash shell, this could be done by using the following commands in your directory of choice:

python -m venv path-to-where-you-want-the-virtual-environment-to-be

You can activate and use the environment using

source path-to-where-you-want-the-virtual-environment-to-be/bin/activate

Installing From Source

To install from source, clone the git repository, and in the directory containing the snipar source code, at the shell type:

pip install .

Python version incompatibility

snipar does not currently support Python 3.10 or higher due to version incompatibilities of dependencies. To overcome this, create a Python3.9 environment using conda and install using pip in the conda environment:

conda create -n myenv python=3.9
conda activate myenv
pip install snipar

Apple ARM processor machines

There can be difficulties install snipar on Apple ARM processor machines due to lack of available versions of scientific computing software made for these processors' architectures. A workaround for this is to use snipar in a docker (https://docs.docker.com/desktop/install/mac-install/) image. To create an appropriate docker image, use this command in the terminal:

docker run -it amd64/python:3.9.9-slim-buster /bin/bash

Running tests

To check that the code is working properly and that the C modules have been compiled, you can run the tests using this command:

python -m unittest snipar.tests

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

snipar-0.0.18-cp39-cp39-win_amd64.whl (53.3 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

snipar-0.0.18-cp39-cp39-win32.whl (53.2 MB view hashes)

Uploaded CPython 3.9 Windows x86

snipar-0.0.18-cp39-cp39-musllinux_1_1_x86_64.whl (55.7 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

snipar-0.0.18-cp39-cp39-musllinux_1_1_i686.whl (55.7 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

snipar-0.0.18-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (55.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

snipar-0.0.18-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (55.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

snipar-0.0.18-cp39-cp39-macosx_10_9_x86_64.whl (53.6 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

snipar-0.0.18-cp38-cp38-win_amd64.whl (53.3 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

snipar-0.0.18-cp38-cp38-win32.whl (53.3 MB view hashes)

Uploaded CPython 3.8 Windows x86

snipar-0.0.18-cp38-cp38-musllinux_1_1_x86_64.whl (56.4 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

snipar-0.0.18-cp38-cp38-musllinux_1_1_i686.whl (55.9 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

snipar-0.0.18-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (55.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

snipar-0.0.18-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (55.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

snipar-0.0.18-cp38-cp38-macosx_10_9_x86_64.whl (53.6 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

snipar-0.0.18-cp37-cp37m-win_amd64.whl (53.3 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

snipar-0.0.18-cp37-cp37m-win32.whl (53.2 MB view hashes)

Uploaded CPython 3.7m Windows x86

snipar-0.0.18-cp37-cp37m-musllinux_1_1_x86_64.whl (55.6 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

snipar-0.0.18-cp37-cp37m-musllinux_1_1_i686.whl (55.6 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ i686

snipar-0.0.18-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (54.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

snipar-0.0.18-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (54.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686

snipar-0.0.18-cp37-cp37m-macosx_10_9_x86_64.whl (53.6 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ 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