mr_steiger() for binary trait

449 views
Skip to first unread message

ar3...@columbia.edu

unread,
Jul 30, 2018, 9:12:53 AM7/30/18
to MR-Base
Hello,

I am working on an MR analysis with a binary exposure and outcome and wanted to run the directionality_test() function in MR Base. When running the function it returns the following warning (as in the MR Base vignette)  "Use get_r_from_lor for binary traits.” However, looking through the manual and the code on get hub, I don’t see a way to have  directionality_test() use the  get_r_from_lor()  function for binary traits. Looking at the mr_steiger() code I see that it uses the function get_r_from_pn() to estimate the contribution from each SNP which are then combined. Is it correct to replace get_r_from_pn() with get_r_from_lor()? I tried this and I am getting some non-sensical results where the SNPs used in the MR (after clumping) explain close to 8% of the variance. 

We also noticed the tin the MR Base Vignette, the directionality_test() is used with an outcome of Coronary heart disease, which is a binary outcome. Should this part of the vignette be ignored?

Many thanks for any guidance you can provide on the above and thank you for the wonderful tool.


Philip Haycock

unread,
Aug 28, 2018, 2:27:18 PM8/28/18
to MR-Base
Hello 

Did you get a response to your query?

arat...@gmail.com

unread,
Aug 28, 2018, 2:46:56 PM8/28/18
to MR-Base
Hi Phillip,

Gib Hemani replied very nicely to me and I asked him if I could post his response but never heard back. I'd be happy to copy his reply here if that's okay with the team.

Many thanks,

Andrew

arat...@gmail.com

unread,
Sep 25, 2018, 10:27:17 AM9/25/18
to MR-Base
Apologies to the group for the delay, but below is Gib Hemani's response.

Hey there

 

Forgive me for the slow response, things have been somewhat hectic of late. I do appreciate the feedback you’ve sent, I’m typing this in a rush, hope it is of some help -

 

I made some updates, if you now reinstall the R package (devtools::install_github(‘MRCIEU/TwoSampleMR’)) then you will pull down the changes. Basically you can pre-supply the SNP-trait correlations for the exposure and outcome as two columns – r.exposure and r.outcome. If those aren’t provided then it will try to estimate based on p-value and sasmple size. So if you have any binary traits then you should supply those in the new columns.

 

A few notes about estimating SNP-trait correlations -

 

The get_r_from_pn()  (for quantitative traits) has its own problems in that it might be numerically unstable at some low p-values. The estimation of r2 for binary traits is difficult, as I’m sure you are aware. The get_r_from_lor()  (for binary traits) attempts to estimate the variance explained on the liability scale in an unascertained sample, following

 

Lee SH, Wray NR. Novel genetic analysis for case-control genome-wide association studies: quantification of power and genomic prediction accuracy. PLoS One. 2013;8(8):e71494.

 

Another problem with both is if GWAS hits are used from the discovery sample, which will have inflated effects due to winner’s curse. So ideally effect size estimates from independent replication samples (for the exposure variable) would be used.

 

Thanks for pointing out that the example is on CHD as an outcome – this is not ideal I think it must have been used just to illustrate the code – I will change it to something when I get a chance.

 

Hope this helps, best wishes

Gib

arat...@gmail.com

unread,
Apr 19, 2019, 12:12:35 AM4/19/19
to MR-Base
Hi All,

I just reinstall the TwoSampleMR package today and the function get_r_from_lor() is no longer available. Entering "TwoSampleMR::get_r_from_lor" yields the error:

Error: 'get_r_from_lor' is not an exported object from 'namespace:TwoSampleMR'

Has this function been removed for a reason? I.e., can I add the function manually by grabbing it from the steiger function on github (https://rdrr.io/github/MRCIEU/TwoSampleMR/src/R/steiger.R) or should the function not be used?

Many thanks,

Andrew

Reply all
Reply to author
Forward
0 new messages