threeFACTORplot {rtpcr} | R Documentation |
Bar plot of the relative gene expression (\Delta C_T
method) from the qpcrANOVARE
output of a a three-factorial experiment data
Description
Bar plot of the relative expression (\Delta C_T
method) of a gene along with the confidence interval and significance
Usage
threeFACTORplot(
res,
arrangement = c(1, 2, 3),
bar.width = 0.5,
fill = "Reds",
xlab = "none",
ylab = "Relative Expression",
errorbar,
y.axis.adjust = 0.5,
y.axis.by = 2,
letter.position.adjust = 0.3,
legend.title = "Legend Title",
legend.position = c(0.4, 0.8),
fontsize = 12,
fontsizePvalue = 5,
show.letters = TRUE,
axis.text.x.angle = 0,
axis.text.x.hjust = 0.5
)
Arguments
res |
the FC data frame created by |
arrangement |
order based on the columns in the output table (e.g. c(2,3,1) or c(1,3,2)) affecting factor arrangement of the output graph. |
bar.width |
a positive number determining bar width. |
fill |
a color vector specifying the fill color for the columns of the bar plot. One of the palettes in |
xlab |
the title of the x axis |
ylab |
the title of the y axis |
errorbar |
Type of error bar, can be |
y.axis.adjust |
a negative or positive number for reducing or increasing the length of the y axis. |
y.axis.by |
determines y axis step length |
letter.position.adjust |
adjust the distance between the grouping letters to the error bars |
legend.title |
legend title |
legend.position |
a two digit vector specifying the legend position. |
fontsize |
all fonts size of the plot |
fontsizePvalue |
font size of the pvalue labels |
show.letters |
a logical variable. If TRUE, mean grouping letters are added to the bars. |
axis.text.x.angle |
angle of x axis text |
axis.text.x.hjust |
horizontal justification of x axis text |
Details
The threeFACTORplot
function generates the bar plot of the average fold change for target genes along with the significance, standard error (se) and the 95% confidence interval (ci).
Value
Bar plot of the average fold change for target genes along with the standard error or 95% confidence interval as error bars.
Author(s)
Ghader Mirzaghaderi
Examples
#' # See a sample data frame
data_3factor
# Before plotting, the result needs to be extracted as below:
res <- qpcrANOVARE(data_3factor, numberOfrefGenes = 1, block = NULL)$Result
res
# Arrange the first three colunms of the result table.
# This determines the columns order and shapes the plot output.
threeFACTORplot(res, arrangement = c(3, 1, 2), errorbar = "se",
xlab = "condition")
threeFACTORplot(res, arrangement = c(1, 2, 3), bar.width = 0.5, fill = "Greys",
xlab = "Genotype", ylab = "Relative Expression", errorbar = "se")
# Reordering factor levels to a desired order.
res$Conc <- factor(res$Conc, levels = c("L","M","H"))
res$Type <- factor(res$Type, levels = c("S","R"))
# Producing the plot
threeFACTORplot(res, arrangement = c(2, 3, 1), bar.width = 0.5,
fill = "Reds", xlab = "Drought", ylab = "Relative Expression",
errorbar = "se", legend.title = "Genotype", legend.position = c(0.2, 0.8))
# When using ci as error, increase the
# y.axis.adjust value to see the plot correctly!
threeFACTORplot(res, arrangement = c(2, 3, 1), bar.width = 0.8, fill = "Greens",
xlab = "Drought", ylab = "Relative Expression", errorbar = "ci",
y.axis.adjust = 1, y.axis.by = 2, letter.position.adjust = 0.6,
legend.title = "Genotype", fontsize = 12, legend.position = c(0.2, 0.8),
show.letters = TRUE)