broadinstitute / infercnv

Inferring CNV from Single-Cell RNA-Seq
Other
561 stars 166 forks source link

C stack usage 7972356 is too close to the limit #335

Closed bobbyshih closed 2 years ago

bobbyshih commented 3 years ago

I am running into an error station C stack usage is too close to the limit. I am using the latest version of both R (version 4.1.0) and inferCNV (1.8.0). The machine I am running this on has 12 cores and 64 GB of memory.

I am running inferCNV using the following command:

infercnv_obj = infercnv::run(infercnv_obj,
                             cutoff = 0.1,
                             out_dir = "/mnt/data/bobby/CUSSN2_SingleCell/CUSSN2_VER3/InferCNV/results3",
                             cluster_by_groups = FALSE,
                             denoise = TRUE,
                             HMM = TRUE,
                             analysis_mode = "subcluster",
                             tumor_subcluster_partition_method = "random_trees",
                             HMM_report_by = "cell",
                             num_threads = 4,
                             cluster_references = FALSE)

After some time I get the following error: Error: C stack usage 7972356 is too close to the limit

I have run this analysis before using the following settings:

analysis_mode = "sample",
HMM_report_by = "subcluster", 
cluster_by_group=TRUE, 
cluster_references=TRUE 

This successfully ran without any error. However, my goal with this analysis is to extract single cell inferCNV calls for malignant cells and observe single cell clustering on a dendrogram based on copy number alterations to identify clonal evolutionary patterns between these clusters.

I am also attaching sessioninfo, related error logs, and other code I used.

traceback.txt InferCNV_Error.txt inferCNV_RScript.txt SessionInfo.txt

Any advice would be greatly appreciated!

GeorgescuC commented 3 years ago

Hi @bobbyshih ,

The error is related to the recursion depth when converting the dendrogram displayed on the left side of the figure. If you run ulimit -s unlimited in the terminal before starting a new R session, you should be able to resume your run without issues.

Of note, even if you report the HMM results by cell, there will be no useful clustering information within each subcluster in the HMM outputs because all cells from the same subcluster have the same set of predictions. The clustering between the different subclusters is informative though. If you want cell level clustering information, you can use the clustering outputs from the non HMM steps.

Regards, Christophe.

bobbyshih commented 3 years ago

That worked! I could have sworn I tried this already, but there must have been something different this time.

My only change from the original post was changing HMM_report_by = "subcluster"

infercnv_obj = infercnv::run(infercnv_obj,
                             cutoff = 0.1,
                             out_dir = "/mnt/data/bobby/CUSSN2_SingleCell/CUSSN2_VER3/InferCNV/results3",
                             cluster_by_groups = FALSE,
                             denoise = TRUE,
                             HMM = TRUE,
                             analysis_mode = "subcluster",
                             tumor_subcluster_partition_method = "random_trees",
                             HMM_report_by = "subcluster",
                             num_threads = 4,
                             cluster_references = FALSE)