subsetting out cells from seurat object based on expression of 1 gene

subsetting out cells from seurat object based on expression of 1 gene

1

I have a seurat object, with raw counts stored in the RNA assay at object@assays[[“RNA”]]@counts

Lets say that the count matrix is simple and looks like this, where letters are genes and numbers are cells:

      [1] [2]  [3] 
[A]    2    4    3 
[B]    1    5    7 
[C]    2    3    4

I want to subset out all the cells that have expression of gene A >= 3. So that if I did that the resulting matrix would look like this:

      [2]  [3] 
[A]    4    3 
[B]    5    7 
[C]    3    4

Im having trouble getting the right syntax for this, specifically how to call only that one gene within a Subset function and still retain all the other genes in the list


seurat


R

• 7.6k views

updated 1 hour ago by

▴

10

written 22 months ago by

▴

130

Read more here: Source link