JoinLayers function for Seurat Object for annotation with SingleR
0
1
Entering edit mode
4 months ago
Bine ▴ 60

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

Seurat • 551 views
ADD COMMENT

Login before adding your answer.

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