plotDotPlot: Visualizes fedup enrichment and depletion results using...

Description Usage Arguments Value Examples

View source: R/plot.R

Description

This function supports any combination of numeric x-y variables to plot from fedup results. The list outputted by runFedup must first be converted to a data.frame before plotting (see examples for sample use).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plotDotPlot(
    df,
    xVar,
    yVar,
    xLab = xVar,
    yLab = NULL,
    pTitle = NULL,
    fillVar = NULL,
    fillCol = NULL,
    fillLab = fillVar,
    sizeVar = NULL,
    sizeLab = sizeVar
)

Arguments

df

(data.frame) table with fedup results generated via runFedup

xVar

(char) x-axis variable (must be a column value in df)

yVar

(char) y-axis variable (must be a column value in df)

xLab

(char) x-axis label (default xVar value)

yLab

(char) y-axis label (default NULL)

pTitle

(char) plot title (default NULL)

fillVar

(char) point fill variable (default NULL)

fillCol

(char) point fill colours (default NULL)

fillLab

(char) point fill label (default fillVar value)

sizeVar

(char) point size variable (default NULL)

sizeLab

(char) point size label (default sizeVar value)

Value

Object returned from ggplot with the enrichment dot plot.

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
# Load example data
data(geneDouble)
data(pathwaysGMT)
# Load external libraries
suppressMessages(library(dplyr))
suppressMessages(library(tidyr))
# Run fedup
fedupRes <- runFedup(geneDouble, pathwaysGMT)
# Prepare dataframe from fedup results
fedupPlot <- fedupRes %>%
    bind_rows(.id = "set") %>%
    separate(col = "set", into = c("set", "sign"), sep = "_") %>%
    subset(qvalue < 0.01) %>%
    mutate(log10qvalue = -log10(qvalue)) %>%
    mutate(pathway = gsub("\\%.*", "", pathway)) %>%
    as.data.frame()
# Plot
p <- plotDotPlot(
    df = fedupPlot,
    xVar = "log10qvalue",
    yVar = "pathway",
    xLab = "-log10(qvalue)",
    fillVar = "sign",
    fillLab = "Genetic interaction",
    fillCol = c("#0077f1", "#fcde24"),
    sizeVar = "fold_enrichment",
    sizeLab = "Fold enrichment"
)

rosscm/fedup documentation built on July 19, 2021, 2:21 a.m.