Two-sample Mendelian randomization / 两样本孟德尔随机化(MR)
mr_runTwo-sample Mendelian randomization / 两样本孟德尔随机化(MR) | USE WHEN: the user has GWAS summary statistics and wants a causal estimate (IVW / MR-Egger / weighted median) with instrument QC and figures | ALIASES: 孟德尔随机化, 随机化, mendelian randomization, MR, IVW, MR-Egger, 加权中位数, 工具变量, GWAS, summary statistics | RETURNS: IVW/Egger/加权中位数估计(β、SE、P、95%CI)、异质性 Q、工具变量质检、三态结论门禁、图 SVG
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"exposure_file_id": "<exposure_file_id>"
},
"name": "mr_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | 随机种子,默认 42;固定则结果可逐位复算 | |
| n_bootstrap | No | 加权中位数 bootstrap 次数,默认 1000(100–20000) | |
| p_threshold | No | 不给 rsID 时,按该 P 值阈值从暴露表里自动筛工具变量(如 5e-8) | |
| genome_build | No | GRCh37 / GRCh38;两侧不一致会告警(只有按 chr:pos 匹配时才影响结果) | |
| exposure_only | No | true = 只做工具变量质检(F 统计量/弱工具),不出因果估计 | |
| sample_overlap | No | 两样本重叠情况:none / partial / same_cohort / unknown(默认 unknown,会在 gate 里降级说明) | |
| include_figures | No | 是否返回森林/散点/漏斗/留一图 SVG(默认 true) | |
| outcome_file_id | No | 结局 sumstats 的 file_id;只想做工具变量质检时传 exposure_only=true 可不给 | |
| exposure_file_id | Yes | 暴露 sumstats 的 file_id(先用 sanyu_upload_data 上传;tsv/csv/txt,制表符或逗号分隔,首行列名) | |
| instrument_rsids | No | 工具变量 rsID 列表,如 ["rs12345", "rs67890"];最多 5000 个 | |
| instrument_file_id | No | 工具变量清单的 file_id(至少含 SNP 列);与 instrument_rsids / p_threshold 三选一 | |
| outcome_column_map | No | 结局文件的列名映射对象 {"SNP":"rsid","beta":"b",…},与 exposure_column_map 同构。列名不标准时靠它对齐。 | |
| exposure_column_map | No | 规范名→原列名,如 {"beta": "Effect", "se": "StdErr", "snp": "MarkerName"};自动识别失败时用它显式指定 |