plot_volcano: plot the differential analysis results by volcano plot

View source: R/plot_volcano_scatter.R

plot_volcanoR Documentation

plot the differential analysis results by volcano plot

Description

The function is to use ggplot2 to draw volcano.

Usage

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)

Arguments

da_res

(Required). a data frame from differential analysis.

group_names

(Optional). character. the two groups' names (default: NULL).

x_index

(Required). character. the variable for x-axis.

x_index_cutoff

(Optional). numeric. the cutoff of x-axis (default: 1).

rev_x_index

(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).

y_index

(Required). character. the variable for y-axis.

y_index_cutoff

(Optional). numeric. the cutoff of y-axis (default: 0.05).

group_colors

(Optional). character. the color for plotting. (default: upregulated->"red", downregulated->"blue", nonsignificant->"grey").

topN

(Optional). integer. the number of top significant taxa to plot (default: NULL).

feature_name

(Optional). character. the interesting significant feature to show(default: NULL).

p_size

(Optional). numeric. point size of the scatterplot (default: 1).

line_size

(Optional). numeric. line size (default: 0.7).

geom_text_size

(Optional). numeric. geom: text size (default: 6).

geom_label_repel_size

(Optional). numeric. main geom: label repel size (default: 4).

theme_text_size

(Optional). numeric. main theme: text size (default: 10).

theme_title_size

(Optional). numeric. main theme: title size (default: 12).

theme_legend_size

(Optional). numeric. main legend: text size (default: 8).

theme_strip_size

(Optional). numeric. main strip: text size (default: 14).

add_enrich_arrow

(Optional). logical. whether to add enriched arrow. (default: FALSE).

x_gap_times

(Optional). numeric. times of x axis gap (default: 1.2).

segment_size

(Optional). numeric. arrow segment size (default: 8).

segment_text_size

(Optional). numeric. size of text in arrow segment (default: 4).

Author(s)

Created by Hua Zou (12/3/2022 Shenzhen China)

Examples


## Not run: 

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)

## End(Not run)


HuaZou/MicrobiomeAnalysis documentation built on May 13, 2024, 11:10 a.m.