mp_plot_diff_boxplot-methods: displaying the differential result contained abundance and...

mp_plot_diff_boxplotR Documentation

displaying the differential result contained abundance and LDA with boxplot (abundance) and error bar (LDA).

Description

displaying the differential result contained abundance and LDA with boxplot (abundance) and error bar (LDA).

Usage

mp_plot_diff_boxplot(
  .data,
  .group,
  .size = 2,
  errorbar.xmin = NULL,
  errorbar.xmax = NULL,
  point.x = NULL,
  taxa.class = "all",
  group.abun = FALSE,
  removeUnknown = FALSE,
  ...
)

## S4 method for signature 'MPSE'
mp_plot_diff_boxplot(
  .data,
  .group,
  .size = 2,
  errorbar.xmin = NULL,
  errorbar.xmax = NULL,
  point.x = NULL,
  taxa.class = "all",
  group.abun = FALSE,
  removeUnknown = FALSE,
  ...
)

## S4 method for signature 'tbl_mpse'
mp_plot_diff_boxplot(
  .data,
  .group,
  .size = 2,
  errorbar.xmin = NULL,
  errorbar.xmax = NULL,
  point.x = NULL,
  taxa.class = "all",
  group.abun = FALSE,
  removeUnknown = FALSE,
  ...
)

## S4 method for signature 'grouped_df_mpse'
mp_plot_diff_boxplot(
  .data,
  .group,
  .size = 2,
  errorbar.xmin = NULL,
  errorbar.xmax = NULL,
  point.x = NULL,
  taxa.class = "all",
  group.abun = FALSE,
  removeUnknown = FALSE,
  ...
)

Arguments

.data

MPSE or tbl_mpse after run mp_diff_analysis with 'action="add"'.

.group

the column name for mapping the different color.

.size

the column name for mapping the size of points or numeric, default is 2.

errorbar.xmin

the column name for 'xmin' mapping of error barplot layer, default is NULL.

errorbar.xmax

the column name for 'xmax' mapping of error barplot layer, default is NULL.

point.x

the column name for 'x' mapping of point layer (right panel), default is NULL.

taxa.class

the taxonomy class features will be displayed, default is 'all'.

group.abun

logical whether plot the abundance in each group with bar plot, default is FALSE.

removeUnknown

logical whether mask the unknown taxonomy information but differential species, default is FALSE.

...

additional params, see also the 'geom_boxplot', 'geom_errorbarh' and 'geom_point'.

Examples

data(mouse.time.mpse)
mouse.time.mpse %<>%
  mp_rrarefy()
mouse.time.mpse
mouse.time.mpse %<>%
  mp_diff_analysis(.abundance=RareAbundance,
                   .group=time,
                   first.test.alpha=0.01,
                   action="add")
library(ggplot2)
p1 <- mouse.time.mpse %>% 
        mp_plot_diff_boxplot(.group = time) %>%
        set_diff_boxplot_color(
          values = c("deepskyblue", "orange"),
          guide = guide_legend(title=NULL)
        )
p1
p2 <- mouse.time.mpse %>% 
        mp_plot_diff_boxplot(
          taxa.class = c(Genus, OTU),
          group.abun = TRUE, 
          removeUnknown = TRUE,
        ) %>%
        set_diff_boxplot_color(
          values = c("deepskyblue", "orange"),
          guide = guide_legend(title=NULL)
        )
p2 

xiangpin/MicrobitaProcess documentation built on April 12, 2024, 9:03 p.m.