mz_vis | R Documentation |
The function 'mz_vis' visualizes the mass difference distribution, which has been summarized by 'mz_summary'.
mz_vis(df, var = "group")
df |
'data.frame', previously generated by 'mz_summary'. Needs to contain the columns "transformation", "mass_difference" and "counts". |
var |
'character(1)', the column in 'df' to visualize on the y-axis |
Plots the mass difference distribution, summarized by 'mz_summary'. Visualization is performed using ggplot2
'ggplot' object and corresponding barplot for visualizations
Liesa Salzer, liesa.salzer@helmholtz-muenchen.de and Thomas Naake, thomasnaake@googlemail.com
data("x_test", package = "MetNet")
transformation <- rbind(
c("Monosaccharide (-H2O)", "C6H10O5", "162.0528234315"),
c("Disaccharide (-H2O)", "C12H20O11", "340.1005614851"),
c("Trisaccharide (-H2O)", "C18H30O15", "486.1584702945"))
transformation <- data.frame(group = transformation[, 1],
formula = transformation[, 2],
mass = as.numeric(transformation[, 3]))
am_struct <- structural(x_test, transformation,
var = c("group", "formula", "mass"), ppm = 5, directed = TRUE)
mz_sum <- mz_summary(am_struct, var = "group")
mz_vis(mz_sum)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.