This function integrates pathway name/description annotations, ten of the most advanced differential abundance (DA) methods, and visualization of DA results.
Source:R/ggpicrust2.R
ggpicrust2.Rd
This function integrates pathway name/description annotations, ten of the most advanced differential abundance (DA) methods, and visualization of DA results.
Usage
ggpicrust2(
file,
metadata,
group,
pathway,
daa_method = "ALDEx2",
ko_to_kegg = FALSE,
p.adjust = "BH",
order = "group",
p_values_bar = TRUE,
x_lab = NULL,
select = NULL,
reference = NULL,
colors = NULL
)
Arguments
- file
A character, the file path to store picrust2 export files
- metadata
A tibble, consisting of sample information
- group
A character, name of the group
- pathway
A character, consisting of "EC", "KO", "MetaCyc"
- daa_method
A character, the chosen differential abundance analysis (DA) method
- ko_to_kegg
A character to control the conversion of KO abundance to KEGG abundance
- p.adjust
A character, the method to adjust p-values
- order
A character to control the order of the main plot rows
- p_values_bar
A character to control if the main plot has the p_values bar
- x_lab
A character to control the x-axis label name, you can choose from "feature","pathway_name" and "description"
- select
A vector consisting of pathway names to be selected
- reference
A character, a reference group level for several DA methods
- colors
A vector consisting of colors number
Examples
if (FALSE) {
# Load necessary data: abundance data and metadata
abundance_file <- "path/to/your/abundance_file.tsv"
metadata <- read.csv("path/to/your/metadata.csv")
# Run ggpicrust2 with desired parameters
results <- ggpicrust2(file = abundance_file,
metadata = metadata,
group = "your_group_column",
pathway = "KO",
daa_method = "LinDA",
ko_to_kegg = TRUE,
order = "pathway_class",
p_values_bar = TRUE,
x_lab = "pathway_name")
# Access the plot and results dataframe for the first DA method
example_plot <- results[[1]]$plot
example_results <- results[[1]]$results
}