plot_filters: Diagnostic plot of compound filtering

View source: R/plot_filters.R

plot_filtersR Documentation

Diagnostic plot of compound filtering

Description

This function creates several plots that visualizes compounds and filtering criteria. Requires filter_area and filter_freq to be run first, and optionally filter_ambient_ratio. It requires ggplot2.

Usage

plot_filters(
  chemtable,
  option = "rarity",
  yrange = 3,
  fontsize = 3,
  pointsize = 10
)

Arguments

chemtable

the data frame of the data about the compounds

yrange

the number of orders of magnitude the log10 y-axis will span (for method "ambient") or the negative left limit of the log2 x-axis (for method "volcano"), NA means no limit

fontsize

size of the compound labels

pointsize

size of the largest point

method

the type of plot to produce, "rarity" or "ambient", see Details

Details

The following plotting options are available. The color of points is set based on whether the compound met the final filtering criteria (filter_final column), or the t-test or area and frequency filters. See the pipeline vignette for details.

rarity

Plots compound rarity (x-axis), maximum peak area across samples (y-axis), mean nonzero area peak area (size), and amounts relative to ambient controls (labels, if filter_ambient_ratio is run first)

ambient

Plots mean peak area in ambient controls (x-axis) versus in floral samples (y-axis), frequency in floral samples (size), and shows the cutoff used for filter_ambient_ratio (dotted line)

volcano

Plots fold change (x-axis) and (adjusted) p-value (y-axis) comparing floral to ambient samples, frequency in floral samples (size), and shows the cutoff used for filter_ambient_ratio and alpha (dotted lines)

prop

Plots the proportion of chemicals that passed each test

Examples

data(GCMSfloral)
plot_filters(chemtable, option="rarity")
plot_filters(chemtable, option="ambient")

jmpowers/bouquet documentation built on Feb. 12, 2023, 12:11 a.m.