satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.29k stars 915 forks source link

Removing a highly expressed genes in a combined Seurat objects #7338

Closed weiyangkong closed 1 year ago

weiyangkong commented 1 year ago

Hi all,

I am a new learner in using Seurat package to run my scRNAseq analysis. My problem is I have to analyse T cells (CD4 and CD8 T cells) and rare population of T cell subsets. I spiked my rare population of T cells with B cells in order to load them into chromium for sequencing. In my data, I would like to ask how to remove the cells that contains CD19 expression? I have run UMAP and identify the cluster of B cells and remove the cluster. But there is still 2 cells with high CD19 expression in my rare T cell cluster. This give me the DEG analysis result comes from B cells.

So, my ultimate goal is to remove the CD19 expression and I can compare the DEG between the rare T cell population and CD4, CD8 T cells.

May I know any script that is useful to remove the CD19 expression within the cell sample in a Seurat object, so this wont disturb my DEG analysis in T cell population.

Thank you very much in advance for your guidance.

longmanz commented 1 year ago

Hi, Do you wish to remove any cell with high CD19 expression? You will need to first identify the IDs of the cells with high CD19 expression: top10 = names( sort(seurat_obj@assays$RNA$data['CD19', ], decreasing = T)[1:10] ) This command will list the top 10 cells with highest CD19 expression. You can then copy their cell IDs and remove them from your seurat object: seurat_obj.filtered = subset(seurat_obj, cells = top10, invert = T) seurat_obj.filtered is the one without these 10 cells with CD19 expression.