plot_group_panel: Plot boxplots of log10 relative abundance, facetted by 1...

Description Usage Arguments Details Value

View source: R/plot_group_panel.R

Description

plot_group_panel plots boxplots of log10 relative abundances, sorted by their median and facetted by 1 feature. In each plot, the top cutoff OTUs are plotted, as well as a line connecting the medians from the base_group. Any increases or decreases in the other groups, relative to the base group, are colored. 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_group_panel(metadata, otu_tab_matrix, group, base_group = "Control",
  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.

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

plot_group_panel plots boxplots of log10 relative abundances, sorted by their median and facetted by 1 feature. In each plot, the top cutoff OTUs are plotted, as well as a line connecting the medians from the base_group. Any increases or decreases in the other groups, relative to the base group, are colored. 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 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. This function does not automatically display the plot, so you need to call print on its output to display the plot.


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