Error in validate_infercnv_obj(infercnv_obj): Problem detected w/ infercnv_obj and Error: No feature overlap between existing object and new layer data #659
Hi when I run inferCNV I get errors, irrespective of the versions.
In an older Version
options("CY112sn_subset.assay.version" = "v3")
infercnv_obj = CreateInfercnvObject(
raw_counts_matrix=GetAssayData(CY112sn_subset, slot="scale.data"),
annotations_file=infercnv_meta,
delim="\t",
gene_order_file="infercnv//hg38_gencode_v27.txt",
ref_group_names=c("CD8+ T cell","B cell","CD4+ T cell","Lymphatic endothelial cell","Fibroblast","Endothelial cell"))
Macrophage
out_dir = tempfile()
infercnv_obj_default = infercnv::run(
infercnv_obj,
cutoff=1, # cutoff=1 works well for Smart-seq2, and cutoff=0.1 works well for 10x Genomics
out_dir="./infercnv/CY112/",
cluster_by_groups=TRUE,
plot_steps=FALSE,
denoise=TRUE,
HMM=FALSE,
no_prelim_plot=TRUE,
png_res=60
)
This gave me the following error:
INFO [2024-04-18 17:56:52] define_signif_tumor_subclusters(p_val=0.1
INFO [2024-04-18 17:56:52] define_signif_tumor_subclusters(), tumor: CD8+ T cell
INFO [2024-04-18 17:56:52] Less cells in group CD8+ T cell than k_nn setting. Keeping as a single subcluster.
INFO [2024-04-18 17:56:52] define_signif_tumor_subclusters(), tumor: B cell
INFO [2024-04-18 17:56:52] Less cells in group B cell than k_nn setting. Keeping as a single subcluster.
INFO [2024-04-18 17:56:52] define_signif_tumor_subclusters(), tumor: Macrophage
Warning message:
“Data is of class matrix. Coercing to dgCMatrix.”
Error: No feature overlap between existing object and new layer data
Traceback:
LayerData<-(object = *tmp*, layer = layer, features = features[[layer]],
. cells = cells[[layer]], transpose = transpose, value = counts[[layer]])
LayerData<-.Assay5(object = *tmp*, layer = layer, features = features[[layer]],
. cells = cells[[layer]], transpose = transpose, value = counts[[layer]])
stop("No feature overlap between existing object and new layer data",
. call. = FALSE)
In the New version 1.19.1, the same command gives the following error:
INFO [2024-04-23 18:08:51] ::above_min_mean_expr_cutoff:Start
INFO [2024-04-23 18:08:51] Removing 1919 genes from matrix as below mean expr threshold: 1
INFO [2024-04-23 18:08:51] validating infercnv_obj
ERROR [2024-04-23 18:08:51] hmm.... rownames(infercnv_obj@expr.data != rownames(infercnv_obj@gene_order))
Error in validate_infercnv_obj(infercnv_obj): Problem detected w/ infercnv_obj
Traceback:
Hi when I run inferCNV I get errors, irrespective of the versions.
In an older Version
options("CY112sn_subset.assay.version" = "v3") infercnv_obj = CreateInfercnvObject( raw_counts_matrix=GetAssayData(CY112sn_subset, slot="scale.data"), annotations_file=infercnv_meta, delim="\t", gene_order_file="infercnv//hg38_gencode_v27.txt", ref_group_names=c("CD8+ T cell","B cell","CD4+ T cell","Lymphatic endothelial cell","Fibroblast","Endothelial cell"))
Macrophage
out_dir = tempfile() infercnv_obj_default = infercnv::run( infercnv_obj, cutoff=1, # cutoff=1 works well for Smart-seq2, and cutoff=0.1 works well for 10x Genomics out_dir="./infercnv/CY112/", cluster_by_groups=TRUE, plot_steps=FALSE, denoise=TRUE, HMM=FALSE, no_prelim_plot=TRUE, png_res=60 )
This gave me the following error: INFO [2024-04-18 17:56:52] define_signif_tumor_subclusters(p_val=0.1 INFO [2024-04-18 17:56:52] define_signif_tumor_subclusters(), tumor: CD8+ T cell INFO [2024-04-18 17:56:52] Less cells in group CD8+ T cell than k_nn setting. Keeping as a single subcluster. INFO [2024-04-18 17:56:52] define_signif_tumor_subclusters(), tumor: B cell INFO [2024-04-18 17:56:52] Less cells in group B cell than k_nn setting. Keeping as a single subcluster. INFO [2024-04-18 17:56:52] define_signif_tumor_subclusters(), tumor: Macrophage Warning message: “Data is of class matrix. Coercing to dgCMatrix.” Error: No feature overlap between existing object and new layer data Traceback:
LayerData<-
(object =*tmp*
, layer = layer, features = features[[layer]], . cells = cells[[layer]], transpose = transpose, value = counts[[layer]])LayerData<-.Assay5
(object =*tmp*
, layer = layer, features = features[[layer]], . cells = cells[[layer]], transpose = transpose, value = counts[[layer]])In the New version 1.19.1, the same command gives the following error: INFO [2024-04-23 18:08:51] ::above_min_mean_expr_cutoff:Start INFO [2024-04-23 18:08:51] Removing 1919 genes from matrix as below mean expr threshold: 1 INFO [2024-04-23 18:08:51] validating infercnv_obj ERROR [2024-04-23 18:08:51] hmm.... rownames(infercnv_obj@expr.data != rownames(infercnv_obj@gene_order)) Error in validate_infercnv_obj(infercnv_obj): Problem detected w/ infercnv_obj Traceback:
I get the same errors despite the rownames being the same. Could you please help me solve this?
Thanks, Prakrithi