Closed huiyijiangling closed 3 weeks ago
Sorry for the late reply since I was traveling. This is a known issue when the gene count matrix is a DelayedArray
, buried deep inside DelayedArray
's binary arithmetic operators. I'm not sure what to do about it for now. Quick and dirty fix: something like logcounts(sfe) <- as(logcounts(sfe), "CsparseMatrix")
. I may try adding something before this line for a more permanent fix: https://github.com/pachterlab/voyager/blob/27944de52b5fc4ecca06b03eb56f887ef28ba498/R/SFEMethod-bivariate.R#L22
I finally got a chance to look into it. Turns out the problem is much simpler. The base
version of the sweep
function is called here, which can't handle DelayedArray
. Now in the updated code, DelayedArray
's sweep
method is called (simply imported it so it can be found), and it works. Nothing to do with weird ways DelayedArray
handles binary arithmetic operations; that arose because of the way the base
version of sweep
preprocesses the data.