Generates volcano plots to visualize the results of differential expression analysis by plotting log2 fold changes against negative log10 adjusted p-values. The function creates plots for all pairwise group comparisons and applies significance thresholds to highlight upregulated, downregulated, and non-significant features.

plot_Volcano(
  PPData,
  FCData,
  CAData,
  arrangeLevels = NULL,
  fcUP = 2,
  fcDown = 0.5,
  adjpvalue = 0.05,
  show_plots = TRUE,
  verbose = TRUE
)

Arguments

PPData

A list object returned by perform_PreprocessingPeakData(). Must contain a Metadata component with a Group column.

FCData

A list object returned by perform_FoldChange(). Must contain fold change data for group comparisons.

CAData

A list object returned by perform_ComparativeAnalysis(). Must contain a results component with p-values and adjusted p-values.

arrangeLevels

A character vector specifying the order of group levels. Format: c('group1', 'group2', ...). If NULL (default), groups are sorted alphabetically. Recommended order: control, case1, case2 (e.g., Control, Non-severe dengue, Severe dengue).

fcUP

A numeric value specifying the upper fold change threshold for significance. Features with fold change >= fcUP are considered upregulated. Default: 2.

fcDown

A numeric value specifying the lower fold change threshold for significance. Features with fold change <= fcDown are considered downregulated. Default: 0.5.

adjpvalue

A numeric value specifying the adjusted p-value threshold for significance. Default: 0.05.

show_plots

A logical value indicating whether to display plots. Default: TRUE.

verbose

A logical value indicating whether to print progress messages. Default: TRUE.

Value

A list containing:

FunctionOrigin

Character string identifying the source function

Parameters

List of input parameters used

VolcanoPlots

Named list of ggplot2 objects, one for each comparison

VolcanoData_Comparison

Data frame with complete volcano plot data for each comparison

VolcanoData_filtered_Comparison

Data frame with significant features only for each comparison

Summary

Summary statistics for each comparison

Details

The function performs the following steps:

  1. Validates input data structures and parameters

  2. Extracts non-QC samples from the metadata

  3. Creates all possible pairwise group comparisons

  4. Merges fold change and statistical test results

  5. Applies significance thresholds to classify features

  6. Generates volcano plots with customizable thresholds

  7. Returns comprehensive results including plots and data

Features are classified as:

  • Upregulated: Fold change >= fcUP AND adjusted p-value < adjpvalue

  • Downregulated: Fold change <= fcDown AND adjusted p-value < adjpvalue

  • Not Significant: All other features

Author

John Lennon L. Calorio

Examples

if (FALSE) { # \dontrun{
# Basic usage with default parameters
volcano_results <- plot_Volcano(
  PPData = preprocess_results,
  FCData = foldchange_results,
  CAData = comparative_results
)

# With custom thresholds and group ordering
volcano_results <- plot_Volcano(
  PPData = preprocess_results,
  FCData = foldchange_results,
  CAData = comparative_results,
  arrangeLevels = c("Control", "Treatment1", "Treatment2"),
  fcUP = 1.5,
  fcDown = 0.67,
  adjpvalue = 0.01
)

# Access specific results
plot_obj <- volcano_results$VolcanoPlots[["Control vs. Treatment1"]]
sig_features <- volcano_results$VolcanoData_filtered_Control_vs._Treatment1
} # }