I am comparing differentially expressed genes (DEGs) between WT and KO samples. If I want to compare DEGs between conditions in a particular cluster I use FindMarkers function of Seurat tool by indicating ident.1 and ident.2.
However if I wanted to compare overall DEGs between WT and KO samples and NOT specific to any cluster. How can I accomplish in Seurat or using other tool?
From what I read in the documentation of Seurat, if you set both ident.1 and ident.2 parameters to NULL (the default by the way) it will do (according to the docs): if NULL, use all other cells for comparison. See also the explanation on the Seurat vignettes/tutorials: If the ident.2 parameter is omitted or set to NULL, FindMarkers will test for differentially expressedfeatures between the group specified by ident.1 and all other cells
Sorry, this will never work because you are comparing everything against everything, so obviously it'll not work. It only works when you want to compare one group against everything, then you can set the identity for that group ident.1 = group and the second identity group as NULL - ident.2 = NULL
You need to define ident.1 in FindMarkers and cannot keep it as NULL.
Allowed idents are members of the named vector Idents(seurat_obj). The names of this vector are cell names. Originally, Idents(seurat_obj) holds cluster indices which lends itself to find markers between clusters.
However you can set Idents(seurat_obj) to other variables.
An easy way to do this is by using one of the columns in the metadata matrix of seurat_obj (whose rownames are also cell names). Check head(seurat_obj@meta.data) to determine if you already have a column holding KO or WT per each row. Say this column name is stim. You can now redefine Idents as follows: Idents(seurat_obj) <- seurat_obj$stim and continue with
If you do not have a proper column in the metadata matrix, create a new one which holds KO/WT information (e.g. seurat_obj$newColumn<-...) and then use this column to redefine Idents.
@singcell - it is probably better to convert your response from answer to comment. Otherwise, please provide more details about the problem that you actually see.
@jomo018 Thank you for your help. It worked however, I am seeing the FC other way round.
When I run Idents(seurat_obj) I see multiple levels or clusters. I am wondering how Idents(seurat_obj) <- seurat_obj$stimis able to assign cells to correct idents or KO or WT.
Hi,
From what I read in the documentation of
Seurat
, if you set bothident.1
andident.2
parameters toNULL
(the default by the way) it will do (according to the docs):if NULL, use all other cells for comparison
. See also the explanation on the Seurat vignettes/tutorials:If the ident.2 parameter is omitted or set to NULL, FindMarkers will test for differentially expressed
features between the group specified by ident.1 and all other cells
So, try something like:
I hope this answers your question.
António
Sorry, this will never work because you are comparing everything against everything, so obviously it'll not work. It only works when you want to compare one group against everything, then you can set the identity for that group
ident.1 = group
and the second identity group asNULL
-ident.2 = NULL
Sorry by the mistake.
Follow the solution provided by @jomo018
António
@jomo018 way worked. Thank you for your help, anyway.
@jomo018 way worked. Thank you for your help, anyway.