
Generate Volcano Plots for Taxa Volatility Test
Source:R/generate_taxa_volatility_volcano_long.R
generate_taxa_volatility_volcano_long.RdCreates volcano plots visualizing taxa abundance volatility differences between groups.
Arguments
- data.obj
A MicrobiomeStat data object, which is a list containing at minimum the following components:
feature.tab: A matrix of feature abundances (taxa/genes as rows, samples as columns)meta.dat: A data frame of sample metadata (samples as rows)
Optional components include:
feature.ann: A matrix/data frame of feature annotations (e.g., taxonomy)tree: A phylogenetic tree object (class "phylo")feature.agg.list: Pre-aggregated feature tables by taxonomy
Data objects can be created using converters like
mStat_convert_phyloseq_to_data_objor importers likemStat_import_qiime2_as_data_obj.- group.var
Character string specifying the column name in meta.dat containing the grouping variable (e.g., treatment, condition, phenotype). Used for between-group comparisons.
- test.list
List of test results from generate_taxa_volatility_test_long.
- feature.sig.level
Numeric; significance level cutoff for highlighting taxa.
- feature.mt.method
Character; multiple testing method ("fdr" or "none").
- features.plot
Character vector of features to plot. If NULL, plots all.
- palette
Character vector of colors or a named palette for the plot. If NULL, uses default MicrobiomeStat color scheme. Can be:
A vector of color codes (e.g., c("#E41A1C", "#377EB8"))
A palette name recognized by the plotting function
Logical. If TRUE, saves the plot(s) to PDF file(s) in the current working directory. Default is TRUE.
- pdf.wid
Numeric value specifying the width of PDF output in inches. Default is typically 11.
- pdf.hei
Numeric value specifying the height of PDF output in inches. Default is typically 8.5.
Examples
if (FALSE) { # \dontrun{
data("subset_T2D.obj")
test.list <- generate_taxa_volatility_test_long(
data.obj = subset_T2D.obj,
time.var = "visit_number",
subject.var = "subject_id",
group.var = "subject_race",
adj.vars = "sample_body_site",
prev.filter = 0.1,
abund.filter = 0.0001,
feature.level = c("Order", "Family", "Genus"),
feature.dat.type = "count",
transform = "CLR"
)
plot.list <- generate_taxa_volatility_volcano_long(data.obj = subset_T2D.obj,
group.var = "subject_race",
test.list = test.list,
feature.sig.level = 0.1,
feature.mt.method = "none")
data("ecam.obj")
test.list <- generate_taxa_volatility_test_long(
data.obj = ecam.obj,
time.var = "month_num",
subject.var = "subject.id",
group.var = "antiexposedall",
adj.vars = "delivery",
prev.filter = 0.1,
abund.filter = 0.0001,
feature.level = c("Order", "Family", "Genus"),
feature.dat.type = "proportion",
transform = "CLR"
)
plot.list <- generate_taxa_volatility_volcano_long(
data.obj = ecam.obj,
group.var = "antiexposedall",
test.list = test.list,
feature.sig.level = 0.1,
feature.mt.method = "none"
)
} # }