This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filter SingleCellExperiment object just by one gene expression

In seurat you use WhichCells but how do you filter/classify your cells based on one gene expression values using SingleCellExperiment object ?

singlecellexperiment

1 answer

You can treat a SingleCellExperiment just like a standard R data.frame. The columns would allow subsetting on specific cells and the rows would allow subsetting on specific genes.

Here I subset my SingleCellExperiment object sce for only cells that contain the string WT.

sce <- sce[,grep('WT',colnames(sce))]

If you want to filter based on specific gene expression you could do something like this - keeping only cells with over 5k beta-actin reads:

sce <- sce[,which(assay(sce)['ACTB',] > 5000)]

Log in to answer this question.