Hi
Sorry guys
I have a dimplot and heatmap of my clusters but some cells seems to outliers making dimplot and heatmap less beautiful
https://i.ibb.co/QPRm46K/Rplot12.png
Can you help me in cropping these cells?
Thanks
You can always subset the seurat object in several ways,
based on the cellnames or expression of sepcific genes.
Make a vector of cells that you do not need. Suppose you need cells from the group IF005OGM2 which has expression of the gene 'MMP7' and 'CXCL1' more than 1.0.
cells_to_remove <- WhichCells(SeuratObject, expression = orig.ident == "IF005OGM2" & MMP7 >1 & CXCL1 >1)
new_Seurat_Object <- subset(Original.Seurat.Object, cells = cells_to_remove, invert = T)
Use the new object to plot; It only has the cells you want
Sorry saying
> cells_to_remove <- WhichCells(IF1, expression = "orig.ident" == "IF005OGM2" & MMP7 >1 & CXCL1 >1)
Error in CellsByIdentities(object = object, cells = cells) :
Cannot find cells provided
> cells_to_remove <- WhichCells(IF1, group.by = "orig.ident" == "IF005OGM2" & MMP7 >1 & CXCL1 >1)
Error in CheckDots(...) : object 'MMP7' not found
>
It is misleading to alter the data like that. I highly recommend you do not remove cells with the goal of making plots look "better"
Most helpful comment
It is misleading to alter the data like that. I highly recommend you do not remove cells with the goal of making plots look "better"