You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm am having some troubles using the WhichCells() within a for loop.
My code looks like this:
genes <- c("KIF22", "RPGRIP1L")
v <- c(1:length(genes))
for (i in v){
cells <- WhichCells(seurat_object, expression = genes[i] > 0)
print(length(cells))
}
But when I run this I get the following error message:
Error in FetchData(object = object, vars = expr.char[vars.use], cells = cells, : None of the requested variables were found:
When I simply run
WhichCells(seurat_object, expression = KIF22 > 0)
it works fine.
In the end I would like to use this for loop to get some summary statistics for my genes of interest (e.g. min/max expression, mean expression, number of cells expressing the gene etc.).
So it would be great if I could find a way to make this work, or is there even a more simple/prebuilt way to do this?
The text was updated successfully, but these errors were encountered:
Much like subset, the expression parameter for WhichCells is designed for interactive use only, not programmatic. In fact, subset.Seurat calls WhichCells under the hood. For using subset and WhichCells in a programmatic way, please see #1053 (comment)
Hello,
I'm am having some troubles using the
WhichCells()
within a for loop.My code looks like this:
But when I run this I get the following error message:
When I simply run
WhichCells(seurat_object, expression = KIF22 > 0)
it works fine.
In the end I would like to use this for loop to get some summary statistics for my genes of interest (e.g. min/max expression, mean expression, number of cells expressing the gene etc.).
So it would be great if I could find a way to make this work, or is there even a more simple/prebuilt way to do this?
The text was updated successfully, but these errors were encountered: