MRCIEU / TwoSampleMR

R package for performing 2-sample MR using MR-Base database
https://mrcieu.github.io/TwoSampleMR
Other
415 stars 175 forks source link

harmonisation ld matrix #270

Open MaVdb opened 3 years ago

MaVdb commented 3 years ago

I've applied the commands below to obtain mr_ivw effect estimates, taking into account correlation between SNPs. MRObject <- dat_to_MRInput(dat, get_correlation=TRUE) MendelianRandomization::mr_ivw(MRObject[[1]], correl=TRUE)

As it's important that the correlations are in the right direction, with signs of the correlations corresponding to the same effect alleles as the genetic associations, I was wondering whether harmonization is performed automatically (applying the commands above)?

I've compared the results with the following: 1) Create ld matrix within TwoSample MR 2) Apply harmonise_ld_dat function (this function was not working, but I created it myself with the source code from https://rdrr.io/github/MRCIEU/TwoSampleMR/src/R/other_formats.R 3) Get mr_ivw with function in MendelianRandomization package and using the harmonised dataset from step 2: mr_ivw(mr_input(bx=Input$beta.exposure,bxse=Input$se.exposure,by=Input$beta.outcome,byse=Input$se.outcome,corr=Harmonised_ld_matrix))

The same results were obtained, as same LD matrix. Is it correct to assume that the MRObject already contains harmonised LD matrix?

Shicheng-Guo commented 2 years ago

@MaVdb , did you confirm it? I am also interested in this question. Thanks.

MaVdb commented 2 years ago

@Shicheng-Guo No, I do not know the answer yet.

laleoarrow commented 4 months ago

This is also issued in #420