SCORPIUS icon indicating copy to clipboard operation
SCORPIUS copied to clipboard

Error in array(ans, c(len.a%/%d2, d.ans), if (!is.null(names(dn.ans)) || : negative length vectors are not allowed

Open lucygarner opened this issue 1 year ago • 1 comments

Hi,

I am getting this error at the extract_modules step, which appears to be related to the maximum length of allowed vectors in R: https://stackoverflow.com/questions/42479854/merge-error-negative-length-vectors-are-not-allowed, https://github.com/alyssafrazee/polyester/issues/41, https://support.bioconductor.org/p/66401/

"You are getting this error because the data.frame / data.table created by the join has more than 2^31 - 1 rows (2,147,483,647). Due to the way vectors are constructed internally by R, the maximum length of any vector is 2^31 - 1 elements (see: https://stackoverflow.com/a/5234293/2341679). Since a data.frame / data.table is really a list() of vectors, this limit also applies to the number of rows."

modules <- extract_modules(scale_quantile(expr_sel), traj$time, verbose = FALSE)

expr_sel is 48384 (cells) * 100 (top 100 genes from gene_importances)

Looking at my memory profiling output, there is a spike of memory usage at this point:

image

Is there a way around this, or would I need to subsample the number of cells? What is the maximum number of cells * genes for which you have run extract_modules. Looking at the underlying code, my guess is that the error arises when running Mclust.

Best wishes, Lucy

lucygarner avatar Mar 14 '23 13:03 lucygarner