Description Usage Arguments Value Warning Author(s) References See Also Examples
View source: R/post_analysis.R
This function will plot the expression profile of a gene across a valid
X-axis variable in the phenodata
while representing the mean
and confidence interval of groups of samples defined by levels of another
valid grouping factor in the phenodata
.
1 2 3 4 5 6 7 8 | expression_plot(
gene_id, result, eSet, x_var, f=result$factor, subset=NULL,
xlab=x_var, ylab="log2(cpm)", ylim=range(exprs(eSet)),
col.palette="Accent",
col=brewer.pal(n=length(levels(pData(eSet)[,f])), name=col.palette),
level=0.95, title=NULL, title.size=2, axis.title.size=20,
axis.text.size=15, axis.text.angle=0,
legend.title.size=20, legend.text.size=15, legend.key.size=30)
|
gene_id |
An gene or probeset identifier present in |
result |
An output of the |
eSet |
|
x_var |
A column name in |
f |
A column name in |
subset |
A named list to subset |
xlab |
Title of the X-axis. Default is tha value of |
ylab |
Title of the Y-axis. Default is "log2(cpm)". |
ylim |
Numeric vector of length 2 specifying the lower and upper bounds of the Y axis. Default is scaled to the full range of expression values in the expression dataset, to ease comparison of different genes. If set to NULL, the axis will be scaled to fit the plotted data only. |
col.palette |
A valid |
col |
A vector of color names or codes. The number of colors provided must match
the number of levels of the grouping factor. If specified, overrides
argument |
level |
The confidence interval level to visualise around the mean of each group. Default is 0.95. |
title |
Changes the plot title. Default is a combination of the gene id and the associated gene. |
title.size |
Changes the font size of the title. Default is 2. |
axis.title.size |
Changes the font size of the axes title. Defalt is 20. |
axis.text.size |
Changes the font size of the axes text labels. Default is 15. |
axis.text.angle |
Changes the angle of the X axis text labels. Default is 0 (horizontal). |
legend.title.size |
Changes the font size of the legend title. Default is 20. |
legend.text.size |
Changes the font size of the legend text labels. Default is 15. |
legend.key.size |
Changes the size of the legend keys (in points). Default is 30. |
The ggplot object.
Common issues:
It may not be possible to produce plots where the combination of X-axis variable and grouping factor leaves too few replicates to compute a confidence interval for each X value. This is a limitation imposed by the ggplot2 package to produce proper statistics and confidence intervals. In such cases, it may be preferrable to use the expression_profiles() method.
Kevin Rue-Albrecht
ggplot2 package.
Packages Biobase
and ggplot2
, methods
expression_plot_symbol
and
GO_analyse
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # load the sample output data
data(AlvMac_results)
# Expression by gene identifier (TNIP3)
expression_plot(
gene_id="ENSBTAG00000047107",
result=AlvMac_results, eSet=AlvMac, x_var="Timepoint"
)
# Same gene, plotted by animal and grouped by treatment (merging time points)
expression_plot(
gene_id="ENSBTAG00000047107",
result=AlvMac_results, eSet=AlvMac, x_var="Animal",
f="Treatment")
# Same gene, plotted by animal and grouped by time-point (merging treatments)
expression_plot(
gene_id="ENSBTAG00000047107",
result=AlvMac_results, eSet=AlvMac, x_var="Animal",
f="Time")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.