Error running inferCNV::run

99 views
Skip to first unread message

swati gupta

unread,
Dec 3, 2023, 10:40:39 AM12/3/23
to Trinity_CTAT_users
Hi,
I am trying to find tumor cells in my dataset of epithelial cells. I have labelled the wild type condition cells as my reference (ob1). 
When running the infercnv:: run command (whole code below):

newobj<-readRDS('integrated_epi.rds')
Idents(newobj)<-'dataset'
DefaultAssay(newobj)<-'RNA'
counts_matrix <- GetAssayData(newobj,slot ="counts")
ann<-ne...@meta.data[,"dataset",drop=FALSE]
infercnv_obj = CreateInfercnvObject(raw_counts_matrix=counts_matrix,
                                    annotations_file=ann,
                                   gene_order_file="gene_orderfile.txt",
                                    delim="\t",
                                    ref_group_names=c("ob1"))

# perform infercnv operations to reveal cnv signal
infercnv_obj = infercnv::run(infercnv_obj,
                             cutoff=0.1,  # use 1 for smart-seq, 0.1 for 10x-genomics## since already processed count matrix setting to 0
                             out_dir="infercnv_out",  # dir is auto-created for storing outputs
                             denoise=T,
                             HMM=T
)

I am getting the following error:
STEP 15: computing tumor subclusters via leiden INFO [2023-12-03 16:19:37] define_signif_tumor_subclusters(p_val=0.1 INFO [2023-12-03 16:19:37] define_signif_tumor_subclusters(), tumor: ob2 Warning: Data is of class matrix. Coercing to dgCMatrix. Finding variable features for layer counts Calculating gene variances 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **************************************************| Calculating feature variances of standardized and clipped values 0% 10 20 30 40 50 60 70 80 90 100% [----|----|----|----|----|----|----|----|----|----| **************************************************| Warning: No layers found matching search pattern provided Error in `ScaleData()`: ! No layer matching pattern 'data' found. Please run NormalizeData and retry

My seurat object was normalized and scaled and had the data slot in RNA assay. But I cant see any 'data' in infercnv_obj. Please advice on how to proceed.

Alice Dong

unread,
Dec 15, 2023, 11:13:45 AM12/15/23
to Trinity_CTAT_users
Hi, 

I have the same error. Did any of you figure out the reason or have any suggestions please?

cgeo...@broadinstitute.org

unread,
Dec 15, 2023, 11:19:34 AM12/15/23
to Trinity_CTAT_users
Hi,

Version 1.18.1 of infercnv that is available on BioConductor should have this issue fixed, so simply updating your install should allow the run to keep going.

Regards,
Christophe.

Alice Dong

unread,
Dec 15, 2023, 11:57:31 AM12/15/23
to Trinity_CTAT_users
Thanks! The error was fixed!

swati gupta

unread,
Dec 20, 2023, 5:55:21 AM12/20/23
to Trinity_CTAT_users
Hi,
Thanks a lot.
This worked for me as well. 

Can you also point me to how I can understand the results and use them to infer the tumor cells from the sample?

Swati

Reply all
Reply to author
Forward
0 new messages