I'm trying to annotate cell types in my single cell dataset (so
) using 3 different single cell references (ref1
, ref2
, ref3
). I've manually harmonized the cell type labels in each of the 3 references, so they use the exact same labels with each label appearing in at least 2 references.
Following the SingleR book, I would like to predict cell types using both combining results from each reference (https://bioconductor.org/books/release/SingleRBook/using-multiple-references.html#combining-inferences-from-individual-references) and by sharing information between references during markers detection (https://bioconductor.org/books/release/SingleRBook/using-multiple-references.html#combining-inferences-from-individual-references).
I can use each reference separately like so:
l <- SingleR::SingleR(test=GetAssayData(so, assay="RNA", layer="counts"), # so is a Seurat object
ref = ref1, # each reference is log normalized
labels = ref1$Celltype,
de.method = "wilcox",
de.n = 50,
aggr.ref = TRUE,
fine.tune=TRUE,
BPPARAM = BiocParallel::MulticoreParam(60))
However, trying to run 2 or 3 references together doesn't produce an error, but runs for much, much longer than the combinend run time of all references:
l <- SingleR::SingleR(test=GetAssayData(so, assay="RNA", layer="counts"),
ref = list(Ref1=ref1, Ref2=ref2, Ref3=ref3),
labels = list(Ref1=ref1$Celltype, Ref2=ref2$Celltype, Ref3=ref3$Celltype),
de.method = "wilcox",
de.n = 50,
aggr.ref = TRUE,
fine.tune=TRUE,
BPPARAM = BiocParallel::MulticoreParam(60))
It runs for so long I haven't been able to determine if it will eventually produce an error. Is it necessary to piece together the individual steps manually (e.g. aggregateReference
, trainSingleR
, classifySingleR
, combineRecomputedResults
)?
For the second approach (sharing information during marker detection), the SingleR books points to the getClassicMarkers
function. IIRC this isn't appropriate for single cell data: Is there an equivalent approach for multiple single cell references using scran? (pairwiseWilcox
)?
Is it possible to use SingleR with multiple single cell references?