No project description provided
Project description
GWAS-SSF Tools
A basic toolkit for reading and formatting GWAS sumstats files from the GWAS Catalog. Built with:
There are two commands, read
and format
.
read
is for:
- Previewing a data file: no options
- Extracting the field headers:
-h
- Extracting all the metadata:
-M
- Extacting specific field, value pairs from the metada:
-m <field name>
format
is for:
- Converting a minamally formatted sumstats data file to the standard format. This is not guaranteed to return a valid standard file, because manadatory data fields could be missing in the input. It simply does the following.
-s
- Renames
variant_id
->rsid
- Reorders the fields
- Converts
NA
missing values to#NA
- It is memory efficient and will take approx. 30s per 1 million records
- Renames
- Generate metadata for a data file:
-m
- Read metadata in from existing file:
--meta-in <file>
- Create metadata from the GWAS Catalog (internal use, requires authenticated API):
-g
- Edit/add the values to the metadata:
-e
with--<FIELD>=<VALUE>
- Read metadata in from existing file:
##Usage
$ gwas-ssf [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
format
: Format a sumstats file and...read
: Read a sumstats file
gwas-ssf format
Format a sumstats file and creating a new one. Add/edit metadata.
Usage:
$ gwas-ssf format [OPTIONS] FILENAME
Arguments:
FILENAME
: Input sumstats file. Must be TSV or CSV and may be gzipped [required]
Options:
-o, --ss-out PATH
: Output sumstats file-s, --minimal2standard
: Try to convert a valid, minimally formatted file to the standard format.This assumes the file at least hasp_value
combined with rsid invariant_id
field orchromosome
andbase_pair_location
. Validity of the new file is not guaranteed because mandatory data could be missing from the original file. [default: False]-m, --generate-metadata
: Create the metadata file [default: False]--meta-out PATH
: Specify the metadata output file--meta-in PATH
: Specify a metadata file to read in-e, --meta-edit
: Enable metadata edit mode. Then provide params to edit in the--<FIELD>=<VALUE>
format e.g.--GWASID=GCST123456
to edit/add that value [default: False]-g, --meta-gwas
: Populate metadata from GWAS Catalog [default: False]-c, --custom-header-map
: Provide a custom header mapping using the--<FROM>:<TO>
format e.g.--chr:chromosome
[default: False]--help
: Show this message and exit.
gwas-ssf read
Read (preview) a sumstats file
Usage:
$ gwas-ssf read [OPTIONS] FILENAME
Arguments:
FILENAME
: Input sumstats file [required]
Options:
-h, --get-header
: Just return the headers of the file [default: False]--meta-in PATH
: Specify a metadata file to read in, defaulting to -meta.yaml-M, --get-all-metadata
: Return all metadata [default: False]-m, --get-metadata TEXT
: Get metadata for the specified fields e.g. `-m genomeAssembly -m isHarmonised--help
: Show this message and exit.
TODO:
- Installation/distribution docs
- Transformation features
- update GWAS API
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for gwas_sumstats_tools-0.1.1a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9aef3789dcb7af30a155c08bfa96450ddc6745bc043c5b7463356e108d8c719d |
|
MD5 | 410dd1365b47eed0c29b15097be30cb1 |
|
BLAKE2b-256 | 9ed42e0c85f21592a13ffa6d404e04b7d7c94e4b8f6fe7e99bb12981b47a85b3 |
Close
Hashes for gwas_sumstats_tools-0.1.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9efed8b904a4889dad4f1cbbc0cf7c7b93c73a0a6fd113cd3faf8625831da28 |
|
MD5 | 591e34e7c065a3708f9834f458db2ae7 |
|
BLAKE2b-256 | 8e1ad8bb3693af8984ef393a33e71397f6cff1214263faf7deebcd64c467da75 |