К основному содержанию
скилл CX Codex

tooluniverse-mendelian-randomization — скилл для Claude Code

Скилл tooluniverse-mendelian-randomization проверяет, вызывает ли один фактор другой (например, холестерин — болезнь сердца), используя генетические варианты как инструменты.

Apache-2.0 137 установок ★ 1 798 обновлён 2026-10-24

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add mims-harvard/ToolUniverse --skill tooluniverse-mendelian-randomization -a claude-code
Открыть на GitHub

Что делает tooluniverse-mendelian-randomization

Менделевская рандомизация (MR) отвечает на вопрос, который корреляция не может: X действительно вызывает Y, или это просто совпадение? Поскольку генетические варианты распределяются случайно при зачатии, они устойчивы к смешивающим факторам и обратной причинности, которые искажают обычные наблюдательные данные.

Скилл оборачивает готовые результаты MR из EpiGraphDB и OpenGWAS: вводишь воздействие и исход, получаешь оценку эффекта, стандартную ошибку, p-value, метод (IVW, MR-Egger, взвешенная медиана) и качество инструментов (MOE score). Встроены проверки на горизонтальную плейотропию (когда вариант влияет на исход не через воздействие) и двусторонняя MR (обратная причинность). Результаты обновляются вместе с новыми GWAS — никогда не подставляй значения по памяти.

Ограничение: скилл работает с парами, уже в EpiGraphDB, или с любыми двумя GWAS, если ты запросишь инструменты через OpenGWAS_get_mr_instruments и посчитаешь MR через MR_estimate. Не подходит для простого поиска связей (см. GWAS-скиллы) или если ты подгоняешь собственные инструменты к сырым данным.

Какие задачи решает

  • определить, вызывает ли риск-фактор или биомаркер болезнь или просто коррелирует
  • различить причинность от генетической корреляции и консоциации
  • проверить обратную причинность (может ли исход вызывать воздействие)
  • оценить качество генетических инструментов и согласованность методов
  • приоритизировать мишени для лекарств с генетическим подтверждением

Примеры запросов агенту

  • Влияет ли холестерин LDL причинно на болезнь коронарных артерий или это корреляция?
  • Вызывает ли индекс массы тела диабет второго типа, или обе черты имеют общую генетику?
  • Есть ли причинная связь между С-реактивным белком и инсультом?

Как установить tooluniverse-mendelian-randomization

1Через Skills CLI (Vercel)

npx skills add mims-harvard/ToolUniverse --skill tooluniverse-mendelian-randomization -a claude-code

2Вручную: положить файлы

~/.claude/skills/tooluniverse-mendelian-randomization/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/tooluniverse-mendelian-randomization/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о tooluniverse-mendelian-randomization

Как установить tooluniverse-mendelian-randomization в Claude Code?

Выполни npx skills add mims-harvard/ToolUniverse --skill tooluniverse-mendelian-randomization -a claude-code, затем открой ~/.claude/skills/tooluniverse-mendelian-randomization/SKILL.md для проверки.

Что делает tooluniverse-mendelian-randomization?

Скилл проверяет причинность: вызывает ли воздействие (риск-фактор, биомаркер) исход или болезнь. Использует генетические варианты как инструменты, устойчивые к смешиванию и обратной причинности. Работает с готовыми результатами MR из EpiGraphDB и OpenGWAS, поддерживает двусторонний анализ и проверку плейотропии.

В чём разница между Менделевской рандомизацией и генетической корреляцией?

Генетическая корреляция (rg) означает, что два признака разделяют наследуемость — это не указывает на причинность и не показывает направление. MR с валидными инструментами оценивает реальную причинность. Это разные виды доказательств, сообщай их отдельно.

Исходный текст

SKILL.md · Apache-2.0
---
name: tooluniverse-mendelian-randomization
description: Mendelian randomization (MR) causal inference — does an exposure, risk factor, or biomarker CAUSALLY affect a disease/outcome, using genetic variants as instrumental variables (IEU OpenGWAS / EpiGraphDB MR-EvE). Use this whenever the user asks if X causes Y, whether an observational association is actually causal or just correlation, if a biomarker/trait is a causal risk factor, wants to triangulate epidemiology against genetic evidence, or mentions Mendelian randomization, instrumental-variable analysis, two-sample MR, or genetic causal evidence — even if they never say "MR" (e.g. "is LDL cholesterol actually causal for heart disease?", "does BMI cause type 2 diabetes or just correlate?", "is CRP a causal driver of stroke?"). Covers trait-label resolution, MR effect direction/magnitude, instrument quality (MOE score), method agreement (IVW vs MR-Egger vs weighted median), bidirectional MR for reverse causation, and distinguishing causation from genetic correlation. Not for plain GWAS association lookups (use the GWAS skills) or fitting your own instruments from raw summary statistics.
disable-model-invocation: true
---

# Mendelian Randomization (Causal Inference from Genetic Instruments)

**MR estimates the CAUSAL effect of an exposure on an outcome using genetic variants as instrumental variables.** Because alleles are randomized at conception, MR is largely robust to the confounding and reverse causation that bias observational associations. It is *not* a free lunch: the causal claim rests on three assumptions, and violating them (especially horizontal pleiotropy) silently biases the estimate.

**LOOK UP, DON'T GUESS:** never assert a causal MR estimate from memory. Genetic-instrument results are updated as new GWAS are published — always retrieve current evidence with `EpiGraphDB_get_mendelian_randomization`. Do not invent beta/p-values.

**Correlation ≠ causation, and genetic correlation ≠ causation.** A high genetic correlation (`rg`) means two traits share heritability — it does NOT establish a causal direction. Only MR (with valid instruments) speaks to causality. Report them as different kinds of evidence.

## The three instrumental-variable assumptions

| Assumption | Statement | How it fails | Check |
|---|---|---|---|
| **Relevance** | Instrument is robustly associated with the exposure | Weak instruments (low F-stat) → bias toward the confounded observational estimate | MOE score; instruments selected at GWAS significance |
| **Independence** | Instrument shares no common cause with the outcome | Population stratification, assortative mating | Ancestry-matched GWAS; report population |
| **Exclusion restriction** | Instrument affects the outcome ONLY through the exposure | **Horizontal pleiotropy** — the variant influences the outcome via another path | MR-Egger intercept ≈ 0; agreement across methods |

If you cannot speak to these, your causal claim is provisional. Say so.

## When to use

- "Does **[exposure]** causally affect **[outcome/disease]**?" — the core MR question.
- Triangulating an observational/epidemiological association ("BMI correlates with depression — is it causal?").
- Reverse-causation checks (bidirectional MR: does the outcome cause the exposure instead?).
- Prioritising drug targets / risk factors with genetic causal support.
- Distinguishing a causal driver from a shared-etiology bystander (MR vs genetic correlation).

This skill wraps the **IEU OpenGWAS / EpiGraphDB MR-EvE** ("MR Everything-vs-Everything") resource: a large matrix of pre-computed two-sample MR results between GWAS traits. It does **not** run a bespoke two-sample MR from raw summary statistics with your own instrument set — see *Limitations*.

## Anchor tools

| Tool | Purpose |
|---|---|
| `EpiGraphDB_search_opengwas` | Resolve a free-text trait to exact OpenGWAS study IDs + labels (DO THIS FIRST) |
| `EpiGraphDB_get_mendelian_randomization` | Pre-computed MR estimate(s) for an exposure→outcome trait pair (curated pairs; start here) |
| `OpenGWAS_get_mr_instruments` | Custom two-sample MR: fetch the exposure's clumped instruments + their harmonized outcome effects for *any* GWAS pair (needs a free `OPENGWAS_JWT`). Use when the pair isn't in MR-EvE |
| `MR_estimate` | Local calculator: given harmonized `beta_exposure`/`se_exposure`/`beta_outcome`/`se_outcome` arrays (e.g. straight from `OpenGWAS_get_mr_instruments`), computes IVW, MR-Egger (with pleiotropy intercept), weighted-median, and Cochran's Q / I² — no R, no manual formula. Use this to finish the custom-MR path below instead of hand-deriving IVW or shelling out to `TwoSampleMR` |
| `EpiGraphDB_get_genetic_correlations` | `rg` between a trait and others (shared etiology, NOT causation). **Sparse** — see Step 4 caveat |
| `EpiGraphDB_get_drugs_for_trait` | Drugs targeting genes associated with a risk-factor trait (causal-target follow-up) |
| `gwas_search_associations` | GWAS Catalog associations, to inspect the instruments behind a trait |

## Workflow

### Step 1 — Resolve trait labels (avoid silent misses)
EpiGraphDB matches GWAS trait labels **exactly and case-sensitively**. Always resolve free text first:

```
EpiGraphDB_search_opengwas {"query": "coronary heart disease"}
# → returns ids like 'ieu-a-7' and the exact label 'Coronary heart disease'
```

Use the returned exact label (or a sentence-case form) in the MR call. The MR tool now retries sentence-case variants and returns a `metadata.note` when it falls back or finds nothing — **read that note**; an empty `mr_results` with a note means "labels didn't match", NOT "no causal effect".

### Step 2 — Run MR (exposure → outcome)
```
EpiGraphDB_get_mendelian_randomization {
  "exposure_trait": "LDL cholesterol",
  "outcome_trait":  "Coronary heart disease",
  "pval_threshold": 1e-5
}
```
Each row carries `beta` (causal effect estimate), `se`, `pval`, `method`, `moescore`, and the exposure/outcome IDs.

### Step 3 — Interpret (see tables below)
Direction, magnitude, instrument quality, and method agreement.

### Step 4 — Triangulate
1. **Bidirectional MR (primary triangulation)** — swap exposure and outcome to test reverse causation. A causal X→Y with no Y→X strengthens the claim; bidirectional signals suggest shared genetics or feedback. This is the reliable leg — lean on it.
2. **Multiple methods** — prefer pairs where IVW and a pleiotropy-robust method (MR-Egger, weighted median) agree in sign and significance.
3. **Genetic correlation (secondary, often empty)** — `EpiGraphDB_get_genetic_correlations` on the exposure. ⚠️ The `/genetic-cor` graph is **sparse**: it stores only strong edges (|rg| > 0.8), matches **exact, case-sensitive** labels distinct from OpenGWAS search labels, and **ignores** the `pval_threshold` argument. Common traits (e.g. 'Body mass index') return empty — that is a graph gap, **not** "no shared genetics." Read `metadata.note`; if empty, do NOT conclude absence — fall back to bidirectional MR. When it does return, high `rg` + significant MR = causal; high `rg` + null MR = shared etiology without a detectable causal path.

### Step 5 — Actionable follow-up (optional)
`EpiGraphDB_get_drugs_for_trait` surfaces drugs whose target genes drive a causal risk factor — a genetics-anchored repurposing hypothesis.

## Interpretation tables

### Causal effect (`beta`)
| Observation | Meaning |
|---|---|
| `beta > 0`, `pval` significant | Higher exposure causally **increases** the outcome (on the GWAS scale — often log-odds for a binary outcome) |
| `beta < 0`, `pval` significant | Higher exposure causally **decreases** the outcome |
| `pval` not significant | No detectable causal effect at the available instrument strength — **absence of evidence, not evidence of absence** |
| Effect on a binary outcome | `beta` is typically a log-odds-ratio; report `exp(beta)` as an odds ratio per SD/unit of exposure |

### Instrument quality (`moescore`, "Mixture of Experts")
| MOE | Confidence |
|---|---|
| > 0.9 | High-quality instrument selection — trust the estimate most |
| 0.6–0.9 | Moderate — corroborate with another exposure GWAS or method |
| < 0.6 | Weak — treat as hypothesis-generating only |

### Method (`method`)
| Method | Note |
|---|---|
| IVW (inverse-variance weighted) | Primary estimate; assumes no pleiotropy |
| MR-Egger | Allows directional pleiotropy; intercept ≠ 0 flags pleiotropy; lower power |
| Weighted median | Valid if ≥50% of instrument weight is from valid variants |
| Disagreement across methods | A red flag for pleiotropy — downgrade confidence |

## Limitations (state these honestly)

- **Two MR paths, different scopes.** `EpiGraphDB_get_mendelian_randomization` returns *pre-computed* MR-EvE estimates for curated trait pairs — fast, but limited to pairs IEU already ran. For a pair that isn't covered, or for custom instruments (your own p-value/clumping thresholds), use `OpenGWAS_get_mr_instruments` (needs a free `OPENGWAS_JWT`) to assemble harmonized exposure+outcome SNP data, then pass the four harmonized arrays straight to **`MR_estimate`** for IVW / MR-Egger / weighted-median / Cochran's Q+I² — no manual formula, no R dependency (verified live: a 6-instrument example returns a real IVW estimate of 0.520, se 0.062, p=8.4e-10, Egger intercept -0.010 [p=0.73, no pleiotropy signal], I²=0.0). Advanced sensitivity analyses beyond these four methods (MR-PRESSO, Steiger filtering, leave-one-out) still need the `TwoSampleMR` R package — `MR_estimate` does not replace those.
- **Palindromic SNPs** (A/T, C/G) are not strand-resolved by `OpenGWAS_get_mr_instruments`; review or drop ambiguous ones before trusting the estimate.
- **Horizontal pleiotropy** is the dominant threat and cannot be fully excluded from a single estimate. Method agreement reduces but does not eliminate it.
- **Population.** Most OpenGWAS instruments are European-ancestry; effects and LD differ across ancestries. Report this.
- **Winner's curse / weak instruments** bias toward the confounded observational estimate; lean on MOE and instrument F-statistics.
- **Scale.** A statistically significant causal effect may be clinically small. Report magnitude, not just the p-value.
- **One GWAS ≠ truth.** Replication across independent exposure and outcome GWAS strengthens any MR claim.

## Reporting template

> **Causal question:** Does *[exposure]* affect *[outcome]*?
> **MR estimate:** beta = *X* (se *Y*, p = *Z*), method *IVW*, MOE *score* → *[direction + magnitude, OR if binary]*.
> **Triangulation:** bidirectional MR *[reverse effect?]*; genetic correlation rg = *[value]*; method agreement *[yes/no]*.
> **Assumptions/caveats:** instrument quality *[MOE]*, pleiotropy *[Egger intercept / method agreement]*, ancestry *[population]*.
> **Verdict:** *[supported / not supported / inconclusive]* causal effect, with the above caveats.

© mims-harvard · Apache-2.0 · mims-harvard/ToolUniverse

Похожие скиллы

Все скиллы по теме «Наука и исследования» →
ROBINS-I V2 MCP Black-Swan-Causal-Labs Оценивает риск систематической ошибки в когортных исследованиях по методике ROBINS-I V2 с жёсткой проверкой цитат по тексту. CX Codex +1 scientific-thinking-biology Agents365-ai Скилл scientific-thinking-biology для Claude Code структурирует анализ биологических исследований и генетических данных. Помогает отличить ассоциацию от причинности, маркер от драйвера. CX Codex +1 296установок Causal Inference aj-geddes Скилл Causal Inference для Claude Code учит агента оценивать причинные эффекты: propensity score, инструментальные переменные, причинные графы. Работает там, где эксперимент недоступен. CX Codex +1 544установок folklore-variant-evidence K-Dense-AI Скилл folklore-variant-evidence для Claude Code получает через Folklore MCP публичные данные ClinGen и доказательства по одному варианту GRCh38. Ищет связанную литературу и проверяет статус разрешения варианта. CX Codex +1 718установок StatsPAI_skill franklee16 Подключает к сессии Python-пакет statspai: описательные статистики, выбор оценщика под исследовательский вопрос, оценка эффектов и проверки после неё. CX Codex +1 ★ 240звёзд репо biorxiv-search yorkeccak Скилл biorxiv-search ищет препринты на bioRxiv через натуральный язык, без фильтров и синтаксиса. Семантический поиск понимает смысл запроса и возвращает полные тексты статей с изображениями. CX Codex +1 150установок

Из того же набора136

Весь набор →
tooluniverse-protein-lof-mechanism Скилл tooluniverse-protein-lof-mechanism синтезирует пять слоёв вычислительных данных — от AlphaMissense до DynaMut2 — чтобы предложить конкретный механизм, как миссенс-вариант приводит к потере функции белка. CX Codex +1 141установок tooluniverse-pharmacokinetics Скилл tooluniverse-pharmacokinetics для Claude Code рассчитывает фармакокинетические параметры по концентрациям препарата во времени. Анализирует профиль после дозы и биодоступность при IV- и пероральном введении. CX Codex +1 140установок tooluniverse-protein-sae-variant-interpretation Скилл tooluniverse-protein-sae-variant-interpretation объясняет механизм мутаций белка через разреженные автоэнкодеры ESMC-6B, показывая потерю или появление биологических признаков. CX Codex +1 140установок tooluniverse-residue-functional-mechanism-interpretation Скилл tooluniverse-residue-functional-mechanism-interpretation для Claude Code объясняет значимость аминокислотных остатков по структуре белка, данным UniProt и опциональным свидетельствам DMS или SAE. CX Codex +1 140установок tooluniverse-primer-design Скилл tooluniverse-primer-design подбирает праймеры для PCR и qPCR, считает температуру плавления и проверяет олигонуклеотиды на димеры. CX Codex +1 131установок tooluniverse-diagnostic-test-evaluation Скилл tooluniverse-diagnostic-test-evaluation оценивает точность диагностических тестов и биомаркеров по таблице 2×2 или непрерывным шкалам. Рассчитывает чувствительность, специфичность, ROC AUC и байесовскую вероятность. CX Codex +1 129установок tooluniverse-dose-response Скилл tooluniverse-dose-response для Claude Code подбирает 4PL-кривую по концентрациям и ответам, оценивает IC50 или EC50 и качество подгонки. Сравнивает активность соединений в лабораторных анализах. CX Codex +1 128установок tooluniverse-enzyme-kinetics Скилл tooluniverse-enzyme-kinetics рассчитывает параметры ферментативной кинетики Михаэлиса — Ментен по экспериментальным точкам и определяет тип ингибирования. CX Codex +1 128установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой