broadinstitute / infercnv

Inferring CNV from Single-Cell RNA-Seq
Other
557 stars 164 forks source link

Error during step 4 with plot_steps #444

Open Prathyusha-konda opened 2 years ago

Prathyusha-konda commented 2 years ago

Hi, I am getting the following error when I try "plot_steps=TRUE" option. Can you please let me know how to fix this or how to recreate the graphs without this option? Thank you!!

STEP 04: log transformation of data

INFO [2022-08-08 13:45:52] transforming log2xplus1() INFO [2022-08-08 13:45:54] -mirroring for hspike INFO [2022-08-08 13:45:54] transforming log2xplus1() INFO [2022-08-08 13:46:17] ::plot_cnv:Start INFO [2022-08-08 13:46:17] ::plot_cnv:Current data dimensions (r,c)=4479,13652 Total=14861066.4303665 Min=0 Max=8.24624443603367. INFO [2022-08-08 13:46:18] ::plot_cnv:Depending on the size of the matrix this may take a moment. INFO [2022-08-08 13:47:34] plot_cnv(): auto thresholding at: (-1.773288 , 2.259362) 4: (function () traceback(2))() 3: png(paste(out_dir, paste(output_filename, ".png", sep = ""), sep = "/"), width = 10, height = (8.22 + sum(grouping_key_height)) + dynamic_extension, units = "in", res = png_res) 2: plot_cnv(infercnv_obj = infercnv_obj, k_obs_groups = k_obs_groups, cluster_by_groups = cluster_by_groups, cluster_references = cluster_references, out_dir = out_dir, title = sprintf("%02d_log_transformed_data", step_count), output_filename = sprintf("infercnv.%02d_log_transformed", step_count), output_format = output_format, write_expr_matrix = TRUE, png_res = png_res, useRaster = useRaster) 1: infercnv::run(infercnv_obj, cutoff = 0.1, out_dir = out_dir, cluster_by_groups = TRUE, analysis_mode = "subclusters", plot_steps = TRUE, denoise = TRUE, HMM = TRUE)

GeorgescuC commented 2 years ago

Hi @Prathyusha-konda ,

The traceback seems to show the error happens when trying to open the png output file to write to (but without trying to write anything to it yet). Are you able to run the "png()" method directly in R without using infercnv?

Regards, Christophe.

Prathyusha-konda commented 2 years ago

Hi @GeorgescuC, I was submitting the inferCNV job on the cluster and was getting this error. If I perform this on a standalone R studio desktop app, the process goes through just fine. So I have been using RStudio instead.

I have another question regarding this. I have HMM features that I'd like to add to my individual seurat objects before performing integration. For this, does it matter if my seurat object is pre- or post-normalized? I read that inferCNV is not recommended on integrated seurat object. So would this be a right thing to do for further analysis?

Thank you very much!

GeorgescuC commented 2 years ago

Hi @Prathyusha-konda ,

There are sometimes issues with opening png/pdf outputs from R on a server because of what packages are/are not installed, so for that issue I would suggest running an interactive session on your cluster and testing what combination of R/environment settings work for opening a png file and writing some test data to. One of the things you can try is to change the bitmapType in R.

For your second question, infercnv only adds an extra set of @meta.data fields to a Seurat object, but does not alter the rest of the object or use the data from it. Whether your Seurat object is pre or post normalization should thus not matter from our side of things because the cell CNV status is the same in both cases. I think the recommendation you read is about using the post-normalized data from a Seurat object as input to infercnv, which is not what you describe.

Regards, Christophe.