| Type: | Package |
| Title: | qPCR Data Analysis |
| Version: | 2.0.5 |
| Description: | Various methods are employed for statistical analysis and graphical presentation of real-time PCR (quantitative PCR or qPCR) data. 'rtpcr' handles amplification efficiency calculation, statistical analysis and graphical representation of real-time PCR data based on up to two reference genes. By accounting for amplification efficiency values, 'rtpcr' was developed using a general calculation method described by Ganger et al. (2017) <doi:10.1186/s12859-017-1949-5> and Taylor et al. (2019) <doi:10.1016/j.tibtech.2018.12.002>, covering both the Livak and Pfaffl methods. Based on the experimental conditions, the functions of the 'rtpcr' package use t-test (for experiments with a two-level factor), analysis of variance (ANOVA), analysis of covariance (ANCOVA) or analysis of repeated measure data to calculate the fold change (FC, Delta Delta Ct method) or relative expression (RE, Delta Ct method). The functions further provide standard errors and confidence intervals for means, apply statistical mean comparisons and present significance. To facilitate function application, different data sets were used as examples and the outputs were explained. ‘rtpcr’ package also provides bar plots using various controlling arguments. The 'rtpcr' package is user-friendly and easy to work with and provides an applicable resource for analyzing real-time PCR data. |
| URL: | https://github.com/mirzaghaderi/rtpcr |
| License: | GPL-3 |
| Imports: | multcomp, multcompView, ggplot2, lmerTest, purrr, reshape2, tidyr, dplyr, grid, emmeans |
| Encoding: | UTF-8 |
| LazyData: | true |
| RoxygenNote: | 7.3.3 |
| NeedsCompilation: | no |
| Packaged: | 2025-12-12 11:43:32 UTC; GM |
| Depends: | R (≥ 3.5.0) |
| Suggests: | knitr, rmarkdown |
| VignetteBuilder: | knitr |
| Author: | Ghader Mirzaghaderi [aut, cre, cph] |
| Maintainer: | Ghader Mirzaghaderi <gh.mirzaghaderi@uok.ac.ir> |
| Repository: | CRAN |
| Date/Publication: | 2025-12-12 12:10:02 UTC |
Relative expression (\Delta Ct method) analysis using ANOVA
Description
Analysis of variance of relative expression (\Delta Ct method) values for
all factor level combinations in which the expression level of a
reference gene is used as normalizer.
Usage
ANOVA_DCt(x, numberOfrefGenes, block, alpha = 0.05, adjust = "none")
Arguments
x |
a data.frame structured as described in the vignette consisting of condition columns, target gene efficiency (E), target Gene Ct, reference
gene efficiency and reference gene Ct values, respectively. Each Ct in the data frame is the mean of
technical replicates. Complete amplification efficiencies of 2 was assumed in the example data for
all wells but the calculated efficienies can be used instead. NOTE: Each line belongs to a separate
individual reflecting a non-repeated measure experiment). See |
numberOfrefGenes |
number of reference genes (1 or 2). Up to two reference genes can be handled. |
block |
A string or NULL. If provided, this should be the name of the column in |
alpha |
significance level for cld (default 0.05) |
adjust |
p-value adjustment method passed to emmeans/cld |
Details
The ANOVA_DCt function performs analysis of variance (ANOVA) of relative
expression (RE) values for all factor level combinations using the expression
level of reference gene(s) as a normalizer.
Value
A list with 4 elements:
- Final_data
The row data plus weighed delta Ct (wDCt) values.
- lm
The output of linear model analysis including ANOVA tables
- ANOVA
ANOVA table based on CRD
- Result
The result table including treatments and factors, RE (Relative Expression), LCL, UCL, letter display for pair-wise comparisons and standard error with the lower and upper limits.
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
# If the data include technical replicates, means of technical replicates
# should be calculated first using meanTech function.
# Applying ANOVA
ANOVA_DCt(data_3factor, numberOfrefGenes = 1, block = NULL)
ANOVA_DCt(data_2factorBlock, block = "Block", numberOfrefGenes = 1)
Relative expression (\Delta \Delta Ct method) analysis using ANOVA and ANCOVA
Description
Relative expression analysis using \Delta \Delta Ct method can be done by
ANOVA (analysis of variance) and ANCOVA (analysis of covariance) through the ANOVA_DDCt function, for uni- or multi-factorial experiment data. The bar plot of the relative expression (RE)
values along with the standard error (se) and confidence interval (ci) is returned by
the ANOVA_DDCt function.
Usage
ANOVA_DDCt(
x,
numberOfrefGenes = 1,
mainFactor.column = 1,
analysisType = "anova",
mainFactor.level.order = NULL,
block = NULL,
x.axis.labels.rename = "none",
p.adj = "none",
plot = TRUE,
plotType = "RE"
)
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 relative 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. |
x.axis.labels.rename |
a vector replacing the x axis labels in the bar plot |
p.adj |
Method for adjusting p values |
plot |
if |
plotType |
Plot based on "RE" (relative expression) or "log2FC" (log2 fold change). |
Details
ANOVA (analysis of variance) and ANCOVA (analysis of covariance) analysis of relative expression
using \Delta \Delta Ct method can be done using ANOVA_DDCt function, for uni- or multi-factorial experiment data.
If there are more than one factor, RE 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,
RE 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 ANOVA_DDCt. ANOVA_DDCt function performs RE
analysis even there is only one factor (without covariate or factor variable). Bar plot of relative expression
(RE) values along with the standard errors are also returned by the ANOVA_DDCt 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
- RE Table
Table of RE (relative expression) values, log2FC (log2 fold change) values, significance and confidence interval and standard error with the lower and upper limits for the main factor levels.
- Bar plot of RE values
Bar plot of the relative expression 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
ANOVA_DDCt(data_1factor, numberOfrefGenes = 1, mainFactor.column = 1, block = NULL)
ANOVA_DDCt(data_2factor,
numberOfrefGenes = 1,
mainFactor.column = 2, block = NULL,
analysisType = "ancova")
# 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)
ANOVA_DDCt(df, numberOfrefGenes = 1, analysisType = "ancova", block = NULL,
mainFactor.column = 2, plotType = "log2FC")
ANOVA_DDCt(data_2factorBlock,
numberOfrefGenes = 1,
mainFactor.column = 1,
mainFactor.level.order = c("S", "R"),
block = "block",
analysisType = "ancova")
df <- meanTech(Lee_etal2020qPCR, groups = 1:3)
df2 <- df[df$factor1 == "DSWHi",][-1]
ANOVA_DDCt(df2,
mainFactor.column = 1,
block = NULL,
numberOfrefGenes = 1,
analysisType = "anova")
addline_format <- function(x,...){gsub('\\s','\n',x)}
ANOVA_DDCt(data_1factor, numberOfrefGenes = 1,
mainFactor.column = 1,
block = NULL,
x.axis.labels.rename = addline_format(c("Control",
"Treatment_1 vs Control",
"Treatment_2 vs Control")))
Sample data (with technical replicates)
Description
A sample data for calculating biological replicated. Each line belongs to a separate individual (non-repeated measure experiment).
Usage
Lee_etal2020qPCR
Format
A data frame with 72 observations and 8 variables:
- factor1
experimental factor
- DS
DS
- biolRep
biological replicate
- techRep
technical replicates
- E_APOE
Amplification efficiency of APOE gene
- Ct_APOE
Ct of APOE gene
- E_GAPDH
Amplification efficiency of GAPDH gene
- Ct_GAPDH
Ct of GAPDH gene
Source
Lee et al, (2020) <doi:10.12688/f1000research.23580.2>
\Delta \Delta C_T analysis analysis using a model
Description
Relative expression (\Delta \Delta C_T method) analysis using a model object produced by the
ANOVA_DDCt or REPEATED_DDCt.
Usage
Means_DDCt(model, specs, p.adj = "none")
Arguments
model |
an 'lmer' fitted model object created by ANOVA_DDCt or REPEATED_DDCt functions |
specs |
A character vector specifying the names of the predictors over which FC values are desired |
p.adj |
Method for adjusting p values |
Details
The Means_DDCt function performs fold change (\Delta \Delta C_T method) analysis using a model produced by the
ANOVA_DDCt or REPEATED_DDCt. The values can be returned for any effects in the model including simple effects,
interactions and slicing if an ANOVA model is used, but ANCOVA models returned by rtpcr package only include simple effects.
Value
Table of FC values, significance and confidence interval.
Author(s)
Ghader Mirzaghaderi
Examples
# Returning fold change values from a fitted model.
# Firstly, result of `ANOVA_DDCt` or `REPEATED_DDCt` is
# acquired which includes a model object:
res <- ANOVA_DDCt(data_3factor, numberOfrefGenes = 1, mainFactor.column = 1, block = NULL)
# Returning fold change values of Type levels from a fitted model:
Means_DDCt(res$lm_ANOVA, specs = "Type")
# Returning fold change values of Conc levels from a fitted model:
Means_DDCt(res$lm_ANOVA, specs = "Conc")
# Returning fold change values of Conc levels sliced by Type:
Means_DDCt(res$lm_ANOVA, specs = "Conc | Type")
# Returning fold change values of Conc levels sliced by Type*SA:
Means_DDCt(res$lm_ANOVA, specs = "Conc | (Type*SA)")
Fold change (\Delta \Delta C_T method) analysis of repeated measure qPCR data
Description
REPEATED_DDCt function performs fold change (\Delta \Delta C_T method)
analysis of observations repeatedly taken over different time courses.
Data may be obtained over time from a uni- or multi-factorial experiment. The bar plot of the fold changes (FC)
values along with the standard error (se) or confidence interval (ci) is also returned by the REPEATED_DDCt function.
Usage
REPEATED_DDCt(
x,
numberOfrefGenes,
factor,
block,
x.axis.labels.rename = "none",
p.adj = "none",
plot = TRUE,
plotType = "RE"
)
Arguments
x |
input data frame in which the first column is id,
followed by the factor column(s) which include at least time.
The first level of time in data frame is used as calibrator or reference level.
Additional factor(s) may also be present. Other columns are efficiency and Ct values of target and reference genes.
NOTE: In the "id" column, a unique number is assigned to each individual from which samples have been taken over time,
for example see |
numberOfrefGenes |
number of reference genes which is 1 or 2 (Up to two reference genes can be handled). as reference or calibrator which is the reference level or sample that all others are compared to. Examples are untreated of time 0. The FC value of the reference or calibrator level is 1 because it is not changed compared to itself. If NULL, the first level of the main factor column is used as calibrator. |
factor |
the factor for which the FC values is analysed. The first level of the specified factor in the input data frame is used as calibrator. |
block |
column name of the block if there is a blocking factor (for correct column arrangement see example data.). Block effect is usually considered as random and its interaction with any main effect is not considered. |
x.axis.labels.rename |
a vector replacing the x axis labels in the bar plot |
p.adj |
Method for adjusting p values |
plot |
if |
plotType |
Plot based on "RE" (relative expression) or "log2FC" (log2 fold change). |
Details
The REPEATED_DDCt function performs fold change (FC) analysis of observations repeatedly taken over time.
The intended factor (could be time or any other factor) is defined for the analysis by the factor argument,
then the function performs FC analysis on its levels
so that the first levels (as appears in the input data frame) is used as reference or calibrator.
The function returns FC values along with confidence interval and standard error for the FC values.
Value
A list with 5 elements:
- Final_data
Input data frame plus the weighted Delat Ct values (wDCt)
- lm
lm of factorial analysis-tyle
- ANOVA_table
ANOVA table
- FC Table
Table of FC values, significance, confidence interval and standard error with the lower and upper limits for the selected factor levels.
- Bar plot of FC values
Bar plot of the fold change values for the main factor levels.
Author(s)
Ghader Mirzaghaderi
Examples
REPEATED_DDCt(data_repeated_measure_1,
numberOfrefGenes = 1,
factor = "time", block = NULL)
REPEATED_DDCt(data_repeated_measure_2,
numberOfrefGenes = 1,
factor = "time", block = NULL)
Expression (\Delta \Delta C_T method) analysis of target genes using t-test
Description
t.test based analysis of the fold change expression for any number of target genes.
Usage
TTEST_DDCt(
x,
numberOfrefGenes,
paired = FALSE,
var.equal = TRUE,
p.adj = "BH",
order = "none",
plotType = "RE"
)
Arguments
x |
a data frame of 4 columns including Conditions, E (efficiency), Gene and Ct values (see examples below). Biological replicates needs to be equal for all Genes. Each Ct value is the mean of technical replicates. Complete amplification efficiencies of 2 is assumed here for all wells but the calculated efficienies can be used instead. See |
numberOfrefGenes |
number of reference genes. Up to two reference genes can be handled. |
paired |
a logical indicating whether you want a paired t-test. |
var.equal |
a logical variable indicating whether to treat the two variances as being equal. If TRUE then the pooled variance is used to estimate the variance otherwise the Welch (or Satterthwaite) approximation to the degrees of freedom is used. |
p.adj |
Method ("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none") for adjusting p values. |
order |
a vector determining genes order on the output graph. |
plotType |
Plot based on "RE" (relative expression) or "log2FC" (log2 fold change). |
Details
The TTEST_DDCt function applies a t.test based analysis to calculate
fold change (\Delta \Delta C_T method) expression and returns related statistics for any number of
target genes that have been evaluated under control and treatment conditions. This function also returns the
expression bar plot based on fold change or log2 fold change. Sampling may be paired or unpaired.
One or two reference genes can be used. Unpaired and paired samples are commonly analyzed
using unpaired and paired t-test, respectively. NOTE: Paired samples in quantitative PCR refer to two sample
data that are collected from one set of individuals
at two different conditions, for example before and after a treatment or at two different time points. While
for unpaired samples, two sets of individuals are used: one under untreated and the other set under treated
condition. Paired samples allow to compare gene expression changes within the same individual, reducing
inter-individual variability.
Value
A list of two elements:
- Result
Output table including the Fold Change values, lower and upper confidence interval, pvalue and standard error with the lower and upper limits.
For more information about the test procedure and its arguments,
refer t.test, and lm.
If the residuals of the model do not follow normal distribution and variances between the two groups are not homoGene, wilcox.test procedure may be concidered
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
# See the sample data structure
data_ttest
# Getting t.test results
TTEST_DDCt(data_ttest,
paired = FALSE,
var.equal = TRUE,
numberOfrefGenes = 1)
TTEST_DDCt(Taylor_etal2019,
numberOfrefGenes = 2,
var.equal = TRUE,
p.adj = "BH")
Sample qPCR data (one target and two reference genes under two different conditions)
Description
Sample qPCR data (one target and two reference genes under two different conditions)
Usage
Taylor_etal2019
Format
A data frame with 18 observations and 4 variables:
- Condition
Experimental conditions
- Gene
Genes
- E
Amplification efficiency
- Ct
Ct values
Source
Not applicable
Sample data (one factor three levels)
Description
A sample dataset for demonstration purposes. Each line belongs to a separate individual (non-repeated measure experiment).
Usage
data_1factor
Format
A data frame with 9 observations and 6 variables:
- SA
An experimental factor here called SA
- Rep
Biological replicates
- E_PO
Mean amplification efficiency of PO gene
- Ct_PO
Ct values of PO gene. Each is the mean of technical replicates
- E_GAPDH
Mean amplification efficiency of GAPDH gene
- Ct_GAPDH
Ct values of GAPDH gene. Each is the mean of technical replicates
Source
Not applicable
Sample data (two factor)
Description
A sample dataset for demonstration purposes. Each line belongs to a separate individual (non-repeated measure experiment).
Usage
data_2factor
Format
A data frame with 18 observations and 7 variables:
- Genotype
First experimental factor
- Drought
Second experimental factor
- Rep
Biological replicates
- E_PO
Mean amplification efficiency of PO gene
- Ct_PO
Ct values of PO gene. Each is the mean of technical replicates
- E_GAPDH
Mean amplification efficiency of GAPDH gene
- Ct_GAPDH
Ct values of GAPDH gene. Each is the mean of technical replicates
Source
Not applicable
Sample data (two factor with blocking factor)
Description
A sample qPCR data set with blocking factor. Each line belongs to a separate individual (non-repeated measure experiment).
Usage
data_2factorBlock
Format
A data frame with 18 observations and 8 variables:
- factor1
First experimental factor
- factor2
Second experimental factor
- block
Second experimental factor
- Rep
Biological replicates
- E_PO
Mean amplification efficiency of PO gene
- Ct_PO
Ct values of PO gene. Each is the mean of technical replicates
- E_GAPDH
Mean amplification efficiency of GAPDH gene
- Ct_GAPDH
Ct values of GAPDH gene. Each is the mean of technical replicates
Source
Not applicable
Sample data (three factor)
Description
A sample dataset for demonstration purposes. Each line belongs to a separate individual (non-repeated measure experiment).
Usage
data_3factor
Format
A data frame with 36 observations and 8 variables:
- Type
First experimental factor
- Conc
Second experimental factor
- SA
Third experimental factor
- Replicate
Biological replicates
- E_PO
Mean amplification efficiency of PO gene
- Ct_PO
Ct values of PO gene. Each is the mean of technical replicates
- E_GAPDH
Mean amplification efficiency of GAPDH gene
- Ct_GAPDH
Ct values of GAPDH gene. Each is the mean of technical replicates
Source
Not applicable
Sample qPCR data: amplification efficiency
Description
A sample qPCR dataset for demonstrating efficiency calculation.
Usage
data_efficiency
Format
A data frame with 21 observations and 4 variables:
- dilutions
Dilution factor
- C2H2.26
Target gene 1
- C2H2.01
Target gene 2
- GAPDH
Reference gene
Source
Where the data comes from (if applicable)
Repeated measure sample data
Description
A repeated measure sample data in which 3 individuals have been analysed. In the "id" column, a unique number is assigned to each individual, e.g. all the three number 1 indicate one individual. samples are taken or measurements are scored over different time points (time column) from each individual.
Usage
data_repeated_measure_1
Format
A data frame with 9 observations and 6 variables:
- id
experimental factor
- time
time course levels
- E_target
Amplification efficiency of target gene
- Ct_target
Ct of target gene
- E_ref
Amplification efficiency of reference gene
- Ct_ref
Ct of reference gene
Source
NA
Repeated measure sample data
Description
A repeated measure sample data in which 6 individuals have been analysed. In the "id" column, a unique number is assigned to each individual, e.g. all the three number 1 indicate one individual. samples are taken or measurements are scored over different time points (time column) from each individual.
Usage
data_repeated_measure_2
Format
A data frame with 18 observations and 7 variables:
- id
experimental factor
- treatment
treatment
- time
time course levels
- E_target
Amplification efficiency of target gene
- Ct_target
Ct of target gene
- E_ref
Amplification efficiency of reference gene
- Ct_ref
Ct of reference gene
Source
NA
Sample qPCR data from an experiment conducted under two different conditions
Description
Sample qPCR data from an experiment conducted under two different conditions.
Usage
data_ttest
Format
A data frame with 24 observations and 4 variables:
- Condition
Experimental conditions
- Gene
Genes
- E
Amplification efficiency
- Ct
Ct values
Source
University of Kurdistan
Sample data (with technical replicates)
Description
A sample data for calculating biological replicated. Each line belongs to a separate individual (non-repeated measure experiment).
Usage
data_withTechRep
Format
A data frame with 18 observations and 9 variables:
- factor1
experimental factor
- factor2
experimental factor
- factor3
experimental factor
- biolrep
biological replicate
- techrep
technical replicates
- E_target
Amplification efficiency of target gene
- Ct_target
Ct of target gene
- E_ref
Amplification efficiency of reference gene
- Ct_ref
Ct of reference gene
Source
Not applicable
Slope, R2 and Efficiency (E) statistics and standard curves
Description
The efficiency function calculates amplification efficiency and returns related statistics and standard curves.
Usage
efficiency(df)
Arguments
df |
a data frame of dilutions and Ct of genes. First column is dilutions and other columns are Ct values for different genes. |
Details
The efficiency function calculates amplification efficiency of genes, and present the Slope, Efficiency, and R2 statistics.
Value
A list 3 elements.
- efficiency
Slope, R2 and Efficiency (E) statistics
- Slope_compare
slope comparison table
- plot
standard curves
Author(s)
Ghader Mirzaghaderi
Examples
# locate and read the sample data
data_efficiency
# Applying the efficiency function
efficiency(data_efficiency)
Internal global variables
Description
These objects are declared to avoid R CMD check notes about non-standard evaluation (e.g., in ggplot2).
Calculating mean of technical replicates
Description
Calculating arithmetic mean of technical replicates for subsequent ANOVA analysis
Usage
meanTech(x, groups)
Arguments
x |
A raw data frame including technical replicates. |
groups |
grouping columns based on which the mean technical replicates are calculated. |
Details
The meanTech calculates mean of technical replicates. Arithmetic mean of technical replicates can be calculated in order to simplify the statistical comparison between sample groups.
Value
A data frame with the mean of technical replicates.
Author(s)
Ghader Mirzaghaderi
Examples
# See example input data frame:
data_withTechRep
# Calculating mean of technical replicates
meanTech(data_withTechRep, groups = 1:4)
# Calculating mean of technical replicates
meanTech(Lee_etal2020qPCR, groups = 1:3)
Multiple plot function
Description
multiplot function combines multiple ggplot objects into a single plate.
Usage
multiplot(..., cols = 1)
Arguments
... |
ggplot objects can be passed in ... or to plotlist (as a list of ggplot objects) |
cols |
Number of columns in the panel |
Details
Combining multiple ggplot objects into a single plate.
Value
A multiple-plots plate
Author(s)
gist.github.com/pedroj/ffe89c67282f82c1813d
Examples
a <- TTEST_DDCt(data_ttest,
numberOfrefGenes = 1)
p1 <- a$plot
out2 <- ANOVA_DCt(data_1factor, numberOfrefGenes = 1, block = NULL)$Result
p2 <- plotOneFactor(out2,
x_col= 1,
y_col= 2,
Lower.se_col = 7,
Upper.se_col = 8,
letters_col = 11,
show.groupingLetters = TRUE)
multiplot(p1, p2, cols=2)
multiplot(p1, p2, cols=1)
Bar plot of gene expression from an expression table of a single-factor experiment data
Description
Bar plot of the relative expression of a gene along with the standard error (se), 95% confidence interval (ci) and significance.
Usage
plotOneFactor(
data,
x_col,
y_col,
Lower.se_col,
Upper.se_col,
letters_col = NULL,
show.groupingLetters = TRUE
)
Arguments
data |
A data.frame such as the expression result of |
x_col |
The column number of the data.frame used for x axis. |
y_col |
The column number of the data.frame used for y axis. |
Lower.se_col |
The column number of the data.frame used for the lower error bar. |
Upper.se_col |
The column number of the data.frame used for the upper error bar. |
letters_col |
The column number of the data.frame used as the result of statistical comparing and grouping. |
show.groupingLetters |
a logical variable. If TRUE, mean grouping letters (the results of statistical comparison) are added to the bars. |
Details
The plotOneFactor function generates the bar plot of the fold change for target genes along with the significance and the 95% confidence interval as error bars.
Value
Bar plot of the average fold change for target genes along with the significance and the standard error or 95% confidence interval as error bars.
Author(s)
Ghader Mirzaghaderi
Examples
# Before plotting, the result needs to be extracted as below:
res <- ANOVA_DCt(data_1factor, numberOfrefGenes = 1, block = NULL)$Result
# Bar plot
plotOneFactor(res, 1, 2, 7, 8, 11,
show.groupingLetters = TRUE)
Bar plot of gene expression from an expression table of 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
plotThreeFactor(
data,
x_col,
y_col,
group_col,
facet_col,
Lower.se_col,
Upper.se_col,
letters_col = NULL,
show.groupingLetters = TRUE
)
Arguments
data |
A data.frame such as the expression result of |
x_col |
column number of the x-axis factor. |
y_col |
column number of the y-axis factor. |
group_col |
column number of the grouping factor. |
facet_col |
column number of the faceting factor. |
Lower.se_col |
The column number of the data.frame used for the lower error bar. |
Upper.se_col |
The column number of the data.frame used for the upper error bar. |
letters_col |
The column number of the data.frame used as the result of statistical comparing and grouping. |
show.groupingLetters |
a logical variable. If TRUE, mean grouping letters (the results of statistical comparison) are added to the bars. |
Details
The plotThreeFactor 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
res <- ANOVA_DCt(data_3factor,
numberOfrefGenes = 1,
block = NULL)
data <- res$Results
plotThreeFactor(data,
3, # x-axis factor
5, # bar height
1, # fill groups
2, # facet grid
11, # lower SE column
12, # upper SE column
letters_col = 13,
show.groupingLetters = TRUE)
Bar plot of gene expression from an expression table of a two-factorial experiment data
Description
Bar plot of the relative expression (\Delta C_T method) of a gene along with the standard error (se), 95% confidence interval (ci) and significance
Usage
plotTwoFactor(
data,
x_col,
y_col,
group_col,
Lower.se_col,
Upper.se_col,
letters_col = NULL,
show.groupingLetters = TRUE
)
Arguments
data |
A data.frame such as the expression result of |
x_col |
column number of the x-axis factor. |
y_col |
column number of the y-axis factor. |
group_col |
column number of the grouping factor. |
Lower.se_col |
The column number of the data.frame used for the lower error bar. |
Upper.se_col |
The column number of the data.frame used for the upper error bar. |
letters_col |
The column number of the data.frame used as the result of statistical comparing and grouping. |
show.groupingLetters |
a logical variable. If TRUE, mean grouping letters (the results of statistical comparison) are added to the bars. |
Details
The plotTwoFactor 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) as error bars.
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
a <- ANOVA_DCt(data_2factorBlock, block = "Block", numberOfrefGenes = 1)
data <- a$Results
plotTwoFactor(
data = data,
x_col = 2,
y_col = 3,
group_col = 1,
Lower.se_col = 8,
Upper.se_col = 9,
letters_col = 12,
show.groupingLetters = TRUE)
# Combining FC results of two different genes:
a <- REPEATED_DDCt(data_repeated_measure_1,
numberOfrefGenes = 1,
factor = "time", block = NULL, plot = FALSE)
b <- REPEATED_DDCt(data_repeated_measure_2,
factor = "time",
numberOfrefGenes = 1, block = NULL, plot = FALSE)
a1 <- a$FC_statistics_of_the_main_factor
b1 <- b$FC_statistics_of_the_main_factor
c <- rbind(a1, b1)
c$gene <- factor(c(1,1,1,2,2,2))
c
plotTwoFactor(
data = c,
x_col = 1,
y_col = 2,
group_col = 13,
Lower.se_col = 9,
Upper.se_col = 10,
letters_col = 5,
show.groupingLetters = TRUE)