Skip to contents

create volcano plots for all comparisons present in the results file

Usage

plotVolcano(
  res,
  pval_cutoff = 0.05,
  fc_cutoff = 1,
  label = "sig",
  top_n = NULL,
  up_color = "red3",
  down_color = "dodgerblue",
  ns_color = "grey70"
)

Arguments

res

A data frame with results from get_DEPresults()

pval_cutoff

The p.adj significance cutoff

fc_cutoff

The log2 fold change significance cutoff

label

Specifies which points to label. The default is 'sig', labeling all significant points. Entering a value for top_n limits the labeling to the top_n up- and top_n down-regulated proteins based on the p.adj. When providing a vector with protein names, only those points are labeled.

top_n

Specifies how many significant points to label.

up_color

Specifies the color of the significantly up-regulated proteins.

down_color

Specifies the color of the significantly down-regulated proteins.

ns_color

Specifies the color of non-significant proteins.

Value

A single ggplot object (1 comparison) or a list with ggplot objects.

Examples


library(ggplot2)
library(ggrepel)

se <- prepare_se(report.pg_matrix, expDesign)

#> Imputing along margin 1 (features/rows).
#> Warning: 36 rows with more than 50 % entries missing;
#>  mean imputation used for these rows
#> Cluster size 5548 broken into 2203 3345 
#> Cluster size 2203 broken into 1569 634 
#> Cluster size 1569 broken into 1504 65 
#> Cluster size 1504 broken into 645 859 
#> Done cluster 645 
#> Done cluster 859 
#> Done cluster 1504 
#> Done cluster 65 
#> Done cluster 1569 
#> Done cluster 634 
#> Done cluster 2203 
#> Cluster size 3345 broken into 2136 1209 
#> Cluster size 2136 broken into 1087 1049 
#> Done cluster 1087 
#> Done cluster 1049 
#> Done cluster 2136 
#> Done cluster 1209 
#> Done cluster 3345 
res <- get_DEPresults(se, type = 'all')
#> Tested contrasts: neg_ctrl_vs_motif1, neg_ctrl_vs_motif2, motif1_vs_motif2
vol <- plotVolcano(res, top_n = 10) # Labels the top 10 upregulated and
# top10 downregulated proteins based on fdr.
vol <- plotVolcano(res, label = c('SMAD3', 'SMAD4')) # Only labels SMAD3/4
vol <- plotVolcano(res, up_color = 'green', down_color = 'yellow') #
# Gives a very ugly volcano plot