plot_defect {gcxgclab} | R Documentation |
Plots the Kendrick Mass Defect of a peak
Description
plot_defect
Plots Kendrick Mass Defect of a peak.
Usage
plot_defect(ms, compound_mass = 14.01565, title = "Kendrick Mass Defect")
Arguments
ms |
a data.frame object. A data frame of the mass values and the percent intensity values, ideally the output of find_ms(). |
compound_mass |
a float object. The exact mass, using most common ions, of the desired atom group to base the Kendrick mass on. Default is 14.01565, which is the mass for CH_2. |
title |
a string object. Title placed at the top of the plot. Default title "Kendrick Mass Defect". |
Details
This function produces a scatter plot of the Kendrick mass defects
for mass spectrum data. Plotted using ggplot
from
ggplot2 package (Wickham 2016).
Value
A ggplot object. A line plot of the mass spectra data. The mass values vs the percent intensity values as a percent of the highest intensity.
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
file <- system.file("extdata","sample1.cdf",package="gcxgclab")
frame <- extract_data(file,mod_t=.5)
peaks <- top_peaks(frame$TIC_df, 5)
mz <- find_ms(frame, t_peak=peaks$'T'[1])
plot_ms(mz)
plot_defect(mz,title="Kendrick Mass Defect, CH_2")