| plot_volcano | R Documentation |
Performs necessary calculations (i.e., calculate p-values and log2-fold changes) and creates a basic Volcano Plot.
The plot is drawn with ggplot2 and can therefore be easily manipulated afterwards (e.g., changing the theme or the axis labels).
Please note that the function is intended to be easy to use and beginner friendly and therefore offers limited ability to fine-tune certain parameters of the resulting plot.
If you wish to draw the plot yourself, you can set return_tbl = TRUE. In this case, a tibble is returned instead of a ggplot2 object which you can use to create a plot yourself.
A Volcano Plot is used to compare two groups. Therefore grouping information must be provided. See join_metadata for more information.
plot_volcano(
data,
group_column,
name_column,
groups_to_compare,
batch_column = NULL,
batch = NULL,
log2fc_cutoff = 1,
p_value_cutoff = 0.05,
colors = list(sig_up = "darkred", sig_down = "darkblue", not_sig_up = "grey",
not_sig_down = "grey", not_sig = "grey"),
adjust_p = FALSE,
log2_before = FALSE,
return_tbl = FALSE,
...
)
data |
A tidy tibble created by |
group_column |
Which column should be used for grouping? Usually |
name_column |
Which column contains the feature names? Can for example be |
groups_to_compare |
Names of the groups which should be compared as a character vector. Those are the group names in the |
batch_column |
Which column contains the batch information? Usually |
batch |
The names of the batch(es) that should be included when calculating p-value and log2 fold change. |
log2fc_cutoff |
A numeric. What cutoff should be used for the log2 fold change? Traditionally, this is set to |
p_value_cutoff |
A numeric. What cutoff should be used for the p-value? Traditionally, this is set to |
colors |
A named list for coloring the dots in the Volcano Plot or |
adjust_p |
Should the p-value be adjusted? Can be either |
log2_before |
A logical. Should the data be log2 transformed prior to calculating the p-values? |
return_tbl |
A logical. If |
... |
Arguments passed on to |
Either a Volcano Plot in the form of a ggplot2 object or a tibble.
# returns a Volcano Plot in the form of a ggplot2 object
toy_metaboscape %>%
impute_lod() %>%
join_metadata(toy_metaboscape_metadata) %>%
plot_volcano(
group_column = Group,
name_column = Feature,
groups_to_compare = c("control", "treatment")
)
# returns a tibble to draw the plot manually
toy_metaboscape %>%
impute_lod() %>%
join_metadata(toy_metaboscape_metadata) %>%
plot_volcano(
group_column = Group,
name_column = Feature,
groups_to_compare = c("control", "treatment"),
return_tbl = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.