broadinstitute / infercnv

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

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

Open yintz opened 1 year ago

yintz commented 1 year ago

hi, when I run the inferCNV up to the point, based on the previous discuss, I tried to adjust the ulimit, but it doesn't work at all. so I want to know if there is any methods yet.

infCNV = infercnv::run(infCNV, cutoff=0.1, out_dir="./Outputs", num_threads = 10, cluster_by_groups=FALSE, denoise=TRUE, HMM=TRUE)

INFO [2022-12-15 07:03:54] -mirroring for hspike INFO [2022-12-15 07:03:54] define_signif_tumor_subclusters(p_val=0.1 INFO [2022-12-15 07:03:55] define_signif_tumor_subclusters(), tumor: all_observations INFO [2022-12-15 07:03:55] define_signif_tumor_subclusters(), tumor: simnorm_cell_normalsToUse INFO [2022-12-15 07:07:41] ::plot_cnv:Start INFO [2022-12-15 07:07:41] ::plot_cnv:Current data dimensions (r,c)=10478,21023 Total=220520877.289766 Min=0.715669324907483 Max=1.61318599172622. INFO [2022-12-15 07:08:07] ::plot_cnv:Depending on the size of the matrix this may take a moment. INFO [2022-12-15 07:08:47] plot_cnv(): auto thresholding at: (0.873603 , 1.128593) INFO [2022-12-15 07:08:53] plot_cnv_observation:Start INFO [2022-12-15 07:08:53] Observation data size: Cells= 21023 Genes= 10478

GeorgescuC commented 1 year ago

Hi @yintz ,

Based on the last log message shown and your settings, the error appears to happen in the plotting when trying to write the dendrogram/hclust to file with ape::write.tree() which uses recursion internally. If you are unable to change the stack limit on your system to increase max recursion depth, the work around would be to remove the write.tree calls in the code (as there is currently no option to control that) or disable plotting if you are only interested in the text outputs and R object.

Regards, Christophe.

Dana11T commented 1 year ago

have you tried “ulimit -s unlimited“,I used this code, but still getting the same error. At present, I have given the stack a specified value,(ulimit -s 51200), it is running now. I don’t know if the result will be normal. you can have a try

GeorgescuC commented 1 year ago

A new option has been added recently to both run() and plot_cnv(), write_phylo which defaults to FALSE. The option controls if the dendrogram/hclust is converted to a newick string to write to file during plotting. That conversion is actually the call that uses recursion, so on the latest version, the issue should not happen in this location anymore.