zhengli09 / BASS-Analysis

Tutorial of BASS and results reproduction
6 stars 3 forks source link

Error in harmonyObj$init_cluster_cpp(0) #1

Closed YANG-ERA closed 1 year ago

YANG-ERA commented 1 year ago

Hi, When I used BASS for multi sample analysis (DLPFC_p3.RData), I encountered an error in the preprocessing part,

Error in harmonyObj$init_cluster_cpp(0) : 
  element-wise multiplication: incompatible matrix dimensions: 100x4 and 100x1

I had checked the version of harmony (0.1.1), which satisfied the configuration of BASS. Am I perhaps missing something?
Thanks in advance

zhengli09 commented 1 year ago

Hi, Thank you for your interest in using BASS! This error seems to come from the package "harmony" that BASS is using to remove batch effects across slices. I have a problem replicating this error since the code works all right on my side . I am wondering if this error comes from any package conflict. I find some people reported this similar error here (https://github.com/immunogenomics/harmony/issues/166). They were able to solve this error by re-installing "harmony" and "Rcpp". I would suggest you to first try approaches mentioned there to see if they can help. Best, Zheng

YANG-ERA commented 1 year ago

Thank you for your reply! I had re-installed harmony and Rcpp, but it didn't work on my side. In addition, I tried to run BASS on my server, but the same error occurred. At last, I modified the code of Harmony in the preprocessing part. It worked successfully in my computer! Here is my code:

X_run <- harmony::HarmonyMatrix(
  data_mat = X_run,
  meta_data = as.character(rep(1:4, table(sample_id))),
  do_pca = FALSE ## don't recompute PCs)
)

You can have a look Best Yang