Apply hierarchical clustering to reorder the cell populations and/or feature modules and group similar ones together based on the cosine distance of the factorized matrix from factorizeMatrix.

reorderCelda(
  x,
  celdaMod,
  useAssay = "counts",
  altExpName = "featureSubset",
  method = "complete"
)

# S4 method for SingleCellExperiment,ANY
reorderCelda(
  x,
  useAssay = "counts",
  altExpName = "featureSubset",
  method = "complete"
)

# S4 method for matrix,celda_CG
reorderCelda(x, celdaMod, method = "complete")

# S4 method for matrix,celda_C
reorderCelda(x, celdaMod, method = "complete")

# S4 method for matrix,celda_G
reorderCelda(x, celdaMod, method = "complete")

Arguments

x

Can be one of

  • A SingleCellExperiment object returned by celda_C, celda_G or celda_CG, with the matrix located in the useAssay assay slot in altExp(x, altExpName). Rows represent features and columns represent cells.

  • Integer count matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate celdaMod.

celdaMod

Celda model object. Only works if x is an integer counts matrix. Ignored if x is a SingleCellExperiment object.

useAssay

A string specifying which assay slot to use if x is a SingleCellExperiment object. Default "counts".

altExpName

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

method

Passed to hclust. The agglomeration method to be used to be used. Default "complete".

Value

A SingleCellExperiment object (or Celda model object) with updated cell cluster and/or feature module labels.

Examples

data(sceCeldaCG) reordersce <- reorderCelda(sceCeldaCG)
#> Cluster labels are converted to factors.
#> Module labels are converted to factors.
data(celdaCGSim, celdaCGMod) reorderCeldaCG <- reorderCelda(celdaCGSim$counts, celdaCGMod) data(celdaCSim, celdaCMod) reorderCeldaC <- reorderCelda(celdaCSim$counts, celdaCMod) data(celdaGSim, celdaGMod) reorderCeldaG <- reorderCelda(celdaGSim$counts, celdaGMod)