# Subset on multiple genes in Seurat

I know that I can do subsetting on just one gene in Seurat:

seurat_subset <- SubsetData(seurat_object, subset.name = neuron_ids[1], accept.low = 0.1)


However, I want to subset on multiple genes. Is there a way to do that? I just do not want to do manual subsetting on 10 genes, then manually getting @data matrix from each subset, and recreating seurat object afterwards.

I was able to achieve this in the following way:

require(data.table)
cell_names <- vector(mode="character")
for (i in 1:length(neuron_ids)) {
seurat_subset <- SubsetData(seurat_object, subset.name = neuron_ids[i], accept.low = 0.1)
genes <- colnames(seurat_subset@data)
cell_names <- c(cell_names, genes[! genes %chin% cell_names])
}
seurat_subset <- SubsetData(seurat_object, cells.use = cell_names)


Would be interesting to know if Seurat provides such functionality out of the box.

• In Seurat V3 you should use seurat_subset <- SubsetData(seurat_object, cells = cell_names) as cells.use is no longer supported. Nov 15 '19 at 19:36