rcannood / SCORPIUS

Linear trajectory inference for single-cell RNA-seq
http://rcannood.github.io/SCORPIUS/
58 stars 16 forks source link

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

Open lucygarner opened 1 year ago

lucygarner commented 1 year ago

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 commented 1 year ago

I noticed this issue might be similar: https://github.com/rcannood/SCORPIUS/issues/32

asif7adil commented 4 months ago

Hi Lucy!

I am also facing the same problem, did you find a solution to this problem? I would be grateful for any help.

Thanks!

Best, Asif