Description Usage Arguments Details Value Author(s) Examples
A profile plot shows Log Intensity on the X axis and Log Ratios on the Y axis. This function is intended to show the profile plot from a dataframe created by topTable or topTreat. Properly normalized data will generally be centered around LogRatio = 0.
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 29 30 31 32 | profilePlot(
df,
logRatioCol = "logFC",
logIntCol = "AveExpr",
pvalCol = "P.Value",
pthreshold = 0.01,
geneSymLabels,
geneSymCol,
rugColor = NULL,
rugAlpha = 1,
xlab = NULL,
ylab = NULL,
title = NULL,
symbolSize = c(4, 1, 4),
symbolShape = c(21, 20, 21),
symbolColor = c("black", "grey25", "grey0"),
symbolFill = c("red3", "grey25", "deepskyblue4"),
alpha = 0.5,
sizeBySignificance = FALSE,
referenceLine = "grey25",
foldChangeLines = log2(1.5),
refLineThickness = 1,
lineFitType = "loess",
lineFitColor = "goldenrod1",
legendPosition = "right",
baseFontSize = 12,
themeStyle = "grey",
footnote,
footnoteSize = 3,
footnoteColor = "black",
footnoteJust = 1
)
|
df |
A dataframe with LogRatio and LogIntensity columns and optionally a pvalue or FDR column. |
logRatioCol |
name of the LogRatio column (Default = "logFC") |
logIntCol |
name of the LogIntensity column (Default = "AveExpr") |
pvalCol |
name of the pvalue or FDR column (Default = "P.Value") |
pthreshold |
Used to color points (default = 0.01) |
geneSymCol |
Name of the gene symbol column in df. The gene symbol is not in topTable output by default so the user has to bind this column to the dataframe in advance. Then this column will be used to label significantly changed points |
rugColor |
Specify color for rug density plot along xy axes. Set to NULL to disable rug layer. (Default=NULL) |
rugAlpha |
Sets the transparency for the rug layer. An alpha <1.0 takes a long time to draw (~10 min on 32bit Win7). So I set the default at 1.0, but for a final plot try 0.1 or 0.2 for alpha for more informative rug. |
xlab |
X axis label (default the LogIntensity column name) |
ylab |
Y axis label (default the LogRatio column name) |
title |
Plot title (optional) |
symbolSize |
Size of symbols for Up, no change and Down. default = c(4, 1, 4); Note: you cannot choose the exact same size for all three. But you can use decimal values. |
symbolShape |
Shape of the symbols for Up, no change and Down; Default = c(21, 20, 21) (20 = filled circle, 21 = fillable open circle); Note: you cannot choose the same symbol shape for all three. See http://www.cookbook-r.com/Graphs/Shapes_and_line_types |
symbolColor |
c(Up, NoChange, Down); default = c("black", "grey25", "grey0") See http://research.stowers-institute.org/efg/R/Color/Chart Note: You cannot duplicate colors. |
symbolFill |
Set the fill color for the symbols. Note only symbols 21-25 are fillable. This will have no effect on other symbols. Default = c("red3", "grey25", "deepskyblue4") Note: You cannot duplicate colors. |
alpha |
Controls the transparency of the plotted points (0-1; default = 0.5) |
sizeBySignificance |
Set to TRUE to size points by the negative Log10 of the Significance measure (Default = FALSE) |
referenceLine |
Color for an intercept=0 horizontal reference line (Default = "blue"; NULL disables) |
foldChangeLines |
Position of reference horizontal lines for fold change (Default = log2(1.5); NULL disables) |
lineFitType |
Enable a linefit through the data (Default = "loess"; "lm" produces a linear fit. NULL disables) |
lineFitColor |
Color for the fit line (Default = "goldenrod1") |
legendPosition |
One of "top", "bottom", "left", "right", "ne", "se", "nw", "sw", NULL. top/bottom/left/right place the legend outside the figure. ne/se/nw/sw place the figure inside the figure. NULL disables the legend. Default = "right" |
baseFontSize |
The smallest size font in the figure in points. Default = 12 |
themeStyle |
"bw" or "grey" which correspond to theme_bw or theme_grey respectively. Default = bw" |
footnote |
optional string placed right justified at bottom of plot. |
footnoteSize |
applies to footnote. (default = 3) |
footnoteColor |
applies to footnote. (default = "black") |
footnoteJust |
Value 0-1. 0 is left justified, 1 is right justified, 0.5 is centered. (default=1) |
geneSym |
A character vector of gene to label (must be the name space of the column specified by geneSymCol) |
By default, the plot places "logFC" on the Y axis and "AveExpr" on the X axis. By default, a reference horizontal line is shown at LogRatio = 0 on the Y axis. Optionally, additional reference lines will be drawn at +/- a user supplied logratio threshold. A loess line fit is drawn through the actual data. The points are color coded using the significance measure (pvalue or FDR threshold) supplied by the user. By default, the P.Value field is used with a threshold of 0.01 to color code the points.
The profilePlot has also been implemented with a scalable theme that makes it easy to scale font sizes larger or smaller for PPT or Knitr output. Just add baseFont(n), where n equals the base font size (12 works well for knitr, 18 or 24 works well for PPT). e.g. MyPlot + theme_grey(18).
Data Structure for the input dataframe:
The defaults are set for dataframes produced by topTable and topTreat. The columns named "logFC", "AveExpr" and "P.Value" are used by default to accommodate the column names used in topTable/topTreat dataframes. Any other dataframe can be used with foldchange, intensity and significance measures. In this case you must use the appropriate arguments to define the column names to use. By default, the column names will be used for the axis labels. You can overide the xylabels the xlab and ylab arguments.
A significance measure (which defaults to P.Value <= 0.01) is used to color code genes that are significantly increased or decreased. Use the appropriate arguments to use an FDR measure instead.
Sensible defaults are chosen for symbols (Size, Shape, Color and Fill). Optionally, there are arguments to allow you to fiddle with these settings. A length of 3 is required for these arguments which applies the attributes in this order: Increased, NoChange, Decreased.
ggplot object
John Thompson, jrt@thompsonclan.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Simple plot with custom title(df is a topTable dataframe)
MyPlot = profilePlot(df, title = "Plot Title")
Some options with a custom datafile
MyPlot = profilePlot (df, pthreshold = 0.1,
logRatioCol = "Log2ratio",
logIntCol = "AverageIntensity",
pvalCol = "BHFDR",
xlab = "Log2Intensity", ylab = "Log2Ratio",
title = "Profile Plot Title",
referenceLine = "blue",
legendPosition="ne")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.