tooluniverse-polygenic-risk-score

Build and interpret polygenic risk scores (PRS) for complex diseases using GWAS summary statistics. Calculates genetic risk profiles, interprets PRS percentiles, and assesses disease predisposition across conditions including type 2 diabetes, coronary artery disease, and Alzheimer's disease. Use when asked to calculate polygenic risk scores, interpret genetic risk for complex diseases, build custom PRS from GWAS data, or answer questions like "What is my genetic predisposition to breast cancer?"

1,802 stars

Best use case

tooluniverse-polygenic-risk-score is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Build and interpret polygenic risk scores (PRS) for complex diseases using GWAS summary statistics. Calculates genetic risk profiles, interprets PRS percentiles, and assesses disease predisposition across conditions including type 2 diabetes, coronary artery disease, and Alzheimer's disease. Use when asked to calculate polygenic risk scores, interpret genetic risk for complex diseases, build custom PRS from GWAS data, or answer questions like "What is my genetic predisposition to breast cancer?"

Teams using tooluniverse-polygenic-risk-score should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/tooluniverse-polygenic-risk-score/SKILL.md --create-dirs "https://raw.githubusercontent.com/FreedomIntelligence/OpenClaw-Medical-Skills/main/skills/tooluniverse-polygenic-risk-score/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/tooluniverse-polygenic-risk-score/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How tooluniverse-polygenic-risk-score Compares

Feature / Agenttooluniverse-polygenic-risk-scoreStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Build and interpret polygenic risk scores (PRS) for complex diseases using GWAS summary statistics. Calculates genetic risk profiles, interprets PRS percentiles, and assesses disease predisposition across conditions including type 2 diabetes, coronary artery disease, and Alzheimer's disease. Use when asked to calculate polygenic risk scores, interpret genetic risk for complex diseases, build custom PRS from GWAS data, or answer questions like "What is my genetic predisposition to breast cancer?"

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Polygenic Risk Score (PRS) Builder

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

## Overview

**Use Cases:**
- "Calculate my genetic risk for type 2 diabetes"
- "Build a polygenic risk score for coronary artery disease"
- "What's my genetic predisposition to Alzheimer's disease?"
- "Interpret my PRS percentile for breast cancer risk"

**What This Skill Does:**
- Extracts genome-wide significant variants (p < 5e-8) from GWAS Catalog
- Builds weighted PRS models using effect sizes (beta coefficients)
- Calculates individual risk scores from genotype data
- Interprets PRS as population percentiles and risk categories

**What This Skill Does NOT Do:**
- Diagnose disease (PRS is probabilistic, not deterministic)
- Replace clinical assessment or genetic counseling
- Account for non-genetic factors (lifestyle, environment)
- Provide treatment recommendations

## Methodology

### PRS Calculation Formula

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

```
PRS = Σ (dosage_i × effect_size_i)
```

Where:
- **dosage_i**: Number of effect alleles at SNP i (0, 1, or 2)
- **effect_size_i**: Beta coefficient or log(odds ratio) from GWAS

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

- **Genome-wide significance**: p < 5×10⁻⁸ (default threshold)
- This corrects for ~1 million independent tests across the genome
- Relaxed thresholds (e.g., p < 1×10⁻⁵) can include more SNPs but may add noise

### Effect Size Handling

- **Continuous traits** (e.g., height, BMI): Beta coefficient (units of trait per allele)
- **Binary traits** (e.g., disease): Odds ratio converted to log-odds (beta = ln(OR))
- Missing effect sizes or non-significant SNPs are excluded

## Data Sources

This skill uses ToolUniverse GWAS tools to query:

1. **GWAS Catalog** (EMBL-EBI)
   - Curated GWAS associations
   - 5000+ studies, millions of variants
   - Tools: `gwas_get_associations_for_trait`, `gwas_get_snp_by_id`

2. **Open Targets Genetics**
   - Integrated genetics platform
   - Fine-mapped credible sets
   - Tools: `OpenTargets_search_gwas_studies_by_disease`, `OpenTargets_get_variant_info`

## 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:**
- **Continuous distribution**: PRS forms a bell curve in populations
- **Relative risk**: Compares individual to population average
- **Probabilistic**: High PRS doesn't guarantee disease, low PRS doesn't guarantee protection
- **Ancestry-specific**: PRS accuracy depends on matching GWAS and target ancestry

### 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:**
- **Discovery cohort**: Initial identification of associations
- **Replication cohort**: Validation in independent samples
- **Sample size**: Larger studies detect smaller effects (power ∝ √N)
- **Multiple testing correction**: Bonferroni-type correction for ~1M tests

### Effect Sizes and Odds Ratios

- **Beta (β)**: Change in trait per copy of effect allele
  - Example: β = 0.5 kg/m² means each allele increases BMI by 0.5 units
- **Odds Ratio (OR)**: Multiplicative change in disease odds
  - OR = 1.5 means 50% increased odds per allele
  - Convert to beta: β = ln(OR)

### Linkage Disequilibrium (LD) and Clumping

Nearby variants are often inherited together (LD). To avoid double-counting:
- **LD clumping**: Select independent variants (r² < 0.1 within 1 Mb windows)
- **Fine-mapping**: Statistical methods to identify causal variants
- This skill uses raw associations; production PRS should include LD pruning

### Population Stratification

GWAS and PRS are most accurate when ancestries match:
- **Population structure**: Different ancestries have different allele frequencies
- **Transferability**: European-trained PRS perform worse in non-European populations
- **Solution**: Train PRS on diverse cohorts or use ancestry-matched references

## Applications

### Clinical Risk Assessment

PRS can stratify individuals for:
- **Screening programs**: Target high-risk individuals (e.g., mammography, colonoscopy)
- **Prevention strategies**: Lifestyle interventions for high genetic risk
- **Drug response**: Pharmacogenomics based on metabolism genes

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

### Research Applications

- **Gene discovery**: PRS-based phenome-wide association studies (PheWAS)
- **Genetic correlation**: Compare PRS across traits
- **Causal inference**: Mendelian randomization using PRS as instruments
- **Simulation studies**: Model polygenic architecture

### Personal Genomics

Consumer genetic testing (23andMe, Ancestry DNA) provides raw genotypes. Users can:
- Calculate PRS for traits not reported
- Compare to published PRS models
- Understand genetic contribution vs. lifestyle factors

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

## Limitations and Considerations

### Scientific Limitations

1. **Heritability Gap**: PRS explains a fraction of genetic heritability
   - Type 2 diabetes: ~50% heritable, PRS explains ~10-20%
   - Rare variants, epistasis, and gene-environment interactions not captured

2. **Ancestry Bias**: Most GWAS are European ancestry
   - PRS accuracy drops in non-European populations
   - Need for diverse cohort recruitment

3. **Winner's Curse**: Discovery effect sizes often overestimated
   - Replication studies show smaller effects
   - Meta-analyses provide better estimates

4. **Missing Heritability**: Unexplained genetic contribution from:
   - Rare variants not captured by SNP arrays
   - Structural variants (CNVs, inversions)
   - Epigenetic factors

### Clinical Limitations

1. **Not Diagnostic**: PRS is probabilistic, not deterministic
   - High PRS doesn't mean you will get disease
   - Low PRS doesn't mean you won't get disease

2. **Environmental Factors**: Many complex diseases are 50%+ environmental
   - Smoking, diet, exercise, stress, pollution
   - PRS doesn't account for these

3. **Pleiotropy**: Same variants affect multiple traits
   - Genetic correlation between diseases
   - Risk for one may protect against another

4. **Actionability**: Not all high-risk predictions have interventions
   - Alzheimer's PRS has limited actionability currently
   - Ethical considerations for testing

### Ethical Considerations

1. **Privacy**: Genetic data is identifiable and permanent
   - Can't be changed like passwords
   - Familial implications (relatives share genetics)

2. **Discrimination**: Potential for genetic discrimination
   - GINA protects against health/employment discrimination (US)
   - Life insurance and long-term care not protected

3. **Psychological Impact**: Knowledge of high risk can cause anxiety
   - Need for genetic counseling
   - Risk communication training

4. **Equity**: Ancestry bias means unequal benefits
   - Europeans benefit most from current PRS
   - Exacerbates health disparities

## References

### Key Publications

1. **Lambert et al. (2021)**: "The Polygenic Score Catalog as an open database for reproducibility and systematic evaluation"
   - PGS Catalog: https://www.pgscatalog.org/
   - Repository of published PRS models

2. **Khera et al. (2018)**: "Genome-wide polygenic scores for common diseases identify individuals with risk equivalent to monogenic mutations"
   - Nature Genetics, 50:1219–1224
   - Demonstrated clinical utility of PRS

3. **Torkamani et al. (2018)**: "The personal and clinical utility of polygenic risk scores"
   - Nature Reviews Genetics, 19:581–590
   - Comprehensive review of PRS applications

4. **Martin et al. (2019)**: "Clinical use of current polygenic risk scores may exacerbate health disparities"
   - Nature Genetics, 51:584–591
   - Addresses ancestry bias and equity concerns

5. **Choi et al. (2020)**: "Tutorial: a guide to performing polygenic risk score analyses"
   - Nature Protocols, 15:2759–2772
   - Practical guide to PRS calculation and evaluation

### Resources

- **PGS Catalog**: https://www.pgscatalog.org/ - Published PRS models
- **LD Hub**: http://ldsc.broadinstitute.org/ - Genetic correlations
- **PRSice**: https://www.prsice.info/ - PRS calculation software
- **GWAS Catalog**: https://www.ebi.ac.uk/gwas/ - Association database

## Workflow

### 1. Trait Selection

Identify the disease or trait of interest:
- Use standard terminology (e.g., "type 2 diabetes" not "T2D")
- Check GWAS Catalog for availability
- Verify sufficient GWAS studies exist (n > 10,000 samples ideal)

### 2. Association Collection

Query GWAS databases for genome-wide significant associations:
```python
prs = build_polygenic_risk_score(
    trait="coronary artery disease",
    p_threshold=5e-8,  # Genome-wide significance
    max_snps=1000
)
```

**Considerations:**
- P-value threshold: 5e-8 is conservative, 1e-5 includes more variants
- LD clumping: Production systems should prune correlated SNPs
- Study quality: Prefer large meta-analyses over small studies

### 3. Effect Size Extraction

Extract beta coefficients or odds ratios:
- Beta for continuous traits (direct use)
- OR for binary traits (convert to log-odds)
- Handle missing values (exclude or impute from meta-analysis)

### 4. SNP Filtering

Quality control filters:
- **MAF filter**: Exclude rare variants (MAF < 0.01) for robustness
- **Genotype QC**: Remove SNPs with high missingness (> 10%)
- **Hardy-Weinberg**: Exclude SNPs violating HWE (p < 1e-6)
- **Ambiguous SNPs**: Remove A/T and G/C SNPs (strand ambiguity)

### 5. Score Calculation

Calculate weighted sum of genotype dosages:
```python
result = calculate_personal_prs(
    prs_weights=prs,
    genotypes=my_genotypes,
    population_mean=0.0,
    population_std=1.0
)
```

**Genotype Sources:**
- 23andMe raw data export
- Ancestry DNA raw data
- Whole genome sequencing (VCF files)
- SNP array data (Illumina, Affymetrix)

### 6. Risk Interpretation

Convert to percentiles and risk categories:
```python
result = interpret_prs_percentile(result)
print(f"Percentile: {result.percentile:.1f}%")
print(f"Risk: {result.risk_category}")
```

**Risk Categories:**
- **Low risk**: < 20th percentile (genetic protection)
- **Average risk**: 20-80th percentile (typical genetic predisposition)
- **Elevated risk**: 80-95th percentile (moderately increased risk)
- **High risk**: > 95th percentile (substantially increased risk)

**Clinical Interpretation:**
- Percentiles assume normal distribution
- Relative risk vs. average (not absolute risk)
- Combine with family history, clinical risk factors
- PRS is NOT diagnostic - many high-risk individuals never develop disease

## Best Practices

### PRS Construction

1. **Use validated PRS from PGS Catalog** when available
   - Published models have been externally validated
   - Include LD clumping and ancestry-specific weights

2. **Match ancestries** between GWAS and target population
   - European GWAS for European individuals
   - Use multi-ancestry GWAS when available

3. **Include as many SNPs as practical**
   - More SNPs = better prediction (up to a point)
   - Balance between coverage and genotyping cost

4. **Consider trait architecture**
   - Highly polygenic traits (height, education): benefit from relaxed thresholds
   - Oligogenic traits (IBD, T1D): few large-effect variants, strict thresholds

### Clinical Use

1. **Combine with clinical risk scores**
   - Add PRS to Framingham Risk Score, QRISK, etc.
   - Integrated models improve prediction

2. **Stratify screening and prevention**
   - Intensify surveillance for high PRS (e.g., earlier mammography)
   - Lifestyle interventions for modifiable risk

3. **Provide genetic counseling**
   - Explain probabilistic nature of PRS
   - Discuss limitations and uncertainty
   - Address psychological impact

4. **Consider actionability**
   - Is there an intervention for high risk?
   - Benefits vs. harms of knowing genetic risk

### Research Use

1. **Report methods transparently**
   - Document SNP selection criteria
   - Report LD clumping parameters
   - Specify ancestry of GWAS and target

2. **Validate in held-out cohorts**
   - Split data: training vs. testing
   - Report out-of-sample prediction accuracy (R², AUC)

3. **Compare to existing PRS**
   - Benchmark against PGS Catalog models
   - Report incremental improvement

4. **Test across ancestries**
   - Evaluate transferability to non-European populations
   - Report performance stratified by ancestry

## Disclaimer

**This skill is for educational and research purposes only.**

- **Not for clinical diagnosis or treatment decisions**
- **Not validated for clinical use** - use PGS Catalog models for clinical-grade PRS
- **Requires genetic counseling** - interpretation requires expertise
- **Does not account for family history, environment, or lifestyle factors**
- **Ancestry-specific** - accuracy depends on matching GWAS ancestry

**For clinical genetic testing, consult:**
- Genetic counselors (certified by ABGC/ABMGG)
- Medical geneticists
- Healthcare providers with genomics training

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

**Regulatory Status:**
- FDA does not currently regulate PRS (as of 2024)
- Some countries restrict direct-to-consumer genetic risk reporting
- Check local regulations before clinical implementation

Related Skills

tooluniverse-variant-interpretation

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Systematic clinical variant interpretation from raw variant calls to ACMG-classified recommendations with structural impact analysis. Aggregates evidence from ClinVar, gnomAD, CIViC, UniProt, and PDB across ACMG criteria. Produces pathogenicity scores (0-100), clinical recommendations, and treatment implications. Use when interpreting genetic variants, classifying variants of uncertain significance (VUS), performing ACMG variant classification, or translating variant calls to clinical actionability.

tooluniverse-variant-analysis

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Production-ready VCF processing, variant annotation, mutation analysis, and structural variant (SV/CNV) interpretation for bioinformatics questions. Parses VCF files (streaming, large files), classifies mutation types (missense, nonsense, synonymous, frameshift, splice, intronic, intergenic) and structural variants (deletions, duplications, inversions, translocations), applies VAF/depth/quality/consequence filters, annotates with ClinVar/dbSNP/gnomAD/CADD via ToolUniverse, interprets SV/CNV clinical significance using ClinGen dosage sensitivity scores, computes variant statistics, and generates reports. Solves questions like "What fraction of variants with VAF < 0.3 are missense?", "How many non-reference variants remain after filtering intronic/intergenic?", "What is the pathogenicity of this deletion affecting BRCA1?", or "Which dosage-sensitive genes overlap this CNV?". Use when processing VCF files, annotating variants, filtering by VAF/depth/consequence, classifying mutations, interpreting structural variants, assessing CNV pathogenicity, comparing cohorts, or answering variant analysis questions.

tooluniverse-target-research

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Gather comprehensive biological target intelligence from 9 parallel research paths covering protein info, structure, interactions, pathways, expression, variants, drug interactions, and literature. Features collision-aware searches, evidence grading (T1-T4), explicit Open Targets coverage, and mandatory completeness auditing. Use when users ask about drug targets, proteins, genes, or need target validation, druggability assessment, or comprehensive target profiling.

tooluniverse-systems-biology

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Comprehensive systems biology and pathway analysis using multiple pathway databases (Reactome, KEGG, WikiPathways, Pathway Commons, BioModels). Performs pathway enrichment, protein-pathway mapping, keyword searches, and systems-level analysis. Use when analyzing gene sets, exploring biological pathways, or investigating systems-level biology.

tooluniverse-structural-variant-analysis

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Comprehensive structural variant (SV) analysis skill for clinical genomics. Classifies SVs (deletions, duplications, inversions, translocations), assesses pathogenicity using ACMG-adapted criteria, evaluates gene disruption and dosage sensitivity, and provides clinical interpretation with evidence grading. Use when analyzing CNVs, large deletions/duplications, chromosomal rearrangements, or any structural variants requiring clinical interpretation.

tooluniverse-statistical-modeling

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Perform statistical modeling and regression analysis on biomedical datasets. Supports linear regression, logistic regression (binary/ordinal/multinomial), mixed-effects models, Cox proportional hazards survival analysis, Kaplan-Meier estimation, and comprehensive model diagnostics. Extracts odds ratios, hazard ratios, confidence intervals, p-values, and effect sizes. Designed to solve BixBench statistical reasoning questions involving clinical/experimental data. Use when asked to fit regression models, compute odds ratios, perform survival analysis, run statistical tests, or interpret model coefficients from provided data.

tooluniverse-spatial-transcriptomics

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Analyze spatial transcriptomics data to map gene expression in tissue architecture. Supports 10x Visium, MERFISH, seqFISH, Slide-seq, and imaging-based platforms. Performs spatial clustering, domain identification, cell-cell proximity analysis, spatial gene expression patterns, tissue architecture mapping, and integration with single-cell data. Use when analyzing spatial transcriptomics datasets, studying tissue organization, identifying spatial expression patterns, mapping cell-cell interactions in tissue context, characterizing tumor microenvironment spatial structure, or integrating spatial and single-cell RNA-seq data for comprehensive tissue analysis.

tooluniverse-spatial-omics-analysis

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Computational analysis framework for spatial multi-omics data integration. Given spatially variable genes (SVGs), spatial domain annotations, tissue type, and disease context from spatial transcriptomics/proteomics experiments (10x Visium, MERFISH, DBiTplus, SLIDE-seq, etc.), performs comprehensive biological interpretation including pathway enrichment, cell-cell interaction inference, druggable target identification, immune microenvironment characterization, and multi-modal integration. Produces a detailed markdown report with Spatial Omics Integration Score (0-100), domain-by-domain characterization, and validation recommendations. Uses 70+ ToolUniverse tools across 9 analysis phases. Use when users ask about spatial transcriptomics analysis, spatial omics interpretation, tissue heterogeneity, spatial gene expression patterns, tumor microenvironment mapping, tissue zonation, or cell-cell communication from spatial data.

tooluniverse-single-cell

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Production-ready single-cell and expression matrix analysis using scanpy, anndata, and scipy. Performs scRNA-seq QC, normalization, PCA, UMAP, Leiden/Louvain clustering, differential expression (Wilcoxon, t-test, DESeq2), cell type annotation, per-cell-type statistical analysis, gene-expression correlation, batch correction (Harmony), trajectory inference, and cell-cell communication analysis. NEW: Analyzes ligand-receptor interactions between cell types using OmniPath (CellPhoneDB, CellChatDB), scores communication strength, identifies signaling cascades, and handles multi-subunit receptor complexes. Integrates with ToolUniverse gene annotation tools (HPA, Ensembl, MyGene, UniProt) and enrichment tools (gseapy, PANTHER, STRING). Supports h5ad, 10X, CSV/TSV count matrices, and pre-annotated datasets. Use when analyzing single-cell RNA-seq data, studying cell-cell interactions, performing cell type differential expression, computing gene-expression correlations by cell type, analyzing tumor-immune communication, or answering questions about scRNA-seq datasets.

tooluniverse-sequence-retrieval

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Retrieves biological sequences (DNA, RNA, protein) from NCBI and ENA with gene disambiguation, accession type handling, and comprehensive sequence profiles. Creates detailed reports with sequence metadata, cross-database references, and download options. Use when users need nucleotide sequences, protein sequences, genome data, or mention GenBank, RefSeq, EMBL accessions.

tooluniverse-rnaseq-deseq2

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Production-ready RNA-seq differential expression analysis using PyDESeq2. Performs DESeq2 normalization, dispersion estimation, Wald testing, LFC shrinkage, and result filtering. Handles multi-factor designs, multiple contrasts, batch effects, and integrates with gene enrichment (gseapy) and ToolUniverse annotation tools (UniProt, Ensembl, OpenTargets). Supports CSV/TSV/H5AD input formats and any organism. Use when analyzing RNA-seq count matrices, identifying DEGs, performing differential expression with statistical rigor, or answering questions about gene expression changes.

tooluniverse-rare-disease-diagnosis

1802
from FreedomIntelligence/OpenClaw-Medical-Skills

Provide differential diagnosis for patients with suspected rare diseases based on phenotype and genetic data. Matches symptoms to HPO terms, identifies candidate diseases from Orphanet/OMIM, prioritizes genes for testing, interprets variants of uncertain significance. Use when clinician asks about rare disease diagnosis, unexplained phenotypes, or genetic testing interpretation.