PYPE

Input and output formats

Phenotype dataframe

Rows represent samples. Columns contain outcomes and covariates.

PartRequirement
IndexMust match the predictor dataframe index exactly.
OutcomesNumeric columns named in the outcomes argument.
CovariatesOptional numeric columns named in the covariates argument.
Missing valuesAllowed. 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 typeExample
Genotype dosage0, 1, and 2 effect-allele copies.
PhenotypeA biomarker or derived measurement.
ScoreA polygenic score or model prediction.

PheWAS result dataframe

ColumnDescription
outcomeOutcome phenotype name.
predictorPredictor name.
sample_countComplete-case sample count.
total_sample_countTotal aligned input sample count.
negative_log10_pvalueNegative base-10 logarithm of the regression p-value.
pvalueRegression p-value.
betaPredictor coefficient.
standard_errorCoefficient standard error.

Phenotype metadata

Metadata provides labels and plotting groups. It may be a dataframe or a CSV/TSV path.

ColumnRequiredDescription
outcomeYesIdentifier matching the PheWAS result.
categoryYesGroup used on Manhattan and enrichment plots.
descriptionOptionalReadable label used for annotations.

MR summary statistics

ColumnRequiredDescription
variant_idYesVariant identifier.
chromosomeYesChromosome. X and Y are accepted.
effect_alleleYesAllele associated with beta.
other_alleleRecommendedOther allele used during harmonization.
betaYesEffect estimate.
standard_errorYesEffect standard error.
pvalueYesAssociation p-value.
sample_sizeOptionalSample 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

ColumnDescription
methodMR estimator name.
exposureExposure label supplied to the analysis.
outcomeOutcome label supplied to the analysis.
pvalueEstimator p-value.
betaEstimated exposure-outcome effect.
standard_errorEstimator standard error.
variant_countNumber 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.

ColumnDescription
chromosomeChromosome, such as chr1.
startGene coding start coordinate.
endGene coding end coordinate.
geneGene 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.