plot_clustered_tsne: Plot Clustered t-SNE Results

View source: R/utils.R

plot_clustered_tsneR Documentation

Plot Clustered t-SNE Results

Description

This function generates a t-SNE plot with cluster assignments using consistent color mappings. It includes options for plotting points based on their t-SNE coordinates and adding cluster labels at the cluster centroids. The plot is saved as an SVG file in a temporary directory.

Usage

plot_clustered_tsne(info.norm, cluster_data, settings)

Arguments

info.norm

A data frame containing t-SNE coordinates (tsne1, tsne2) and cluster assignments (pandora_cluster) for each point.

cluster_data

A data frame containing the cluster centroids and labels, with columns tsne1, tsne2, label, and pandora_cluster.

settings

A list of settings for the plot, including:

  • theme: The ggplot2 theme to use (e.g., "theme_classic").

  • colorPalette: The color palette to use for clusters (e.g., "RdPu").

  • pointSize: The size of points in the plot.

  • fontSize: The font size used in the plot.

  • legendPosition: The position of the legend (e.g., "right").

  • plot_size: The size of the plot.

  • aspect_ratio: The aspect ratio of the plot.

Value

ggplot2 object representing the clustered t-SNE plot.

Examples

## Not run: 
# Example usage
plot <- plot_clustered_tsne(info.norm, cluster_data, settings)
print(plot)

## End(Not run)

immunaut documentation built on April 12, 2025, 1:22 a.m.