Input and output formats
Phenotype dataframe
Rows represent samples. Columns contain outcomes and covariates.
| Part | Requirement |
| Index | Must match the predictor dataframe index exactly. |
| Outcomes | Numeric columns named in the outcomes argument. |
| Covariates | Optional numeric columns named in the covariates argument. |
| Missing values | Allowed. Each regression uses its own complete-case subset. |
sample_id trait_a trait_b age sex
S001 1.2 0 50 1
S002 2.0 1 61 0
S003 1.5 0 47 1
Predictor dataframe
Rows use the same sample index as the phenotype dataframe. Each column is tested independently against every selected outcome.
| Predictor type | Example |
| Genotype dosage | 0, 1, and 2 effect-allele copies. |
| Phenotype | A biomarker or derived measurement. |
| Score | A polygenic score or model prediction. |
PheWAS result dataframe
| Column | Description |
outcome | Outcome phenotype name. |
predictor | Predictor name. |
sample_count | Complete-case sample count. |
total_sample_count | Total aligned input sample count. |
negative_log10_pvalue | Negative base-10 logarithm of the regression p-value. |
pvalue | Regression p-value. |
beta | Predictor coefficient. |
standard_error | Coefficient standard error. |
Metadata provides labels and plotting groups. It may be a dataframe or a CSV/TSV path.
| Column | Required | Description |
outcome | Yes | Identifier matching the PheWAS result. |
category | Yes | Group used on Manhattan and enrichment plots. |
description | Optional | Readable label used for annotations. |
MR summary statistics
| Column | Required | Description |
variant_id | Yes | Variant identifier. |
chromosome | Yes | Chromosome. X and Y are accepted. |
effect_allele | Yes | Allele associated with beta. |
other_allele | Recommended | Other allele used during harmonization. |
beta | Yes | Effect estimate. |
standard_error | Yes | Effect standard error. |
pvalue | Yes | Association p-value. |
sample_size | Optional | Sample size used to resolve duplicate variant rows. |
variant_id chromosome effect_allele other_allele beta standard_error pvalue
rs100001 1 A G 0.12 0.03 2e-8
rs100002 2 C T -0.08 0.02 4e-9
MR result dataframe
| Column | Description |
method | MR estimator name. |
exposure | Exposure label supplied to the analysis. |
outcome | Outcome label supplied to the analysis. |
pvalue | Estimator p-value. |
beta | Estimated exposure-outcome effect. |
standard_error | Estimator standard error. |
variant_count | Number of variants used by the estimator. |
Gene interval file
annotate_genes accepts a tab-separated interval table. The variant and gene coordinates must use the same genome assembly.
| Column | Description |
chromosome | Chromosome, such as chr1. |
start | Gene coding start coordinate. |
end | Gene coding end coordinate. |
gene | Gene symbol. |
Rename source columns to this schema before calling PYPE. Choose GRCh37/hg19 or GRCh38 to match the variant coordinates.
Plot outputs
Plot functions write PNG, SVG, PDF, or other Matplotlib-supported image formats based on the output suffix. Manhattan and volcano calls also write tab-separated significant-result files beside the image.