| plotDotPlot {fedup} | R Documentation |
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).
plotDotPlot(
df,
xVar,
yVar,
xLab = xVar,
yLab = NULL,
pTitle = NULL,
fillVar = NULL,
fillCol = NULL,
fillLab = fillVar,
sizeVar = NULL,
sizeLab = sizeVar
)
df |
(data.frame) table with fedup results generated via runFedup |
xVar |
(char) x-axis variable (must be a column value in |
yVar |
(char) y-axis variable (must be a column value in |
xLab |
(char) x-axis label (default |
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 |
sizeVar |
(char) point size variable (default NULL) |
sizeLab |
(char) point size label (default |
Object returned from ggplot with the enrichment dot plot.
# 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"
)