ezVolcano: Volcano plot

View source: R/plots.R

ezVolcanoR Documentation

Volcano plot

Description

Plot the interactive volvano plot or volcano plot with labelled genes.

Usage

  ezVolcano(log2Ratio, pValue, yType = c("p-value", "FDR"), 
              xlim = NULL, ylim = NULL, isPresent = NULL, 
              names = NULL, types = NULL, 
              colors = rainbow(ncol(types)), main = NULL, labelGenes = NULL,
              mode=c("plotly", "ggplot2"))

Arguments

log2Ratio

numeric(n): the log2 fold change of each gene

pValue

numeric(n): the p-value or FDR from differential gene expression analysis.

yType

character(1): p-value or FDR in pValue.

xlim

numeric(2): the range of xaxis.

ylim

numeric(2): the range of yaxis.

isPresent

boolean(n): the genes are expressed or not.

names

character(n): the gene names.

types

data.frame of boolean: indices for each type per column.

colors

colors for the types.

main

character(1): the title of volcano plot.

labelGenes

character(n): subset of names to label.

mode

generate interactive plot with ‘plotly’ or static plot with ‘ggplot2’. To label the genes, only ‘ggplot2’ is supported.

Value

A plotly or ggplot2 object.

Author(s)

Ge Tan

See Also

ezXYScatter

Examples

  log2Ratio <- -3:3
  pValue <- 10^(c(-3:0, -1:-3))
  yType <- "p-value"
  isPresent <- c(TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE)
  types <- data.frame(Significants=c(TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE),
                      ZincFinger=c(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE))
  names <- c("SALL1", "PAX6", "MEIS1", "IRX3", "ARX", "TBX2", "SHH")
  main <- "A--over--B"
  labelGenes <- c("MEIS1", "ARX")
  p_plotly <- ezVolcano(log2Ratio=log2Ratio, pValue=pValue,
                        yType="p-value", isPresent=isPresent,
                        names=names,
                        types=types, main=main, labelGenes=labelGenes,
                        mode="plotly")
  export(p_plotly, file="volcano_plotly.pdf")
  library(htmlwidgets)
  saveWidget(as_widget(p_volcano), "volcano_plotly.html")
  
  p_ggplot2 <- ezVolcano(log2Ratio=log2Ratio, pValue=pValue,
                         yType="p-value", isPresent=isPresent,
                         names=names,
                         types=types, main=main, labelGenes=labelGenes,
                         mode="ggplot2")
  p_ggplot2 + theme(title=element_text(size=20),
                    axis.title.x=element_text(size=30),
                    axis.title.y=element_text(size=30))

uzh/ezRun documentation built on Dec. 26, 2024, 9:53 a.m.