Description Usage Arguments Examples
Reads a data frame and plots fold difference and p-value in a volcano plot.
P-values can be calculated using calc_ttest_padj
and fold change (log2 of fold change)
using calc_fold_change
. Column names for p-value and log2_fold
difference is
matched based on character matched with p_val
and fold_change
arguments.
Thresholds can be modified using fold_threshold
and p_val_threshold
arguments.
Plot parameters are added in the plot_config
list. Protein annotation (e.g. gene names)
can be added. If annotation is not included in the data frame, you can use append_cols_df
function to add extra columns in your dataset and then continue with plotting. The processed
dataset of plot_volc
function can be saved in an object (see example).
1 2 3 4 5 6 | plot_volc(x, p_val, fold_change, fold_threshold = 2, p_val_threshold = 0.05,
plot_config = list(col = c("blue", "red", "grey"), point_size = 1, xlim =
c(-4, 4), ylim = c(0, NA), xlab = "Log2 fold change A/B", ylab =
"-log p-value", title =
"Differentially abundant proteins between groups A and B", show_labs = FALSE,
lab_lines = FALSE, labs_size = 2, labs_id = "Gene.names...primary.."))
|
x |
Data frame containing p-values and calculated fold_change. If fold change is not
calculated use |
p_val |
Character string for the identification of the column containing p-values. Only one column should match. |
fold_change |
Character string for the identification of the column containing log2_fold change values. Only one column should match. |
fold_threshold |
Threshold for fold difference. Default is 2. You don<e2><80><99>t have to calculate the log2 value of the threshold. |
p_val_threshold |
Threshold for t-test p-value. Default is 0.05. |
plot_config |
List of plot parameters (see usage): |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | p_val <- "pValue"
fold_change <- "log2_fold_change_AB"
plot_config <- list(col = c("blue", "red", "grey"),
point_size = 2,
xlim = c(-4, 4),
ylim = c(0, NA),
xlab = "Log2 fold change A/B",
ylab = "-log p-value",
title = "DA proteins between groups A and B",
show_labs = TRUE,
lab_lines = TRUE,
labs_size = 2,
labs_id = "Gene.names...primary..")
my_graph_data <- plot_volc(x = data,
p_val = p_val,
fold_change = fold_change,
fold_threshold = 1.5,
p_val_threshold = 0.05,
plot_config = plot_config)
write.csv(my_graph_data, file = <e2><80><9c>my_graph_data.csv<e2><80><9d>, row.names = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.