UMAP Cluster separation
1
1
Entering edit mode
13 months 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 • 1.4k views
ADD COMMENT
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.

ADD REPLY
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).

ADD REPLY
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.

ADD REPLY
0
Entering edit mode
13 months ago
Mensur Dlakic ★ 26k

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.

enter image description here

ADD COMMENT
0
Entering edit mode

Yes! This is exactly what I meant!

ADD REPLY

Login before adding your answer.

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