PIGEAN is the package-owned runtime for gene-set enrichment from GWAS, exomes, positive controls, and case/control burden counts. The active entrypoints are:
PYTHONPATH=src python -m pigeanPYTHONPATH=src python -m eaggl
PIGEAN is the trait-to-gene and trait-to-gene-set inference layer.
- At a high level, it combines direct human-genetic evidence with indirect support from shared gene annotations or gene sets.
- Its main outputs are:
- gene-level support scores
- gene-set regression effects
- optional downstream phenotype-resolved summaries
- The mathematical writeup is in:
docs/methods.tex
EAGGL is the latent-mechanism layer that follows PIGEAN.
- At a high level, it factorizes the weighted gene-by-annotation structure into a smaller number of latent mechanisms.
- It then annotates those factors with genes, gene sets, canonical trait linkage summaries, and optionally expert factor-level phenotype enrichment.
- The mathematical writeup is in:
docs/eaggl/methods.tex
If you want to run the code:
- Start with
docs/PIGEAN_CLI_REFERENCE.mdfor PIGEAN ordocs/eaggl/CLI_REFERENCE.mdfor EAGGL. - Then use the minimal setup and example commands in
README.mdbelow.
If you want to follow the paper or understand the scientific method:
- Read
docs/methods.texfor PIGEAN anddocs/eaggl/methods.texfor EAGGL. - Then use
docs/pigean/METHODS_TO_CODE.mdto map methods-level concepts onto the owning modules.
If you want to modify the implementation:
- Start with the architecture summary in this
README.md. - Then read
docs/pigean/README.md,docs/eaggl/README.md, anddocs/CANONICAL_SOURCE.md. - Use
docs/pigean/METHODS_TO_CODE.mdwhen you need to connect a methods section to the current code owner.
The current code layout is:
src/: active PIGEAN and EAGGL implementationlegacy/: frozen historical scriptsconfig/profiles/: reusable config profilesscripts/: fetch/build/release helperscatalog/: bundle catalogsdocs/: user, architecture, release, and interoperability docstests/: unit, regression, and bundled-fixture coverage
Use this as the index for the repo documentation set.
README.md: project entrypoint, architecture summary, test tiers, and documentation indexdocs/PIGEAN_CLI_REFERENCE.md: human-written manual for how to run PIGEANdocs/GIBBS_STOPPING.md: outer-Gibbs iteration, precision-stopping, and optional stall/restart controlsdocs/PIGEAN_DASHBOARD.md: post-processing dashboard for existing PIGEAN/EAGGL outputsdocs/PIGEAN_PORTAL.md: thresholded SQLite + served viewers — Explorer (one run) and Comparer (two runs) — for existing PIGEAN outputsdocs/eaggl/CLI_REFERENCE.md: human-written manual for how to run EAGGLdocs/CLI_OPTIONS.md: machine-generated exhaustive PIGEAN CLI inventorydocs/eaggl/CLI_OPTIONS.md: machine-generated exhaustive EAGGL CLI inventory
docs/methods.tex: primary PIGEAN methods writeupdocs/eaggl/methods.tex: primary EAGGL methods writeupdocs/pigean/METHODS_TO_CODE.md: developer map from methods-level concepts to owning code modules
docs/ADVANCED_SET_B.md: supported advanced PIGEAN workflows, especially precomputed inputs and PheWAS-related pathsdocs/EAGGL_INTEROP.md: PIGEAN to EAGGL handoff bundle workflowdocs/eaggl/INTEROP.md: EAGGL-specific interoperability notesdocs/eaggl/WORKFLOWS.md: human-written EAGGL workflow guidedocs/eaggl/LABELING.md: how optional EAGGL labeling works and why it remains integrated intofactordocs/pigean/README.md: focused PIGEAN package notes for developers working insidesrc/pigean/docs/eaggl/README.md: focused EAGGL package notes for developers working insidesrc/eaggl/
docs/CANONICAL_SOURCE.md: canonical source-of-truth and active package architecturedocs/LEGACY_RETIREMENT_REPORT.md: summary of the legacy-runtime retirement workdocs/eaggl/TRANSITION.md: EAGGL transition and package-ownership notesdocs/eaggl/SHARED_CODE.md: how EAGGL shares code with the main repo instead of maintaining a separate duplicated corelegacy/README.md: what remains in the frozen legacy area and how it should be interpreted
docs/REPO_BOOTSTRAP.md: repository setup and bundle bootstrap stepsdocs/BUNDLES.md: bundle structure and handlingdocs/CONFIGS.md: config-profile structure and usagedocs/RELEASE_CHECKLIST.md: PIGEAN release checklistdocs/RELEASE_STATUS.md: PIGEAN release-status tracking notesdocs/eaggl/RELEASE_CHECKLIST.md: EAGGL release checklistdocs/eaggl/RELEASE_STATUS.md: EAGGL release-status tracking notesdocs/STITCHED_ARTIFACTS.md: optional stitched single-file artifact generation
docs/KNOWN_LIMITATIONS.md: known PIGEAN limitationsdocs/eaggl/KNOWN_LIMITATIONS.md: known EAGGL limitations
config/profiles/README.md: profile layout and usage conventionstests/data/t2d_smoke/README.md: bundled toy/validation T2D fixtures used in repo teststests/data/reference/eaggl_factor_workflow_effective_config/README.md: reference effective-config fixture used by EAGGL tests
Minimal setup:
- Use the repo-tracked model bundle under
bundles/model_large-2026.02.22/data/, or install an alternate bundle and override the paths on the command line. - Run commands from the repository root so the default profile paths resolve correctly.
- Use
docs/PIGEAN_CLI_REFERENCE.mdfor actual command shapes and workflow-specific flags.
Minimal example:
GENE_CSV=$(awk 'NF && $1 !~ /^#/ {print $1}' data/mody.gene.list | awk '!seen[$1]++' | paste -sd ',' -)
PYTHONPATH=src python -m pigean gibbs \
--config config/profiles/gene_list.default.json \
--gene-list "$GENE_CSV" \
--gene-stats-out results/MODY.gene_stats.out.gz \
--gene-set-stats-out results/MODY.gene_set_stats.out.gz \
--params-out results/MODY.params.out.gzFor the practical run manual, use:
docs/PIGEAN_CLI_REFERENCE.md
For the exhaustive generated parser surface, use:
docs/CLI_OPTIONS.mddocs/cli_option_manifest.json
Two bundled T2D fixture tiers are available for repo-tracked testing:
- Toy tier:
- inputs live under
tests/data/t2d_smoke/ - includes compact GWAS + exomes + MODY positive controls + synthetic case/control counts
- uses
tests/data/t2d_smoke/gene_set_list_mouse_t2d_toy.txt - intended for quick regression coverage of mixed input parsing and staged Y assembly
- inputs live under
- Validation tier:
- uses the same compact bundled GWAS fixture
- uses the real mouse gene-set file from the model bundle,
bundles/model_large-2026.02.22/data/gene_set_list_mouse_2024.txt, when present - intended for slower but more faithful gene-set validation without the toy QC-filter override
Run the toy tier:
cd pigean
PYTHONPATH=src ../../.venv/bin/python -m pytest \
tests/test_t2d_toy_bundle_inputs_unittest.pyRun the validation tier:
cd pigean
PYTHONPATH=src ../../.venv/bin/python -m pytest \
tests/test_t2d_validation_bundle_inputs_unittest.py \
tests/test_huge_real_gwas_regression_unittest.pyRun the broader focused slice covering bundled fixtures plus MODY/CLI paths:
cd pigean
PYTHONPATH=src ../../.venv/bin/python -m pytest \
tests/test_t2d_toy_bundle_inputs_unittest.py \
tests/test_t2d_validation_bundle_inputs_unittest.py \
tests/test_huge_real_gwas_regression_unittest.py \
tests/test_mody_core_modes_regression_unittest.py \
tests/test_mody_gibbs_regression_unittest.py \
tests/test_pigean_cli_unittest.pyCurrent architecture:
- Both flat legacy runtime files have been retired; the package-owned
python -m pigeanandpython -m eagglentrypoints are canonical. src/pigean/app.pyandsrc/eaggl/app.pyare the package-owned runtime entry modulessrc/pigean/dispatch.py,src/pigean/pipeline.py,src/pigean/gibbs.py,src/pigean/huge.py, andsrc/pigean/model.pyown the stage-level PIGEAN flowsrc/eaggl/dispatch.py,src/eaggl/factor.py,src/eaggl/phewas.py,src/eaggl/regression.py, andsrc/eaggl/io.pyown the stage-level EAGGL flowsrc/pigean/main_support.pyandsrc/eaggl/main_support.pyare narrow package-owned support layers for entry/runtime wiringsrc/pigean/state.pyandsrc/eaggl/state.pyare the remaining deep runtime-coupled modules and the canonical deep engines; further splitting should be seam-drivensrc/pigean/state.pyis organized around:PhewasLabelStateGeneSetRegressionStateGeneSignalHugeStateModelSummaryState
src/eaggl/state.pyis organized around:PhewasPhenoStateGeneSetRegressionStateGeneSignalHugeStateFactorModelState
src/pegs_utils.pyis no longer the catch-all owner for shared runtime behavior and continues to shrink toward a narrow transitional shim