This is a test version of Biostars. For the public version, visit https://www.biostars.org.
highlight subset of cells on tSNE plot

I am working with a single-cell Seurat object with metadata added. The object metadata contains information on patient (Sample_Name) and treatment conditions (LMO1_cells or LMO2_cells). I need a tSNE plot that shows all cells in the object but highlights the 2 treatment conditions (one in red and the other in blue) but only from Patient 1. The rest of them are grey in the background. I have a plot but it shows the 2 conditions from all patients. The Sample_Name col in metadata has Patient info but subsetting with group.by() is causing issues. Could anyone help here? thanks

> DimPlot(seurat_all, reduction = "TSNE", group.by = 'Sample_Name', 
        cells.highlight = list(LMO1_cells, LMO2_cells),
        cols.highlight = c("darkblue", "darkred"), cols = "grey")

enter image description here

enter image description here

seurat single-cell sce r

Try with split.by = 'Sample_Name'

That kind of does what I want, but makes a bunch of tSNE plots on the 1 plot

enter image description here

1 answer

Make a new metadata column, then group.by with that column.

Log in to answer this question.