Learn R Programming

ggpicrust2 (version 2.1.2)

compare_gsea_daa: Compare GSEA and DAA results

Description

This function compares the results from Gene Set Enrichment Analysis (GSEA) and Differential Abundance Analysis (DAA) to identify similarities and differences.

Usage

compare_gsea_daa(
  gsea_results,
  daa_results,
  plot_type = "venn",
  p_threshold = 0.05
)

Value

A ggplot2 object or a list containing the plot and comparison results

Arguments

gsea_results

A data frame containing GSEA results from the pathway_gsea function

daa_results

A data frame containing DAA results from the pathway_daa function

plot_type

A character string specifying the visualization type: "venn", "upset", "scatter", or "heatmap"

p_threshold

A numeric value specifying the significance threshold

Examples

Run this code
if (FALSE) {
# Load example data
data(ko_abundance)
data(metadata)

# Prepare abundance data
abundance_data <- as.data.frame(ko_abundance)
rownames(abundance_data) <- abundance_data[, "#NAME"]
abundance_data <- abundance_data[, -1]

# Run GSEA analysis
gsea_results <- pathway_gsea(
  abundance = abundance_data,
  metadata = metadata,
  group = "Environment",
  pathway_type = "KEGG",
  method = "fgsea"
)

# Run DAA analysis
daa_results <- pathway_daa(
  abundance = abundance_data,
  metadata = metadata,
  group = "Environment"
)

# Compare results
comparison <- compare_gsea_daa(
  gsea_results = gsea_results,
  daa_results = daa_results,
  plot_type = "venn"
)
}

Run the code above in your browser using DataLab