Remove certain highly expressing cells from a SCE
1
0
Entering edit mode
mollyab12 • 0
@910a5090
Last seen 19 months ago
Australia

Hello!

I am currently working on a 10x dataset using the SingleCellExperiment package and have made a new SCE isolating the CD4 T helper cells for analysis. I did this by identifying and separating the clusters that highly expressed particular genes such as CD4/CD3 etc. However, now that I am clustering these cells I've noticed a small amount (a few 100) B cell expressing genes (MS4A1 and CD19) which I am assuming are B cells, on the end of one cluster of T cells (I have run a doublet finder so not sure how they got in the new SCE).

My first question is, is there a way to remove these cells in particular that are highly expressing a certain gene? I can easily remove the gene but not the cells that express it.

Secondly, was clustering the best way to isolate the CD4 expressing cells for further analysis?

Thank you so much for your help!

SingleCellExperiment • 2.8k views
ADD COMMENT
0
Entering edit mode

If you're still early on in the analysis, I would suggest switching to Seurat. It appears to offer more features that are frequently used, in a more user-friendly manner. Seurat works great with 10x data, and they have a pretty clear and easy to follow tutorial as well.

Question 1:

What you would like to do, to remove cells can be easily done in Seurat. As suggested here: https://satijalab.org/seurat/articles/essential_commands.html

There's a lot you can do with subset, e.g https://github.com/satijalab/seurat/issues/1782

Question 2:

Yes, if there's a particular cluster you're interested. In Seurat, just select the cluster and run Scaling + clustering again. Skip the Normalization step, which presumably you already did at the beginning of the analysis. https://github.com/satijalab/seurat/issues/6115

ADD REPLY
1
Entering edit mode
Peter Hickey ▴ 740
@petehaitch
Last seen 4 weeks ago
WEHI, Melbourne, Australia

My first question is, is there a way to remove these cells in particular that are highly expressing a certain gene? I can easily remove the gene but not the cells that express it.

You need to choose a cutoff to define 'highly expressed' and then you can filter out cells with expression for a certain gene. This example code assumes you have a _SingleCellExperiment_ object called sce:

# Made up cutoff for the given gene (you need to decide this value based on your data)
cutoff <- 3
# Identify cells with expression of the give gene below the cutoff.
# Is TRUE if cell has expression less than or equal to cutoff and FALSE if above cutoff.
expression_below_cutoff <- logcounts(sce)[gene, ] <= cutoff
# Subset SingleCellExperiment object to only retain those cells with expression below the cutoff
sce[, expression_below_cutoff]
ADD COMMENT
0
Entering edit mode

Amazing! Thank you so much that really helps, works perfectly.

ADD REPLY

Login before adding your answer.

Traffic: 610 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6