r-lib / vctrs

Generic programming with typed R vectors

Home Page:https://vctrs.r-lib.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error in vctrs when running MRlap

Cui4399 opened this issue · comments

I runned MRlap to do twosample MR when there are sample overlaps. My exposure and outcome data are both from Finngen, log files for ldsc and munge seems normal,and my codes are as follows:
reslap = MRlap(exposure = GP,

  •            exposure_name = "GP",
    
  •            outcome = SD,
    
  •            outcome_name = "SD",
    
  •            ld = "/home/ubuntu/ldsc/eur_w_ld_chr/",
    
  •            hm3 = "/home/ubuntu/MRLAP/filesNeed/w_hm3.snplist",
    
  •            MR_threshold = 5e-10,
    
  •            MR_pruning_LD = 0.05,
    
  •            save_logfiles=TRUE)
    

<<< Preparation of analysis >>>

Checking parameters
The p-value threshold used for selecting MR instruments is: 5e-10
The distance used for pruning MR instruments is: 500 Kb
The LD threshold used for pruning MR instruments is: 0.05
Processing exposure (GP) summary statistics...

Preparation of the data...

The data.frame used as input is: "GP".
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 (SD) summary statistics...

Preparation of the data...

The data.frame used as input is: "SD".
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...
Please check the log file GP_munge.log to ensure that all columns were interpreted correctly and no warnings were issued for any of the summary statistics files
Munging outcome data...
Please check the log file SD_munge.log to ensure that all columns were interpreted correctly and no warnings were issued for any of the summary statistics files
Running cross-trait LDSC...
Please check the log file GP.sumstats.gz_SD.sumstats.gz_ldsc.log for detailed results of the cross-trait LDSC analysis
Cleaning temporary files...
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
<<< Running IVW-MR >>>
Error in vctrs::vec_locate_matches():
! Match procedure results in an allocation larger than 2^31-1 elements.
ℹ Attempted allocation size was 94013060093.
ℹ This is an internal error that was detected in the vctrs package.
Please report it at https://github.com/r-lib/vctrs/issues with a reprex (https://tidyverse.org/help/) and the full backtrace.
Run rlang::last_trace() to see where the error occurred.

I think you will want to discuss this with the authors of MRlap.

It is saying that you are trying to perform a join that ends up resulting in >94 billion rows, way too many for R. This is likely an incorrect by argument in a dplyr join function, and you should probably bring that up to them!