Python API reference

PostHoc’s CLI commands are thin wrappers around a regular importable Python package. Every function and class documented here is available under the posthoc namespace and can be used directly in scripts or notebooks — for example, to run a custom analysis loop around posthoc.attribution .pal.compute_pal() without going through the command-line interface.

Package overview

Module

Contents

posthoc.io

Genotype (.pgen/.pvar/.psam), phenotype, and covariate readers; .glm/PAL TSV writers.

posthoc.qc

MAF, missingness, and LD-pruning filters.

posthoc.models

The MLP model, its training loop, and shared training utilities.

posthoc.attribution

Integrated Gradients attribution, PAL/AMAS aggregation, and null-model significance testing.

posthoc.simulation

The additive/dominant/recessive/interaction phenotype simulation model.

posthoc.commands

The Click command implementations documented in Command-line reference — thin orchestration over the modules above.