ClusteringScatterPlot {ILoReg} | R Documentation

## Visualize the clustering over nonliner dimensionality reduction

### Description

ClusteringScatterPlot function enables visualizing the clustering over nonliner dimensionality reduction (t-SNE or UMAP).

### Usage

    ClusteringScatterPlot.SingleCellExperiment(
      object,
      clustering.type,
      return.plot,
      dim.reduction.type,
      point.size,
      title,
      show.legend
    )

    ## S4 method for signature 'SingleCellExperiment'
    ClusteringScatterPlot(
      object,
      clustering.type = "manual",
      return.plot = FALSE,
      dim.reduction.type = "",
      point.size = 0.7,
      title = "",
      show.legend = TRUE
    )

### Arguments

`object` | of `SingleCellExperiment` class
`clustering.type` | "manual" or "optimal". "manual" refers to the clustering formed using the "SelectKClusters" function and "optimal" to the clustering formed using the "CalcSilhInfo" function. Default is "manual".
`return.plot` | a logical denoting whether to return the ggplot2 object. Default is `FALSE`.
`dim.reduction.type` | "tsne" or "umap". Default is "tsne".
`point.size` | point size. Default is Default is `0.7`.
`title` | text to write above the plot
`show.legend` | whether to show the legend on the right side of the plot. Default is `TRUE`.

### Value

ggplot2 object if return.plot=TRUE

### Examples

    library(SingleCellExperiment)
    sce <- SingleCellExperiment(assays = list(logcounts = pbmc3k_500))
    sce <- PrepareILoReg(sce)
    ## These settings are just to accelerate the example, use the defaults.
    sce <- RunParallelICP(sce,L=2,threads=1,C=0.1,k=5,r=1)
    sce <- RunPCA(sce,p=5)
    sce <- HierarchicalClustering(sce)
    sce <- SelectKClusters(sce,K=5)
    sce <- RunTSNE(sce)
    ClusteringScatterPlot(sce,"manual",dim.reduction.type="tsne")
    sce <- RunUMAP(sce)
    ClusteringScatterPlot(sce,"manual",dim.reduction.type="umap")

[Package ILoReg version 1.0.0 Index]