runMultiUMAP | R Documentation |
Perform UMAP with multiple input matrices by intersecting their simplicial sets. Typically used to combine results from multiple data modalities into a single embedding.
calculateMultiUMAP(x, ...)
## S4 method for signature 'ANY'
calculateMultiUMAP(x, ..., metric = "euclidean")
## S4 method for signature 'SummarizedExperiment'
calculateMultiUMAP(
x,
exprs_values,
metric = "euclidean",
assay.type = exprs_values,
...
)
## S4 method for signature 'SingleCellExperiment'
calculateMultiUMAP(
x,
exprs_values,
dimred,
altexp,
altexp_exprs_values = "logcounts",
assay.type = exprs_values,
altexp.assay.type = altexp_exprs_values,
...
)
runMultiUMAP(x, ..., name = "MultiUMAP")
x |
For Alternatively, a SummarizedExperiment containing relevant matrices in its assays. Alternatively, a SingleCellExperiment containing relevant matrices in its assays, |
... |
For the generic, further arguments to pass to specific methods. For the ANY method, further arguments to pass to For the SummarizedExperiment and SingleCellExperiment methods, and for |
metric |
Character vector specifying the type of distance to use for each matrix in |
exprs_values |
Alias to |
assay.type |
A character or integer vector of assays to extract and transpose for use in the UMAP. For the SingleCellExperiment, this argument can be missing, in which case no assays are used. |
dimred |
A character or integer vector of |
altexp |
A character or integer vector of |
altexp_exprs_values |
Alias to |
altexp.assay.type |
A character or integer vector specifying the assay to extract from alternative experiments, when |
name |
String specifying the name of the |
These functions serve as convenience wrappers around umap
for multi-modal analysis.
The idea is that each input matrix in x
corresponds to data for a different mode.
A typical example would consist of the PC coordinates generated from gene expression counts,
plus the log-abundance matrix for ADT counts from CITE-seq experiments;
one might also include matrices of transformed intensities from indexed FACS, to name some more possibilities.
Roughly speaking, the idea is to identify nearest neighbors within each mode to construct the simplicial sets. Integration of multiple modes is performed by intersecting the sets to obtain a single graph, which is used in the rest of the UMAP algorithm. By performing an intersection, we focus on relationships between cells that are consistently neighboring across all the modes, thus providing greater resolution of differences at any mode. The neighbor search within each mode also avoids difficulties with quantitative comparisons of distances between modes.
The most obvious use of this function is to generate a low-dimensional embedding for visualization.
However, users can also set n_components
to a higher value (e.g., 10-20) to retain more information for downstream steps like clustering.
This
Do, however, remember to set the seed appropriately.
By default, all modes use the distance metric of metric
to construct the simplicial sets within each mode.
However, it is possible to vary this by supplying a vector of metrics, e.g., "euclidean"
for the first matrix, "manhattan"
for the second.
For the SingleCellExperiment method, matrices are extracted in the order of assays, reduced dimensions and alternative experiments,
so any variation in metrics
is also assumed to follow this order.
For calculateMultiUMAP
, a numeric matrix containing the low-dimensional UMAP embedding.
For runMultiUMAP
, x
is returned with a MultiUMAP
field in its reducedDims
.
Aaron Lun
runUMAP
, for the more straightforward application of UMAP.
# Mocking up a gene expression + ADT dataset:
exprs_sce <- mockSCE()
exprs_sce <- logNormCounts(exprs_sce)
exprs_sce <- runPCA(exprs_sce)
adt_sce <- mockSCE(ngenes=20)
adt_sce <- logNormCounts(adt_sce)
altExp(exprs_sce, "ADT") <- adt_sce
# Running a multimodal analysis using PCs for expression
# and log-counts for the ADTs:
exprs_sce <- runMultiUMAP(exprs_sce, dimred="PCA", altexp="ADT")
plotReducedDim(exprs_sce, "MultiUMAP")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.