Tooluniverse polygenic risk score

From mims-harvard/ToolUniverse · View interactive version

Tooluniverse polygenic risk score is an AI agent skill from the GitHub repository mims-harvard/ToolUniverse. Build and interpret polygenic risk scores (PRS) for complex diseases using GWAS summary statistics. Covers PRS construction (clumping/thresholding, PRS-CS), validation in independent cohorts, ancestry-aware adjustment, and clinical interpretation (population-relative risk, not absolute prediction).

How to use this skill

Skill file

Polygenic Risk Score (PRS) Builder

Build and interpret polygenic risk scores for complex diseases using genome-wide association study (GWAS) data.

Reasoning Strategy

A polygenic risk score predicts genetic risk, not disease. A high PRS means elevated risk relative to the population — it does not mean the person will develop the condition, and a low PRS does not confer immunity. PRS performance varies dramatically across ancestries: a European-derived PRS applied to a West African population can lose 50–70% of its predictive power because the underlying GWAS was trained on European allele frequencies and LD patterns. Effect sizes from discovery GWAS are subject to winner's curse (overestimation in single studies); always prefer weights from large meta-analyses or validated PGS Catalog models. PRS should always be interpreted in the context of non-genetic risk factors — for most complex diseases, environmental factors contribute as much or more than genetics.

LOOK UP DON'T GUESS: Do not assume effect sizes, allele frequencies, or which SNPs are genome-wide significant for a trait — always query GWAS Catalog (gwas_get_associations_for_trait) for actual data. Do not assume a validated PRS model exists for a trait; check PGS Catalog via PubMed search.

Overview

Use Cases:

What This Skill Does:

What This Skill Does NOT Do:

Methodology

PRS Calculation Formula

A polygenic risk score is calculated as a weighted sum across genetic variants:

PRS = Σ (dosage_i × effect_size_i)

Where:

Standardization

Raw PRS is standardized to z-scores for interpretation:

z-score = (PRS - population_mean) / population_std

This allows comparison to population distribution and percentile calculation.

Significance Thresholds

Effect Size Handling

Data Sources

This skill uses ToolUniverse GWAS tools to query:

  1. GWAS Catalog (EMBL-EBI)
  1. Open Targets Genetics
  1. Variant Annotation
  1. PGS Catalog (pgscatalog.org, EMBL-EBI) — check this FIRST, before building anything from raw GWAS associations

Key Concepts

Polygenic Risk Scores (PRS)

Polygenic risk scores aggregate the effects of many genetic variants to estimate an individual's genetic predisposition to a trait or disease. Unlike Mendelian diseases caused by single mutations, complex diseases involve hundreds to thousands of variants, each with small effects.

Key Properties:

GWAS (Genome-Wide Association Studies)

GWAS compare allele frequencies between cases and controls (or correlate with trait values) across millions of SNPs to identify disease-associated variants.

Study Design:

Effect Sizes and Odds Ratios

Linkage Disequilibrium (LD) and Clumping

Nearby variants are often inherited together (LD). To avoid double-counting:

Population Stratification

GWAS and PRS are most accurate when ancestries match:

Applications

Clinical Risk Assessment

PRS can stratify individuals for:

Example: Khera et al. (2018) showed PRS identifies 3× more individuals at >3-fold coronary artery disease risk than monogenic mutations.

Research Applications

SNP-heritability and genetic correlation (LDSC)

Before or alongside building a PRS, quantify how much of the trait is captured by common SNPs and how traits relate — directly from GWAS summary statistics:

Both are remote tools (LD Score regression engine + reference LD-score panels). Use them to ground heritability/rg claims in data rather than citing literature point estimates.

Personal Genomics

Consumer genetic testing (23andMe, Ancestry DNA) provides raw genotypes. Users can:

Caution: Personal PRS should not replace medical advice. Results may cause anxiety if not properly contextualized.

Limitations and Considerations

Workflow

0. Check PGS Catalog Before Building From Raw GWAS

Before extracting associations and building a PRS from scratch (steps 1-5 below), check whether a validated score already exists:

PGSCatalog_search_traits(query="<trait>")            # resolve to a real trait_id
PGSCatalog_get_scores_by_trait(trait_id="<from above>")   # list candidate scores
PGSCatalog_get_score(pgs_id="<candidate>")                 # check dev-cohort ancestry
PGSCatalog_get_performance_metrics(pgs_id="<candidate>")   # check validated AUROC/OR/R2 by ancestry

If a well-validated score exists for the target population's ancestry, use its published weights (scoring_file URL) directly rather than re-deriving a cruder PRS from raw GWAS Catalog associations — this is exactly the "winner's curse" and LD-clumping problem the raw-GWAS path (steps 1-5) has to work around manually. Only fall back to building from raw associations when PGS Catalog has no score for the trait, or when every existing score was developed and evaluated in an ancestry that doesn't match the population you're scoring.

1. Trait Selection

Identify the disease or trait of interest:

2. Association Collection

Query GWAS databases for genome-wide significant associations:

prs = build_polygenic_risk_score(
    trait="coronary artery disease",
    p_threshold=5e-8,  # Genome-wide significance
    max_snps=1000
)

Considerations:

3. Effect Size Extraction

Extract beta coefficients or odds ratios:

4. SNP Filtering

Quality control filters:

5. Score Calculation

Calculate weighted sum of genotype dosages:

result = calculate_personal_prs(
    prs_weights=prs,
    genotypes=my_genotypes,
    population_mean=0.0,
    population_std=1.0
)

Genotype Sources:

6. Risk Interpretation

Convert to percentiles and risk categories:

result = interpret_prs_percentile(result)
print(f"Percentile: {result.percentile:.1f}%")
print(f"Risk: {result.risk_category}")

Risk Categories:

Clinical Interpretation:

Best Practices

Disclaimer

This skill is for educational and research purposes only.

For clinical genetic testing, consult:

PRS is a rapidly evolving field. Guidelines and best practices will continue to change as research progresses.

Regulatory Status:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.