Skip to contents

Generate Volcano Plots for Taxa Differential Test for a Single Time Point

Usage

generate_taxa_volcano_single(
  data.obj,
  group.var = NULL,
  test.list,
  feature.sig.level = 0.1,
  feature.mt.method = "fdr",
  features.plot = NULL,
  palette = c("white", "#7FB695", "#006D2C"),
  pdf = FALSE,
  pdf.wid = 7,
  pdf.hei = 5
)

Arguments

data.obj

A list object in a format specific to MicrobiomeStat, which can include components such as feature.tab (matrix), feature.ann (matrix), meta.dat (data.frame), tree, and feature.agg.list (list). The data.obj can be converted from other formats using several functions from the MicrobiomeStat package, including: 'mStat_convert_DGEList_to_data_obj', 'mStat_convert_DESeqDataSet_to_data_obj', 'mStat_convert_phyloseq_to_data_obj', 'mStat_convert_SummarizedExperiment_to_data_obj', 'mStat_import_qiime2_as_data_obj', 'mStat_import_mothur_as_data_obj', 'mStat_import_dada2_as_data_obj', and 'mStat_import_biom_as_data_obj'. Alternatively, users can construct their own data.obj. Note that not all components of data.obj may be required for all functions in the MicrobiomeStat package.

group.var

The grouping variable tested, found in metadata.

test.list

The list of test results returned by generate_taxa_trend_test_long.

feature.sig.level

The significance level cutoff for highlighting taxa.

feature.mt.method

Multiple testing correction method, "fdr" or "none".

features.plot

A character vector of taxa to be plotted. If NULL, all taxa will be plotted.

palette

An optional parameter specifying the color palette to be used for the plot. It can be either a character string specifying the name of a predefined palette or a vector of color codes in a format accepted by ggplot2 (e.g., hexadecimal color codes). Available predefined palettes include 'npg', 'aaas', 'nejm', 'lancet', 'jama', 'jco', and 'ucscgb', inspired by various scientific publications and the `ggsci` package. If `palette` is not provided or an unrecognized palette name is given, a default color palette will be used. Ensure the number of colors in the palette is at least as large as the number of groups being plotted.

pdf

Boolean; whether to save the plot as a PDF file.

pdf.wid

Numeric; width of the saved PDF file.

pdf.hei

Numeric; height of the saved PDF file.

Value

A list of ggplot objects of volcano plots for each taxonomic level

Examples

if (FALSE) { # \dontrun{
  # Load the data
  data(peerj32.obj)

  # Generate a list of tests for taxa significance
  test.list <- generate_taxa_test_single(
    data.obj = peerj32.obj,
    time.var = "time",
    t.level = "2",
    group.var = "group",
    adj.vars = "sex",
    feature.dat.type = "count",
    feature.level = c("Family"),
    prev.filter = 0.1,
    abund.filter = 0.0001
  )

  # Generate volcano plots from the test results
  volcano_plots <- generate_taxa_volcano_single(
    data.obj = peerj32.obj,
    group.var = "group",
    test.list = test.list,
    feature.sig.level = 0.1,
    feature.mt.method = "none"
  )

  volcano_plots <- generate_taxa_volcano_single(
    data.obj = peerj32.obj,
    group.var = "group",
    test.list = test.list,
    features.plot = peerj32.obj$feature.ann[,"Family"][1:10],
    feature.sig.level = 0.1,
    feature.mt.method = "none"
  )
} # }