Package 'gg4way'

Title: 4way Plots of Differential Expression
Description: 4way plots enable a comparison of the logFC values from two contrasts of differential gene expression. The gg4way package creates 4way plots using the ggplot2 framework and supports popular Bioconductor objects. The package also provides information about the correlation between contrasts and significant genes of interest.
Authors: Benjamin I Laufer [aut, cre], Brad A Friedman [aut]
Maintainer: Benjamin I Laufer <[email protected]>
License: MIT + file LICENSE
Version: 1.3.0
Built: 2024-06-30 02:28:13 UTC
Source: https://github.com/bioc/gg4way

Help Index


airwayFit data

Description

Generate example data from the airway data package using eBayes

Usage

data(airwayFit)

Format

An object of class MArrayLM with 14516 rows and 2 columns.

Value

A MArrayLM

Source

airway


Helper Functions for gg4way

Description

These helper functions provide data used in the plot:

getCor Get the correlation of the logFC of all genes
getShared Get only the shared genes that pass the thresholds
getTotals Get the totals of overlap categories

Usage

getCor(p1)

getShared(p1)

getTotals(p1)

Arguments

p1

The plot from gg4way

Value

Each function returns a different result:

getCor A numeric
getShared A tibble
getTotals A tabyl

Examples

data("airwayFit")
p1 <- airwayFit |>
    gg4way(x = "N61311 vs N052611",
           y = "N061011 vs N052611")

## Correlation
getCor(p1)

## Shared
getShared(p1)

## Totals
getTotals(p1)

Create a 4way plot

Description

Create a 4way plot to compare the logFC values from two contrasts of differential gene expression.

Usage

## Default S3 method:
gg4way(
  DGEdata,
  x = NULL,
  y = NULL,
  ID = "ID",
  symbol = "symbol",
  logFC = "logFC",
  FDR = "adj.P.Val",
  sep = " vs ",
  FDRcutoff = 0.05,
  logFCcutoff = 1,
  label = FALSE,
  colorVector = c("grey80", "firebrick", "forestgreen", "mediumblue"),
  lineColor = "grey60",
  textSize = 4,
  textNudge = 0.25,
  ...
)

Arguments

DGEdata

The object to plot from:

x

Character specifying name of DGE results within object for the x-axis

y

Character specifying name of DGE results within object for the y-axis

ID

Column name for gene ID

symbol

Column name for gene symbol description

logFC

Column name for logFC values

FDR

Column name for FDR values

sep

Character specifying the separator between conditions for the contrast

FDRcutoff

Numeric for the FDR cut-off for DEGs, default is 0.05

logFCcutoff

Numeric for the absolute Log2FC cut-off for DEGs, default is 1

label

Character vector specifying genes to label (FALSE for none, TRUE for all blue)

colorVector

Character vector of colors in the following order: "not significant", "significant in x", "significant in y", "significant in both"

lineColor

Color of lines

textSize

Numeric specifying size of text with gene overlap category totals

textNudge

Numeric specifying nudge of text with gene overlap category totals

...

Support for additional arguments used internally by gg4way.MArrayLM, gg4way.list, and gg4way.DESeqDataSet

Details

When a list of data.frames is provided to the DGEdata argument, they should have the following column names and data:

ID Character vector with the feature ID (i.e. EnsemblID)
symbol Optional character vector with gene symbol for labels
LogFC Numeric with the logFC
FDR Numeric with the FDR

The correlation coefficient is useful for comparing across multiple plots. It's important to consider whether there are any common factors when comparing values, since that can result in a larger value.

Value

A ggplot

Examples

data("airwayFit")
airwayFit |>
    gg4way(x = "N61311 vs N052611",
           y = "N061011 vs N052611")