Return or set the cell cluster labels determined by celda_C or celda_CG models.

celdaClusters(x, altExpName = "featureSubset")

# S4 method for SingleCellExperiment
celdaClusters(x, altExpName = "featureSubset")

# S4 method for celdaModel
celdaClusters(x)

celdaClusters(x, altExpName = "featureSubset") <- value

# S4 method for SingleCellExperiment
celdaClusters(x, altExpName = "featureSubset") <- value

Arguments

x

Can be one of

  • A SingleCellExperiment object returned by celda_C, or celda_CG, with the matrix located in the useAssay assay slot. The a altExp slot with name altExpName will be used. Rows represent features and columns represent cells.

  • Celda model object.

altExpName

The name for the altExp slot to use. Default "featureSubset".

value

Character vector of cell cluster labels for replacements. Works only if x is a SingleCellExperiment object.

Value

One of

  • Character vector if x is a SingleCellExperiment object. Contains cell cluster labels for each cell in x.

  • List if x is a celda model object. Contains cell cluster labels (for celda_C and celdaCG Models) and/or feature module labels (for celda_G and celdaCG Models).

Examples

data(sceCeldaCG)
celdaClusters(sceCeldaCG)
#>   [1] 1 2 2 2 1 1 3 1 1 2 3 2 4 3 2 1 2 4 4 1 3 5 3 2 1 3 3 2 3 3 5 3 2 5 5 3 4
#>  [38] 4 3 2 1 2 1 1 2 3 4 2 5 3 5 1 1 3 1 3 3 1 4 5 4 4 1 3 5 2 5 2 1 3 1 2 4 1
#>  [75] 5 2 1 3 4 4 3 5 1 1 4 4 4 1 1 3 3 1 3 1 1 4 4 3 5 3 4 3 4 4 1 3 4 4 1 3 1
#> [112] 3 4 3 1 3 3 3 3 3 5 4 4 4 4 1 1 4 1 4 1 4 1 1 1 5 4 1 4 3 5 4 4 5 4 3 3 3
#> [149] 1 4 4 4 1 4 1 4 3 3 5 4 1 1 4 4 3 4 1 3 2 4 4 3 1 4 1 5 1 3 4 5 1 4 4 3 4
#> [186] 3 5 4 5 5 5 5 5 5 2 5 1 2 3 2 5 5 5 2 1 5 5 2 4 2 1 1 5 5 5 5 5 5 2 2 5 2
#> [223] 5 1 2 5 1 5 2 5 5 5 1 2 1 5 2 5 3 5 5 2 3 5 5 1 3 2 5 5 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5 2 2 5 5 2 4 5 5 5 3 3 2 1 2 1 3 3 1 2 2 3 2 2
#> [297] 2 3 2 3 3 3 1 3 3 5 5 2 2 3 3 3 2 3 3 3 3 2 2 3 3 3 2 3 5 1 2 2 2 2 2 3 2
#> [334] 1 3 3 2 3 5 2 3 2 3 5 3 3 3 2 2 5 2 3 3 3 4 2 4 3 4 3 2 1 2 2 4 1 2 4 4 3
#> [371] 5 2 4 5 2 3 5 3 3 2 3 5 2 4 4 4 3 3 2 3 2 5 2 3 3 5 3 2 2 2 3 2 1 2 1 4 2
#> [408] 1 4 3 2 4 2 5 2 3 1 2 5 1 2 5 1 4 2
#> 
#> $y
#>   [1]  7  5  1  8  1  4 10  9  2  4  7 10 10  5  3 10  2 10  9  5  9  3  5  7  6
#>  [26]  9  9  4  8  2  9  5  4  5  9  5  5  4  4  6  5  8  8  5  1  6 10  9  7  1
#>  [51]  4  3  7  9  6 10  9 10  7  6  8  6  9  5  4  5  9  9 10  5  4  3  8  7  9
#>  [76]  6  2  3  7  6  3  4  9  3  9 10  4 10  7  1  1 10 10  1  6  1  6  9  5  4
#>