Description Usage Arguments Details Value Author(s) See Also Examples
AssignCellType
performs correlation-based cell type inference using a
reference dataset via SingleR
.
1 2 3 |
scrna |
Seurat object. |
refsets |
List of reference dataset(s). Multiple can be provided. |
labels |
String indicating whether to use broad lineage-based labels
|
outdir |
Path to output directory for annotation scores, distributions, and heatmaps. |
method |
String or character vector specifying whether annotation should
be applied to each single cell |
clusters |
String or character vector defining the If provided with |
singler.params |
List of additional arguments to be passed to
|
Reference datasets available for use by this function include those provided by SingleR:
HumanPrimaryCellAtlasData
BlueprintEncodeData
DatabaseImmuneCellExpressionData
NovershternHematopoieticData
MonacoImmuneData
ImmGenData
MouseRNAseqData
If outdir
is specified, the annotation results will be written to a
file named in clusters.refset.labels.txt
format if
method="cluster"
or refset.labels.txt
format if
method="single"
. Label distributions will be written to files named in
refset.labels.dist.txt
and refset.labels.pruned.dist.txt
format. Additionally, a heatmap will be made from the annotation results via
plotScoreHeatmap
if there are fewer than 65500 cells
(the hclust method used fails with more cells than that).
A Seurat object with inferred
cell type information in the meta.data
slot named in
refset.labels
format. If method = "cluster"
, the resulting
meta.data
column will be named in clusters.refset.labels
format. Pruned labels will also be added with .pruned
appended to
the column name.
Jared Andrews
SingleR
for additional options.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library("Seurat")
library("SingleR")
pbmc <- pbmc_small
# Download reference data from ExperimentHub.
hpca <- HumanPrimaryCellAtlasData()
# Always give the reference set a name.
metadata(hpca)$name <- "HPCA"
pbmc.pred <- AssignCellType(pbmc, refsets = list(hpca),
labels = "label.main", method = "single")
pbmc.clusters.pred <- AssignCellType(pbmc, refsets = list(hpca),
labels = "label.fine", method = "cluster", clusters = "RNA_snn_res.1")
## Not run:
# Use both broad and fine labels, 'Single' and 'cluster' method, multiple
# reference sets, and multiple cluster annotations.
bp <- BlueprintEncodeData()
metadata(bp)$name <- "Blueprint_Encode"
pbmc.all.anno <- AssignCellType(pbmc, refsets = list(hpca, bp),
clusters = c("RNA_snn_res.0.8", "RNA_snn_res.1"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.