n-mounier / MRlap

R package to perform two-sample Mendelian Randomisation (MR) analyses using (potentially) overlapping samples
GNU General Public License v2.0
46 stars 11 forks source link

Error occur when running cross-trait LDSC #6

Open jiayanl1 opened 1 year ago

jiayanl1 commented 1 year ago

Hi, an error occurred when running cross-trait LDSC: Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 't': non-conformable arguments

I checked the dataset of exposure and outcome, the number of columns are equal, and the variables name are following the requirement. I am not sure how to deal with this error. Please advise. Thanks.

millie-z commented 1 year ago

Has there been an update or fix for this issue? I am also encountering this error when running cross-trait LDSC

error running cross-trait LCSC
akarito commented 11 months ago

I got the same error.

vincywang22 commented 10 months ago

Same question

lcpilling commented 10 months ago

Can anyone (@jiayanl1 @millie-z @akarito @vincywang22) create a reproducible example (i.e., paste some R code here)? Might help

n-mounier commented 9 months ago

Hello, I have tried on different machines, using different R versions, and haven't been able to reproduce the error... Could you please let me know if you get the same error using the examples provided (hence likely to be related to the LD scores files) or if this only happens when using your own data?

xuj18 commented 9 months ago

Hi, I was able to run MRlap using the example dataset. But I got the same error at the cross-trait LDSC step like everyone else here when running my own dataset. Any ideas on why? Thank you!

> 
> B = MRlap(exposure = mb_analysis,
+           exposure_name = "Bifidobacterium",
+           outcome = bmi_analysis,
+           outcome_name = "BMI",
+           ld = "/gpfs/gibbs/pi/huckins/jx287/microbiome_project/analysis/eur_w_ld_chr",
+           hm3 = "/gpfs/gibbs/pi/huckins/jx287/microbiome_project/analysis/eur_w_ld_chr/w_hm3.snplist",
+           MR_threshold = 1e-5,
+           MR_pruning_dist = 10,
+           MR_pruning_LD =  0.001)
<<< Preparation of analysis >>> 
> Checking parameters 
The p-value threshold used for selecting MR instruments is: 1e-05 
The distance used for pruning MR instruments is:  10 Kb 
The LD threshold used for pruning MR instruments is: 0.001 
> Processing exposure (Bifidobacterium) summary statistics... 
# Preparation of the data... 
The data.frame used as input is: "mb_analysis".  
   SNPID column, ok - CHR column, ok - POS column, ok - ALT column, ok - REF column, ok - BETA column, ok - SE column, ok - N column, ok 
> Processing outcome (BMI) summary statistics... 
# Preparation of the data... 
The data.frame used as input is: "bmi_analysis".  
   SNPID column, ok - CHR column, ok - POS column, ok - ALT column, ok - REF column, ok - BETA column, ok - SE column, ok - N column, ok 

<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 
<<< Performing cross-trait LDSC >>>  
> Munging exposure data... 
> Munging outcome data... 
> Running cross-trait LDSC... 
Error in h(simpleError(msg, call)) :                                                                               
  error in evaluating the argument 'x' in selecting a method for function 't': non-conformable arguments
zzlsms commented 1 month ago

Hi! I may have found some trace for this bug !

I have encountered the same problem when using my own data, and after debugging the code, it seems the problem came from here

image

There is a dimension mismatch between two matrixs, but i don't know why this happended.

It is not likely a problem with data, becasue i am using the debug mode without using my own data, the error remains:

image