Hi, I have been trying to use SingleR to annotate the cell type per cluster. I used my Seurat object from integration analysis and the code was:
ref <- ImmGenData() pred <- SingleR(as.SingleCellExperiment(seurat.integrated), ref, labels=ref$label.main, clusters=Idents(seurat.integrated))
But, when I checked
rownames(pred), it still showed the name of each cell, not the cluster ids that I input in the function.
Also, when I checked with
table(pred$labels), it also showed the number of a single cell per cell type.
Could anyone help me get the cluster-wise annotation results (the code above only provided me a single-cell wise annotation results)?
Any advice will be greatly appreciated. Thank you!