fastcluster: fastcluster

Description Usage Arguments Value Examples

View source: R/clustering.R

Description

Performs a fast two-step clustering: first clusters using k-means with a very large k, then uses louvain clustering of the k cluster averages and reports back the cluster labels.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fastcluster(
  x,
  k = NULL,
  rdname = "PCA",
  nstart = 3,
  iter.max = 20,
  ndims = NULL,
  nfeatures = 1000,
  returnType = c("clusters", "preclusters", "metacells", "graph"),
  BPPARAM = SerialParam()
)

Arguments

x

An object of class SCE

k

The number of k-means clusters to use in the primary step (should be much higher than the number of expected clusters). Defaults to 1/10th of the number of cells with a maximum of 3000.

rdname

The name of the dimensionality reduction to use.

nstart

Number of starts for k-means clustering

iter.max

Number of iterations for k-means clustering

ndims

Number of dimensions to use

nfeatures

Number of features to use (ignored if 'rdname' is given and the corresponding dimensional reduction exists in 'sce')

returnType

See return.

BPPARAM

'BiocParallel' BPPARAM for multithreading.

Value

By default, a vector of cluster labels. If ‘returnType=’preclusters'', returns the k-means pre-clusters. If ‘returnType=’metacells'', returns the metacells aggretated by pre-clusters and the corresponding cell indexes. If ‘returnType=’graph'', returns the graph of (meta-)cells and the corresponding cell indexes.

Examples

1
2
sce <- mockDoubletSCE()
sce$cluster <- fastcluster(sce)

scDblFinder documentation built on Nov. 8, 2020, 5:48 p.m.