plotMeanAverage: Plot Mean Average

Description Usage Arguments Value Author(s) See Also Examples

Description

Plot Mean Average

Usage

1
2
3
4
5
6
7
plotMeanAverage(object, ...)

## S4 method for signature 'DESeqResults'
plotMeanAverage(object, alpha, lfcThreshold = 0L,
  genes = NULL, gene2symbol = NULL, ntop = 0L, direction = c("both",
  "up", "down"), pointColor = "gray50", sigPointColor = c(upregulated =
  "purple", downregulated = "orange"), return = c("ggplot", "data.frame"))

Arguments

object

Object.

...

Additional arguments.

alpha

Adjusted P value ("alpha") cutoff.

lfcThreshold

Log fold change ratio (base 2) cutoff threshold.

genes

Character vector of genes to include. These must match the rownames of the object. It is best practice to use the stable gene identifiers from Ensembl (e.g. "ENSG00000000003") and not the gene symbols.

gene2symbol

data.frame containing gene-to-symbol mappings. Must contain the columns geneID and geneName.

ntop

Number of top genes to label.

direction

Plot "both", "up", or "down" directions.

pointColor

Default point color for the plot.

sigPointColor

character vector containing color names for labeling upregulated and downregulated genes. Also supports a character string for labeling DEGs with the same color, regardless of direction.

return

Object class to return. Uses match.arg() internally and picks the first item in the vector by default.

Value

ggplot.

Author(s)

Rory Kirchner, Michael Steinbaugh

See Also

DESeq2::plotMA().

Other Differential Expression Functions: alphaSummary, contrastName, plotDEGHeatmap, plotDEGPCA, plotVolcano, resultsTables

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
gene2symbol <- gene2symbol(bcb_small)

# DESeqResults ====
# Color DEGs in each direction separately
plotMeanAverage(
    object = res_small,
    sigPointColor = c(
        upregulated = "purple",
        downregulated = "orange"
    )
)

# Label DEGs with a single color
plotMeanAverage(res_small, sigPointColor = "purple")

# Directional support
plotMeanAverage(
    object = res_small,
    direction = "up",
    ntop = 5L,
    gene2symbol = gene2symbol
)
plotMeanAverage(
    object = res_small,
    direction = "down",
    ntop = 5L,
    gene2symbol = gene2symbol
)

# Label genes manually
plotMeanAverage(
    object = res_small,
    genes = head(rownames(res_small)),
    gene2symbol = gene2symbol
)

WeiSong-bio/roryk-bcbioRNASeq documentation built on July 6, 2019, 12:02 a.m.