For the differentially expressed genes analysis, is it possible to check for DEGs based on the levels already identified in the object? For example, my dataset contains cells from 11 subjects, which are marked as so (orig.ident). I want to analyze the differentially expressed markers between them. Will it be accurate to do so? Or should I follow the clustering analysis in Seurat? I want to see the difference in genes between the cells according to the subjects but I'm afraid that may not be the right way to do so.

  head([email protected])
         orig.ident nCount_RNA nFeature_RNA percent.mito
 BC01_02       BC01   998944.0         9189 0.2387108038
 BC01_03       BC01   999696.4         9548 0.2925345423
 BC01_04       BC01   999057.5         7440 0.0009893724

Is clustering analysis absolutely necessary to see the DEGs between them? or can I directly move to FindMarkers based on the levels (orig.ident)?


2 Answers 2


@swbarnes2 code is one correct way to find marker genes that differ between samples. You could also change the Idents slot and then just use FindAllMarkers.

It's not clear what you mean by accurate in your comment. If you look for marker genes between samples (orig.ident) without clustering, Seurat will use expression data from all the cells attributed to each sample to find sample-specific markers. This approach can be right or wrong depending on the question you are asking.

For example, this paper asked which genes were unique to each patient's tumor (see Figure 2D). To recreate their analysis, you would restrict your Seurat object to only include tumor cells (removing other cell types like immune cells and fibroblasts) and then perform FindMarkers on sample origin. This answers which genes are specifically expressed on each patient's tumor cells, averaged over the different tumor cell subpopulations (in HNSC there are basal, differentiated, stressed, and pEMT subpopulations). This analysis could be a good idea if you are trying to find a sample-specific marker that is expressed on the majority of tumor cells in a sample. The downside to this approach is that it averages across tumor cell subpopulations. If there is a rare tumor subpopulation (say a set of cancer stem cells) that do not express the same markers as the majority of cells, the markers Seurat finds may not be expressed on this rare population.

It doesn't make sense to look for sample specific markers when your Seurat object includes several different types of cells (epithelial cells, immune cells, stromal cells etc). In other words, you should probably restrict your analysis to some major cell type before looking for marker genes. If you don't, your results will be analogous to a bulk RNA-Seq differential expression, and will be significantly influenced by the cell type composition between samples which defeats the purpose of doing single cell RNA-sequencing. In this case, one could consider the results inaccurate, as it will be difficult to attribute marker genes to one cell type.

Another way to interpret your question about accuracy is whether calling marker genes between samples provides accurate statistical inference (are the marker genes identified truly up/down in specific patients). If you are using single cell data to compare expression between conditions (normal vs tumor, control vs treated cells), it is advised to not use Seurat FindMarkers or similar tools when you have multiple samples. The problem is that FindMarkers treats each cell like its own sample, even though all cells from a sample are similar and thus correlated. This violates the IID assumption used by the Wilcox test and other methods used by FindMarkers and results in really low p-values and inflated false positive rates. In this scenario, recent studies suggest you should use a pseudo-bulk approach to prevent a high number of false positives. muscat is one method that performs pseudo-bulk analysis, and its paper explains pseudo-bulk analysis in more detail.

TL;DR If you are going to look for sample-specific (or other metadata-based) marker genes, it's probably a good idea to first restrict the analysis to a major cell type. If you are using single cell data to perform differential expression analysis comparing conditions, use pseudo-bulk approaches.


I'm not quite sure what you are asking, but you can use anything in the metadata as a grouping with FindMarkers.

DefaultAssay(combined.all) <- "RNA"
Idents(combined.all) <- "orig.ident"

for (sample in unique(Idents(combined.all))) {
  clustermarkers <- FindMarkers(combined.all, ident.1 = sample)
  print(paste("Cluster", sample))
  print(head(clustermarkers, n = 10))
  • $\begingroup$ thank you for the response! To be clear, when I use different grouping, is it accurate? or is the accuracy dependant on finding markers after clustering? $\endgroup$ Commented Jul 29, 2020 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.