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
sumstats-0.1.2.tar.gz
(3.5 kB
view hashes)