JoinLayers function for Seurat Object for annotation with SingleR
0
1
Entering edit mode
Bine ▴ 40
@bine-23912
Last seen 3 days ago
UK

Dear all,

I have the following issue: I have a Seurat object with 7 layers of raw gene expression counts for 7 different patients.

In order to annotate the object with SingleR I have now used the function "JoinLayers" to combine all counts into one layer of counts of all patients together. I was able to annotate the clusters of cells with

kid.filtered_new<- JoinLayers(kid.filtered)

pbmc_counts_combined <- GetAssayData(kid.filtered_new, slot = 'counts')

pred_combined <- SingleR(test = pbmc_counts_combined,
        ref = ref,
        labels = ref$label.main)

kid.filtered_new$singleR.labels <- pred_combined$labels[match(rownames(kid.filtered_new@meta.data), rownames(pred_combined))]

 DimPlot(kid.filtered, reduction = 'umap', group.by = 'singleR.label`s')

However, I would like to use for the annotation not the labels of every cell. Instead I would like to use for the annotation the seurat clusters:

enter image description here

I am able to clusters them by Seurat clusters but the annotation via SingleR was done per single cell. How can I get the annotation done per seurat clusters?

DimPlot(kid.filtered, reduction = 'umap', group.by = 'singleR.labels')

I tried this but it is giving me an error:

pred_combined <- SingleR(test = pbmc_counts_combined,
        ref = ref,
        labels = ref$label.main, clusters='seurat_clusters')

Error in compute_ugroup(group, ncol(x), reorder) : 
  incorrect length for 'group'

Thank you for any input!

Bine

SingleR SeuratscRNA • 1.6k views
ADD COMMENT
0
Entering edit mode

Please ask at biostars.org for Seurat help which is not a Bioconductor package. As said, SingleR is generic as it can start from a matrix and label vector, that here is a Seurat problem.

ADD REPLY
0
Entering edit mode

Ok thanks, done. Shall I delete this post?

ADD REPLY
0
Entering edit mode

Your post is very helpful.

ADD REPLY

Login before adding your answer.

Traffic: 464 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