Bio Causal Genomics Pleiotropy Detection
Detect and correct for horizontal pleiotropy in Mendelian randomization analyses using...
Install
npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-causal-genomics-pleiotropy-detection -g -a claude-code -y- Repository
- FreedomIntelligence/OpenClaw-Medical-Skills3.1k
- Category
- Engineering
- Updated
- 4mo ago
- License
- See repository
- Context cost
- Mediumabout 2,604 tokens
- Runs scripts
- No, instructions only
What it does
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 instruments, or running sensitivity analyses for causal inference.
Version Compatibility
Reference examples tested with: MR-PRESSO 1.0+, TwoSampleMR 0.5+
Before using code patterns, verify installed versions match. If versions differ:
- R:
packageVersion("<pkg>")then?function_nameto verify parameters
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Pleiotropy Detection
"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.
- R:
MRPRESSO::mr_presso()for global and distortion tests - R:
TwoSampleMR::mr_egger_regression()for Egger intercept test
Overview
Horizontal pleiotropy violates the exclusion restriction assumption of MR: instruments affect the outcome through pathways other than the exposure. Detecting and correcting for pleiotropy is essential for valid causal inference.
Types of pleiotropy:
- Vertical (mediated): Instrument -> exposure -> outcome (valid, not a problem)
- Horizontal (direct): Instrument -> outcome bypassing exposure (violates MR assumptions)
- Balanced: Pleiotropic effects cancel out (IVW still valid, Egger intercept ~0)
- Directional: Pleiotropic effects are systematic (biases IVW, Egger detects this)
MR-PRESSO
Goal: Detect and remove pleiotropic outlier instruments from an MR analysis.
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.
# install.packages('remotes')
# remotes::install_github('rondolab/MR-PRESSO')
library(MRPRESSO)
