overcluster {scDblFinder}R Documentation

overcluster

Description

This function deliberately overclusters based on the desired range of cluster size. It first calculates a SNN network viar 'scran::buildSNNGraph', then runs 'igraph::cluster_fast_greedy' until no cluster is above the size limits, and merges clusters that are too small. By default, 'rankTrans' is used on the counts before, because it tends to produce over-clustering influenced by library size, which is desirable for producing artificial doublets.

Usage

overcluster(x, rtrans = c("rankTrans", "scran", "none"), min.size = 50,
  max.size = NULL)

Arguments

x

A numeric matrix, with entities (e.g. cells) as columns and features (e.g. genes) as rows. Alternatively, an object of class 'igraph'.

rtrans

Transformation to apply, either 'rankTrans' (default, dense step-preserving rank transformation, see ‘rankTrans'), ’scran' (default; see ‘scran::scaledColRanks'), or ’none' (data taken as-is). Ignored if 'x' is an 'igraph'.

min.size

The minimum cluster size (applies after splitting, and hence overrides 'max.size')

max.size

The maximum cluster size. If omitted, will be calculated on the basis of the population size and initial number of clusters.

Value

A vector of cluster labels.

Examples

m <- t(sapply( seq(from=0, to=5, length.out=50), 
               FUN=function(x) rpois(50,x) ) )
cc <- suppressWarnings(overcluster(m,min.size=5))
table(cc)


[Package scDblFinder version 1.1.8 Index]