broadinstitute / infercnv

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

Missing output files in R version 4.2.1 and 4.2.2 #483

Open crg11 opened 1 year ago

crg11 commented 1 year ago

Hello!

I have been running inferCNV for awhile now and am running into a new problem with the file outputs after updating my version of R to 4.2.2. After running inferCNV in version 4.2.1 and 4.2.2 on both sample and subcluster modes on two different computers, the results lack the infercnv.observations.txt and infercnv.reference.text output files needed for the downstream correlation steps, though the rest of the usual files are there. Running it in R 4.1.1 results in all of the correct output files.

The code used here:

library(infercnv)

Set your working directory whereall 3 files are present

infercnv_obj = CreateInfercnvObject( raw_counts_matrix="BalbCv2_2225L_Erlotinib_A_R9_AllCells_rawUMIcounts.txt", annotations_file="BalbCv2_2225L_Erlotinib_A_R9_AllCells_labels.txt", delim="\t", gene_order_file="Geneorderforinfercnv.txt", ref_group_names=c("normal"), chr_exclude = c('chrX', 'chrY', 'chrM'))

Sample mode

numcores=6

print("InferCNV object created, running inferCNV...") system.time( infercnv::run( infercnv_obj, num_threads=numcores-1, out_dir="2225L_Erlotinib_A_R9_run2_check", HMM = FALSE, cutoff=0.1, window_length=101, max_centered_threshold=3, cluster_by_groups=F, plot_steps=F, denoise=T, sd_amplifier=1.3, analysis_mode = "samples" ) )

Thanks so much for the help! Cherise

GeorgescuC commented 1 year ago

Hi @crg11 ,

Those files are generated at the same type as the plots if the "write_expr_matrix" option is set to TRUE, but the default is now set to FALSE and properly linked with plot_cnv. If you simply restart the same run of infercnv you already did but changing this option, it should reload a backup from the end of the process and simply plot the figure again while this time outputting the files. If you would like that to be done for other steps as well, you can manually call plot_cnv() with that option using the backup from the given step. For the other options used in plotting (mostly for the HMM steps), you can check the call used in run() in R/infercnv_ops.R

Regards, Christophe.