跳到正文
cccskills
免费在 GitHub 公开

tooluniverse-mendelian-randomization

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.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md10.1 KB
  • evals/evals.json2.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

AssumptionStatementHow it failsCheck
RelevanceInstrument is robustly associated with the exposureWeak instruments (low F-stat) → bias toward the confounded observational estimateMOE score; instruments selected at GWAS significance
IndependenceInstrument shares no common cause with the outcomePopulation stratification, assortative matingAncestry-matched GWAS; report population
Exclusion restrictionInstrument affects the outcome ONLY through the exposureHorizontal pleiotropy — the variant influences the outcome via another pathMR-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

ToolPurpose
EpiGraphDB_search_opengwasResolve a free-text trait to exact OpenGWAS study IDs + labels (DO THIS FIRST)
EpiGraphDB_get_mendelian_randomizationPre-computed MR estimate(s) for an exposure→outcome trait pair (curated pairs; start here)
OpenGWAS_get_mr_instrumentsCustom 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
EpiGraphDB_get_genetic_correlationsrg between a trait and others (shared etiology, NOT causation). Sparse — see Step 4 caveat
EpiGraphDB_get_drugs_for_traitDrugs targeting genes associated with a risk-factor trait (causal-target follow-up)
gwas_search_associationsGWAS 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)

ObservationMeaning
beta > 0, pval significantHigher exposure causally increases the outcome (on the GWAS scale — often log-odds for a binary outcome)
beta < 0, pval significantHigher exposure causally decreases the outcome
pval not significantNo detectable causal effect at the available instrument strength — absence of evidence, not evidence of absence
Effect on a binary outcomebeta is typically a log-odds-ratio; report exp(beta) as an odds ratio per SD/unit of exposure

Instrument quality (moescore, "Mixture of Experts")

MOEConfidence
> 0.9High-quality instrument selection — trust the estimate most
0.6–0.9Moderate — corroborate with another exposure GWAS or method
< 0.6Weak — treat as hypothesis-generating only

Method (method)

MethodNote
IVW (inverse-variance weighted)Primary estimate; assumes no pleiotropy
MR-EggerAllows directional pleiotropy; intercept ≠ 0 flags pleiotropy; lower power
Weighted medianValid if ≥50% of instrument weight is from valid variants
Disagreement across methodsA 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 compute the IVW/MR-Egger estimate yourself (e.g. IVW = Σ(βx·βy/σy²)/Σ(βx²/σy²)) or hand the mr_input to the TwoSampleMR R package. Advanced sensitivity analyses (MR-PRESSO, Steiger, leave-one-out) still need TwoSampleMR.
  • 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.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Simplest distributed training API. 4 lines to add distributed support to any PyTorch script. Unified API for DeepSpeed/FSDP/Megatron/DDP. Automatic device placement, mixed precision (FP16/BF16/FP8). Interactive config, single launch command. HuggingFace ecosystem standard.

中文简介正在准备中。当前显示原文说明。

huang-sh/DeepScience42026年7月15日 更新

ADMET property prediction for drug candidates. Full pharmacokinetic panel (Caco-2, PPB, clearance, CYP), toxicity (hERG, AMES, DILI), drug-likeness (Lipinski, QED), using RDKit descriptors and TDC models.

中文简介正在准备中。当前显示原文说明。

huang-sh/DeepScience42026年7月15日 更新

Interpretable ADMET analysis with mechanistic reasoning. Maps liabilities to structural causes and biological pathways. Based on CoTox (Park 2025) and DrugR (Liu 2026).

中文简介正在准备中。当前显示原文说明。

huang-sh/DeepScience42026年7月15日 更新

aeon

免费

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

中文简介正在准备中。当前显示原文说明。

huang-sh/DeepScience42026年7月15日 更新

arboreto

免费

Infer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.

中文简介正在准备中。当前显示原文说明。

huang-sh/DeepScience42026年7月15日 更新

astropy

免费

Comprehensive Python library for astronomy and astrophysics. This skill should be used when working with astronomical data including celestial coordinates, physical units, FITS files, cosmological calculations, time systems, tables, world coordinate systems (WCS), and astronomical data analysis. Use when tasks involve coordinate transformations, unit conversions, FITS file manipulation, cosmological distance calculations, time scale conversions, or astronomical data processing.

中文简介正在准备中。当前显示原文说明。

huang-sh/DeepScience42026年7月15日 更新

查看 huang-sh 的全部技能

报告此技能的问题