Skip to contents

Perform UMAP dimensionality reduction on the expression data. The function uses uwot::umap() to perform UMAP analysis.

Usage

gly_umap(
  exp,
  n_neighbors = 15,
  n_components = 2,
  add_info = TRUE,
  ...,
  log_transform = TRUE
)

Arguments

exp

A glyexp::GlycomicSE() or glyexp::GlycoproteomicSE() object, or another SummarizedExperiment containing an expression matrix and sample information.

n_neighbors

Number of neighbors to consider for each point. Default is 15.

n_components

Number of output dimensions. Default is 2.

add_info

A logical value. If TRUE (default), sample information from the experiment will be added to the result tibble. If FALSE, only the UMAP coordinates are returned.

...

Additional arguments passed to uwot::umap().

log_transform

A single logical value indicating whether to transform expression values using log(x + 1) before analysis. Default is TRUE. Set to FALSE for data that are already log-transformed.

Value

A list with three elements:

  • tidy_result: A tibble with UMAP coordinates containing the following columns:

    • sample: Sample name

    • umap1: First UMAP dimension

    • umap2: Second UMAP dimension

    • umap3, umap4, etc.: Additional UMAP dimensions (if n_components > 2)

  • raw_result: The raw UMAP result matrix

  • meta_data: A list containing metadata from the input experiment The list has classes glystats_umap_res and glystats_res.

Details

By default, expression values are transformed using log(x + 1) before analysis. Set log_transform = FALSE to use the expression values as supplied, for example when they are already log-transformed.

Required packages

This function requires the uwot package to be installed for UMAP analysis.

See also