sig_box: Title: sig_box - Generate a Box plot with Statistical...

View source: R/sig_box.R

sig_boxR Documentation

Title: sig_box - Generate a Box plot with Statistical Comparisons

Description

The sig_box function is designed to generate a boxplot with optional statistical comparisons. It takes in various parameters such as data, signature, variable, and more to customize the plot. It can be used to visualize and analyze data in a Seurat object or any other data frame.

Usage

sig_box(
  data,
  signature,
  variable,
  angle_x_text = 0,
  hjust = 0.5,
  palette = "nrc",
  cols = NULL,
  jitter = FALSE,
  point_size = 5,
  size_of_font = 10,
  size_of_pvalue = 6,
  show_pvalue = TRUE,
  return_stat_res = FALSE,
  assay = NULL,
  slot = "scale.data",
  scale = FALSE
)

Arguments

data

The input data, which can be a Seurat object or a data frame.

signature

The column name representing the y-axis values in the plot.

variable

The column name representing the x-axis values in the plot.

angle_x_text

The angle (in degrees) at which x-axis text labels should be displayed (default = 0).

hjust

The horizontal justification of x-axis text labels (default = 0.5).

palette

The color palette to use for filling the boxplots (default = "nrc").

cols

Optional vector of colors to use for filling the boxplots (default = NULL).

jitter

Boolean flag indicating whether to add jitter to the data points (default = FALSE).

point_size

The size of the data points when jitter is enabled (default = 5).

size_of_font

The font size for axis labels and text (default = 10).

size_of_pvalue

The font size for the statistical comparison results (default = 6).

show_pvalue

Boolean flag indicating whether to display the statistical comparison results (default = TRUE).

return_stat_res

Boolean flag indicating whether to return the statistical comparison results (default = FALSE).

assay

The name of the assay to extract data from in a Seurat object (default = NULL, uses the default assay).

slot

The slot name to extract data from in a Seurat object (default = "scale.data").

scale

Boolean flag indicating whether to scale the signature values (default = FALSE).

Author(s)

Dongqiang Zeng

Examples

data("tcga_stad_pdata", package = "IOBR")

sig_box(data = tcga_stad_pdata, signature = "TMEscore_plus", variable = "subtype", jitter = T, palette = "jco")

sig_box(data = tcga_stad_pdata, signature = "TMEscore_plus", variable = "subtype", jitter = FALSE, palette = "jco")

IOBR/IOBR documentation built on May 5, 2024, 2:34 p.m.