volcanoplot: Volcano plot with 'volcanoplot'

Description Usage Arguments Value Examples

View source: R/runPlots.R

Description

A simple function that shows statistical significance (p-value) versus magnitude of change (log2 fold change).

Usage

1
2
3
4
5
6
7
8
9
volcanoplot(
  degseqDF,
  comparison = "M12-A12",
  filter = c(Fold = 2, FDR = 10),
  genes = "NULL",
  plotly = FALSE,
  savePlot = FALSE,
  filePlot = NULL
)

Arguments

degseqDF

object of class data.frame generated by systemPipeR::run_edgeR() or systemPipeR::run_DESeq2().

comparison

character vector specifying the factor names for comparison..

filter

Named vector with filter cutoffs of format c(Fold=2, FDR=1) where Fold refers to the fold change cutoff (unlogged) and FDR to the p-value cutoff.

genes

character vector of genes names to show on the plot.

plotly

logical: when FALSE (default), the ggplot2 plot will be returned. TRUE option returns the plotly version of the plot.

savePlot

logical: when FALSE (default), the plot will not be saved. If TRUE the plot will be saved, and requires the filePlot argument.

filePlot

file name where the plot will be saved. For more information, please consult the ggplot2::ggsave() function.

Value

returns an object of ggplot or plotly class.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Load targets file and count reads dataframe
targetspath <- system.file("extdata", "targets.txt", package="systemPipeR")
targets <- read.delim(targetspath, comment = "#")
cmp <- systemPipeR::readComp(file=targetspath, format="matrix", delim="-")
countMatrixPath <- system.file("extdata", "countDFeByg.xls", package="systemPipeR")
countMatrix <- read.delim(countMatrixPath, row.names=1)
### DEG analysis with `systemPipeR`
degseqDF <- systemPipeR::run_DESeq2(countDF = countMatrix, targets = targets, cmp = cmp[[1]], independent = FALSE)
DEG_list <- systemPipeR::filterDEGs(degDF = degseqDF, filter = c(Fold = 2, FDR = 10))
## Plot
volcanoplot(degseqDF, comparison = "M12-A12", filter = c(Fold = 2, FDR = 10))
volcanoplot(degseqDF, comparison = "M12-A12", filter = c(Fold = 1, FDR = 20), genes = "ATCG00280")

systemPipeR/spsBio documentation built on Oct. 2, 2020, 9:30 a.m.