Skip to main content

gwas-sumstats-parser

version: 0.9.0

gwas-sumstats-parser is a small Python library that reads GWAS summary-statistics flat files into a standard column vocabulary, parses and validates the values, and yields mutable scalar list rows. It is designed as the shared ingest layer for merit and gwas-norm: both consume it, neither depends on the other.

It provides:

  1. A column vocabulary. The canonical names for the quantities a summary-statistics file can carry (chromosome, position, alleles, effect size, standard error, p-value, allele frequency, sample sizes and so on). Callers explicitly map these names to source headers; aliases are not guessed.
  2. Value parsers. Chromosome naming, allele strings, missing-value tokens and numeric fields, each with a stated rule for what is accepted, what is repaired and what is rejected.
  3. Scalar list-row reading. The current reader handles directly supplied linear and ratio effects and retains probability and its negative base-ten logarithm. Sample counts can be derived from case and control counts or supplied globally. Allele frequencies can be derived from diploid allele counts or minor-allele information. Probability conversion and missing-value repair are supported, along with confidence intervals, t statistics, quantitative scores, approximate log odds and calibrated direction effects. No array bindings, pandas dependency or compiled parser are used.
  4. Explicit row failures. The base reader raises a shared error with the original value and source row. The dropping reader skips bad rows and exposes failure records and counts grouped by failing method.

What it is not

  • It is not a normalisation pipeline. Liftover, rsID mapping, variant validation, bad-row files and output formatting stay in gwas-norm.
  • It is not an analysis package. Instrument selection, Mendelian randomisation and colocalisation stay in merit.
  • It is not related to the EBI GWAS Catalog's gwas-sumstats-tools, gwas-sumstats-validator or gwas-sumstats-harmoniser, despite the shared prefix. Those tools target the GWAS Catalog's own submission format. This package targets the heterogeneous files that arrive from consortia and individual studies, and standardises them for downstream Python analysis.

There is online documentation for gwas-sumstats-parser.

Installation instructions

Installation can be via pip or conda:

Pip:

pip install gwas-sumstats-parser

Conda:

conda install -c conda-forge -c bioconda -c cfin gwas-sumstats-parser

Runtime dependencies are numpy, scipy and mpmath. The optional io extra installs rapidgzip and pysam>=0.17 for faster gzip decoding and indexed input:

pip install "gwas-sumstats-parser[io]"

The optional frame extra installs pandas and tqdm for the data frame function read_gwas (see Reading into a pandas data frame):

pip install "gwas-sumstats-parser[frame]"

Reading caller-owned streams does not require those extras or either consumer package.

Supported CPython versions are 3.11 through 3.13; development is on 3.13.

Developer install

Clone the repository and install it in editable mode with the development extras:

git clone git@gitlab.com:cfinan/gwas-sumstats-parser.git
cd gwas-sumstats-parser
python -m pip install -e ".[dev]"

Then run the tests from the repository root:

pytest tests

Next steps

The full documentation is online. Start with the TLDR, then the user guide, which has one page per subject:

What changed in each release is in the changelog.

Command endpoints

None yet. The package is a library first; command-line endpoints will be listed here when they are added.

Project documentation

For contributors: the design, plans, specifications and known issues live in the repository, under resources/agent-docs/. Start with PROJECT.md.

Metadata

Release files for gwas-sumstats-parser 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gwas-sumstats-parser 0.9.0
File Size Uploaded Provenance Actions
gwas_sumstats_parser-0.9.0.tar.gz 112.0 kB Without provenance Details for gwas_sumstats_parser-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gwas-sumstats-parser 0.9.0
File Interpreter ABI Platform Actions
gwas_sumstats_parser-0.9.0-py3-none-any.whl Python 3 none any Details for gwas_sumstats_parser-0.9.0-py3-none-any.whl

Total release size: 231.7 kB

Release files / gwas_sumstats_parser-0.9.0.tar.gz

Download URL gwas_sumstats_parser-0.9.0.tar.gz
Size 112.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cbd7720d50123e791a1f71cb88b3f66bf7b97528198951f0c50b30fd2ea7ffeb
BLAKE2b-256 checksum
How to use checksums
efaf88173c5201db178d3c9a8a83403a1f7cc9b99f274c1c4ff6aaffeec40c55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Release files / gwas_sumstats_parser-0.9.0-py3-none-any.whl

Download URL gwas_sumstats_parser-0.9.0-py3-none-any.whl
Size 119.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e96b804ae0b44204497ff5db53e78f09ad45d637b2ce805503cd70462b02d68
BLAKE2b-256 checksum
How to use checksums
4deca7fbabf36b3e7914afdcf7f1993a21e0b3b45164be88cb364195c74ad258
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Security for gwas-sumstats-parser 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page