gwas-sumstats-parser
version: 0.10.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:
- 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.
- 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.
- 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.
- 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-validatororgwas-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]"
With conda, install the same two packages from conda-forge and bioconda:
conda install -c conda-forge -c bioconda rapidgzip "pysam>=0.17"
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:
- The standard column names - every name a mapping can use, what it holds and whether it can be mapped.
- Opening input files - plain, compressed and indexed input.
- Regions and filters - genomic regions, row filters, repeated sites and progress.
- Files that hold many studies - keep one study's rows from a shared file.
- Checking the genome assembly - which genome build an indexed file follows.
- Reading rows - the reader, its rows and how each value is parsed.
- Reading into a pandas data frame -
read_gwas, parsed rows and refused rows.
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.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gwas_sumstats_parser-0.10.0.tar.gz | 117.2 kB | Without provenance | Details for gwas_sumstats_parser-0.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gwas_sumstats_parser-0.10.0-py3-none-any.whl | Python 3 | none | any | Details for gwas_sumstats_parser-0.10.0-py3-none-any.whl |
Total release size: 242.1 kB
Release files / gwas_sumstats_parser-0.10.0.tar.gz
| Download URL | gwas_sumstats_parser-0.10.0.tar.gz |
|---|---|
| Size | 117.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
484d291eae8322e404b53c7cef6e80c964770d9b3dfccdb138d462867aca1882
|
|
BLAKE2b-256 checksum How to use checksums |
20904be1cd81ecd3cff153cc802b95a595e01a01d8035d0ca6821a8d15630698
|
| 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.10.0-py3-none-any.whl
| Download URL | gwas_sumstats_parser-0.10.0-py3-none-any.whl |
|---|---|
| Size | 124.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8826f199855ddd2359596770a930b940fb43b9dac3104766ea4615e1a4322c4
|
|
BLAKE2b-256 checksum How to use checksums |
f37c7fc33a5f390390048b0d0356e5219405d397d80dbce4d909f2861236a109
|
| 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.10.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.