satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.29k stars 915 forks source link

Error in drawing dotplot #6027

Closed JimmyMasa closed 2 years ago

JimmyMasa commented 2 years ago

Hi, thank you very much for developing Seurat. This is my first time asking questions on the platform, please feel free to point out any mistakes.

As I was trying to create a dotplot for my Seurat object, I realised that they are not in the order of what I wanted, thus I reordered the active.ident as the following: hip@active.ident <- factor(hip@active.ident, levels = c("Granule Cells", "Interneuron", "CA1/CA3 Neuron", "Neuroblasts", "Astrocytes", "Radial Glia-like Cells", "MOL", "MFOL", "OPC", "COP", "Vascular Endothelial Cells", "Leptomeningeal Cells", "Ependymall Cells", "Macrophages/Microglia", "Undefined"))

By doing so, the levels in active.ident are in different order. Which allow me to bring the SeuratObject to the next step for DotPlot. { d <- hip DefaultAssay(d) <- "RNA" length(colnames(d)) markers.to.plot <- c("MOG", "MBP") DotPlot(d, features = markers.to.plot, cols = c("blue", "red"), dot.scale = 8) + RotatedAxis() }

However, here is where I face error as the following comes up: Warning: Found the following features in more than one assay, excluding the default. We will not include these in the final data frame: MOG, MBP Error in FetchData.Seurat(object = object, vars = features, cells = cells) : None of the requested variables were found: MOG, MBP In addition: Warning message: In cells.idents["NA"] <- names(x = which(x = is.na(x = Idents(object = object)[cells]))) : Error in FetchData.Seurat(object = object, vars = features, cells = cells) : None of the requested variables were found: MOG, MBP

I am not entirely sure what these error messages indicates, as before I alter the active.ident order the DotPlot can be illustrated very easily without any issue.

Thank you very much.

Seurat (4.1.1) R version 4.1.2 (2021-11-01) Platform: x86_64-apple-darwin20.6.0 (64-bit) Running under: macOS Monterey 12.3.1

JimmyMasa commented 2 years ago

I am terribly sorry for disturbing the community, turns out the mistake was merely a careless misspelling, :-P

Wish you all have a great day.