Skip to contents

Given a t-test analysis performed with the function gentab_P.t.test, and a Fold Change analyses performed with the function gentab_FC, it gives a Volcano plot.

Usage

Volcano_ttest_FC(
  ttest_results,
  FC_results,
  FDR = FALSE,
  log_base = 2,
  cut_off_names = -log10(0.05),
  line1_position = -log10(0.05),
  line2_position = NULL,
  names_to_plot = NULL,
  category = NULL,
  col_pal = NULL
)

Arguments

ttest_results

data frame obtained from the function gentab_P.t.test.

FC_results

data frame obtained from the function gentab_FC. The first column must contain the same elements of the first column of ttest_results.

FDR

logical. If TRUE, it will plot on the Y-axis the value from the PvaluesFDR column of the ttest_results; if FALSE, the Pvalues.

log_base

numeric of length 1. The base of the logarithm used in the FC analysis. Only for visualisation purpose as it will be shown in the x-axis label.

cut_off_names

NULL or numerical of length 1. The names will be shown only if above this cut-off in the y-axis. Pass 0 if you want to see all names. Pass NULL if you don't want to see any name.

line1_position

NULL or numerical of length 1. The y-value of the horizontal dotted line. Pass NULL if you don't want it.

line2_position

NULL or numerical of length 1. The y-value of the second horizontal dotted line. Pass NULL if you don't want it.

names_to_plot

NULL or character of length 1. The name of the column containing the names to report on the plot. If this column name is absent in ttest_results, it will be considered from FC_results. If NULL is passed to this arguments, the names will be taken from the first column of ttest_results (which elements must match with the first column of FC_results).

category

NULL or character of length 1. The name of the column containing the groups to color the points. If this column name is absent in ttest_results, it will be considered from FC_results. If NULL is passed to this arguments, all the points will be black.

col_pal

NULL or a character vector containing colors. If NULL, colors from the pals package will be used (see function build_long_vector_of_colors).

Value

A ggplot object with the Volcano plot.