plot_one_panel: Plot everything in one panel

Description Usage Arguments Details Value

View source: R/plot_group_panel.R

Description

plot_one_panel plots boxplots of log10 relative abundances, sorted by their median. The top cutoff OTUs (in terms of relative abundance) are plotted. The main inputs are a metadata data.frame, and a matrix for the OTU table. The metadata should be in long format, with one row corresponding to one sample. The OTU table should have the OTUs as the rows, and the samples as the columns.

Usage

1
2
3
plot_one_panel(metadata, otu_tab_matrix, group, base_group = "Control",
  dots = TRUE, cutoff = min(20, nrow(otu_tab_matrix)), alpha = 0.05,
  notch = FALSE, sep = ";", title = "")

Arguments

metadata

Data frame of metadata, like the one returned by readPCL.

otu_tab_matrix

matrix of relative abundance, like the one returned by readPCL. Each row should be an OTU, and each column should be a sample.

group

The grouping variable in the metadata.

base_group

The reference level for the grouping variable group. When performing hypothesis tests, all other levels of the grouping variable group are compared to this one.

dots

If TRUE, dots are plotted on top of the boxplots

cutoff

Only display the top cutoff bugs in terms of median relative abundance.

alpha

alpha level to conduct each hypothesis test.

notch

Whether to have notched boxplots.

sep

Character(s) separating different levels of taxonomic classification in the OTU labels (rows of otu_tab_matrix)

title

Title for the graph.

Details

The main inputs are a metadata data.frame, and a matrix for the OTU table. The metadata should be in long format, with one row corresponding to one sample. The OTU table should have the OTUs as the rows, and the samples as the columns.

The coloring is determined by the results of hypothesis_test, which currently uses a Mann-Witney U test as implemented in wilcox.test.

Value

ggplot2 plotting object. Must call print to actually display the plot.


sagun98/mpuri documentation built on Dec. 23, 2019, 6:32 p.m.