EmbedSOM: Process the cells with SOM into a nice embedding

View source: R/embed.R

EmbedSOMR Documentation

Process the cells with SOM into a nice embedding

Description

Process the cells with SOM into a nice embedding

Usage

EmbedSOM(
  data = NULL,
  map = NULL,
  fsom = NULL,
  smooth = NULL,
  k = NULL,
  adjust = NULL,
  importance = NULL,
  coordsFn = NULL,
  coords = NULL,
  emcoords = NULL,
  emcoords.pow = 1,
  parallel = F,
  threads = if (parallel) 0 else 1
)

Arguments

data

Data matrix with points that optionally overrides the one from fsom$data

map

Map object in FlowSOM format, to optionally override fsom$map

fsom

FlowSOM object with a built SOM (used if data or map are missing)

smooth

Produce smoother (positive values) or more rough approximation (negative values).

k

How many neighboring landmarks (e.g. SOM nodes) to take into the whole computation

adjust

How much non-local information to remove from the approximation

importance

Scaling of the landmarks, will be used to scale the incoming data (should be same as used for training the SOM or to select the landmarks)

coordsFn

A coordinates-generating function (e.g. tSNECoords()) that overrides the existing map$grid.

coords

A matrix of embedding-space coordinates that correspond to map$codes (i.e. the "embedded landmarks"). Overrides map$grid if not NULL.

emcoords

Provided for backwards compatibility, will be removed. Use coords and coordsFn instead.

emcoords.pow

Provided for backwards compatibility, will be removed. Use a parametrized coordsFn instead.

parallel

Boolean flag whether the computation should be parallelized (this flag is just a nice name for threads and does not do anything directly – default FALSE sets threads=1, TRUE sets threads=0)

threads

Number of threads used for computation, 0 chooses hardware concurrency, 1 (default) turns off parallelization.

Value

matrix with 2D or 3D coordinates of the embedded data, depending on the map

Examples

d <- cbind(rnorm(10000), 3*runif(10000), rexp(10000))
colnames(d) <- paste0("col",1:3)
map <- EmbedSOM::SOM(d, xdim=10, ydim=10)
e <- EmbedSOM::EmbedSOM(data=d, map=map)
EmbedSOM::PlotEmbed(e, data=d, 'col1', pch=16)

EmbedSOM documentation built on July 5, 2022, 5:14 p.m.