Skip to main content

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


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)

Uploaded Source

Built Distribution

sumstats-0.1.2-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

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