qpcrANOVAFC {rtpcr} | R Documentation |
Fold change (\Delta \Delta C_T
method) analysis using ANOVA and ANCOVA
Description
Fold change (\Delta \Delta C_T
method) analysis of qPCR data can be done using
ANOVA (analysis of variance) and ANCOVA (analysis of covariance) by the
qpcrANOVAFC
function, for uni- or multi-factorial experiment data. The bar plot of the fold changes (FC)
values along with the standard error (se) and confidence interval (ci) is returned by
the qpcrANOVAFC
function.
Usage
qpcrANOVAFC(
x,
numberOfrefGenes,
mainFactor.column,
analysisType = "anova",
mainFactor.level.order = NULL,
block,
width = 0.5,
fill = "#BFEFFF",
y.axis.adjust = 2,
y.axis.by = 1,
letter.position.adjust = 0.1,
ylab = "Fold Change",
xlab = "none",
fontsize = 12,
fontsizePvalue = 7,
axis.text.x.angle = 0,
axis.text.x.hjust = 0.5,
x.axis.labels.rename = "none",
p.adj = "none",
errorbar = "se",
plot = TRUE
)
Arguments
x |
a data frame of condition(s), biological replicates, efficiency (E) and Ct values of
target and reference genes. Each Ct value in the data frame is the mean of technical replicates.
NOTE: Each line belongs to a separate individual reflecting a non-repeated measure experiment).
See |
numberOfrefGenes |
number of reference genes which is 1 or 2 (up to two reference genes can be handled). |
mainFactor.column |
the factor for which fold change expression is calculated for its levels.
If |
analysisType |
should be one of "ancova" or "anova". Default is "anova". |
mainFactor.level.order |
NULL (default) or a vector of main factor level names. If |
block |
column name of the block if there is a blocking factor (for correct column arrangement see example data.). When a qPCR experiment is done in multiple qPCR plates, variation resulting from the plates may interfere with the actual amount of gene expression. One solution is to conduct each plate as a complete randomized block so that at least one replicate of each treatment and control is present on a plate. Block effect is usually considered as random and its interaction with any main effect is not considered. |
width |
a positive number determining bar width. |
fill |
specify the fill color for the columns in the bar plot. If a vector of two colors is specified, the reference level is differentialy colored. |
y.axis.adjust |
a negative or positive value 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 signs and the error bars. |
ylab |
the title of the y axis |
xlab |
the title of the x axis |
fontsize |
font size of the plot |
fontsizePvalue |
font size of the pvalue labels |
axis.text.x.angle |
angle of x axis text |
axis.text.x.hjust |
horizontal justification of x axis text |
x.axis.labels.rename |
a vector replacing the x axis labels in the bar plot |
p.adj |
Method for adjusting p values |
errorbar |
Type of error bar, can be |
plot |
if |
Details
Fold change (\Delta \Delta C_T
method) analysis of qPCR data can be done using
ANOVA (analysis of variance) and ANCOVA (analysis of covariance) by the
qpcrANOVAFC
function, for uni- or multi-factorial experiment data.
If there are more than one factor, FC value calculations for
the 'mainFactor.column' and the statistical analysis is performed based on a full model factorial
experiment by default. However, if 'ancova' is defined for the 'analysisType' argument,
FC values are calculated for the levels of the 'mainFactor.column' and the other factors are
used as covariate(s) in the analysis of variance, but we should consider ANCOVA table:
if the interaction between the main factor and covariate is significant, ANCOVA is not appropriate in this case.
ANCOVA is basically used when a factor is affected by uncontrolled quantitative covariate(s).
For example, suppose that wDCt of a target gene in a plant is affected by temperature. The gene may
also be affected by drought. Since we already know that temperature affects the target gene, we are
interested to know if the gene expression is also altered by the drought levels. We can design an
experiment to understand the gene behavior at both temperature and drought levels at the same time.
The drought is another factor (the covariate) that may affect the expression of our gene under the
levels of the first factor i.e. temperature. The data of such an experiment can be analyzed by ANCOVA
or using ANOVA based on a factorial experiment using qpcrANOVAFC
. qpcrANOVAFC
function performs FC
analysis even there is only one factor (without covariate or factor variable). Bar plot of fold changes
(FC) values along with the standard errors are also returned by the qpcrANOVAFC
function.
Value
A list with 7 elements:
- Final_data
Input data frame plus the weighted Delat Ct values (wDCt)
- lm_ANOVA
lm of factorial analysis-tyle
- lm_ANCOVA
lm of ANCOVA analysis-type
- ANOVA_table
ANOVA table
- ANCOVA_table
ANCOVA table
- FC Table
Table of FC values, significance and confidence interval and standard error with the lower and upper limits for the main factor levels.
- Bar plot of FC values
Bar plot of the fold change values for the main factor levels.
Author(s)
Ghader Mirzaghaderi
References
Livak, Kenneth J, and Thomas D Schmittgen. 2001. Analysis of Relative Gene Expression Data Using Real-Time Quantitative PCR and the Double Delta CT Method. Methods 25 (4). doi:10.1006/meth.2001.1262.
Ganger, MT, Dietz GD, and Ewing SJ. 2017. A common base method for analysis of qPCR data and the application of simple blocking in qPCR experiments. BMC bioinformatics 18, 1-11.
Yuan, Joshua S, Ann Reed, Feng Chen, and Neal Stewart. 2006. Statistical Analysis of Real-Time PCR Data. BMC Bioinformatics 7 (85). doi:10.1186/1471-2105-7-85.
Examples
qpcrANOVAFC(data_1factor, numberOfrefGenes = 1, mainFactor.column = 1, block = NULL,
fill = c("#CDC673", "#EEDD82"), fontsizePvalue = 5, y.axis.adjust = 0.1)
qpcrANOVAFC(data_2factor, numberOfrefGenes = 1, mainFactor.column = 2, block = NULL,
analysisType = "ancova", fontsizePvalue = 5, y.axis.adjust = 1)
# Data from Lee et al., 2020, Here, the data set contains technical
# replicates so we get mean of technical replicates first:
df <- meanTech(Lee_etal2020qPCR, groups = 1:3)
qpcrANOVAFC(df, numberOfrefGenes = 1, analysisType = "ancova", block = NULL,
mainFactor.column = 2, fill = c("skyblue", "#BFEFFF"), y.axis.adjust = 0.05)
qpcrANOVAFC(data_2factorBlock, numberOfrefGenes = 1, mainFactor.column = 1,
mainFactor.level.order = c("S", "R"), block = "block",
fill = c("#CDC673", "#EEDD82"), analysisType = "ancova",
fontsizePvalue = 7, y.axis.adjust = 0.1, width = 0.35)
df <- meanTech(Lee_etal2020qPCR, groups = 1:3)
df2 <- df[df$factor1 == "DSWHi",][-1]
qpcrANOVAFC(df2, mainFactor.column = 1, fontsizePvalue = 5, y.axis.adjust = 2,
block = NULL, numberOfrefGenes = 1, analysisType = "anova")
addline_format <- function(x,...){gsub('\\s','\n',x)}
qpcrANOVAFC(data_1factor, numberOfrefGenes = 1, mainFactor.column = 1,
block = NULL, fill = c("skyblue","#79CDCD"), y.axis.by = 1,
letter.position.adjust = 0, y.axis.adjust = 1, ylab = "Fold Change",
fontsize = 12, x.axis.labels.rename = addline_format(c("Control",
"Treatment_1 vs Control",
"Treatment_2 vs Control")))