processingCluster {flowSpy} | 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 FSPY 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 FSPY object with cluster.id in meta.data

An FSPY object with dimensionality reduction of clusters

### See Also

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

### Examples

    if (FALSE) {

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

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

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

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

    }

[Package flowSpy version 1.0.4 Index]