Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Summary Statistics TSV file Validator

A file validator for validating GWAS summary statistics TSV files prior to and post harmonisation using pandas_schema. The purpose is to validate files before their conversion to HDF5.

Installation

Python package:

  • Requires python3
  • pip install ss-validate

Alternatively, use the docker image:

  • docker run ebispot/gwas-sumstats-validator ss-validate --help

Running the validator

To run the validator on a file:

  • ss-validate -f <file_to_validate.tsv> --logfile <logfile_name>

Information and errors are logged to the console and errors logged to the file specified. A console output might look like:

(INFO): Filename is good!
(INFO): Validating file...
(ERROR): Length of row 7 is: 16 instead of 15
(ERROR): Please fix the table. Some rows have different numbers of columns to the header
(INFO): Rows with different numbers of columns to the header are not validated
(ERROR): {row: 1, column: "p_value"}: "-99" was not in the range [0, 1)

The errors from the output tell us that row seven has too many columns and row one does not have a valid pvalue.

Addional options

  • --linelimit : int, default 1000

    Once this number of erroneous rows has been reached, stop looking for more.

  • --minrows : int, default 100000

    The minimum number of rows the file is required to have in order to validate sucZZcessfully.

  • --drop-bad-lines : bool, default False

    Drops the the lines with errors from the file and writes it to a new file called <file_to_validate.tsv.valid>

  • --stage : {'standard', 'harmonised', 'curated'}, default 'standard'

    The stage the file is in. It is either standard format ('standard'), harmonised ('harmonised') or pre-standard in the custom curated format ('curated'). Recommended to leave as default.

Import ss-validate to another python script

  • Install as above
  • Import and use in your python file
import ss_validate.validator as ssv

# initialise a validator object for your summary statistics and settings 
validator = ssv.Validator(file='sumstats.tsv.gz', filetype='gwas-upload', error_limit=1, logfile='logfile.log')

# validate the headers
validator.validate_headers()

# validate the squareness
validator.validate_file_squareness()

# validate the data
validator.validate_data()

Metadata

Release files for ss-validate 1.0.0.dev3

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

Source distribution (sdist)

Source distribution for ss-validate 1.0.0.dev3
File Size Uploaded Provenance Actions
ss-validate-1.0.0.dev3.tar.gz 12.7 kB Without provenance Details for ss-validate-1.0.0.dev3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ss-validate 1.0.0.dev3
File Interpreter ABI Platform Actions
ss_validate-1.0.0.dev3-py3-none-any.whl Python 3 none any Details for ss_validate-1.0.0.dev3-py3-none-any.whl

Total release size: 26.0 kB

Release files / ss-validate-1.0.0.dev3.tar.gz

Download URL ss-validate-1.0.0.dev3.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
387911efc571243589e25856a881d7a3f18f3dd09d7135c57a025d425493d1b7
BLAKE2b-256 checksum
How to use checksums
d213db3a2b26d34ec48b95af4d4b3c5bab273d3e9cb080477f599a54d9f3dfed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.28.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4

Release files / ss_validate-1.0.0.dev3-py3-none-any.whl

Download URL ss_validate-1.0.0.dev3-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0df9d3ec9bf751736ebf585c0aac23d8a2a1dfb8487902c97674adac12dbd57
BLAKE2b-256 checksum
How to use checksums
80e5596802ab65ff20d43ccc32c51e7890450d68f94c563e1b4e4e1263099796
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.28.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4

Security for ss-validate 1.0.0.dev3

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