create_grouped_plot: Create a grouped plot with percentage labels in the legend.

View source: R/Visualizations_Seurat_based.R

create_grouped_plotR Documentation

Create a grouped plot with percentage labels in the legend.

Description

This function generates a grouped plot for the specified feature in a Seurat object, adding percentage labels to the legend to represent the proportion of total points in each category.

Usage

create_grouped_plot(
  SerObj,
  group_feature,
  color_values = c("dodgerblue", "maroon"),
  alpha = 0.3,
  raster = F,
  raster.dpi = c(2000, 2000),
  pt.size = 0.5,
  base_size = 10,
  shuffle = F,
  theme_b = theme_classic(base_size = base_size)
)

Arguments

SerObj

A Seurat object containing the data.

group_feature

The feature based on which the data will be grouped and plotted.

color_values

A vector of color values for the groups.

alpha

The alpha (transparency) value for the points. Default is 0.3.

raster

Logical, indicating whether raster graphics should be used. Default is FALSE.

raster.dpi

A numeric vector of length 2 indicating the reSerObjlution of the raster graphics. Default is c(2000, 2000).

pt.size

The size of the points in the plot. Default is 0.5.

base_size

The base font size for the plot. Default is 10.

theme_b

The theme to be applied to the plot. Default is theme_bw with base_size parameter.

Value

A ggplot object with grouped points and legend labels representing percentages.

Examples

## Not run: 
# Example usage:
# gg <- create_grouped_plot(SerObj, group_feature = "IsAlphaBeta", 
#                           color_values = c("dodgerblue", "maroon"), alpha = 0.3,
#                           raster = FALSE, raster.dpi = c(2000, 2000), pt.size = 0.5,
#                           base_size = 10, theme_b = theme_classic(base_size = 10))

## End(Not run)


eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.