Tooluniverse gwas study explorer

From mims-harvard/ToolUniverse · View interactive version

Tooluniverse gwas study explorer is an AI agent skill from the GitHub repository mims-harvard/ToolUniverse. Compare GWAS studies, perform meta-analyses across cohorts, and assess signal replication. Uses GWAS Catalog metadata, study-level statistics, and cross-cohort comparison. Use for evaluating GWAS reproducibility for a trait, meta-analysis sample size and effect-size aggregation, and detecting study

How to use this skill

Skill file

GWAS Study Deep Dive & Meta-Analysis

Compare GWAS studies, perform meta-analyses, and assess replication across cohorts


Overview

The GWAS Study Deep Dive & Meta-Analysis skill enables comprehensive comparison of genome-wide association studies (GWAS) for the same trait, meta-analysis of genetic loci across studies, and systematic assessment of replication and study quality. It integrates data from the NHGRI-EBI GWAS Catalog and Open Targets Genetics to provide a complete picture of the genetic architecture of complex traits.

Key Capabilities

  1. Study Comparison: Compare all GWAS studies for a trait, assessing sample sizes, ancestries, and platforms
  2. Meta-Analysis: Aggregate effect sizes across studies and calculate heterogeneity statistics
  3. Replication Assessment: Identify replicated vs novel findings across discovery and replication cohorts
  4. Quality Evaluation: Assess statistical power, ancestry diversity, and data availability

COMPUTE, DON'T DESCRIBE

When analysis requires computation (statistics, data processing, scoring, enrichment), write and run Python code via Bash. Don't describe what you would do — execute it and report actual results. Use ToolUniverse tools to retrieve data, then Python (pandas, scipy, statsmodels, matplotlib) to analyze it.

Domain Reasoning: Comparing Studies for the Same Trait

When comparing GWAS studies for the same trait, ask: do they replicate? The same lead SNPs appearing in independent studies is strong evidence of a true association. Different lead SNPs at the same locus may reflect LD differences between populations — they may tag the same causal variant. Different loci entirely may reflect different study designs, phenotype definitions, or population ancestry. Before concluding that a finding failed to replicate, check whether the SNP was even genotyped or imputed in the replication cohort.

LOOK UP DON'T GUESS: effect sizes, p-values, allele frequencies, and LD structure for specific loci. Do not assume a SNP present in one study is present in another — use gwas_get_associations_for_snp to retrieve cross-study data. Do not infer LD blocks from genomic proximity; use credible sets from Open Targets for fine-mapping results.


Use Cases

1. Comprehensive Trait Analysis

Scenario: "I want to understand all available GWAS data for type 2 diabetes"

Workflow:

Outcome: Complete landscape of T2D genetics with replicated findings and population-specific signals

2. Locus-Specific Meta-Analysis

Scenario: "Is the TCF7L2 association with T2D consistent across all studies?"

Workflow:

Outcome: Quantitative assessment of effect size consistency with heterogeneity interpretation

Honesty rule (important): A real inverse-variance meta-analysis needs each study's beta + 95% CI. python_implementation.py parses these from the GWAS Catalog beta/or_value + range fields and only then pools effect sizes and computes Cochran's-Q I². When the matched associations don't report usable effect sizes (common), it returns method="descriptive", combined_beta=None, heterogeneity_i2=None, and combined_p_value = the smallest reported p (not a pooled p) — do NOT present a descriptive result as a formal meta-analysis or invent an I².

3. Replication Analysis

Scenario: "Which findings from the discovery cohort replicated in the independent sample?"

Workflow:

Outcome: Systematic replication report with success rates and failed findings

4. Multi-Ancestry Comparison

Scenario: "Are T2D loci consistent across European and East Asian populations?"

Workflow:

Outcome: Ancestry-specific genetic architecture with transferability assessment


Statistical Methods

Meta-Analysis Approach

This skill implements standard GWAS meta-analysis methods:

Fixed-Effects Model:

Random-Effects Model (recommended when I² > 50%):

Heterogeneity Assessment:

The I² statistic measures the percentage of variance due to between-study heterogeneity:

I² = [(Q - df) / Q] × 100%

where Q = Cochran's Q statistic
      df = degrees of freedom (n_studies - 1)

Interpretation Guidelines:

Sources of Heterogeneity

Common reasons for high I²:

  1. Ancestry differences: Different allele frequencies and LD structure
  2. Phenotype heterogeneity: Trait definition varies across studies
  3. Platform differences: Imputation quality and coverage
  4. Winner's curse: Discovery studies overestimate effect sizes
  5. Cohort characteristics: Age, sex, environmental factors

Recommendations:


Study Quality Assessment

Quality Metrics

The skill evaluates studies based on:

1. Sample Size:

2. Ancestry Diversity:

3. Data Availability:

4. Genotyping Quality:

5. Statistical Rigor:

Quality Tiers

Tier 1 (High Quality):

Tier 2 (Moderate Quality):

Tier 3 (Limited):


Best Practices

Before Meta-Analysis

  1. Check phenotype consistency: Ensure studies measure the same trait
  2. Verify ancestry overlap: High heterogeneity expected if ancestries differ
  3. Harmonize alleles: Align effect alleles across studies
  4. Quality control: Exclude low-quality studies or associations

Interpreting Results

  1. Genome-wide significance: p < 5×10⁻⁸ (Bonferroni for ~1M independent tests)
  2. Replication threshold: p < 0.05 in independent cohort
  3. Direction consistency: Effect should be same direction across studies
  4. Heterogeneity: I² > 50% suggests caution in interpretation

Common Pitfalls

❌ Don't:

✅ Do:


Limitations & Caveats

Data Limitations

  1. Incomplete Overlap: Studies may analyze different SNPs
  2. Cohort Overlap: Some cohorts participate in multiple studies (inflates significance)
  3. Publication Bias: Significant findings more likely to be published
  4. Winner's Curse: Discovery studies overestimate effect sizes
  5. Imputation Quality: Varies across studies and populations

Statistical Limitations

  1. Heterogeneity: High I² may preclude meaningful meta-analysis
  2. Sample Size Differences: Large studies dominate fixed-effects models
  3. Allele Frequency Differences: Same variant has different effects across ancestries
  4. Linkage Disequilibrium: Fine-mapping needed to identify causal variants
  5. Gene-Environment Interactions: Not captured in standard meta-analysis

Interpretation Guidelines

When I² > 75%:

When Studies Conflict:


Tools Used

GWAS Catalog API

Open Targets Genetics GraphQL API

Glossary

Credible Set: Set of variants likely to contain the causal variant (from fine-mapping)

L2G (Locus-to-Gene): Score predicting which gene is affected by a GWAS locus

License: Open source (MIT)

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.