tof_reduce_dimensions: Apply dimensionality reduction to a single-cell dataset.

View source: R/dimensionality_reduction.R

tof_reduce_dimensionsR Documentation

Apply dimensionality reduction to a single-cell dataset.

Description

This function is a wrapper around tidytof's tof_reduce_* function family. It performs dimensionality reduction on single-cell data using a user-specified method (of 3 choices) and each method's corresponding input parameters

Usage

tof_reduce_dimensions(
  tof_tibble,
  ...,
  augment = TRUE,
  method = c("pca", "tsne", "umap")
)

Arguments

tof_tibble

A 'tof_tbl' or 'tibble'.

...

Arguments to be passed to the tof_reduce_* function corresponding to the embedding method. See tof_reduce_pca, tof_reduce_tsne, and tof_reduce_umap.

augment

A boolean value indicating if the output should column-bind the dimensionality-reduced embedding vectors of each cell as a new column in 'tof_tibble' (TRUE, the default) or if a tibble including only the low-dimensionality embeddings should be returned (FALSE).

method

A method of dimensionality reduction. Currently, PCA, tSNE, and UMAP embedding are supported.

Value

A tibble with the same number of rows as 'tof_tibble', each representing a single cell. Each of the ‘num_comp' columns represents each cell’s embedding in the calculated embedding space.

See Also

Other dimensionality reduction functions: tof_reduce_pca(), tof_reduce_tsne(), tof_reduce_umap()

Examples

# simulate single-cell data
sim_data <-
    dplyr::tibble(
        cd45 = rnorm(n = 100),
        cd38 = rnorm(n = 100),
        cd34 = rnorm(n = 100),
        cd19 = rnorm(n = 100)
    )

# calculate pca
tof_reduce_dimensions(tof_tibble = sim_data, method = "pca")

# calculate tsne
tof_reduce_dimensions(tof_tibble = sim_data, method = "tsne")

# calculate umap
tof_reduce_dimensions(tof_tibble = sim_data, method = "umap")


keyes-timothy/tidytof documentation built on May 7, 2024, 12:33 p.m.