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]
Release files for sumstats 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sumstats-0.1.2.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sumstats-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / sumstats-0.1.2.tar.gz
| Download URL | sumstats-0.1.2.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a261fd6864548cfc0ba8fb06666770d7e97f6a56c5f2d18f443b8932ff8c6ad
|
|
BLAKE2b-256 checksum How to use checksums |
4d29caf359a832ed857f6de3177f9c3e4c54aac1051e9991809618ff26cd5209
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.10
|
Release files / sumstats-0.1.2-py3-none-any.whl
| Download URL | sumstats-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47062a4bf9ed08aa176017d78df38482d71addb6f0d5e77561d169316d982f9c
|
|
BLAKE2b-256 checksum How to use checksums |
feb5ad6a59dda22d839f4d79563b2b0770716bbb7471854fded4e7d71596d1c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.10
|