Seurat: How to crop some cells from dimplot

Created on 19 Nov 2019  路  3Comments  路  Source: satijalab/seurat

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

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"

All 3 comments

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"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RuiyangLiu94 picture RuiyangLiu94  路  3Comments

rajasreemenon picture rajasreemenon  路  3Comments

farhanma picture farhanma  路  3Comments

fly4all picture fly4all  路  3Comments

htc502 picture htc502  路  3Comments