singleVariablePlot: singleVariablePlot()

View source: R/10_Variable_Plots.R

singleVariablePlotR Documentation

singleVariablePlot()

Description

Plots the abundances for a given variable based on a given factor contained in the metadata of the romics_object. This function will use the factor selected to group the samples and will color the plots based on the level of this factor. This function will function with partial matches.

Usage

singleVariablePlot(
  romics_object,
  variable = "variable",
  type = "jb",
  factor = "main",
  limits = c(-10, 10),
  title = "auto",
  pval = "p",
  y_bracket_pos = 0.5
)

Arguments

romics_object

A romics_object created using romicsCreateObject()

variable

A string, the function will look for any string containing this name (partial match work, however if multiple rows contain the same partial name, the function will stop and indicate the multiple options)

type

Must be in the following list: 'jitter','boxplot','violin','jb',or 'jv'. Indicates the type of plot to be returned. 'jb' is for both a jitter and a boxplot. 'jv' is for both a jitter and a violin

factor

has to be either 'main" or a factor of the romics_object, the list of factor can be retrieved using the function romicsFactorNames()

limits

has to be a numerical vector of length 2 corresponding to the lower and higher y_limits of the plot, by default ggplot will automatically define these, has to be a numeric vector of length 2 c(limit_min, limit_max)

title

String. Indicate the title of the plot. automatically it will use the full feature name found for the chosen variable (in the case of partial match).

pval

character vector of length one. Has to be either "none", "p", or "padj". "none" by default , "p" or "padj" is employed it indicates that pairwise ttest pvalues should be displayed above the groups of the the main factor (these have to be calculated prior running this function).

y_bracket_pos

has to be a numerical vector of length one indicating the position and position increments for the pval bracket (only necessary when pval in c('p', 'padj')).

Details

This function allows to quickly plot a the values for a given variable across multiple levels of a given factor

Value

a ggplot figure

Author(s)

Geremy Clair


PNNL-Comp-Mass-Spec/RomicsProcessor documentation built on March 18, 2023, 5:14 a.m.