utilities for working with GWAS summary statistics
Project description
sumstats
Utilities for working with GWAS summary statistics
This is a package on pypi so you can get it with pip install sumstats
Fine mapping
If inputs are p-values, minor allele frequency, and sample size, first calculate natural log bayes factors and then calculate the PPA's.
To set things up:
import math
import sumstats
N = <sample size>
p_values = <p_values of variants in fine-mapping region>
mafs = <minor allele frequencies of variants in fine-mapping region>
To calculate natural log bayes factors or "lnbf":
lnbfs = [sumstats.approx_lnbf(pval=p, freq=maf, sample_size=N) for p, maf in zip(p_values, mafs)]
To caluclate posterior probability of association:
normalizing_coefficient = sumstats.log_sum(lnbfs)
ppa = [math.exp(lnbf - normalizing_coefficient) for lnbf in lnbfs]
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 Distribution
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 sumstats-0.1.2.tar.gz.
File metadata
- Download URL: sumstats-0.1.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a261fd6864548cfc0ba8fb06666770d7e97f6a56c5f2d18f443b8932ff8c6ad
|
|
| MD5 |
d4de9efdd6a9d1e8e88cc0f428cd23b2
|
|
| BLAKE2b-256 |
4d29caf359a832ed857f6de3177f9c3e4c54aac1051e9991809618ff26cd5209
|
File details
Details for the file sumstats-0.1.2-py3-none-any.whl.
File metadata
- Download URL: sumstats-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47062a4bf9ed08aa176017d78df38482d71addb6f0d5e77561d169316d982f9c
|
|
| MD5 |
1776dd545435bee29e7e6109e0f76c6c
|
|
| BLAKE2b-256 |
feb5ad6a59dda22d839f4d79563b2b0770716bbb7471854fded4e7d71596d1c6
|