R/plot_volcano_scatter.R
plot_volcano.Rd
The function is to use ggplot2 to draw volcano.
plot_volcano(
da_res,
group_names = NULL,
x_index,
x_index_cutoff = 1,
rev_x_index = FALSE,
y_index,
y_index_cutoff = 0.05,
group_colors = c("red", "grey", "blue"),
topN = 5,
feature_name = NULL,
p_size = 1,
line_size = 0.7,
geom_text_size = 5,
geom_label_repel_size = 4,
theme_text_size = 10,
theme_title_size = 12,
theme_legend_size = 8,
theme_strip_size = 14,
add_enrich_arrow = FALSE,
x_gap_times = 1.2,
segment_size = 8,
segment_text_size = 4)
(Required). a data frame from differential analysis.
(Optional). character. the two groups' names (default: NULL).
(Required). character. the variable for x-axis.
(Optional). numeric. the cutoff of x-axis (default: 1).
(Optional). logical. whether to reverse the x index.
The effectsize, logFC or coefficients are controversial in aldex2
, ancom
,
edgeR
, limma_voom
, masslin2
and mbzinb
. For example,
the negative value indicates group1 and the positive indicates group2
when the order of group names is group1, group2. In fact, we expect that
the negative value indicates group2 and the positive indicates group1.
(default: FALSE).
(Required). character. the variable for y-axis.
(Optional). numeric. the cutoff of y-axis (default: 0.05).
(Optional). character. the color for plotting. (default: upregulated->"red", downregulated->"blue", nonsignificant->"grey").
(Optional). integer. the number of top significant taxa to plot (default: NULL).
(Optional). character. the interesting significant feature to show(default: NULL).
(Optional). numeric. point size of the scatterplot (default: 1).
(Optional). numeric. line size (default: 0.7).
(Optional). numeric. geom: text size (default: 6).
(Optional). numeric. main geom: label repel size (default: 4).
(Optional). numeric. main theme: text size (default: 10).
(Optional). numeric. main theme: title size (default: 12).
(Optional). numeric. main legend: text size (default: 8).
(Optional). numeric. main strip: text size (default: 14).
(Optional). logical. whether to add enriched arrow. (default: FALSE).
(Optional). numeric. times of x axis gap (default: 1.2).
(Optional). numeric. arrow segment size (default: 8).
(Optional). numeric. size of text in arrow segment (default: 4).
if (FALSE) {
data("Zeybel_2022_protein")
Zeybel_2022_protein_imput <- impute_abundance(
Zeybel_2022_protein,
group = "LiverFatClass",
method = "knn")
Zeybel_2022_protein_norm <- scale_variables(
Zeybel_2022_protein_imput,
method == "zscore")
DA_results <- run_metabolomeDA(
object_raw = Zeybel_2022_protein,
object_norm = Zeybel_2022_protein_norm,
variable = "LiverFatClass",
variable_name = c("None", "Severe"))
plot_volcano(
da_res = DA_results,
group_names = c("None", "Severe"),
x_index = "Log2FoldChange",
x_index_cutoff = 0.1,
rev_x_index = TRUE,
y_index = "AdjustedPvalue",
y_index_cutoff = 0.5,
group_color = c("red", "grey", "blue"),
topN = 5)
}