plotOneFactor: Bar plot of gene expression for single-factor experiments

View source: R/plotOneFactor.r

plotOneFactorR Documentation

Bar plot of gene expression for single-factor experiments

Description

Creates a bar plot of relative gene expression (fold change) values from a single-factor experiment, including standard error or confidence interval error bars and statistical significance.

Usage

plotOneFactor(
  data,
  x_col,
  y_col,
  Lower.se_col,
  Upper.se_col,
  letters_col = NULL,
  letters_d = 0.2,
  col_width = 0.8,
  err_width = 0.15,
  fill_colors = "grey40",
  alpha = 1,
  base_size = 12,
  legend_position = "none",
  ...
)

Arguments

data

Data frame

x_col

Numeric. Column index for x-axis

y_col

Numeric. Column index for bar height

Lower.se_col

Numeric. Column index for lower SE

Upper.se_col

Numeric. Column index for upper SE

letters_col

Optional column index for grouping letters

letters_d

Numeric. Vertical offset for letters (default 0.2)

col_width

Numeric. Width of bars (default 0.8)

err_width

Numeric. Width of error bars (default 0.15)

fill_colors

Optional vector of fill colors

alpha

Numeric. Transparency of bars (default 1)

base_size

Numeric. Base font size for theme (default 12)

legend_position

Character. Legend position (default "right")

...

Additional valid ggplot2 layer arguments

Details

The plotOneFactor function generates a bar plot of fold change values for target genes using the output expression tables produced by functions such as ANOVA_DDCt() or ANOVA_DCt(). Error bars can represent either standard error (SE) or 95% confidence intervals, and optional grouping letters from post hoc statistical comparisons can be displayed above the bars.

Value

ggplot2 plot object

Author(s)

Ghader Mirzaghaderi

Examples


a <- ANOVA_DCt(
data_1factor,
numberOfrefGenes = 1,
block = NULL
)
data <- a$Results

plotOneFactor(
  data,
  x_col = 1,
  y_col = 2,
  Lower.se_col = 7,
  Upper.se_col = 8,
  letters_col = 11,
  letters_d = 0.1,
  col_width = 0.7,
  err_width = 0.15,
  fill_colors = "skyblue",
  alpha = 1,
  base_size = 16
)




rtpcr documentation built on Dec. 19, 2025, 5:07 p.m.