if (FALSE) {
library(ggpicrust2)
library(tibble)
# Load example data
data("ko_abundance")
data("metadata")
# Convert KO to KEGG abundance
kegg_abundance <- ko2kegg_abundance(data = ko_abundance)
# Run differential abundance analysis
daa_results <- pathway_daa(
abundance = kegg_abundance,
metadata = metadata,
group = "Environment",
daa_method = "LinDA"
)
# Annotate results
daa_annotated <- pathway_annotation(
pathway = "KO",
ko_to_kegg = TRUE,
daa_results_df = daa_results
)
# Create volcano plot
volcano_plot <- pathway_volcano(daa_annotated)
print(volcano_plot)
# Customize the plot
volcano_plot <- pathway_volcano(
daa_annotated,
fc_threshold = 0.5,
p_threshold = 0.01,
label_top_n = 15,
colors = c("Down" = "darkblue", "Not Significant" = "lightgrey", "Up" = "darkred")
)
}
Run the code above in your browser using DataLab