MRCIEU / TwoSampleMR

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

own exposure data in multivariable MR, how? #160

Open Suus0509 opened 4 years ago

Suus0509 commented 4 years ago

Hi,

I am trying to perform a multivariable MR with my own summary exposure data, but I am not sure whether I am doing it the right way, and I keep receiving an error about my data.frame. However, I used the exact same data file in a conventional MR and I did not encounter any trouble here.

I loaded my exposure data in the following manner:

##create vector with my own exposure summary data
a <- 'own_exposure_summary_data.txt'

##search through available GWA Studies and create a vector with the id of the exposures which I wanted to use
id_exposure <- c('a','UKB-a:360')

Afterwards I created the right exposure data format

Exposure_dat <- mv_extract_exposures(id_exposure, clump_r2 = 0.001, clump_kb = 10000, harmonise_strictness = 2, access_token = ieugwasr::check_access_token(), find_proxies = TRUE, force_server = FALSE)

However, I keep receiving the following error

Requesting default values. Extracting from pre-clumped data
1 out of 2 requested outcomes have pre-calculated instruments.
Extracting data from 1 GWAS(s)
and performing LD clumping
[>] 1 of 1
Clumping 1, 167 SNPs
Extracting data for 167 SNP(s) from 2 GWAS(s)
Finding proxies for 167 SNPs in outcome oestradiol.txt
Extracting data for 167 SNP(s) from 1 GWAS(s)
Error in $<-.data.frame(*tmp*, "mr_keep.outcome", value = TRUE) :
replacement has 1 row, data has 0

I hope someone can help me out. Thanks in advance.

krz commented 4 years ago

I would also be interested in using local summary data in a multivariate MR. Or maybe you could add the Scott et al study to your databasee (https://diabetes.diabetesjournals.org/content/66/11/2888.long)