mz_rt_plot | R Documentation |
Plots a scatter plot of results of statistical tests, where each point represents a feature. The plot has retention time on x-axis, m/z on y-axis and the size of the points is scaled based on p-value
mz_rt_plot(
object,
p_col = NULL,
p_limit = NULL,
mz_col = NULL,
rt_col = NULL,
color = NULL,
title = "m/z retention time",
subtitle = NULL,
color_scale = getOption("notame.color_scale_con"),
...
)
object |
a MetaboSet object or a data frame. If x is a MetaboSet object, fData(x) is used. If x is a data frame, it is used as is. |
p_col |
the column name containing p-values. This is used to scale the size of the points. |
p_limit |
numeric, limits plotted features by p-values. If NULL, plots all features. |
mz_col , rt_col |
the column names for m/z and retention time. If NULL, automatic detection is attempted. |
color |
the column name used to color the points |
title |
The plot title |
subtitle |
The plot subtitle |
color_scale |
color scale as returned by a ggplot function. Defaults to current continuous color scale. |
all_features |
logical, should all features be retained? Should be used only if x is a MetaboSet object. |
a ggplot object
# Compute results from a linear model
lm_results <- perform_lm(merged_sample, formula_char = "Feature ~ Group")
with_results <- join_fData(merged_sample, lm_results)
# Plot from the MetaboSet object
# automatically facet by analytical mode in variable Split
mz_rt_plot(with_results, p_col = "GroupB_P", color = "GroupB_Estimate")
# Plot the results from the results dataframe
mz_rt_plot(with_results, p_col = "GroupB_P", color = "GroupB_Estimate")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.