Annotating UMAP clusters in Seurat with SingleR
1
1
Entering edit mode
2.3 years ago
Aaron ▴ 30

I'm trying to use SingleR to annotate UMAP plots in Seurat. I've been following this very helpful tutorial here (http://bioconductor.org/books/devel/SingleRBook/pancreas-case-study.html) and I see that SingleR can be used to annotate clusters in Scran but I haven't been able to figure out how to do the same thing in Seurat. Would someone be able to help me do it? I've pasted a portion of my code below to give a sense of what I want to achieve and what I have been trying.

library(Seurat)
library(DropletUtils)
library(SingleR)
library(celldex)

# Write seurat_integrated to 10X file
write10xCounts(x=seurat_integrated@assays$RNA@counts, path='seurat_integrated_10
X/')

# Annotate with SingleR
new.data <- Read10X("seurat_integrated_10X")
ref.data <- MouseRNAseqData()

predictions <- SingleR(test=new.data, assay.type.test="integrated",
                       ref=ref.data, labels=ref.data$label.main,
                       de.method="wilcox")
table(predictions$labels)

# Annotate UMAP clusters
seurat_integrated$celltypes <- predictions$pruned.labels
DimPlot(dummy_seurat_integrated, reduction="umap", split.by="celltypes")

I've had trouble pasting it in here but in the link, there is a SingleR-labelled TSNE plot achieved using Scran. I'm trying to do the same thing, but using Seurat.

Seurat SingleR Scran UMAP annotating-clusters • 3.7k views
ADD COMMENT
0
Entering edit mode

What exactly is the question? SingleR is agnostic in the sense that it only needs a reference expression matrix, marker genes and then the count matrix that you want to annotate against, and returns the most similar label per cell (so per column of your count matrix). So what do you mean by "in Seurat"? Is it extracting the counts from the object? See Data Access in https://satijalab.org/seurat/articles/essential_commands.html

ADD REPLY
0
Entering edit mode

@ATpoint thanks for your comment, my question isn't so much about labelling cells or extracting the counts from the object. It's more about labelling clusters, and then showing those labels in a Seurat plot (for example, in a Seurat DimPlot()). Please let me know if I can clarify anything else!

ADD REPLY
3
Entering edit mode
2.3 years ago

Provide the clusters parameter to your SingleR call and basically proceed as you've shown. I'd recommend reading the SingleR function documentation, i.e. ?SingleR from within R.

ADD COMMENT
2
Entering edit mode

Alternatively, run SingleR as you are and label each cluster by the highest proportion of cell types within it. And then use the group.by parameter in your DimPlot call.

ADD REPLY
2
Entering edit mode

Or alternatively complement the UMAP with a stacked barplot that shows the percent of cells per cluster being assigned to a particular label. That sometimes can be informative when labels are very similar.

ADD REPLY

Login before adding your answer.

Traffic: 1860 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6