1
$\begingroup$

I detected all markers for each cluster and checked 20 top markers for my clusters one by one. Is there any way that I figure out the selective markers automatically from all the clusters?

For instance, in seurat tutorial, I found comparing one cluster two or three other clusters, but I want to see for instance what are the 10 top markers or genes that are expressed only in cluster of interest.

$\endgroup$
2
$\begingroup$

Directly copy-pasting from one of the Seurat vignettes:

# find markers for every cluster compared to all remaining cells, report only the positive ones
pbmc.markers <- FindAllMarkers(pbmc, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.25)
pbmc.markers %>%
    group_by(cluster) %>%
    top_n(n = 2, wt = avg_log2FC)

Change n to 10 in the top_n() call and filter for your cluster of interest and you will get what you want.

$\endgroup$
1
  • $\begingroup$ Thanks a lot, I realized this code exist in seurat web page, but I didn't know that does the same. Thanks for answering. $\endgroup$ Jun 11 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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