zhanghao-njmu / SCP

An end-to-end Single-Cell Pipeline designed to facilitate comprehensive analysis and exploration of single-cell data.
https://zhanghao-njmu.github.io/SCP/
GNU General Public License v3.0
327 stars 70 forks source link

Error in CellCorHeatmap() #231

Open redtorrentCN opened 4 months ago

redtorrentCN commented 4 months ago

Hi, sir, When I run CellCorHeatmap(), a trouble occurred like following:

Use 'raw' method to find neighbors. Predict cell type... Error in if (length(x = value) == ncol(x = x) && all(names(x = value) == : missing value where TRUE/FALSE needed`

this is my code:

subnatmed.epi <- subset(natmed,celltype %in% c('Uncili_Epi','Cili_Epi')) DimPlot(subnatmed.epi,reduction = 'umap.scvi',label = T,pt.size = 1.5) subnatmed.epi$Epitype <- ifelse(subnatmed.epi$scvi_clusters_0.1 %in% 4,'Cili_Epi', ifelse(subnatmed.epi$scvi_clusters_0.1 %in% 1,'Uncili_Epi 1#','Uncili_Epi 2#'))

subAsse.epi <- subset(Asse,celltype %in% c('Uncili_Epi','Cili_Epi')) DimPlot(subAsse.epi,reduction = 'umap.scvi',label = T,pt.size = 1.5) subAsse.epi$Epitype <- ifelse(subAsse.epi$scvi_clusters_1 %in% 21,'Cili_Epi 1#', ifelse(subAsse.epi$scvi_clusters_1 %in% 22,'Cili_Epi 2#', ifelse(subAsse.epi$scvi_clusters_1 %in% 8,'Uncili_Epi 1#', ifelse(subAsse.epi$scvi_clusters_1 %in% 14,'Uncili_Epi 2#','Uncili_Epi 3#'))))

ht <- CellCorHeatmap( srt_query =subAsse.epi, srt_ref = subnatmed.epi, query_group = "Epitype", ref_group = "Epitype", nlabel = 3, label_by = "row", show_row_names = TRUE, show_column_names = TRUE )

I just use seurat object (s3 assay) directly to SCP package. thanks for your reading and answers. @zhanghao-njmu