plot_peak {gcxgclab}R Documentation

Peak Plot

Description

plot_peak plots peaks on a chromatograph plot.

Usage

plot_peak(
  peaks,
  data,
  title = "Intensity with Peaks",
  circlecolor = "red",
  circlesize = 5
)

Arguments

peaks

a data.frame object. A data frame with 4 columns (Time, X, Y, Peak), ideally the output from either thr_peaks() or top_peaks().

data

a list object. Data extracted from a cdf file, ideally the output from extract_data(). Provides the background GCxGC plot, created with plot_chr().

title

a string object. Title placed at the top of the plot. Default title "Intensity with Peaks".

circlecolor

a string object. The desired color of the circles which indicate the peaks. Default color red.

circlesize

a double object. The size of the circles which indicate the peaks. Default size 5.

Details

This function circles the identified peaks in a sample over a chromatograph plot (ideally smoothed) using ggplot from ggplot2 package (Wickham 2016).

Value

A ggplot object. A plot of the chromatogram heatmap, with identified peaks circled in red.

References

Wickham H (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. ISBN 978-3-319-24277-4, https://ggplot2.tidyverse.org.

Examples

file1 <- system.file("extdata","sample1.cdf",package="gcxgclab")
frame <- extract_data(file1,mod_t=.5)
peaks <- top_peaks(frame$TIC_df, 5)
plot_peak(peaks, frame, title="Top 20 Peaks")


[Package gcxgclab version 1.0.1 Index]