UMAP Cluster separation
1
0
Entering edit mode
11 weeks ago

Is there a way to separate clusters in UMAPs using circles, outlines, borders, etc.? I have seen this in some presentations however cannot find documentation for this feature and would appreciate any input.

Thanks.

seurat ggplot umap scrna-seq • 608 views
0
Entering edit mode

Have you looked at geom_mark_ellipse? https://ggforce.data-imaginist.com/reference/geom_mark_ellipse.html

If you want to have "flexible" boundaries, you could use a simple classifier (on top of the UMAP coordinates) and use geom_contour to plot the decision boundaries between clusters.

0
Entering edit mode

For geom_mark_ellipse, I don't believe this would be feasible given that it requires the input as a data frame, and we cannot coerce the class structure of SeuratObjects into data.frames.

geom_contour also would not work since it would have an error occurring in the 3rd layer (x,y,z directionalities).

1
Entering edit mode

cannot coerce the class structure of SeuratObjects into data.frames

It's trivial enough to pull out the UMAP coordinates and cell labels into a dataframe. The same is true of geom_contour.

If you want to do anything custom, you will eventually need to pull data out of Seurat and into a more native format.

0
Entering edit mode
11 weeks ago
Mensur Dlakic ★ 23k

Do you mean something like the image below? If so, I think you will have to write a custom function - at least I did it. I don't think it matters if the circle or ellipse is not perfectly enclosing the dots, as long as you do some clustering beforehand and color data points accordingly.

0
Entering edit mode

Yes! This is exactly what I meant!