This function generates a scatter plot using two columns from the metadata of a Seurat object and colors the dots based on a specified column of clusters.

scatter_plot_seurat(seurat_obj, x_col, y_col, cluster_col)

Arguments

seurat_obj

A Seurat object.

x_col

The column name to be used for the x-axis.

y_col

The column name to be used for the y-axis.

cluster_col

The column name to be used for coloring the dots.

Examples

library(Seurat)
# Assuming seurat_obj is a Seurat object with appropriate metadata
scatter_plot_seurat(seurat_obj, "UMAP_1", "UMAP_2", "Cell_Type")
#> Error in scatter_plot_seurat(seurat_obj, "UMAP_1", "UMAP_2", "Cell_Type"): Column UMAP_1 not found in metadata