Annotate single cells using SingleR
Usage
RunSingleR(
srt_query,
srt_ref,
query_group = NULL,
ref_group = NULL,
query_assay = "RNA",
ref_assay = "RNA",
genes = "de",
de.method = "wilcox",
sd.thresh = 1,
de.n = NULL,
aggr.ref = FALSE,
aggr.args = list(),
quantile = 0.8,
fine.tune = TRUE,
tune.thresh = 0.05,
prune = TRUE,
BPPARAM = BiocParallel::bpparam()
)
Arguments
- srt_query
An object of class Seurat to be annotated with cell types.
- srt_ref
An object of class Seurat storing the reference cells.
- query_group
A character vector specifying the column name in the `srt_query` metadata that represents the cell grouping.
- ref_group
A character vector specifying the column name in the `srt_ref` metadata that represents the cell grouping.
- query_assay
A character vector specifying the assay to be used for the query data. Defaults to the default assay of the `srt_query` object.
- ref_assay
A character vector specifying the assay to be used for the reference data. Defaults to the default assay of the `srt_ref` object.
- genes
"genes" parameter in
SingleR
function.- de.method
"de.method" parameter in
SingleR
function.- sd.thresh
Deprecated and ignored.
- de.n
An integer scalar specifying the number of DE genes to use when
genes="de"
. Ifde.method="classic"
, defaults to500 * (2/3) ^ log2(N)
whereN
is the number of unique labels. Otherwise, defaults to 10. Ignored ifgenes
is a list of markers/DE genes.- aggr.ref, aggr.args
Arguments controlling the aggregation of the references prior to annotation, see
trainSingleR
.- quantile
"quantile" parameter in
SingleR
function.- fine.tune
"fine.tune" parameter in
SingleR
function.- tune.thresh
"tune.thresh" parameter in
SingleR
function.- prune
"prune" parameter in
SingleR
function.- BPPARAM
A BiocParallelParam object specifying how parallelization should be performed in other steps, see
?trainSingleR
and?classifySingleR
for more details.
Examples
if (FALSE) { # \dontrun{
data("panc8_sub")
# Simply convert genes from human to mouse and preprocess the data
genenames <- make.unique(
capitalize(
rownames(panc8_sub),
force_tolower = TRUE
)
)
names(genenames) <- rownames(panc8_sub)
panc8_sub <- RenameFeatures(
panc8_sub,
newnames = genenames
)
panc8_sub <- check_srt_merge(
panc8_sub,
batch = "tech"
)[["srt_merge"]]
# Annotation
data("pancreas_sub")
pancreas_sub <- standard_scop(pancreas_sub)
pancreas_sub <- RunSingleR( # bug
srt_query = pancreas_sub,
srt_ref = panc8_sub,
query_group = "Standardclusters",
ref_group = "celltype",
)
CellDimPlot(
pancreas_sub,
group.by = "singler_annotation"
)
pancreas_sub <- RunSingleR( # bug
srt_query = pancreas_sub,
srt_ref = panc8_sub,
query_group = NULL,
ref_group = "celltype"
)
CellDimPlot(
pancreas_sub,
group.by = "singler_annotation"
)
} # }