vis_boxplot: Visually appealing boxplots

Description Usage Arguments Details Value Author(s) Examples

View source: R/vis_boxplot.R

Description

Boxplot

Usage

1
vis_boxplot(obj,group_by)

Arguments

obj

(required) A data object of class 'ampvis2' (see amp_load) or class 'mmt' (see mt_load).

group_by

(required) Group the samples by a variable in the metadata.

boxgroup_by

Group the samples within each boxplot by a variable in the metadata.

sort_by

Sort the boxplots by "median", "mean" or "total". (default: "median")

normalise

Can take one of following arguments: (default: "libsize")

  • "total": Normalise the read counts to be in percent per sample.

  • "libsize": Normalise the read counts to adjust for gene dispersion and total read counts per sample. See estimateSizeFactorsForMatrix for details.

  • "none": No normalisation.

plot_type

Plot type. "boxplot" or "point". (default: "boxplot")

point_size

The size of points. (default: 1)

row_show

The number of variables to show, or a vector of gene/OTU names. (default: 20)

order_group

A vector to order the groups by.

order_boxgroup

A vector to order the box-groups by.

title_newline

Split the facet headers by newline. (default: FALSE)

title_size

Size of text in facet headers. (default: 5)

plot_flip

(logical) Flip the axes of the plot axis. (default: FALSE)

plot_log

(logical) Log10-scale the plot. (default: FALSE)

adjust_zero

Keep values of 0 in calculations by adding this value. (default: NULL)

detailed_output

(logical) Return additional details or not. If TRUE, it is recommended to save to an object and then access the additional data by View(object$data). (default: FALSE)

row_labels

(mmtravis only) Additional variables in genedata to plot (mmt).

tax_class

(ampvis2 only) Converts a specific phylum to class level instead, e.g. "p__Proteobacteria".

tax_empty

(ampvis2 only) How to show OTUs without taxonomic information. One of the following:

  • "remove": Remove OTUs without taxonomic information.

  • "best": (default) Use the best classification possible.

  • "OTU": Display the OTU name.

tax_aggregate

(ampvis2 only) The taxonomic level to aggregate the OTUs. (default: "Genus")

Details

The plot is ordered as one would read a book, from left to right and top to bottom.

Value

A ggplot2 object. If detailed_output = TRUE a list with a ggplot2 object and additional data.

Author(s)

Thomas Yssing Michaelsen tym@bio.aau.dk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
data("example_mmt")

vis_boxplot(example_mmt,
  group_by    = "Type",
  boxgroup_by = "Organism",
  row_show    = 10,
  row_labels  = "product",
  title_newline = T)

## End(Not run)

TYMichaelsen/mmtravis documentation built on Aug. 5, 2019, 10:48 a.m.