Skip to contents

This function visualizes the projection of data from one single-cell object onto the UMAP embedding of another object. It allows for coloring the projected data points based on metadata from either the projector or projectee object.

Usage

plot_projection(
  projection,
  projector,
  projectee,
  projector_col = NULL,
  projectee_col = NULL
)

Arguments

projection

A list or SimpleList containing the UMAP coordinates of the projected data. Typically, this is the output from the project_data function.

projector

The original single-cell object (Monocle3 cell_data_set or Seurat object) used to generate the UMAP embedding.

projectee

The single-cell object (Monocle3 cell_data_set or Seurat object) that was projected into the UMAP space.

projector_col

Optional character string specifying the column name in the projector's metadata to use for coloring the data points.

projectee_col

Optional character string specifying the column name in the projectee's metadata to use for coloring the data points.

Value

A ggplot object visualizing the projection.

Examples

if (FALSE) {
# Assuming 'projection' is the output from project_data()
plot_projection(
  projection = projection,
  projector = projector_object,
  projectee = projectee_object,
  projector_col = "cell_type",
  projectee_col = "sample_id"
)
}