Skip to main content

SNP utils

Project description

License BSD-3 PyPI Python Version tests

snputils

Installation

We recommend creating a fresh Python >= 3.8 conda environment. This package can be easily installed using pip after cloning the repository:

(base) $ conda create -n snputils python=3.10
(base) $ conda activate snputils
(snputils) $ git clone https://github.com/AI-sandbox/snputils.git && cd snputils
(snputils) $ pip install -e '.[testing,jupyter]'

Alternatively, you can install the package directly from the repository without cloning it:

(base) $ pip install git+https://github.com/AI-sandbox/snputils.git

Optional Dependencies

By default, torch is not installed when you install snputils using pip install snputils. This is because torch is only required for certain PCA functionalities within snputils.

If you wish to use the optimized PCA implementation for GPU using the PyTorch backend, you can install the extra dependencies using:

pip install snputils[gpu]

This will install torch along with snputils.

Alternatively, you can install torch manually if you prefer:

pip install torch

Please note that installing torch might also install additional NVIDIA packages if CUDA support is enabled.

Use snputils tools

PCA

To directly run Principal Component Analysis (PCA) on SNP data, plotting the results, and saving the principal components on a .npy file, simply call snputils pca with the required arguments, see snputils pca --help for more information.

An example of running PCA on a .vcf file, saving the plot in fig.png and the principal components in pc.npy:

> snputils pca --vcf_file /dataset/path/hapmap3.vcf --fig_path fig.png --npy_path pc.npy --backend sklearn

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

snputils-0.1.1.tar.gz (809.0 kB view details)

Uploaded Source

Built Distribution

snputils-0.1.1-py3-none-any.whl (64.1 kB view details)

Uploaded Python 3

File details

Details for the file snputils-0.1.1.tar.gz.

File metadata

  • Download URL: snputils-0.1.1.tar.gz
  • Upload date:
  • Size: 809.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for snputils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bce553744811704cd6991f7eac7d09f0859bb8c97ed3ec10d3885170d051d42b
MD5 dabf3e0b5820860ff088cb030d0e1094
BLAKE2b-256 b5092652cd831d1bf0a4bac7f2865dda69d8df79bd7c69e83c1ed1a5b8b8ebbc

See more details on using hashes here.

File details

Details for the file snputils-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: snputils-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 64.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for snputils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 95b1874de6372ec1e0a35ca7ed6d588bb27d9b0093c7a53c8135e1a40afc5a8e
MD5 39ff4268efad0c60255a9aef48849981
BLAKE2b-256 7ac1bc860e6639b407d7d925674961d1b454f671bbaf7a69229164482df12201

See more details on using hashes here.

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