renameClusters,ClusterExperiment,character-method {clusterExperiment} | R Documentation

## Change assigned names or colors of clusters

### Description

Change the assigned names or colors of the clusters in a clustering stored in the clusterLegend slot of the object.

### Usage

    ## S4 method for signature 'ClusterExperiment,character'
    renameClusters(object, value,
      whichCluster = "primary", matchTo = c("name", "clusterIds"))

    ## S4 method for signature 'ClusterExperiment,character'
    recolorClusters(object, value,
      whichCluster = "primary", matchTo = c("name", "clusterIds"))

### Arguments

`object` | a ClusterExperiment object.
`value` | The value to be substituted in the corresponding slot. See the slot descriptions in `ClusterExperiment` for details on what objects may be passed to these functions.
`whichCluster` | argument that can be a single numeric or character value indicating the single clustering to be used. Giving values that result in more than one clustering will result in an error. See details of `getClusterIndex`.
`matchTo` | whether to match to the cluster name (`"name"`) or internal cluster id (`"clusterIds"`)

### Value

`renameClusters` changes the names assigned to clusters within a clustering

`recolorClusters` changes the colors assigned to clusters within a clustering

[Package clusterExperiment version 2.6.1 Index]