Compute a linear embedding over a TourExperiment object.

embed_linear(.data, num_comp, .on = NULL, center = TRUE,
  scale = FALSE, .subset = NULL,
  .parallel = BiocParallel::SerialParam(), .engine)

# S4 method for missing
embed_linear(.data, num_comp, .on = NULL,
  center = TRUE, scale = FALSE, .subset = NULL,
  .parallel = BiocParallel::SerialParam(), .engine)

# S4 method for BiocSingularParam
embed_linear(.data, num_comp, .on = NULL,
  center = TRUE, scale = FALSE, .subset = NULL,
  .parallel = BiocParallel::SerialParam(), .engine)

Arguments

.data

A TourExperiment() object

num_comp

Number of components to retain

.on

The named element in .data to compute the PCA (default is NULL which is the first assay in .data.

center

Should columns be centered? Default = TRUE

scale

Should columns be scaled to unit variance?

.subset

Restrict linear embedding to run on a subset of rows. (Default = NULL).

.parallel

A `BiocParallel::BPPARAM()`` object, default is to compute in serial.

.engine

How to compute the embedding. If missing, defaults to pca_exact().

Details

This function is a wrapper to BiocSingular::runPCA(), with additions for computing on parts of TourExperiment object. This function always returns a TourExperiment with the reducedDim slot updated with SingleCellExperiment::LinearEmbeddingMatrix containing the sample factors, loadings, and factor data from the principal components.