digitalcytometry / cytotrace2

CytoTRACE 2 is an interpretable AI method for predicting cellular potency and absolute developmental potential from scRNA-seq data.
Other
97 stars 8 forks source link

undefined columns selected #43

Open victorwang123 opened 1 week ago

victorwang123 commented 1 week ago

Hi,great to see the new version! I followed the tutorial to do it, but when using plotData, the following error occurred. Do you know what's going on? library(CytoTRACE2) expression_data <- seurat_obj@assays$RNA@counts cytotrace2_result <- cytotrace2(expression_data) annotation <- seurat_obj$seurat_clusters plots <- plotData(cytotrace2_result = cytotrace2_result, annotation = annotation,expression_data = expression_data)

-Error in [.data.frame(annotation, "Phenotype") : -undefined columns selected

mrBanana0817 commented 5 days ago

same error, try this instead annotation <- seurat_obj@meta.data['seurat_clusters'] Because the input 'annotation' is required as data.frame not vector according to their code from 'plotting.R': names(annotation)[1] <- "Phenotype" annotation <- merge(prediction, annotation, by = "row.names", all.x = TRUE) rownames(annotation) <- annotation$Row.names annotation$Row.names <- NULL