processingCluster: processingCluster

Description Usage Arguments Value See Also Examples

View source: R/cluster.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
processingCluster(
  object,
  perplexity = 5,
  k = 5,
  downsampling.size = 1,
  force.resample = TRUE,
  random.cluster = FALSE,
  umap.config = umap.defaults,
  verbose = FALSE,
  ...
)

Arguments

object

a 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

A CYT object with dimensionality reduction of clusters

See Also

umap, fast.prcomp, Rtsne, destiny

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)

CytoTree documentation built on Nov. 10, 2020, 2 a.m.