This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Deleting cells from seurat object

I am attempting to delete PBMC cells from my seurat object. I would like to use the WhichCells function to identify the cells that contain these features. Here is my code:

WhichCells(OC_s, slot = 'counts', expression = PTPRC > 0 & CD3E > 0 & CD19 > 0 & MS4A1 > 0 
                   & CD3D > 0 & CD4 > 0 & CD8A > 0 & CD3E > 0 & NKG7 > 0 & IL7R > 0 
                   & CD19 > 0 & MS4A1 > 0 & CD79A > 0 & JCHAIN > 0 & IGHG3 > 0 
                   & IGKC > 0 & CD14 > 0 & LYZ > 0 & CD14 > 0 & CD68 > 0 & AIF1 > 0 
                   & C1QA  > 0 & CD1C > 0 & CD1A > 0 & CLEC9A > 0 & LILRA4 > 0 
                   & CXCR3 > 0 & CLEC9A > 0 & CD1C > 0 & CD1A > 0)

After this, I am hoping to filter out the cells above from my seurat object OC_s. I'm stuck at this point and I don't know if I'm doing this right. Can someone help me?

seurat

once you identify the cells, you can subset the seurat object

colnames(pbmc3k) %>% head()

[1] "AAACATACAACCAC" "AAACATTGAGCTAC" "AAACATTGATCAGC" "AAACCGTGCTTCCG" "AAACCGTGTATGCG" "AAACGCACTGGTAC"

cells<- colnames(pbmc3k) %>% head()

pbmc3k[, cells] An object of class Seurat 13714 features across 6 samples within 1 assay

It may be better to cluster the cells and find the PBMC clusters and remove them that way.

Yes your suggestion was my original thought but unfortunately the way the experiment was done.... you had PBMC + tumor cells. So, they are mixed together and you are stuck trying to use the markers to identify the PBMC from tumor cells. Suggestions are appreciated.

0 answers

No answers yet.

Log in to answer this question.