Skip to content

Commit 2c99702

Browse files
committed
Support WNN in final DimPlots
1 parent a7afd88 commit 2c99702

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

singlecell/resources/chunks/DimPlots.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ for (datasetId in names(seuratObjects)) {
1010
P1 <- Seurat::DimPlot(seuratObj, group.by = field, reduction = 'tsne')
1111
P2 <- Seurat::DimPlot(seuratObj, group.by = field, reduction = 'umap')
1212

13-
P1 <- P1 | P2
14-
P1 <- P1 + patchwork::plot_annotation(title = field)
13+
if ('wnn.umap' %in% names(seuratObj@reductions)) {
14+
P3 <- Seurat::DimPlot(seuratObj, group.by = field, reduction = 'wnn.umap')
15+
P1 <- P1 | P2 | P3
16+
} else {
17+
P1 <- P1 | P2
18+
}
19+
20+
P1 <- P1 + patchwork::plot_annotation(title = field) + patchwork::plot_layout(guides = "collect")
1521
}
1622

1723
# Cleanup

0 commit comments

Comments
 (0)