SingleR-inc / SingleR

Clone of the Bioconductor repository for the SingleR package.
https://bioconductor.org/packages/devel/bioc/html/SingleR.html
GNU General Public License v3.0
173 stars 19 forks source link

Can I use logFC values from a scRNA-seq data for trainSingleR? #215

Closed mkim0327 closed 1 year ago

mkim0327 commented 2 years ago

Hello!

I have a table of gene name, pval, avg_logFC, and labels (output from Seurat FindConservedMarkers) and I was wondering if I can use this for trainSingleR?

Thank you so much in advance!

friedue commented 2 years ago

Ideally, you would want to supply a list of lists where the markers for each pairwise comparison are noted, i.e. markers$acinar$alpha would contain the names of the genes that are up in acinar cells compared to alpha cells (in the pancreas). You can find more details in Section 3.3 of the SingleR book: http://bioconductor.org/books/devel/SingleRBook/more-markers.html#defining-custom-markers

There, you can see how to generate the list of lists using scran (instead of Seurat's findMarkers())

library(scran)
out <- pairwiseBinom(counts(sceM), sceM$label, direction="up")
markers <- getTopMarkers(out$statistics, out$pairs, n=10)

# Upregulated in acinar compared to alpha:
markers$acinar$alpha

# supply this list of markers ti SingleR() via genes=
pred.grun2b <- SingleR(test=sceG, ref=sceM, labels=sceM$label, genes=markers)

If you read further along in that section, you will also find an explanation/code example of how to do the prediction with a simpler list of marker genes of cell types (which is not recommended).