Skip to main content

Optimized phenotype definitions boost GWAS power

Project description

Maximum genetic component phenotyping

Ruff image image image Actions status

Maximum genetic component phenotyping. Optimized phenotype definitions boost GWAS power.

maxgcp is a Python package that implements maximum genetic component phenotyping (MaxGCP), a method that optimizes a linear phenotype definition to maximize its heritability and genetic correlation with a trait of interest. In short, this method results in a phenotype definition that is, close to the genetic component of the trait of interest, on the individual level. This phenotype definition can be used in various applications, including enhancement of statistical power in genome-wide association studies (GWAS). maxgcp requires only estimates of genetic and phenotypic covariances, which can be obtained from GWAS summary statistics.

Usage

import maxgcp
import numpy as np

# Genetic covariances between target and feature phenotypes
genetic_cov_vec = np.array([0.5, 0.75, 0.25])
phenotypic_cov_mat = np.array([
    [0.5, 0.25, 0.1],
    [0.25, 0.3, 0.05],
    [0.1, 0.05, 0.6],
])

# Compute the MaxGCP phenotype (defined by these weights)
w = maxgcp.fit_coheritability(genetic_cov_vec, phenotypic_cov_mat)

# Evaluate MaxGCP at the individual level
feature_phenotypes = np.array([
    [1, 0, 0],
    [0, 0, 1],
    [1, 1, 1],
    [0, 0, 0],
])
maxgcp_phenotypes = feature_phenotypes @ w

# Show the results
>>> maxgcp_phenotypes
array([-0.34242555,  0.18438299,  1.87895044,  0.        ])

MaxGCP fits a phenotype (y) to a target (z) to maximize coheritability between y and z. This package can also fit a maximally heritable phenotype maxgcp.fit_heritability or a maximally genetically correlated phenotype (maxgcp.fit_genetic_correlation.

Installation

pip install maxgcp

maxgcp depends on NumPy, SciPy, and pandas.

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

maxgcp-0.1.5.tar.gz (5.2 MB view details)

Uploaded Source

Built Distribution

maxgcp-0.1.5-py3-none-any.whl (5.9 MB view details)

Uploaded Python 3

File details

Details for the file maxgcp-0.1.5.tar.gz.

File metadata

  • Download URL: maxgcp-0.1.5.tar.gz
  • Upload date:
  • Size: 5.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.20

File hashes

Hashes for maxgcp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 46753114ace843262f007308e4f4d44d7eb94c96d9879f2df045d9bbe466c262
MD5 dd25164d1dc9f05b2dd41eaa6cc36148
BLAKE2b-256 e4b5666809f81cd462b31e92fec2bf09883252c196a2d07ad5f71950ea326383

See more details on using hashes here.

File details

Details for the file maxgcp-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: maxgcp-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.20

File hashes

Hashes for maxgcp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c0c589326708d65747a4847cb72b044989d3ddb0bb0f6ce5c9da7bc5212e02
MD5 8c9fdc7e69af2d2e974941ce012babb0
BLAKE2b-256 409d0c3e484365f9dd6581715f0977290909870187c91f65e24f083eedca283e

See more details on using hashes here.

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