This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Searching expression for one particular gene in Seurat object issue (Seurat, R)

I don't know if it's normal but when I filter my seurat object by a particular gene expression, I have the following results:

My gene expression quantiles look like this:

`0%    25%    50%    75%   100%  : 0.0   10.0   61.5  300.0 4029.0`  So the maximum expression is 4029 and the minimum is 0.

I can't use counts_svep1 <- subset(x = scrna_m, my_gene > 60) because the following error appears Error in CellsByIdentities(object = object, cells = cells) : Cannot find cells provided. 60 is > 0 and < 4029, right? It should be a right value to use.

But if I do this counts_svep1 <- subset(x = scrna_m, my_gene > 2)

It cuts the data like this:

`0%  25%  50%  75% 100% : 529  860 1087 1733 4029` 

How does this work? What is the logic behind it?

Used the way to subset the seurat object discussed here : subsetting out cells from seurat object based on expression of 1 gene

seurat scrna-seq r

counts_svep1 <- subset(x = scrna_m, my_gene > 60)

Are you using my_gene or actual gene name?

actual gene name, I wrote my_gene just for the example

It was like this counts_svep1 <- subset(x = scrna_m, ENSMUSG00000028369 > 2)

Hmmmmm!!

I think you need to mention the subset argument explicitly because the second positional argument for the subset() is cells and in your example, the specified condition is for the features.

something like this,

counts_svep1 <- subset(x = scrna_m, features = ENSMUSG00000028369 > 2)

1 answer

See the Seurat cheatsheet. You can do this via:

counts_svep1 <- subset(x = scrna_m, subset = ENSMUSG00000028369 > 2)

Log in to answer this question.