plot_boxplot: Boxplot for SummarizedPhyloseq data

Description Usage Arguments Author(s) Examples

Description

This function uses the ggplot2 package to generate a boxplot from a givin SummarizedPhyloseq-class object by specifying a taxon name.

Usage

1
plot_boxplot(spy, level, taxon, x, rows, cols, line, color, ...)

Arguments

spy

SummarizedPhyloseq-class

level

character. The phylogenic level.

taxon

character. The taxon name to plot.

line

character. A sample meta-data variable. If specified, geom_line will be called to draw lines between 2 points. This is particually usful to deal with repeated measures.

by

character. The sample meta-data variable to plot the abundance data againt to. It must be from the sample data's column names. If multiple variables are givin, facets will be used. The default is sample name. See examples.

color.by

character. A sample meta-data variable. If specified, points with different levels will be colored diffently. See examples.

jitter

numeric. If specified, points will be jittered. Recommanded value: 0.15. the line and jitter can not be specified at the same time.

point.size

numeric. The size of points. Default is 3

point.alpha

numeric. The transparency of points.

point.color

character. If the color.by is not specified, this value will be given the to the points color.

whisker.width

numeirc. The width of boxplot whisker. Default is 0.5.

color.pal

character. The color panel to use.

show.legend

logical. Whether to show legend. Default is TRUE.

syle

character. The pre-defined style to apply on the plot. "bw" is a empty default style using the theme_bw. "academic" is a classic style based on the theme_classic.

plotly

logical. If TRUE, a plotly variable will be returned.

Author(s)

Chenghao Zhu

Examples

1
2
3
4
5
6
data(fatigue)
fatigue = transform_sample_counts(fatigue, function(x) x/sum(x))
spy = summarizeFromPhyloseq(fatigue)
plot_box(spy, level = "Genus", taxon = "g__Ruminococcus", by = "Subject", jitter = 0.15)
plot_box(spy, level = "Genus", taxon = "g__Ruminococcus", by = c("Subject","Sex"), box.size = 1, whisker.size = 1, show.points = F, style = "academic")
plot_box(spy, level = "Genus", taxon = "g__Ruminococcus", by = c("Subject","Sex"), jitter = 0.15, box.size = 1, whisker.size = 1, point.alpha = 0.75, point.color = "steelblue", style = "academic")

zhuchcn/phylox documentation built on May 31, 2019, 5:14 p.m.