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.
Requirements
- python3
Installation
pip install ss-validate
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 1000Once this number of erroneous rows has been reached, stop looking for more.
-
--minrows: int, default 100000The minimum number of rows the file is required to have in order to validate sucZZcessfully.
-
--drop-bad-lines: bool, default FalseDrops 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 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 0.4.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ss-validate-0.4.8.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ss_validate-0.4.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.4 kB
Release files / ss-validate-0.4.8.tar.gz
| Download URL | ss-validate-0.4.8.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8bfc5022da9325b7595cf931380dd951e7031c8abd40850e715887e31aa5c9c3
|
|
BLAKE2b-256 checksum How to use checksums |
4316795d16ca760ceb0fd4b4a01189863dec833f09af9ae39e5e1a5763b7261e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.27.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4
|
Release files / ss_validate-0.4.8-py3-none-any.whl
| Download URL | ss_validate-0.4.8-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc020c05ef953031b949030e7b90108437ad2926dbf30339db5c205f8eb38007
|
|
BLAKE2b-256 checksum How to use checksums |
09e09faff268e451403138ca9a589e95ab4be92e49f0699764c45a6aabe261ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.27.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4
|