processingCluster {CytoTree} | R Documentation

## processingCluster

### Description

Calculate Principal Components Analysis (PCA), t-Distributed Stochastic Neighbor Embedding (tSNE), Diffusion Map and Uniform Manifold Approximation and Projection (UMAP) of clusters calculated by runCluster.

### Usage

    processingCluster(
      object,
      perplexity = 5,
      k = 5,
      downsampling.size = 1,
      force.resample = TRUE,
      random.cluster = FALSE,
      umap.config = umap.defaults,
      verbose = FALSE,
      ...
    )

### Arguments

`object` | an CYT object
`perplexity` | numeric. Perplexity parameter (should not be bigger than 3 * perplexity < nrow(X) - 1, see details for interpretation). See `Rtsne` for more information.
`k` | numeric. The parameter k in k-Nearest Neighbor.
`downsampling.size` | numeric. Percentage of sample size of downsampling. This parameter is from 0 to 1. by default is 1.
`force.resample` | logical. Whether to do resample if downsampling.size < 1
`random.cluster` | logical. Whether to perfrom random downsampling. If FALSE, an uniform downsampling will be processed.
`umap.config` | object of class umap.config. See `umap`.
`verbose` | logic. Whether to print calculation progress.
`...` | options to pass on to the dimensionality reduction functions.

### Value

An CYT object with cluster.id in meta.data

An CYT object with dimensionality reduction of clusters

### See Also

`umap`, `fast.prcomp`, `Rtsne`, `destiny`

### Examples

    cyt.file <- system.file("extdata/cyt.rds", package = "CytoTree")
    cyt <- readRDS(file = cyt.file)

    # After running clustering
    set.seed(1)
    cyt <- runCluster(cyt, cluster.method = "som", xdim = 3, ydim = 3, verbose = TRUE)

    # Do not perfrom downsampling
    cyt <- processingCluster(cyt, perplexity = 2)

    # Perform cluster based downsampling
    # Only keep 50% cells
    cyt <- processingCluster(cyt, perplexity = 2, downsampling.size = 0.5)

    # Processing clusters without downsampling step
    cyt <- processingCluster(cyt, perplexity = 2, force.resample = FALSE)

[Package CytoTree version 1.4.0 Index]