Filter SingleCellExperiment object just by one gene expression
1
0
Entering edit mode
3.6 years ago
ZheFrench ▴ 590

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

SingleCellExperiment • 3.4k views
ADD COMMENT
1
Entering edit mode
3.6 years ago

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)]
ADD COMMENT

Login before adding your answer.

Traffic: 2469 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