[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CVHGFAC7S1S3H36RH9A4BM":3,"skill-same:01M7CVHGFAC7S1S3H36RH9A4BM":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7CVHGFAC7S1S3H36RH9A4BM","bio-causal-genomics-pleiotropy-detection",null,"Detect and correct for horizontal pleiotropy in Mendelian randomization analyses using MR-PRESSO for outlier removal, MR-Egger regression for directional pleiotropy, and Steiger filtering for variant directionality. Use when validating MR results, detecting pleiotropic instrum...","mrsonord2240\u002Fopenscience-specialists","mrsonord2240","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76487430?v=4","01M7CTEM40S43GSJZ9A3YCCXZK","Samuel Nord","01M7CTEM4K69JD1GBYNHVJ9ZP4",2,"MIT","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-pleiotropy-detection\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-causal-genomics-pleiotropy-detection\ndescription: Detect and correct for horizontal pleiotropy in Mendelian randomization analyses using MR-PRESSO for outlier removal, MR-Egger regression for directional pleiotropy, and Steiger filtering for variant directionality. Use when validating MR results, detecting pleiotropic instrum...\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\u002F\u002Fgithub.com\u002Faipoch\u002Fmedical-research-skills](https:\u002F\u002Fgithub.com\u002Faipoch\u002Fmedical-research-skills)\n\n\n## Version Compatibility\n\nReference examples tested with: MR-PRESSO 1.0+, TwoSampleMR 0.5+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion(\"\u003Cpkg>\")` then `?function_name` to verify parameters\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Pleiotropy Detection\n\n**\"Check my MR results for pleiotropic bias\"** → Detect and correct for horizontal pleiotropy using outlier removal (MR-PRESSO), directional pleiotropy testing (MR-Egger intercept), and variant directionality filtering (Steiger) to validate causal inference results.\n- R: `MRPRESSO::mr_presso()` for global and distortion tests\n- R: `TwoSampleMR::mr_egger_regression()` for Egger intercept test\n\n## Overview\n\nHorizontal pleiotropy violates the exclusion restriction assumption of MR: instruments\naffect the outcome through pathways other than the exposure. Detecting and correcting\nfor pleiotropy is essential for valid causal inference.\n\nTypes of pleiotropy:\n- **Vertical** (mediated): Instrument -> exposure -> outcome (valid, not a problem)\n- **Horizontal** (direct): Instrument -> outcome bypassing exposure (violates MR assumptions)\n- **Balanced**: Pleiotropic effects cancel out (IVW still valid, Egger intercept ~0)\n- **Directional**: Pleiotropic effects are systematic (biases IVW, Egger detects this)\n\n## MR-PRESSO\n\n**Goal:** Detect and remove pleiotropic outlier instruments from an MR analysis.\n\n**Approach:** Run MR-PRESSO to test for global pleiotropy, identify individual outlier SNPs, test whether their removal changes the causal estimate (distortion test), and obtain a corrected estimate.\n\n```r\n# install.packages('remotes')\n# remotes::install_github('rondolab\u002FMR-PRESSO')\nlibrary(MRPRESSO)\n\n# Input: harmonized data from TwoSampleMR\n# Columns needed: beta.exposure, beta.outcome, se.exposure, se.outcome\npresso_input \u003C- data.frame(\n  bx = dat$beta.exposure,\n  by = dat$beta.outcome,\n  bxse = dat$se.exposure,\n  byse = dat$se.outcome\n)\n\n# --- Run MR-PRESSO ---\n# NbDistribution: Number of simulations for null distribution (minimum 1000)\n# SignifThreshold: P-value threshold for outlier detection (0.05 standard)\npresso_result \u003C- mr_presso(\n  BetaOutcome = 'by', BetaExposure = 'bx',\n  SdOutcome = 'byse', SdExposure = 'bxse',\n  OUTLIERtest = TRUE, DISTORTIONtest = TRUE,\n  data = presso_input,\n  NbDistribution = 5000,\n  SignifThreshold = 0.05\n)\n\n# --- Global test ---\n# Tests whether there is any pleiotropy among instruments\n# Significant p-value: Evidence of horizontal pleiotropy\nglobal_p \u003C- presso_result$`MR-PRESSO results`$`Global Test`$Pvalue\ncat('Global test p-value:', global_p, '\\n')\n\n# --- Outlier test ---\n# Identifies individual pleiotropic SNPs\noutliers \u003C- presso_result$`MR-PRESSO results`$`Outlier Test`\ncat('\\nOutlier test results:\\n')\nprint(outliers)\n\n# Outlier SNPs (p \u003C 0.05)\noutlier_indices \u003C- which(outliers$Pvalue \u003C 0.05)\ncat('Outlier SNPs:', length(outlier_indices), '\\n')\n\n# --- Distortion test ---\n# Tests whether removing outliers significantly changes the causal estimate\n# Significant: Outliers were meaningfully biasing the estimate\ndistortion_p \u003C- presso_result$`MR-PRESSO results`$`Distortion Test`$Pvalue\ncat('Distortion test p-value:', distortion_p, '\\n')\n\n# --- Corrected estimate ---\n# MR estimate after removing outlier SNPs\nmain_results \u003C- presso_result$`Main MR results`\ncat('\\nRaw IVW estimate:', main_results$`Causal Estimate`[1], '\\n')\ncat('Corrected IVW estimate:', main_results$`Causal Estimate`[2], '\\n')\n```\n\n## MR-Egger Diagnostics\n\n**Goal:** Test for directional pleiotropy and obtain a pleiotropy-adjusted causal estimate.\n\n**Approach:** Fit MR-Egger regression where the intercept estimates average pleiotropic bias, and check I-squared for instrument strength under the NOME assumption.\n\n```r\nlibrary(TwoSampleMR)\n\n# MR-Egger regression allows for a non-zero intercept\n# The intercept estimates the average pleiotropic effect\negger \u003C- mr_egger_regression(dat$beta.exposure, dat$beta.outcome,\n                              dat$se.exposure, dat$se.outcome)\n\n# --- Egger intercept ---\n# Significant intercept (p \u003C 0.05): Directional pleiotropy present\n# Non-significant: No evidence (but low power with \u003C 10 SNPs)\ncat('Egger intercept:', round(egger$b_i, 5), '\\n')\ncat('Intercept SE:', round(egger$se_i, 5), '\\n')\ncat('Intercept p-value:', format.pval(egger$pval_i), '\\n')\n\n# --- Egger slope ---\n# Valid causal estimate EVEN with directional pleiotropy (InSIDE assumption)\ncat('\\nEgger causal estimate:', round(egger$b, 4), '\\n')\ncat('Egger SE:', round(egger$se, 4), '\\n')\ncat('Egger p-value:', format.pval(egger$pval), '\\n')\n\n# --- I-squared for Egger ---\n# I^2 measures instrument strength for MR-Egger specifically\n# I^2 > 0.9: Egger estimate reliable\n# I^2 \u003C 0.6: Egger has low power, interpret with caution (NOME violation)\nisq \u003C- Isq(dat$beta.exposure, dat$se.exposure)\ncat('\\nI-squared:', round(isq, 3), '\\n')\nif (isq \u003C 0.9) cat('Warning: I-squared \u003C 0.9; Egger estimate may be unreliable (NOME violation)\\n')\n```\n\n## Steiger Filtering\n\n**Goal:** Verify that instruments act in the correct causal direction (exposure -> outcome, not reverse).\n\n**Approach:** Apply the Steiger test to each instrument, remove those explaining more outcome variance than exposure variance, and re-run MR on filtered instruments.\n\n```r\nlibrary(TwoSampleMR)\n\n# Steiger test: Verify each instrument explains more variance in\n# the exposure than the outcome. Instruments failing this test\n# may act through a reverse causal pathway.\n\nsteiger \u003C- steiger_filtering(dat)\n\n# Keep only correctly oriented instruments\ndat_steiger \u003C- steiger[steiger$steiger_dir == TRUE, ]\ncat('Instruments passing Steiger filter:', nrow(dat_steiger), 'of', nrow(steiger), '\\n')\n\n# Re-run MR with filtered instruments\nresults_steiger \u003C- mr(dat_steiger)\nprint(results_steiger[, c('method', 'nsnp', 'b', 'se', 'pval')])\n\n# Directionality test (aggregate)\ndirection \u003C- directionality_test(dat)\ncat('\\nCorrect causal direction:', direction$correct_causal_direction, '\\n')\ncat('Steiger p-value:', format.pval(direction$steiger_pval), '\\n')\n```\n\n## Additional Sensitivity Methods\n\n```r\nlibrary(TwoSampleMR)\n\n# --- Contamination mixture ---\n# Assumes some instruments are valid, others are not\n# Does not require majority valid assumption\nmr_conmix \u003C- mr(dat, method_list = 'mr_raps')\n\n# --- MR-RAPS ---\n# NOTE: MRAPS CRAN package was archived March 2025.\n# Use the MendelianRandomization package instead, or install from GitHub:\n# remotes::install_github('qingyuanzhao\u002Fmr.raps')\nlibrary(MendelianRandomization)\n\nmr_input \u003C- mr_input(\n  bx = dat$beta.exposure, bxse = dat$se.exposure,\n  by = dat$beta.outcome, byse = dat$se.outcome\n)\n\nraps_result \u003C- mr_raps(mr_input)\ncat('MR-RAPS estimate:', raps_result$Estimate, '\\n')\ncat('MR-RAPS p-value:', raps_result$Pvalue, '\\n')\n\n# --- Multivariable MR ---\n# Controls for pleiotropy by including multiple exposures simultaneously\n# e.g., adjust for BMI when estimating effect of lipids on CHD\nexposure1 \u003C- extract_instruments('ieu-a-300')  # LDL\nexposure2 \u003C- extract_instruments('ieu-a-302')  # HDL\n\n# Combine and perform multivariable MR\n# (See TwoSampleMR vignette for full multivariable workflow)\n```\n\n## Comprehensive Sensitivity Framework\n\n**Goal:** Run a complete battery of MR sensitivity analyses to validate causal findings.\n\n**Approach:** Apply IVW, MR-Egger, weighted median, weighted mode, heterogeneity, Egger intercept, leave-one-out, and MR-PRESSO in a single function and summarize results.\n\n```r\nlibrary(TwoSampleMR)\nlibrary(MRPRESSO)\n\nrun_sensitivity \u003C- function(dat) {\n  results \u003C- list()\n\n  # 1. IVW (primary)\n  results$ivw \u003C- mr(dat, method_list = 'mr_ivw')\n\n  # 2. MR-Egger\n  results$egger \u003C- mr(dat, method_list = 'mr_egger_regression')\n\n  # 3. Weighted median (robust to 50% invalid instruments)\n  results$median \u003C- mr(dat, method_list = 'mr_weighted_median')\n\n  # 4. Weighted mode\n  results$mode \u003C- mr(dat, method_list = 'mr_weighted_mode')\n\n  # 5. Heterogeneity\n  results$het \u003C- mr_heterogeneity(dat)\n\n  # 6. Egger intercept\n  results$pleio \u003C- mr_pleiotropy_test(dat)\n\n  # 7. Leave-one-out\n  results$loo \u003C- mr_leaveoneout(dat)\n\n  # 8. MR-PRESSO\n  presso_input \u003C- data.frame(\n    bx = dat$beta.exposure, by = dat$beta.outcome,\n    bxse = dat$se.exposure, byse = dat$se.outcome\n  )\n  results$presso \u003C- mr_presso(\n    BetaOutcome = 'by', BetaExposure = 'bx',\n    SdOutcome = 'byse', SdExposure = 'bxse',\n    OUTLIERtest = TRUE, DISTORTIONtest = TRUE,\n    data = presso_input, NbDistribution = 5000, SignifThreshold = 0.05\n  )\n\n  results\n}\n\nsummarize_sensitivity \u003C- function(sens) {\n  cat('=== MR Sensitivity Analysis Summary ===\\n\\n')\n\n  # Method comparison\n  all_mr \u003C- rbind(sens$ivw, sens$egger, sens$median, sens$mode)\n  cat('Method comparison:\\n')\n  print(all_mr[, c('method', 'b', 'se', 'pval')])\n\n  # Heterogeneity\n  cat('\\nHeterogeneity (Cochran Q):\\n')\n  cat('  Q p-value (IVW):', sens$het$Q_pval[sens$het$method == 'Inverse variance weighted'], '\\n')\n\n  # Egger intercept\n  cat('\\nEgger intercept:\\n')\n  cat('  Intercept:', sens$pleio$egger_intercept, '\\n')\n  cat('  P-value:', sens$pleio$pval, '\\n')\n\n  # MR-PRESSO global test\n  cat('\\nMR-PRESSO global test p-value:',\n      sens$presso$`MR-PRESSO results`$`Global Test`$Pvalue, '\\n')\n\n  cat('\\n--- Interpretation ---\\n')\n  cat('Consistent estimates across methods: Evidence strengthened\\n')\n  cat('Significant Egger intercept: Directional pleiotropy present\\n')\n  cat('Significant MR-PRESSO global: Horizontal pleiotropy detected\\n')\n  cat('Significant heterogeneity: Instruments may be invalid\\n')\n}\n```\n\n## STROBE-MR Reporting\n\nWhen reporting MR analyses, follow STROBE-MR guidelines:\n\n1. Report all MR methods tested (not just the most significant)\n2. Report heterogeneity Q-statistic and p-value\n3. Report Egger intercept with p-value\n4. Report MR-PRESSO global test and number of outliers removed\n5. Report F-statistics for instrument strength\n6. Report Steiger directionality test\n7. State whether results are consistent across sensitivity analyses\n8. Acknowledge limitations of the MR assumptions\n\n## Related Skills\n\n- mendelian-randomization - Primary MR analysis that pleiotropy tests validate\n- fine-mapping - Identify causal variants at instrument loci\n- population-genetics\u002Fassociation-testing - GWAS data for MR instruments\n\n## Input Validation\n\nThis skill accepts requests that match the documented purpose of `bio-causal-genomics-pleiotropy-detection` and include enough context to complete the workflow safely.\n\nDo not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:\n\n> `bio-causal-genomics-pleiotropy-detection` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.\n","> **Source**: [https:\u002F\u002Fgithub.com\u002Faipoch\u002Fmedical-research-skills](https:\u002F\u002Fgithub.com\u002Faipoch\u002Fmedical-research-skills)\n\n\n## Version Compatibility\n\nReference examples tested with: MR-PRESSO 1.0+, TwoSampleMR 0.5+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion(\"\u003Cpkg>\")` then `?function_name` to verify parameters\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Pleiotropy Detection\n\n**\"Check my MR results for pleiotropic bias\"** → Detect and correct for horizontal pleiotropy using outlier removal (MR-PRESSO), directional pleiotropy testing (MR-Egger intercept), and variant directionality filtering (Steiger) to validate causal inference results.\n- R: `MRPRESSO::mr_presso()` for global and distortion tests\n- R: `TwoSampleMR::mr_egger_regression()` for Egger intercept test\n\n## Overview\n\nHorizontal pleiotropy violates the exclusion restriction assumption of MR: instruments\naffect the outcome through pathways other than the exposure. Detecting and correcting\nfor pleiotropy is essential for valid causal inference.\n\nTypes of pleiotropy:\n- **Vertical** (mediated): Instrument -> exposure -> outcome (valid, not a problem)\n- **Horizontal** (direct): Instrument -> outcome bypassing exposure (violates MR assumptions)\n- **Balanced**: Pleiotropic effects cancel out (IVW still valid, Egger intercept ~0)\n- **Directional**: Pleiotropic effects are systematic (biases IVW, Egger detects this)\n\n## MR-PRESSO\n\n**Goal:** Detect and remove pleiotropic outlier instruments from an MR analysis.\n\n**Approach:** Run MR-PRESSO to test for global pleiotropy, identify individual outlier SNPs, test whether their removal changes the causal estimate (distortion test), and obtain a corrected estimate.\n\n```r\n# install.packages('remotes')\n# remotes::install_github('rondolab\u002FMR-PRESSO')\nlibrary(MRPRESSO)\n\n# Input: harmonized data from TwoSampleMR\n# Columns needed: beta.exposure, beta.outcome, se.exposure, se.outcome\npresso_input \u003C- data.frame(\n  bx = dat$beta.exposure,\n  by = dat$beta.outcome,\n  bxse = dat$se.exposure,\n  byse = dat$se.outcome\n)\n\n# --- Run MR-PRESSO ---\n# NbDistribution: Number of simulations for null distribution (minimum 1000)\n# SignifThreshold: P-value threshold for outlier detection (0.05 standard)\npresso_result \u003C- mr_presso(\n  BetaOutcome = 'by', BetaExposure = 'bx',\n  SdOutcome = 'byse', SdExposure = 'bxse',\n  OUTLIERtest = TRUE, DISTORTIONtest = TRUE,\n  data = presso_input,\n  NbDistribution = 5000,\n  SignifThreshold = 0.05\n)\n\n# --- Global test ---\n# Tests whether there is any pleiotropy among instruments\n# Significant p-value: Evidence of horizontal pleiotropy\nglobal_p \u003C- presso_result$`MR-PRESSO results`$`Global Test`$Pvalue\ncat('Global test p-value:', global_p, '\\n')\n\n# --- Outlier test ---\n# Identifies individual pleiotropic SNPs\noutliers \u003C- presso_result$`MR-PRESSO results`$`Outlier Test`\ncat('\\nOutlier test results:\\n')\nprint(outliers)\n\n# Outlier SNPs (p \u003C 0.05)\noutlier_indices \u003C- which(outliers$Pvalue \u003C 0.05)\ncat('Outlier SNPs:', length(outlier_indices), '\\n')\n\n# --- Distortion test ---\n# Tests whether removing outliers significantly changes the causal estimate\n# Significant: Outliers were meaningfully biasing the estimate\ndistortion_p \u003C- presso_result$`MR-PRESSO results`$`Distortion Test`$Pvalue\ncat('Distortion test p-value:', distortion_p, '\\n')\n\n# --- Corrected estimate ---\n# MR estimate after removing outlier SNPs\nmain_results \u003C- presso_result$`Main MR results`\ncat('\\nRaw IVW estimate:', main_results$`Causal Estimate`[1], '\\n')\ncat('Corrected IVW estimate:', main_results$`Causal Estimate`[2], '\\n')\n```\n\n## MR-Egger Diagnostics\n\n**Goal:** Test for directional pleiotropy and obtain a pleiotropy-adjusted causal estimate.\n\n**Approach:** Fit MR-Egger regression where the intercept estimates average pleiotropic bias, and check I-squared for instrument strength under the NOME assumption.\n\n```r\nlibrary(TwoSampleMR)\n\n# MR-Egger regression allows for a non-zero intercept\n# The intercept estimates the average pleiotropic effect\negger \u003C- mr_egger_regression(dat$beta.exposure, dat$beta.outcome,\n                              dat$se.exposure, dat$se.outcome)\n\n# --- Egger intercept ---\n# Significant intercept (p \u003C 0.05): Directional pleiotropy present\n# Non-significant: No evidence (but low power with \u003C 10 SNPs)\ncat('Egger intercept:', round(egger$b_i, 5), '\\n')\ncat('Intercept SE:', round(egger$se_i, 5), '\\n')\ncat('Intercept p-value:', format.pval(egger$pval_i), '\\n')\n\n# --- Egger slope ---\n# Valid causal estimate EVEN with directional pleiotropy (InSIDE assumption)\ncat('\\nEgger causal estimate:', round(egger$b, 4), '\\n')\ncat('Egger SE:', round(egger$se, 4), '\\n')\ncat('Egger p-value:', format.pval(egger$pval), '\\n')\n\n# --- I-squared for Egger ---\n# I^2 measures instrument strength for MR-Egger specifically\n# I^2 > 0.9: Egger estimate reliable\n# I^2 \u003C 0.6: Egger has low power, interpret with caution (NOME violation)\nisq \u003C- Isq(dat$beta.exposure, dat$se.exposure)\ncat('\\nI-squared:', round(isq, 3), '\\n')\nif (isq \u003C 0.9) cat('Warning: I-squared \u003C 0.9; Egger estimate may be unreliable (NOME violation)\\n')\n```\n\n## Steiger Filtering\n\n**Goal:** Verify that instruments act in the correct causal direction (exposure -> outcome, not reverse).\n\n**Approach:** Apply the Steiger test to each instrument, remove those explaining more outcome variance than exposure variance, and re-run MR on filtered instruments.\n\n```r\nlibrary(TwoSampleMR)\n\n# Steiger test: Verify each instrument explains more variance in\n# the exposure than the outcome. Instruments failing this test\n# may act through a reverse causal pathway.\n\nsteiger \u003C- steiger_filtering(dat)\n\n# Keep only correctly oriented instruments\ndat_steiger \u003C- steiger[steiger$steiger_dir == TRUE, ]\ncat('Instruments passing Steiger filter:', nrow(dat_steiger), 'of', nrow(steiger), '\\n')\n\n# Re-run MR with filtered instruments\nresults_steiger \u003C- mr(dat_steiger)\nprint(results_steiger[, c('method', 'nsnp', 'b', 'se', 'pval')])\n\n# Directionality test (aggregate)\ndirection \u003C- directionality_test(dat)\ncat('\\nCorrect causal direction:', direction$correct_causal_direction, '\\n')\ncat('Steiger p-value:', format.pval(direction$steiger_pval), '\\n')\n```\n\n## Additional Sensitivity Methods\n\n```r\nlibrary(TwoSampleMR)\n\n# --- Contamination mixture ---\n# Assumes some instruments are valid, others are not\n# Does not require majority valid assumption\nmr_conmix \u003C- mr(dat, method_list = 'mr_raps')\n\n# --- MR-RAPS ---\n# NOTE: MRAPS CRAN package was archived March 2025.\n# Use the MendelianRandomization package instead, or install from GitHub:\n# remotes::install_github('qingyuanzhao\u002Fmr.raps')\nlibrary(MendelianRandomization)\n\nmr_input \u003C- mr_input(\n  bx = dat$beta.exposure, bxse = dat$se.exposure,\n  by = dat$beta.outcome, byse = dat$se.outcome\n)\n\nraps_result \u003C- mr_raps(mr_input)\ncat('MR-RAPS estimate:', raps_result$Estimate, '\\n')\ncat('MR-RAPS p-value:', raps_result$Pvalue, '\\n')\n\n# --- Multivariable MR ---\n# Controls for pleiotropy by including multiple exposures simultaneously\n# e.g., adjust for BMI when estimating effect of lipids on CHD\nexposure1 \u003C- extract_instruments('ieu-a-300')  # LDL\nexposure2 \u003C- extract_instruments('ieu-a-302')  # HDL\n\n# Combine and perform multivariable MR\n# (See TwoSampleMR vignette for full multivariable workflow)\n```\n\n## Comprehensive Sensitivity Framework\n\n**Goal:** Run a complete battery of MR sensitivity analyses to validate causal findings.\n\n**Approach:** Apply IVW, MR-Egger, weighted median, weighted mode, heterogeneity, Egger intercept, leave-one-out, and MR-PRESSO in a single function and summarize results.\n\n```r\nlibrary(TwoSampleMR)\nlibrary(MRPRESSO)\n\nrun_sensitivity \u003C- function(dat) {\n  results \u003C- list()\n\n  # 1. IVW (primary)\n  results$ivw \u003C- mr(dat, method_list = 'mr_ivw')\n\n  # 2. MR-Egger\n  results$egger \u003C- mr(dat, method_list = 'mr_egger_regression')\n\n  # 3. Weighted median (robust to 50% invalid instruments)\n  results$median \u003C- mr(dat, method_list = 'mr_weighted_median')\n\n  # 4. Weighted mode\n  results$mode \u003C- mr(dat, method_list = 'mr_weighted_mode')\n\n  # 5. Heterogeneity\n  results$het \u003C- mr_heterogeneity(dat)\n\n  # 6. Egger intercept\n  results$pleio \u003C- mr_pleiotropy_test(dat)\n\n  # 7. Leave-one-out\n  results$loo \u003C- mr_leaveoneout(dat)\n\n  # 8. MR-PRESSO\n  presso_input \u003C- data.frame(\n    bx = dat$beta.exposure, by = dat$beta.outcome,\n    bxse = dat$se.exposure, byse = dat$se.outcome\n  )\n  results$presso \u003C- mr_presso(\n    BetaOutcome = 'by', BetaExposure = 'bx',\n    SdOutcome = 'byse', SdExposure = 'bxse',\n    OUTLIERtest = TRUE, DISTORTIONtest = TRUE,\n    data = presso_input, NbDistribution = 5000, SignifThreshold = 0.05\n  )\n\n  results\n}\n\nsummarize_sensitivity \u003C- function(sens) {\n  cat('=== MR Sensitivity Analysis Summary ===\\n\\n')\n\n  # Method comparison\n  all_mr \u003C- rbind(sens$ivw, sens$egger, sens$median, sens$mode)\n  cat('Method comparison:\\n')\n  print(all_mr[, c('method', 'b', 'se', 'pval')])\n\n  # Heterogeneity\n  cat('\\nHeterogeneity (Cochran Q):\\n')\n  cat('  Q p-value (IVW):', sens$het$Q_pval[sens$het$method == 'Inverse variance weighted'], '\\n')\n\n  # Egger intercept\n  cat('\\nEgger intercept:\\n')\n  cat('  Intercept:', sens$pleio$egger_intercept, '\\n')\n  cat('  P-value:', sens$pleio$pval, '\\n')\n\n  # MR-PRESSO global test\n  cat('\\nMR-PRESSO global test p-value:',\n      sens$presso$`MR-PRESSO results`$`Global Test`$Pvalue, '\\n')\n\n  cat('\\n--- Interpretation ---\\n')\n  cat('Consistent estimates across methods: Evidence strengthened\\n')\n  cat('Significant Egger intercept: Directional pleiotropy present\\n')\n  cat('Significant MR-PRESSO global: Horizontal pleiotropy detected\\n')\n  cat('Significant heterogeneity: Instruments may be invalid\\n')\n}\n```\n\n## STROBE-MR Reporting\n\nWhen reporting MR analyses, follow STROBE-MR guidelines:\n\n1. Report all MR methods tested (not just the most significant)\n2. Report heterogeneity Q-statistic and p-value\n3. Report Egger intercept with p-value\n4. Report MR-PRESSO global test and number of outliers removed\n5. Report F-statistics for instrument strength\n6. Report Steiger directionality test\n7. State whether results are consistent across sensitivity analyses\n8. Acknowledge limitations of the MR assumptions\n\n## Related Skills\n\n- mendelian-randomization - Primary MR analysis that pleiotropy tests validate\n- fine-mapping - Identify causal variants at instrument loci\n- population-genetics\u002Fassociation-testing - GWAS data for MR instruments\n\n## Input Validation\n\nThis skill accepts requests that match the documented purpose of `bio-causal-genomics-pleiotropy-detection` and include enough context to complete the workflow safely.\n\nDo not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:\n\n> `bio-causal-genomics-pleiotropy-detection` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.\n",{"name":5,"author":24,"license":15,"description":7},"AIPOCH","main","e0956dc9606356ab78468936b502e55a365282e2","specialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-pleiotropy-detection",0,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists","https:\u002F\u002Fgithub.com\u002Fmrsonord2240","2026-10-12 03:19:04",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-causal-genomics-pleiotropy-detection",{"tool":38,"command":39},"bunx","bunx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-causal-genomics-pleiotropy-detection",{"tool":41,"command":42},"pnpm","pnpm dlx skills add mrsonord2240\u002Fopenscience-specialists --skill bio-causal-genomics-pleiotropy-detection","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-pleiotropy-detection\u002FSKILL.md",true,[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"POLISH_CHANGELOG.md","REFERENCE","参考文档",637,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-pleiotropy-detection\u002FPOLISH_CHANGELOG.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"usage-guide.md",2831,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fmendelian-randomization-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-causal-genomics-pleiotropy-detection\u002Fusage-guide.md",[57,65,72,79,86,93],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7CW36A6QAGWFE2C008M1XPG","bio-workflows-metabolomics-pipeline","Orchestrates the untargeted LC-MS metabolomics pipeline end-to-end (xcms 4.x feature extraction, QC\u002Fdrift\u002Fnormalization, confidence-stratified annotation, permutation-validated statistics, background-aware pathway mapping), naming what each stage decides and where it silently fails. Use when running a full LC-MS metabolomics study from raw mzML to enriched pathways and needing the honest handoffs between stages. Each stage defers to its component skill for parameters and traps; for stable-isotope flux (a separate branch, not this untargeted flow) see metabolomics\u002Fisotope-tracing.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-workflows-metabolomics-pipeline\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7CW2Y18623NA2S1Y30FRQW1","bio-metabolomics-xcms-preprocessing","Programmatic untargeted LC-MS feature extraction in R with the modern xcms 4.x MsExperiment\u002FXcmsExperiment API, taking raw mzML to a feature table via CentWave peak detection, retention-time alignment, peak-density correspondence, gap-filling, CAMERA redundancy collapse, and built-in QC feature filtering. Use when converting centroided LC-MS runs into a features-by-samples matrix and deciding centWave\u002Fgrouping\u002Falignment parameters. For drift correction and QC\u002FCV filtering execution see metabolomics\u002Fnormalization-qc; for metabolite identification see metabolomics\u002Fmetabolite-annotation; for the MS-DIAL GUI alternative with MS2Dec deconvolution see metabolomics\u002Fmsdial-preprocessing; for downstream statistics see metabolomics\u002Fstatistical-analysis.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-xcms-preprocessing\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7CW2M364HVWPNQEKE2WP4PP","bio-metabolomics-statistical-analysis","Decision-grade statistical analysis for metabolomics intensity tables. Covers transformation and scaling (Pareto vs unit-variance as a hidden hypothesis), unsupervised structure (PCA\u002FHCA for QC), permutation-validated PLS-DA\u002FOPLS-DA (R2 vs Q2, double CV, VIP as heuristic), univariate testing (Welch\u002FMann-Whitney\u002FANOVA\u002FLMM with covariate adjustment), and dependence-aware multiple testing. Use when testing which metabolites differ, building or validating a discriminant model, choosing a scaling, or correcting many correlated tests. For sample-wise normalization\u002Fdrift correction see metabolomics\u002Fnormalization-qc; for ML classifiers and selection-inside-CV leakage see machine-learning\u002Fbiomarker-discovery and machine-learning\u002Fmodel-validation; for pathway interpretation see metabolomics\u002Fpathway-mapping; for design\u002Fpower\u002Fmultiplicity regime see experimental-design\u002Fmultiple-testing.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-statistical-analysis\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7CW2BCBF851WYE03Z8XPEDQ","bio-metabolomics-pathway-mapping","Maps metabolomics results to biological pathways via over-representation (ORA), metabolite-set enrichment (MSEA\u002FQEA), mummichog\u002FPSEA on raw m\u002Fz peaks, and network-diffusion enrichment (FELLA), with correct background-set construction and honest interpretive ceilings. Use when interpreting differential metabolites or an untargeted LC-MS feature table in pathway context, choosing ORA vs MSEA vs mummichog vs topology, or setting the reference\u002Fbackground set. For annotation confidence levels feeding ORA see metabolomics\u002Fmetabolite-annotation; for gene-set concepts see pathway-analysis\u002Fgo-enrichment and pathway-analysis\u002Fgsea; for joint gene+metabolite pathways see multi-omics-integration\u002Fmofa-integration.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-pathway-mapping\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CW21NSZMCPMF7D9CHJM718","bio-metabolomics-normalization-qc","Designs QC, corrects signal drift, removes batch effects, filters features, normalizes samples, and imputes missing values for untargeted LC-MS\u002FGC-MS metabolomics, framing each step as a measurement model that can create or erase biological signal. Use when processing a peak\u002Ffeature table before statistical analysis, choosing a drift-correction or sample-normalization method, deciding QC RSD vs D-ratio filtering, or handling left-censored missing values. The feature table is produced by metabolomics\u002Fxcms-preprocessing or metabolomics\u002Fmsdial-preprocessing; transformation\u002Fscaling for modeling defers to metabolomics\u002Fstatistical-analysis; cross-study design issues link to experimental-design\u002Fbatch-design.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-normalization-qc\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":61,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7CW1SWVM0NYHVE6Q7MA3G7R","bio-metabolomics-msdial-preprocessing","Runs the MS-DIAL preprocessing workflow (peak picking, MS2Dec spectral deconvolution, alignment, gap-filling) and imports the alignment-result table into R or Python with honest filtering. Use when preprocessing LC-MS DDA\u002FDIA (SWATH) or GC-MS raw data with MS-DIAL, deciding MS-DIAL vs XCMS, configuring the MSDIALCUI console run, or parsing an MS-DIAL export into a clean feature matrix. For programmatic R peak detection and the feature-table-as-artifact framing see metabolomics\u002Fxcms-preprocessing; for lipid annotation mode see metabolomics\u002Flipidomics; for MSI-level confidence honesty see metabolomics\u002Fmetabolite-annotation; for drift correction and QC see metabolomics\u002Fnormalization-qc.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-msdial-preprocessing\u002FSKILL.md",[],[]]