Run Joint-RPCA and store embedding in reducedDim

Universal Joint RPCA Wrapper

Arguments

altexp

Optional name of an alternative experiment. If supplied, Joint-RPCA is run on altExp(x, altexp) instead of x.

name

Character scalar giving the name of the reducedDim slot in which to store the joint sample embedding. Defaults to "JointRPCA".

x

Input object: MultiAssayExperiment, SummarizedExperiment (including TreeSummarizedExperiment), list of matrices, or single matrix.

experiments

Character vector of experiment names to extract when x is a MultiAssayExperiment (i.e. names(experiments(x))). If NULL, all experiments are used.

For MultiAssayExperiment inputs, one assay per experiment is used: by default the first assay returned by assayNames() (or index 1L if unnamed). The actually used assay names are recorded in $assay_names_used in the result. If you need a different assay (e.g. "relab" instead of "counts"), subset or reorder assays in x before calling jointRPCAuniversal().

transform

Character string specifying preprocessing applied to each input table before ordination. Use "rclr" to apply the robust CLR transform (via decostand(method = "rclr")) or "none" to disable transformation (data are used as-is after masking non-finite values).

optspace.tol

Numeric tolerance passed to optspace().

center

Logical; whether to center the reconstructed low-rank matrix (double-centering) prior to SVD/PCA steps.

scale

Logical; whether to scale the reconstructed matrix prior to SVD/PCA steps. Defaults to FALSE.

...

Additional arguments passed to .joint_rpca().

Value

The input object x with a new entry in reducedDim(x, name) containing the Joint-RPCA sample embedding. The full Joint-RPCA result (including distances, cross-validation statistics and transformed tables) is stored in metadata(x)$JointRPCA[[name]].

Output from .joint_rpca() with extra fields when x is a MultiAssayExperiment:

  • $experiment_names: character vector of experiments used.

  • $assay_names_used: named character vector giving, for each experiment, the assay name that was used (typically the first in assayNames()).

Details

Convenience wrapper that runs Joint Robust PCA on one or more compositional tables and stores the resulting sample embedding in reducedDim(x, name), similar to runMDS() and runPCA().