plotDotPlot {fedup} | R Documentation

## Visualizes fedup enrichment and depletion results using ggplot.

### 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

    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

    # 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"
    )

[Package fedup version 1.2.0 Index]