Insturments associated with other phenotypes than the exposure lead MR estimate being biased (horizontal pleiotropy). This package is designed to predict which instruments are likely to be problematic due to pleiotropy and downweight them to be used in MR.
Suppose we estimate the effect of X on Y. X is instrumented by genetic variants, which are likely to be associated with other phenotypes. We can use external data to predict which instrument are the most pleiotropic to down weight them. 1. Make score for every SNP to see how likely it is to be pleiotropic. 2. Perform MR accounting for pleiotropy using IOS (e.g. higher IOS = lower weight)
Defining IOS
Write functions for
MR analysis considering IOS: IOS will be taken account into the MR model. The variants with higher IOS scores will be down-weighted.
Apply the functions to empirical analysis to answer the main questions
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Call the packages
library(TwoSampleMR) library(RadialMR) library(mr.ios)
# choose exposure - BMI id_exp <- "ieu-a-2" exp_dat <- TwoSampleMR::extract_instruments(id_exp) # choose outcome - CHD id_out <- "ieu-a-7" out_dat <- TwoSampleMR::extract_outcome_data(exp_dat$SNP, id_out) # choose background dataset list id_bg <- background_ids(id_exp=id_exp, id_out=id_out, type="default") # make background dataset bg_dat <- make_background(exp = exp_dat, id_bg = id_bg) # generate ios ios_dat <- ios(exp=exp_dat, bg=bg_dat) # perform mr dat <- TwoSampleMR::harmonise_data(exp_dat, out_dat) mr_res <- mr.ios(dat=dat, ios = ios_dat, alpha = 0.05, 1, tol = 0.0001)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.