Skip to main content

Installable Python package for real-data post-GWAS preprocessing and analysis workflows.

Project description

gwas-pipeline

Python package for packaging the full GWAS tutorial workflow behind a consistent CLI and reusable step modules.

It installs a pure GWAS package with packaged step1 through step9 modules, while keeping the legacy standalone step scripts as thin compatibility wrappers.

Scope of the first version

This scaffold focuses on the minimum post-GWAS path:

  • summary statistics loading
  • configurable source-to-standard column mapping
  • variant harmonization
  • colocalization wrapper boundary
  • Mendelian randomization wrapper boundary
  • batch workflow orchestration by gene and cell type

The package is designed to keep analysis logic in Python while calling specialized external tools from adapters when needed.

R dependencies

The real colocalization and MR wrappers expect:

  • Rscript available on PATH
  • R package coloc
  • R package MendelianRandomization

Install

pip install -e .

GWAS tutorial CLI

After pip install -e ., you can run the packaged step modules through either entrypoint:

gwas-pipeline step3 --gwas /path/to/results.tsv --gff /path/to/genes.gff --output-dir /tmp/step3
python -m gwas_pipeline step8 --vcf /path/to/region.vcf.gz --region 22:1-100000 --class-file class.csv --output-dir /tmp/step8
gwas-pipeline doctor --profile plink_env

The original gwas_step*_project/*.py files remain available and now forward to the packaged modules in src/gwas_pipeline/steps/.

Runnable GWAS template

There is also a pure-Python GWAS teaching template that runs without plink, numpy, or pandas. It is intended for learning the workflow and for adapting to small tabular datasets before swapping in external tools for real production-scale GWAS.

Run the bundled demo:

python3 scripts/run_simple_gwas_template.py \
  --config examples/simple_gwas_template/config.json

The template writes:

  • gwas_results.tsv
  • candidate_hits.tsv
  • summary.txt
  • manhattan.svg
  • qq_plot.svg

Real-data preprocessing

For split cell-type eQTL files similar to the Bryois-style layout, first build standardized tables:

python scripts/build_standardized_eqtl.py \
  --eqtl-root /home/y413109/project/eqtl \
  --snp-map /home/y413109/project/eqtl/snp_pos.txt \
  --output /home/y413109/project/eqtl/standardized/brain_eqtl_standardized.tsv.gz

python scripts/build_standardized_gwas.py \
  --gwas /home/y413109/project/eqtl/gwas/summary_stats_AD_mapped \
  --output /home/y413109/project/eqtl/standardized/ad_gwas_standardized.tsv.gz

Then point examples/run_real_postgwas.yaml at those standardized outputs.

Real input expectations

The package standardizes input columns into this internal schema:

  • chrom
  • position
  • effect_allele
  • other_allele
  • beta
  • se
  • p_value
  • gene_id for eQTL only
  • cell_type for eQTL only
  • maf optional today, reserved for future coloc improvements

Use inputs.eqtl.columns and inputs.gwas.columns in YAML to map your real source column names onto those standard names.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gwas_postgwas_tools-0.1.1.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gwas_postgwas_tools-0.1.1-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file gwas_postgwas_tools-0.1.1.tar.gz.

File metadata

  • Download URL: gwas_postgwas_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for gwas_postgwas_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7b36432a80061e7a9fd588bb1f52ad0bafdf30659c62d6a77256032a8cef84b9
MD5 c634ddb4f22f94dc9ceadaee4d1d5ad9
BLAKE2b-256 79e22f475ab0391eb50fdf0e8d393947b136ee4fc5b455dc9d99c4a4ca089b1f

See more details on using hashes here.

File details

Details for the file gwas_postgwas_tools-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gwas_postgwas_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1a6ae1b8080e8e601b30365969e1d82d0dccd756a449efceddbff6cab3d122a
MD5 844b78b26697ba2300d25ace9708589b
BLAKE2b-256 b9c7673a3f09afeae20a2345be13ffc7132358e55ff2ce97759021147c78ca23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page