boxplot_trio: Boxplot to compare groups

Description Usage Arguments Value References Examples

View source: R/boxplot_trio.R

Description

Plots the expression of a specific row in expression to compare the three groups in a boxplot using either ggplot or plotly.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
boxplot_trio(
  polar,
  value,
  box_colours = c("green3", "blue", "red"),
  test = "polar_pvalue",
  levels_order = NULL,
  my_comparisons = NULL,
  text_size = 10,
  stat_colour = "black",
  stat_size = 3,
  step_increase = 0.05,
  plot_method = "ggplot",
  ...
)

Arguments

polar

A polar object including expression data from groups of interest. Created by polar_coords.

value

The row name or number in polar@expression to be analysed

box_colours

The fill colours for each box assigned in order of levels_order. Default = c('green3', 'blue', 'red') ).

test

The statistical test used to compare expression. Allowed values include:

  • polar_pvalue (default) and 'polar_padj' for the pvalues and adjusted pvalues in the polar object.

  • polar_multi_pvalue and polar_multi_padj for the pvalues and adjusted pvalues across all groups using the polar@multi_group_test columns.

  • t.test (parametric) and wilcox.test (non-parametric). Perform comparison between groups of samples.

  • anova (parametric) and kruskal.test (non-parametric). Perform one-way ANOVA test comparing multiple groups.

levels_order

A character vector stating the contrast groups to be plotted, in order. If NULL this defaults to the levels in polar@sampledata[, polar@contrast].

my_comparisons

A list of contrasts to pass to stat_compare_means. If NULL (default) all contrast pvalues are calculated and plotted.

text_size

The font size of text (default = 10)

stat_colour

Colour to print statistics (default="black").

stat_size

The font size of statistical parameter (default = 3).

step_increase

The distance between statistics on the y-axis (default = 0.05).

plot_method

Whether to use 'plotly' or 'ggplot'. Default is 'ggplot'

...

Other parameters for stat_compare_means

Value

Returns a boxplot featuring the differential expression between groups in comparison with annotated pvalues.

References

Lewis, Myles J., et al. (2019). Molecular portraits of early rheumatoid arthritis identify clinical and treatment response phenotypes. Cell reports, 28:9

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(example_data)
syn_polar <- polar_coords(sampledata = syn_example_meta,
                          contrast = "Pathotype",
                          groups = NULL,
                          pvalues = syn_example_p,
                          expression = syn_example_rld,
                          p_col_suffix = "pvalue",
                          padj_col_suffix = "padj",
                          non_sig_name = "Not Significant",
                          multi_group_prefix = "LRT",
                          significance_cutoff = 0.01,
                          fc_col_suffix='log2FoldChange',
                          fc_cutoff = 0.3)

boxplot_trio(syn_polar, value = "SLAMF6", plot_method="plotly")
boxplot_trio(syn_polar, value = "SLAMF6")

volcano3D documentation built on July 1, 2020, 9:56 p.m.