celda_C {celda} | R Documentation

## Cell clustering with Celda

### Description

Clusters the columns of a count matrix containing single-cell data into K subpopulations.

### Usage

    celda_C(
      counts,
      sampleLabel = NULL,
      K,
      alpha = 1,
      beta = 1,
      algorithm = c("EM", "Gibbs"),
      stopIter = 10,
      maxIter = 200,
      splitOnIter = 10,
      splitOnLast = TRUE,
      seed = 12345,
      nchains = 3,
      zInitialize = c("split", "random", "predefined"),
      countChecksum = NULL,
      zInit = NULL,
      logfile = NULL,
      verbose = TRUE
    )

### Arguments

`counts` | Integer matrix. Rows represent features and columns represent cells.
`sampleLabel` | Vector or factor. Denotes the sample label for each cell (column) in the count matrix.
`K` | Integer. Number of cell populations.
`alpha` | Numeric. Concentration parameter for Theta. Adds a pseudocount to each cell population in each sample. Default 1.
`beta` | Numeric. Concentration parameter for Phi. Adds a pseudocount to each feature in each cell population. Default 1.
`algorithm` | String. Algorithm to use for clustering cell subpopulations. One of 'EM' or 'Gibbs'. The EM algorithm is faster, especially for larger numbers of cells. However, more chains may be required to ensure a good solution is found. If 'EM' is selected, then 'stopIter' will be automatically set to 1. Default 'EM'.
`stopIter` | Integer. Number of iterations without improvement in the log likelihood to stop inference. Default 10.
`maxIter` | Integer. Maximum number of iterations of Gibbs sampling or EM to perform. Default 200.
`splitOnIter` | Integer. On every 'splitOnIter' iteration, a heuristic will be applied to determine if a cell population should be reassigned and another cell population should be split into two clusters. To disable splitting, set to -1. Default 10.
`splitOnLast` | Integer. After 'stopIter' iterations have been performed without improvement, a heuristic will be applied to determine if a cell population should be reassigned and another cell population should be split into two clusters. If a split occurs, then 'stopIter' will be reset. Default TRUE.
`seed` | Integer. Passed to with_seed. For reproducibility, a default value of 12345 is used. If NULL, no calls to with_seed are made.
`nchains` | Integer. Number of random cluster initializations. Default 3.
`zInitialize` | Chararacter. One of 'random', 'split', or 'predefined'. With 'random', cells are randomly assigned to a populations. With 'split', cells will be split into sqrt(K) populations and then each popluation will be subsequently split into another sqrt(K) populations. With 'predefined', values in ‘zInit' will be used to initialize 'z'. Default ’split'.
`countChecksum` | "Character. An MD5 checksum for the 'counts' matrix. Default NULL.
`zInit` | Integer vector. Sets initial starting values of z. If NULL, starting values for each cell will be randomly sampled from ‘1:K'. ’zInit' can only be used when ‘initialize = ’random''. Default NULL.
`logfile` | Character. Messages will be redirected to a file named 'logfile'. If NULL, messages will be printed to stdout. Default NULL.
`verbose` | Logical. Whether to print log messages. Default TRUE.

### Value

An object of class 'celda_C' with the cell population clusters stored in 'z'.

### See Also

'celda_G()' for feature clustering and 'celda_CG()' for simultaneous clustering of features and cells. 'celdaGridSearch()' can be used to run multiple values of K and multiple chains in parallel.

### Examples

    data(celdaCSim)
    celdaCMod <- celda_C(celdaCSim$counts,
        K = celdaCSim$K,
        sampleLabel = celdaCSim$sampleLabel)

[Package celda version 1.2.4 Index]