volcano_plot: Volcano plot for DGE analysis

Description Usage Arguments Details Value See Also Examples

Description

volcano_plot takes an object of class dge and returns a volcano plot. If filename is provided, the plot is also saved to the file.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
volcano_plot(x, interactive = FALSE, title, labels = 6L, filename,
  height = 8L, width = 12L, ...)

## Default S3 method:
volcano_plot(x, interactive = FALSE, title, labels = 6L,
  filename, height = 8L, width = 12L, ...)

## S3 method for class 'dge'
volcano_plot(x, interactive = FALSE, title, labels = 6L,
  filename, height = 8L, width = 12L, ...)

Arguments

x

An object of class dge or a list of objects of class dge.

interactive

Default is FALSE. If TRUE, uses ggplotly::ggplotly() to return an interactive plot.

title

Plot title.

labels

Integer vector of length-1 indicating the number of top genes that should be labeled. Default is 6.

filename

Default is to plot to screen. If a file name is provided, the plot is saved to file and the plot object will be returned. The type of graphic device is auto-detected from file extension (using ggsave).

height

Height of the plot, default is 8 inches.

width

Width of the plot, default is 12 inches.

...

Optional arguments to pass to ggsave call.

Details

Both limma_dge or edger_dge methods return dge object which can be directly passed to volcano_plot. It inherits from data.table.

Value

A ggplot2 or plotly object containing the volcano plot of input dge object.

See Also

rnaseq, gather_counts show_counts limma_dge edger_dge construct_design construct_contrasts write_dge as.dgelist as.eset density_plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
path = system.file("tests", package="ganalyse")

# ----- raw ----- # 
raw_path = file.path(path, "raw", "annotation.txt")
raw_obj = rnaseq(raw_path, format="raw", experiment="sample")
raw_counts = gather_counts(raw_obj, by="gene-id", threshold=1L)
raw_design = construct_design(raw_counts, ~ 0 + condition)
raw_contrasts = construct_contrasts(
                     design = raw_design, 
                     treatA.vs.control = conditiontreatA-conditioncontrol, 
                     treatB.vs.control = conditiontreatB-conditioncontrol
                 )
# DE genes between treatA and control
ans = edger_dge(raw_counts, design=raw_design, 
             contrast=raw_contrasts[, "treatA.vs.control"])
volcano_plot(ans, interactive=FALSE) # ggplot2 plot
volcano_plot(ans, interactive=FALSE, title="A.vs.control")
volcano_plot(ans, interactive=TRUE, title="A.vs.control") # ggplotly plot
## Not run: 
volcano_plot(ans, filename="tmp.png") # write to file and return plot obj

## End(Not run)

asrinivasan-oa/ganalyse documentation built on May 12, 2019, 5:38 a.m.