Skip to main content

Indirect GWAS

Ruff Test package

Indirect GWAS is a Rust program for computing genome-wide association study results indirectly. Unlike traditional methods, indirect GWAS generates GWAS summary statistics for a phenotype definition using only other summary statistics. To do so, we approximate a target phenotype using phenotypes for which GWAS summary statistics are already available.

As an example, indirect GWAS allows you to compute GWAS summary statistics for phecodes using only summary statistics about ICD-10 codes.

Traditional approach:

  1. Define phenotype in terms of clinically-observed features
  2. Evaluate phenotype for every individual
  3. Perform GWAS

Indirect approach:

  1. Define phenotype in terms of features that have available GWAS summary statistics (using e.g. Pan-UKBB summary statistics)
  2. Compute GWAS summary statistics for the target using feature summary statistics as inputs

Installation

If cargo is not installed, see cargo installation.

cargo install --git https://github.com/tatonetti-lab/indirect-gwas

Usage

Indirect GWAS is a command line tool.

As an example,

igwas \
    -p projection.tsv \
    -c covariance.tsv \
    -g plink*.glm.linear \
    -o indirect_results.csv

To see a full list of parameters, run

igwas -h

Indirect GWAS takes four main arguments:

  1. Projection matrix
  2. Covariance matrix
  3. GWAS result files
  4. Output path

Each of these is a path in the filesystem.

Projection matrix

This should be a CSV/TSV file with row and column names. The first column of the first row is ignored. For example:

rowid,proj1,proj2
feat1,0.1,0.2
feat2,0.2,-0.511119

The contents of this file should give the coefficients needed to project feature phenotypes onto the projected phenotypes. In the example above, proj1 is a projection defined as 0.1 * feat1 + 0.2 * feat2. Many projections can be passed simultaneously in this file.

Covariance matrix

This should be a CSV/TSV file with row and column names. The first column of the first row is ignored. The row and column names should match, otherwise. For example:

_,feat1,feat2
feat1,0.1,0.1
feat2,0.1,0.5

The contents of this file should give the partial covariances of the feature phenotype. Partial covariance is defined as the covariance of the residuals of the phenotypes when regressed against the GWAS covariates. For example, if each GWAS regression takes the form phenotype ~ genotype + covar_1 + covar_2, you should regress phenotype ~ covar_1 + covar_2, compute the residuals, do this for every phenotype, then compute the covariance matrix of these residuals.

GWAS results

GWAS results should be formatted as CSV/TSV files. These files should contain, at minimum, columns with the following pieces of information: variant ID, coefficient estimate, standard error, and sample size. The column names may be specified with additional flags (e.g. --variant-id, --beta, etc.). The default field names correspond to the outputs of Plink linear regressions.

Output path

This should be a simple path to a single file. This file will contains GWAS summary statistics for all the projected phenotypes, combined.

Metadata

Release files for igwas 0.1.0

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

Source distribution (sdist)

Source distribution for igwas 0.1.0
File Size Uploaded
igwas-0.1.0.tar.gz 49.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for igwas 0.1.0
File Interpreter ABI Platform
igwas-0.1.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details

Total release size: 1.3 MB

Release files / igwas-0.1.0.tar.gz

Download URL igwas-0.1.0.tar.gz
Size 49.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8051b6cf907706d88519ca994f2224ed689b18eebdf04241e29efd2bafe8901a
BLAKE2b-256 checksum
How to use checksums
8eef52e4a54bcef01ecf7593b1ba6c78124f4e131ef3d6df04131d03f93a9d09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.20

Release files / igwas-0.1.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL igwas-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Size 1.3 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9f24b39f844fefdf092971ee143e0daa5094973e00c8c5e746307090146f7c40
BLAKE2b-256 checksum
How to use checksums
03324936c7abbc171b7a06a40b6c32bb52955693b2e8011548a3eccfe67cea98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.20

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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