clusterCells {scran} | R Documentation |
A SingleCellExperiment-compatible wrapper around clusterRows
from the bluster package.
clusterCells( x, assay.type = NULL, use.dimred = NULL, BLUSPARAM = NNGraphParam(), ... )
x |
A SummarizedExperiment or SingleCellExperiment object containing cells in the columns. |
assay.type |
Integer or string specifying the assay values to use for clustering, typically log-normalized expression. |
use.dimred |
Integer or string specifying the reduced dimensions to use for clustering, typically PC scores.
Only used when |
BLUSPARAM |
A BlusterParam object specifying the clustering algorithm to use, defaults to a graph-based method. |
... |
Further arguments to pass to |
This is largely a convenience wrapper to avoid the need to manually extract the relevant assays or reduced dimensions from x
.
Altering BLUSPARAM
can easily change the parameters or algorithm used for clustering -
see ?"BlusterParam-class"
for more details.
A factor of cluster identities for each cell in x
,
or a list containing such a factor - see the return value of ?clusterRows
.
Aaron Lun
library(scuttle) sce <- mockSCE() sce <- logNormCounts(sce) # From log-expression values: clusters <- clusterCells(sce, assay.type="logcounts") # From PCs: sce <- scater::runPCA(sce) clusters2 <- clusterCells(sce, use.dimred="PCA") # With different parameters: library(bluster) clusters3 <- clusterCells(sce, use.dimred="PCA", BLUSPARAM=NNGraphParam(k=5)) # With different algorithms: clusters4 <- clusterCells(sce, use.dimred="PCA", BLUSPARAM=KmeansParam(centers=10))