Run PheWAS
Test selected predictors against many phenotypes with optional covariates.
PheWAS analysis, visualization, phenotype metadata, and Mendelian randomization in Python.
PYPE is a Python package for phenome-wide association studies, result visualization, variant annotation, and Mendelian randomization.
It was developed for investigator-driven analyses of biobank-scale data. Researchers can test genetic variants, risk scores, biomarkers, or other numeric predictors against many phenotypes while adjusting for covariates such as age, sex, and genetic principal components.
A phenome-wide association study, or PheWAS, tests one or more predictors against a large set of phenotypes. It is useful when the question is broad: which diseases, measurements, laboratory values, or other traits are associated with a genetic variant or phenotype of interest?
PYPE runs the predictor-outcome regressions, applies sample-size requirements, and returns the effect estimate, standard error, and p-value for each association. It also provides multiple-testing correction, phenotype metadata, and Manhattan, volcano, and category enrichment plots.
Mendelian randomization, or MR, uses genetic variants associated with an exposure as instruments to estimate the exposure's effect on an outcome. Because genetic variants are assigned before disease develops, MR can provide evidence about whether an observed relationship may be causal.
MR depends on assumptions about instrument strength, confounding, and horizontal pleiotropy. PYPE includes inverse variance weighted, MR-Egger, median, mode, and MR-PRESSO methods so results can be compared across estimators with different assumptions.
PheWAS and MR answer different questions. PheWAS is a broad screen for associations across many traits. MR is a focused follow-up that tests whether evidence is consistent with an exposure affecting an outcome.
PYPE supports both steps in one package: run a PheWAS, add phenotype descriptions and categories, inspect the results in plots, then use suitable GWAS summary statistics for MR. The methods can also be used independently.
Test selected predictors against many phenotypes with optional covariates.
Apply multiple-testing correction and examine significant associations in plots.
Attach phenotype metadata and map significant variants to nearby genes.
Harmonize exposure and outcome summary statistics and compare MR estimators.
Install PYPE and run a first PheWAS, plot, and MR analysis.
See every required dataframe and column, including gene interval files.
Review function signatures, parameters, return values, and examples.
Compare assumptions, use cases, caveats, and primary citations.
View every plot type and the options that control annotations and styling.
Rerun the public MR analyses and compare legacy and corrected IVW results.