{"skill":{"slug":"two-sample-mr-research-planner-2","displayName":"Two Sample Mr Research Planner","summary":"Generates complete two-sample Mendelian randomization study designs with four workload plans and workflow steps based on user-specified exposures and outcomes.","description":"---\nname: two-sample-mr-research-planner\ndescription: Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction. Use when users want to design, plan, or build a study using two-sample MR to test causal relationships. Triggers: \"design a two-sample MR study\", \"build a publishable MR paper\", \"test whether this biomarker causally affects this disease\", \"generate Lite/Standard/Advanced MR plans\", \"screen multiple exposures with MR\", \"bidirectional MR design\", \"causal inference using GWAS summary statistics\", or \"I want to study X and Y using MR\". Always outputs four workload configurations (Lite / Standard / Advanced / Publication+) with a recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, and publication upgrade path.\nlicense: MIT\nskill-author: AIPOCH\n---\n\n# Two-Sample Mendelian Randomization Research Planner\n\nGenerates a complete two-sample MR study design from a user-provided research direction. Always outputs four workload configurations and a recommended primary plan.\n\n## Supported Study Styles\n\n| Style | Description | Example |\n|-------|-------------|---------|\n| **A. Single Exposure → Single Outcome** | One biomarker or trait to one disease | Serum uric acid → gout; vitamin D → osteoporosis |\n| **B. Multi-Exposure Screening** | Panel of exposures to one outcome | Dietary factors → endometriosis; cytokine panel → RA |\n| **C. Bidirectional MR** | Reciprocal causal testing | Inflammation ↔ depression; BMI ↔ osteoarthritis |\n| **D. Lifestyle / Diet / Behavioral** | Self-reported behavioral exposures | Coffee intake → hypertension; sleep duration → stroke |\n| **E. Biomarker / Molecular Trait** | Circulating proteins, metabolites | Cytokines → autoimmune disease; plasma proteins → Alzheimer's |\n| **F. Publication-Oriented** | Comprehensive sensitivity-rich design | Full estimator suite with complete figure set |\n\n## Minimum User Input\n\n- One exposure (or exposure set) + one outcome\n- If limited detail is provided, infer a reasonable default design and state all assumptions explicitly\n\n## Step-by-Step Execution\n\n### Step 1: Infer Study Type\n\nIdentify:\n- Exposure(s) and outcome\n- Exposure class (dietary, biomarker, metabolite, behavioral, disease trait, molecular)\n- User goal: screening, bidirectional, causal verification, or publication strength\n- Whether MVMR or colocalization is justified\n- Time or resource constraints stated by the user\n\n### Step 2: Output Four Configurations\n\nAlways generate all four. For each configuration describe: goal, required data, major modules, expected workload, figure set, strengths, and weaknesses.\n\n| Config | Goal | Timeframe | Best For |\n|--------|------|-----------|----------|\n| **Lite** | Fast minimal causal test | 2–4 weeks | Quick launch, 1 exposure × 1 outcome |\n| **Standard** | Publication-ready core MR | 4–8 weeks | Single or small panel + sensitivity suite |\n| **Advanced** | Robust multi-extension design | 8–14 weeks | Bidirectional, MVMR, replication GWAS |\n| **Publication+** | High-impact comprehensive paper | 12–20 weeks | Full sensitivity, MVMR, colocalization, power |\n\n### Step 3: Recommend One Primary Plan\n\nSelect the best-fit configuration and explain why, given the exposure type, outcome, and any stated user constraints (time, data access, publication goal).\n\n### Step 4: Full Step-by-Step Workflow\n\nFor each step include: step name, purpose, input, method, key parameters/thresholds, expected output, failure points, and alternative approaches.\n\n**Core modules to address when relevant:**\n\n- Exposure GWAS selection + ancestry matching\n- Outcome GWAS selection\n- Instrument extraction (p < 5×10⁻⁸, LD clumping r² < 0.001 / 10,000 kb)\n- F-statistic screening (F > 10)\n- Harmonization (palindromic SNP handling)\n- IVW (primary analysis, random effects)\n- MR-Egger, weighted median, simple/weighted mode (complementary)\n- Heterogeneity (Cochran's Q, I²)\n- Pleiotropy (MR-Egger intercept, MR-PRESSO)\n- Leave-one-out analysis\n- Bidirectional MR (when justified — see Hard Rules)\n- MVMR (when confounding exposures need adjustment)\n- Power / MDES discussion\n- Colocalization (Advanced / Publication+ only; PP.H4 > 0.8 standard)\n\n**Exposure-class IV count benchmarks** — state expected IV count and flag weak-instrument risk accordingly:\n\n→ Full benchmarks by exposure class: [references/iv_benchmarks.md](references/iv_benchmarks.md)\n\n**GWAS data sources by exposure class:**\n\n→ Recommended databases and last-verified dates: [references/gwas_databases.md](references/gwas_databases.md)\n\n**Fault tolerance guidelines:**\n- If the target GWAS is unavailable: state this explicitly, suggest the closest publicly available alternative, and recommend the Lite configuration until data access is confirmed\n- If IV count falls below 3: warn the user that MR is not feasible with current instruments; suggest waiting for larger GWAS or pivoting to a proxy exposure\n- If F-statistic < 10 for all IVs: do not proceed with IVW as primary; escalate to weak-instrument-robust methods (LIML, sisVIVE) and note this as a study limitation\n\n### Step 5: Figure and Deliverable Plan\n\nAlways list:\n- Scatter plots (exposure–outcome per estimator)\n- Forest plots (leave-one-out)\n- Funnel plots (pleiotropy visual)\n- Summary results table (all estimators)\n- Sensitivity analysis table\n\n### Step 6: Validation and Robustness Plan\n\nState what each layer proves and what it does not prove. Distinguish:\n- **Primary MR evidence**: IVW result + instrument validity checks (F > 10, no strong pleiotropy signal)\n- **Sensitivity support**: estimator consistency across MR-Egger, weighted median, mode; Cochran Q non-significant\n- **Higher-tier causal strengthening**: MVMR (adjusts for correlated exposures), bidirectional MR (rules out reverse causation), colocalization (rules out LD confounding)\n\n### Step 7: Risk Review\n\nAlways include a self-critical section addressing:\n- Strongest part of the design\n- Most assumption-dependent part\n- Most likely source of false positives\n- Easiest part to overinterpret\n- Most likely reviewer criticisms: weak instruments, pleiotropy, ancestry mismatch, sample overlap, multiple-testing (for screening studies), behavioral phenotype noise, insufficient IV count for dietary/microbiome exposures\n- Revision strategy if first-pass findings fail\n\n### Step 8: Minimal Executable Version\n\nSlim version using only publicly available GWAS: 1 exposure (or small set), 1 outcome, IVW + 1–2 complementary estimators, heterogeneity/pleiotropy/leave-one-out, concise interpretation. Confirm this fits within any stated time constraints before recommending.\n\n### Step 9: Publication Upgrade Path\n\nExplain what to add beyond Standard, which additions most improve publication strength, and which modules add rigor versus complexity. For molecular trait MR (proteins, metabolites), always include colocalization as a required upgrade for high-impact journals.\n\n## R Code Framework Guidelines\n\nWhen providing R code examples or frameworks:\n- Always use the `TwoSampleMR` package (CRAN) as the primary tool\n- Mark all GWAS IDs as examples with an explicit inline comment: `# EXAMPLE ID — replace with your target phenotype ID`\n- Do not present example IDs as validated or guaranteed to resolve correctly\n- Provide the IEU Open GWAS API query pattern so users can search for their own phenotype IDs\n\n**Standard R framework template:**\n\n```r\nlibrary(TwoSampleMR)\nlibrary(MRPRESSO)\n\n# Step 1: Extract instruments for exposure\n# EXAMPLE ID below — replace with your target exposure GWAS ID\nexposure <- extract_instruments(outcomes = \"ukb-b-XXXXX\")  # EXAMPLE ID\n\n# Step 2: Extract outcome data\n# EXAMPLE ID below — replace with your target outcome GWAS ID\noutcome <- extract_outcome_data(\n  snps = exposure$SNP,\n  outcomes = \"ieu-b-XXXXX\"  # EXAMPLE ID\n)\n\n# Step 3: Harmonise\nharmonized <- harmonise_data(exposure, outcome)\n\n# Step 4: Primary and sensitivity analyses\nres <- mr(harmonized, method_list = c(\n  \"mr_ivw\",\n  \"mr_egger_regression\",\n  \"mr_weighted_median\",\n  \"mr_weighted_mode\"\n))\n\n# Step 5: Heterogeneity and pleiotropy\nhet  <- mr_heterogeneity(harmonized)\nplt  <- mr_pleiotropy_test(harmonized)\nloo  <- mr_leaveoneout(harmonized)\n```\n\nTo find valid GWAS IDs: `ao <- available_outcomes(); View(ao)`\n\n## Hard Rules\n\n1. Never output only one generic plan — always output all four configurations.\n2. Always recommend one primary plan with justification.\n3. Always separate necessary modules from optional modules.\n4. Distinguish primary MR evidence, sensitivity support, and higher-tier causal strengthening.\n5. Do not force bidirectional or MVMR if the topic does not justify it.\n6. Do not overclaim causality when instruments are weak or behavioral phenotypes are noisy.\n7. Do not treat nominal estimator agreement as proof if sensitivity analyses are inconsistent.\n8. Do not ignore ancestry mismatch or sample-overlap concerns.\n9. If the user provides limited detail, infer a reasonable default design and state all assumptions clearly.\n10. Do not produce only a literature summary or flat methods list.\n11. **Out-of-scope redirect**: If the user requests a non-MR causal inference design (RCT, propensity score matching, DAG-based observational analysis, Bayesian network, etc.), clearly state that this skill covers two-sample MR only and recommend consulting appropriate resources (e.g., CONSORT for RCTs, STROBE for observational studies).\n\n## Input Validation\n\nThis skill accepts: a research direction involving a causal question between an exposure (biomarker, dietary factor, behavioral trait, molecular trait, or disease) and an outcome, where the user wants to design a two-sample Mendelian randomization study.\n\nIf the user's request does not involve MR study design — for example, asking to design an RCT, conduct a systematic review, write a manuscript introduction, perform propensity score analysis, or answer a general epidemiology question — do not proceed with the MR planning workflow. Instead respond:\n> \"Two-Sample MR Research Planner is designed to generate Mendelian randomization study designs using GWAS summary statistics. Your request appears to be outside this scope. Please provide an exposure–outcome pair you want to test using MR, or use a more appropriate skill for your task (e.g., a systematic review skill for literature synthesis, or an experimental design skill for RCTs).\"\n\n## Reference Files\n\n| File | Content | Used In |\n|------|---------|---------|\n| [references/gwas_databases.md](references/gwas_databases.md) | Recommended GWAS sources by exposure class with last-verified dates | Step 4 — GWAS selection |\n| [references/iv_benchmarks.md](references/iv_benchmarks.md) | Typical IV count ranges and weak-instrument risk flags by exposure class | Step 4 — instrument extraction |\n","topics":["Study"],"tags":{"latest":"0.1.0"},"stats":{"comments":0,"downloads":534,"installsAllTime":20,"installsCurrent":1,"stars":0,"versions":1},"createdAt":1773395849627,"updatedAt":1778491880948},"latestVersion":{"version":"0.1.0","createdAt":1773395849627,"changelog":"two-sample-mr-research-planner-2 v0.1.0\n\n- Initial release of a skill to generate comprehensive two-sample Mendelian randomization (MR) study designs from simple user input.\n- Supports a range of study types (single exposure, multi-exposure, bidirectional, behavior, biomarker, publication-focused).\n- Always outputs four workload configurations with a recommended plan and publication upgrade path.\n- Provides explicit step-by-step workflows, validation strategies, and risk reviews tailored to user context.\n- Includes R code framework recommendations and clear guidance for data sources, instrument selection, and sensitivity analysis.","license":"MIT-0"},"metadata":null,"owner":{"handle":"theresayao0614-sudo","userId":"s17ea40c1y75h06x45mjjxwg3583qhxm","displayName":"Theresa","image":"https://avatars.githubusercontent.com/u/259492064?v=4"},"moderation":null}