Katsevich-Lab / sceptre

An R package for single-cell CRISPR screen data analysis emphasizing statistical rigor, massive scalability, and ease of use.
https://katsevich-lab.github.io/sceptre/
GNU General Public License v3.0
22 stars 7 forks source link

Error: C stack usage is too close to the limit #130

Closed vkartha closed 1 week ago

vkartha commented 1 month ago

Hi there, thanks for developing this package.

I'm running into the following error when running the object initialization step:

sceptre_object <- import_data(
  response_matrix = rnaMat,
  grna_matrix = gRNAMat,
  grna_target_data_frame = grna_target_data_frame,
  moi = "low",
  extra_covariates = extra_covariates,
  response_names = rownames(rnaMat))

Error: C stack usage 9612268 is too close to the limit

I get this error regardless of using the ondisc option or not

Some searching suggests this has to do with function recursion, but I was wondering if there's a fix? All my input variables are in the right format as far as I checked (both matrices are sparse matrices and the rest are data frames with relevant metadata)

Thanks in advance

timothy-barry commented 1 month ago

Hi,

How big is your rnaMat? In particular, how many rows, columns, and nonzero entries does it have? Also, what is its class? You can determine this via class(rnaMat).

Tim

vkartha commented 1 month ago

Hey! rnaMat is a sparse Matrix format object that has ~27k genes, and ~92k cells. ~10% of the entries are non zero

Output below:

> class(rnaMat)
[1] "dgCMatrix"
attr(,"package")
[1] "Matrix"

> dim(rnaMat)
[1] 27743 92104

> sum(rnaMat!=0)
[1] 278826597
timothy-barry commented 1 month ago

Hi Vinay,

Thanks for the info. That matrix should be well within the limits of what the standard R console interface to sceptre can handle. My hunch is that something might be a bit off with the input argument formatting. Would you be able to send me your data so that I can take a look? (Of course, we will keep the data confidential and delete the data after we resolve the bug.) You could send me a list (in .rds format) containing response_matrix, grna_matrix, grna_target_data_frame, moi, extra_covariates, and response_names. My email is tbarry@hsph.harvard.edu.

timothy-barry commented 1 week ago

Closing due to inactivity. Please let me know if you need further assistance.