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.5.0 |
Built: | 2024-11-29 08:14:05 UTC |
Source: | https://github.com/bioc/gg4way |
Generate example data from the airway data package using eBayes
data(airwayFit)
data(airwayFit)
An object of class MArrayLM
with 14516 rows and 2 columns.
A MArrayLM
gg4way
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 |
getCor(p1) getShared(p1) getTotals(p1)
getCor(p1) getShared(p1) getTotals(p1)
p1 |
The plot from gg4way |
Each function returns a different result:
getCor |
A numeric |
getShared |
A tibble |
getTotals |
A tabyl |
data("airwayFit") p1 <- airwayFit |> gg4way(x = "N61311 vs N052611", y = "N061011 vs N052611") ## Correlation getCor(p1) ## Shared getShared(p1) ## Totals getTotals(p1)
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 to compare the logFC values from two contrasts of differential gene expression.
## 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, ... )
## 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, ... )
DGEdata |
The object to plot from:
|
x |
Character specifying the name of DGE results within the object for the x-axis |
y |
Character specifying the name of DGE results within the object for the y-axis |
ID |
Column name for gene IDs |
symbol |
Column name for gene symbols, which can be the same as the value for the ID column if not present in the object |
logFC |
Column name for logFC values |
FDR |
Column name for FDR values |
sep |
Character specifying the separator between conditions for the contrast name provided to the x and y arguments |
FDRcutoff |
Numeric for the FDR cut-off for DEGs (default is 0.05) |
logFCcutoff |
Numeric for the absolute logFC cut-off for DEGs (default is 1) |
label |
Character vector specifying the symbols of 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, where 0 will remove the text |
textNudge |
Numeric specifying nudge of text with gene overlap category totals |
... |
Support for additional arguments used internally by
|
When a named list of data.frames is provided to the DGEdata
argument,
each data.frame can follow the defaults and have the following columns or
specify alternate names for the following to the ID, symbol, logFC, and FDR
arguments:
ID |
Character vector with the feature ID (i.e. EnsemblID) |
symbol |
Optional character vector with gene symbol for labels |
logFC |
Numeric with the logFC |
adj.P.Val |
Numeric with the FDR |
The correlation coefficient is useful for comparing across multiple plots. However, it is important to consider whether there are any common factors when comparing values, since that can result in a larger value. Some examples are contrasts with covariates that are shared between groups or contrasts with the same control group.
A ggplot
data("airwayFit") airwayFit |> gg4way(x = "N61311 vs N052611", y = "N061011 vs N052611")
data("airwayFit") airwayFit |> gg4way(x = "N61311 vs N052611", y = "N061011 vs N052611")