plotDimReduceCluster {celda} | R Documentation

## Plotting the cell labels on a dimensionality reduction plot

### Description

Create a scatterplot for each row of a normalized gene expression matrix where x and y axis are from a data dimensionality reduction tool. The cells are colored by its given 'cluster' label.

### Usage

    plotDimReduceCluster(
      dim1,
      dim2,
      cluster,
      size = 1,
      xlab = "Dimension_1",
      ylab = "Dimension_2",
      specificClusters = NULL,
      labelClusters = FALSE,
      groupBy = NULL,
      labelSize = 3.5
    )

### Arguments

`dim1` | Numeric vector. First dimension from data dimensionality reduction output.
`dim2` | Numeric vector. Second dimension from data dimensionality reduction output.
`cluster` | Integer vector. Contains cluster labels for each cell.
`size` | Numeric. Sets size of point on plot. Default 1.
`xlab` | Character vector. Label for the x-axis. Default "Dimension_1".
`ylab` | Character vector. Label for the y-axis. Default "Dimension_2".
`specificClusters` | Numeric vector. Only color cells in the specified clusters. All other cells will be grey. If NULL, all clusters will be colored. Default NULL.
`labelClusters` | Logical. Whether the cluster labels are plotted. Default FALSE.
`groupBy` | Character vector. Contains sample labels for each cell. If NULL, all samples will be plotted together. Default NULL.
`labelSize` | Numeric. Sets size of label if labelClusters is TRUE. Default 3.5.

### Value

The plot as a ggplot object

### Examples

    data(celdaCGSim, celdaCGMod)
    celdaTsne <- celdaTsne(counts = celdaCGSim$counts,
        celdaMod = celdaCGMod)
    plotDimReduceCluster(dim1 = celdaTsne[, 1],
        dim2 = celdaTsne[, 2],
        cluster = as.factor(clusters(celdaCGMod)$z),
        specificClusters = c(1, 2, 3))

[Package celda version 1.3.4 Index]