Skip to main content

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
  • 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>

##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 has p_value combined with rsid in variant_id field or chromosome and base_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gwas_sumstats_tools-0.1.1a1.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

gwas_sumstats_tools-0.1.1a1-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file gwas_sumstats_tools-0.1.1a1.tar.gz.

File metadata

  • Download URL: gwas_sumstats_tools-0.1.1a1.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.7.4 Darwin/22.3.0

File hashes

Hashes for gwas_sumstats_tools-0.1.1a1.tar.gz
Algorithm Hash digest
SHA256 4e3a70a58746d173040fc4c183948d8f35e59b66286341cdfe822276bc033fb4
MD5 4cb8d53d20bbeb51606a2552598070ef
BLAKE2b-256 4b997452ca1dca6417ef90fa22eed2bf0acb659da9036da9256732a1df53ce48

See more details on using hashes here.

Provenance

File details

Details for the file gwas_sumstats_tools-0.1.1a1-py3-none-any.whl.

File metadata

File hashes

Hashes for gwas_sumstats_tools-0.1.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 7730c8a0dd6c8326cc1e6f5dd8e1f64cfbad2ea562062b47784afe86202a35da
MD5 1531b36a506b194a0ee6bc922046ff62
BLAKE2b-256 762668e2b6017740cd537a69c054afa81a07f0f6d4e9c384272778b6fc5149c7

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page