Hello all,
I am interested in determining differentially expressing genes in a small group of cells that does not cluster on its own. These cells are spread over 9 different clusters (the entire object has 13 clusters total). I would like to compare the transcriptome of this small group of cells with the remaining cells to see what makes them unique, if anything. Is there a way to feed "cells.use" or something similar in the FindMarkers command? Alternatively, could I add new ids to a group of cells in anyway so that FindMarkers could distinguish between the two types of cells?
Thanks
Hi,
You can specifically change the identity of these cells using the SetIdent() function of Seurat, and leave the identity of all other cells unchanged. This will allow you to use these new identities to compare your cells to each other.
# Create a vector of cells of interest
cells.of.interest <- c("cell_names")
# Change the identity of the cells of interest to 'special_cells'
object <- SetIdent(object = object, cells.use = cells.of.interest, id = "special_cells")
Alternatively, you can change the identity of all your cells, by defining a new column in your [email protected] slot in such a way that one level is attributed to the cells.of.interest, and another for all other cells. You can then change the identity of all the cells by using the SetAllIdent() function of Seurat.
# Create a vector of cells of interest
cells.of.interest <- c("cell_names")
# Create a new column in the [email protected] slot defining two groups of cells:
# those of interest, and all the others
[email protected]$cell.type <- ifelse(rownames([email protected]) %in% cells.of.interest, "of_interest", "other")
# Change the identity of all the cells to attributes of [email protected]$cell.type
object <- SetAllIdent(object = object, id = "cell.type")
The use of one or the other of the above mentioned approaches will depend on how you want to perform your analysis (i.e. whether it is by comparing these cells to multiple distinct cell types, or to all other cells irrespective of their differences).
Hope this was clear!
Best,
Leon
Thanks a lot!
the SetIdent function solved my issue. I had completely overlooked that function.
PS: you have solved so many of my issues related to Seurat that if we ever come across at a conference or something, beer is on me!
@kathirij
Any reason why you reopened the issue?
PS: you have solved so many of my issues related to Seurat that if we ever come across at a conference or something, beer is on me!
It's my pleasure. If we manage to find some good amber beer, then I'll be delighted!
@leonfodoulian
I meant to close the issue and must've reopened it by mistake.
Amber beer it is.
Most helpful comment
Thanks a lot!
the SetIdent function solved my issue. I had completely overlooked that function.
PS: you have solved so many of my issues related to Seurat that if we ever come across at a conference or something, beer is on me!