Skip to contents

Perform t-SNE dimensionality reduction on the expression data. The function uses Rtsne::Rtsne() to perform t-SNE analysis.

Usage

gly_tsne(
  exp,
  dims = 2,
  perplexity = 30,
  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.

dims

Number of output dimensions. Default is 2.

perplexity

Perplexity parameter for t-SNE. Default is 30.

add_info

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

...

Additional arguments passed to Rtsne::Rtsne().

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 t-SNE coordinates containing the following columns:

    • sample: Sample name

    • tsne1: First t-SNE dimension

    • tsne2: Second t-SNE dimension

  • raw_result: The raw Rtsne object

  • meta_data: A list containing metadata from the input experiment The list has classes glystats_tsne_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 Rtsne package to be installed for t-SNE analysis.

See also