A collection of handy tools for GWAS
Project description
gwaslab
Note: Some part of the docs are outdated. I am currently updating the documents.
- A simple python package for handling GWAS sumstats.
- Each process is modularized and can be customized to your needs.
- Most manipulations are designed as methods of python object,
gwaslab.Sumstats
.
Please check GWASLab document at https://cloufield.github.io/gwaslab/
import gwaslab as gl
# load plink2 output
mysumstats = gl.Sumstats("t2d_bbj.txt.gz",
fmt="plink2",
build="19")
# or you can specify the columns:
mysumstats = gl.Sumstats("t2d_bbj.txt.gz",
snpid="SNP",
chrom="CHR",
pos="POS",
ea="ALT",
nea="REF",
neaf="Frq",
beta="BETA",
se="SE",
p="P",
direction="Dir",
n="N",
build="19")
# manhattan and qq plot
mysumstats.plot_mqq()
...
Functions
Standardization, Normalization & Harmonization
- CHR and POS notation standardization
- Variant POS and allele normalization
- Genome build : Liftover
- Reference allele alignment using a reference genome sequence
- rsID assignment based on CHR, POS, REF and ALT
- CHR POS assignment based on rsID using a reference VCF
- Palindromic SNPs and indels strand inference using a reference VCF
- Check allele frequency discrepancy using a reference VCF
Quality control, Value conversion & Filtering
- Statistics sanity check
- Equivalent statistics conversion
- BETA/SE , OR/OR_95L/OR_95U
- P, Z, CHISQ, MLOG10
- Extract/exclude hapmap3 variants
- Extract/exclude MHC variants
- Filtering values.
Visualization
- Mqq plot : Manhattan plot and QQ plot side by side (with a bunch of customizable features including auto-annotate nearest gene names)
- Heatmap : ldsc-rg genetic correlation matrix
- Scatter Plot : variant effect size comparison with sumstats
- Scatter Plot : allele frequency comparison
- Forest Plot : forest plots for meta-analysis of SNPs
- Examples
Other Utilities
- Read ldsc h2 or rg outputs directly as DataFrames (auto-parsing).
- Extract lead variants given a sliding window size.
- Extract novel loci given a list of known lead variants.
- Logging : keep a complete record of manipulations from raw data to munged data.
- Sumstats summary function: know your data better.
- Formating GWAS sumstats in certain formats
- LDSC / MAGMA / METAL / MR-MEGA / FUMA / VCF / BED... check available formats
Install
pip install gwaslab==3.3.2
Requirements:
- Python >= 3.6
- pySAM
- pyensembl
- scikit-allel
- Biopython >= 1.79
- liftover >= 1.1.13
- pandas >= 1.2.4
- numpy >= 1.21.2
- matplotlib >=3.5
- seaborn >=0.11.1
- scipy >=1.6.2
- statsmodels > =0.13
- adjustText
Contacts
- Github: https://github.com/Cloufield/gwaslab
- Blog (in Chinese): https://gwaslab.com/
- Email: gwaslab@gmail.com
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
gwaslab-3.3.2.tar.gz
(77.8 MB
view details)
Built Distribution
gwaslab-3.3.2-py3-none-any.whl
(77.8 MB
view details)
File details
Details for the file gwaslab-3.3.2.tar.gz
.
File metadata
- Download URL: gwaslab-3.3.2.tar.gz
- Upload date:
- Size: 77.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.1.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6ce56301f00bf35a0b3d56de8f04aeb139409c35fe10316adf2f144f0c56ce2 |
|
MD5 | 0232175e958e297e7f9aa96df572455b |
|
BLAKE2b-256 | 1d58958b6212899ab99d7119d77133229ea6c861b9ba264d4ee63f06c65af04e |
File details
Details for the file gwaslab-3.3.2-py3-none-any.whl
.
File metadata
- Download URL: gwaslab-3.3.2-py3-none-any.whl
- Upload date:
- Size: 77.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.1 keyring/23.1.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19a706e8b9cc1aabbaec034216cd12b7a215cf8da8bcebe783f37063bc9f5ec7 |
|
MD5 | 6c7aca692d6a1eb9d3497e74c52cf501 |
|
BLAKE2b-256 | 243c7235d2b1b651efe50a635b966d0af3cd522d7a0bc8c3b261a3021b3fd43b |