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.3.tar.gz (14.5 MB view details)

Uploaded Source

Built Distribution

maxgcp-0.1.3-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for maxgcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9e493d5341b1f80fab04f20cfee90a33ffc5a6ecd223560a2e1fcc4b029d2c12
MD5 552fd4bd67c076ec840ebefc2718fb20
BLAKE2b-256 60990d64041bcef4008f0dafa5bc37a2acc631e8a75ff5161e9dcfe9389ee4c6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for maxgcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e032a222660e466745a53e36ae5de3d90d7b68789ccbbbe8e01f7e6391f4e85a
MD5 5f76fcc14c30725047c685a38b37e35d
BLAKE2b-256 3718a9d9e5112f1a4adec0123bf4ff5c4e2c82549d28969108ed9d55abd31225

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