qPCRtools introduction

Install

install.packages("qPCRtools")

Calculate volume for reverse transcription

The first step of qPCR is usually the preparation of cDNA. We need to calculate the column of RNA for reverse transcription to cDNA. So, if we have the concentration of RNA, we can use the function CalRTable to do that. The function have three patameters:

library(magrittr)

df.1.path <- system.file("examples", "crtv.data.txt", package = "qPCRtools")
df.2.path <- system.file("examples", "crtv.template.txt", package = "qPCRtools")
df.1 <- data.table::fread(df.1.path)
df.2 <- data.table::fread(df.2.path)
result <- qPCRtools::CalRTable(data = df.1, template = df.2, RNA.weight = 2)

result %>% 
  dplyr::slice(1:6) %>% 
  kableExtra::kable(format = "html") %>% 
  kableExtra::kable_styling("striped")
sample mean volume.RNA mix gDNARemover all volume.h2o
1 160.4000 12.468828 8 2 40 17.53117
2 163.3333 12.244898 8 2 40 17.75510
3 182.5667 10.954902 8 2 40 19.04510
4 203.8000 9.813543 8 2 40 20.18646
5 180.1333 11.102887 8 2 40 18.89711
6 171.8333 11.639185 8 2 40 18.36081

Calculate standard curve

The function can calculate the standard curve. At the same time, it can get the amplification efficiency of primer(s). Based on the amplification efficiency, we can know which method can be used to calculate the expression level. The function has 6 parameters:

library(qPCRtools)

df.1.path <- system.file("examples", "calsc.cq.txt", package = "qPCRtools")
df.2.path <- system.file("examples", "calsc.info.txt", package = "qPCRtools")
df.1 <- data.table::fread(df.1.path)
df.2 <- data.table::fread(df.2.path)
qPCRtools::CalCurve(
                    cq.table = df.1,
                    concen.table = df.2,
                    lowest.concen = 4,
                    highest.concen = 4096,
                    dilu = 4,
                    by = "mean"
                  ) -> p

p[["table"]] %>% 
  dplyr::slice(1:6) %>% 
  kableExtra::kable(format = "html") %>% 
  kableExtra::kable_styling("striped")
Gene Formula Slope Intercept R2 P.value max.Cq min.Cq E Date
Gene1 y = -2.07*Conc + 40.08 -2.07 40.08 0.7502 0 40.00 27.33 0.954 2022-08-15
Gene2 y = -2.09*Conc + 34.97 -2.09 34.97 0.9908 0 33.89 22.31 0.941 2022-08-15
Gene3 y = -2.24*Conc + 33.34 -2.24 33.34 0.9969 0 31.39 19.59 0.857 2022-08-15
Gene4 y = -2.21*Conc + 35.46 -2.21 35.46 0.9977 0 33.44 22.06 0.873 2022-08-15
p[["figure"]]
## `geom_smooth()` using formula 'y ~ x'

Calculate expression using standard curve

After we calculated the standard curve, we can use the standard curve to calculate the expression level of genes. In qPCRtools, function CalExpCurve can get the expression using standard curve. There are several parameters in this function: - cq.table: The table of Cq. It must contain at least two columns:One Position and Cq. The demo data can be found at GitHub. - curve.table: The table of standard curve calculated by CalCurve. - design.table: The design information including three columns: Position, Treatment and Gene. The demo table can be found at GitHub. - correction: Expression level is corrected or not with internal reference genes. The default value is TRUE. - ref.gene: The name of reference gene. - stat.method: The method of statistics. One of t.test, wilcox.test or anova. The default value is t.test. - ref.group: The name of reference group. If stat.method is t.test or wilcox.test, the function need a ref.group. - fig.type: The type of figure, box or bar. box represents boxplot. bar represents barplot. The default value is box. - fig.ncol: The column of figure. The default value is NULL.

df1.path = system.file("examples", "cal.exp.curve.cq.txt", package = "qPCRtools")
df2.path = system.file("examples", "cal.expre.curve.sdc.txt", package = "qPCRtools")
df3.path = system.file("examples", "cal.exp.curve.design.txt", package = "qPCRtools")

cq.table = data.table::fread(df1.path)
curve.table = data.table::fread(df2.path)
design.table = data.table::fread(df3.path)

qPCRtools::CalExpCurve(
                      cq.table,
                      curve.table,
                      design.table,
                      correction = TRUE,
                      ref.gene = "OsUBQ",
                      stat.method = "t.test",
                      ref.group = "CK",
                      fig.type = "box",
                      fig.ncol = NULL) -> res
## Warning in qPCRtools::CalExpCurve(cq.table, curve.table, design.table,
## correction = TRUE, : Cq of A3 out of curve range!
res[["table"]] %>% 
  dplyr::slice(1:6) %>% 
  kableExtra::kable(format = "html") %>% 
  kableExtra::kable_styling("striped")
Treatment Gene expre temp signif mean.expre sd.expre n se
CK OSPOX8 1.0312698 OSPOX8CK NA 1.0359221 0.0483130 8 0.0170812
CK OsWAK91 0.2791407 OsWAK91CK NA 0.7631784 0.2121981 8 0.0750234
CK OsRBBI2 0.5073215 OsRBBI2CK NA 0.5399223 0.0431135 8 0.0152429
CK OsCeBip 0.9040572 OsCeBipCK NA 0.8421330 0.1713979 8 0.0605983
CK OsPR10 1.1275436 OsPR10CK NA 1.2492427 0.2011588 8 0.0711204
CK OSPOX8 1.0715901 OSPOX8CK NA 1.0359221 0.0483130 8 0.0170812
res[["figure"]]
## Warning: Removed 40 rows containing missing values (geom_text).

Calculate expression using 2-ΔΔCt

$2^{-{Δ}{Δ}{C_t }} $is a widely used method to calculate qPCR data[1]. Our function CalExp2ddCt can do it. Seven parameters are required for this function: - cq.table: The demo file can be found at GitHub. - design.table: The demo data can be found at GitHub. Other parameters are same as the function CalExpCurve. - ref.gene: The name of reference gene. - ref.group: The name of reference group. If stat.method is t.test or wilcox.test, the function need a ref.group. - stat.method: The method of statistics. One of t.test, wilcox.test or anova. The default value is t.test. - fig.type: The type of figure, box or bar. box represents boxplot. bar represents barplot. The default value is box. - fig.ncol: The column of figure. The default value is NULL.

df1.path = system.file("examples", "ddct.cq.txt", package = "qPCRtools")
df2.path = system.file("examples", "ddct.design.txt", package = "qPCRtools")

cq.table = data.table::fread(df1.path)
design.table = data.table::fread(df2.path)

qPCRtools::CalExp2ddCt(cq.table,
                       design.table,
                       ref.gene = "OsUBQ",
                       ref.group = "CK",
                       stat.method = "t.test",
                       fig.type = "bar",
                       fig.ncol = NULL) -> res

res[["table"]] %>% 
  dplyr::slice(1:6) %>% 
  kableExtra::kable(format = "html") %>% 
  kableExtra::kable_styling("striped")
Treatment gene biorep expre mean.expre sd.expre n se.expre temp signif
Treatment OsPR10 1 0.5398479 0.6896177 0.2739611 4 0.3448088 OsPR10Treatment NS
Treatment OsPR10 2 0.8097930 0.6896177 0.2739611 4 0.3448088 OsPR10Treatment NS
Treatment OsPR10 3 0.3979406 0.6896177 0.2739611 4 0.3448088 OsPR10Treatment NS
Treatment OsPR10 4 1.0108893 0.6896177 0.2739611 4 0.3448088 OsPR10Treatment NS
CK OsPR10 1 0.8069913 2.0326462 1.5252126 4 1.0163231 OsPR10CK NA
CK OsPR10 2 3.1725106 2.0326462 1.5252126 4 1.0163231 OsPR10CK NA
res[["figure"]]
## Warning: Removed 20 rows containing missing values (geom_text).

Calculate expression using RqPCR

The method from SATQPCR can identify the most stable reference genes (REF) across biological replicates and technical replicates[2]. Our package provides a function, CalExpRqPCR, to achieve it. In the design.table, BioRep, TechRep and Eff are required. BioRep is the biological replicates. TechRep is the technical replicates. Eff is the amplification efficiency of genes.

df1.path <- system.file("examples", "cal.expre.rqpcr.cq.txt", package = "qPCRtools")
df2.path <- system.file("examples", "cal.expre.rqpcr.design.txt", package = "qPCRtools")

cq.table <- data.table::fread(df1.path, header = TRUE)
design.table <- data.table::fread(df2.path, header = TRUE)

qPCRtools::CalExpRqPCR(cq.table,
                       design.table,
                       ref.gene = NULL,
                       ref.group = "CK",
                       stat.method = "t.test",
                       fig.type = "bar",
                       fig.ncol = NULL
                       ) -> res

res[["table"]] %>% 
  dplyr::slice(1:6) %>% 
  kableExtra::kable(format = "html") %>% 
  kableExtra::kable_styling("striped")
group biorep gene Expre4Stat Expression SD SE
CK 1 OSPOX8 1.0000000 1.393984 0.5409190 0.2704595
CK 2 OSPOX8 1.7640638 1.393984 0.5409190 0.2704595
CK 3 OSPOX8 1.1700339 1.393984 0.5409190 0.2704595
CK 4 OSPOX8 0.6965246 1.393984 0.5409190 0.2704595
Treatment 1 OSPOX8 0.6609311 1.000000 0.2887030 0.1443515
Treatment 2 OSPOX8 1.0000000 1.000000 0.2887030 0.1443515
CK 1 OsCeBip 1.0000000 1.123741 0.5020716 0.2510358
CK 2 OsCeBip 0.3006107 1.123741 0.5020716 0.2510358
CK 3 OsCeBip 0.9256854 1.123741 0.5020716 0.2510358
CK 4 OsCeBip 1.1681248 1.123741 0.5020716 0.2510358
Treatment 1 OsCeBip 0.5103220 1.000000 0.4585177 0.2292588
Treatment 2 OsCeBip 1.0000000 1.000000 0.4585177 0.2292588
CK 1 OsPR10 1.0000000 1.946979 0.6240021 0.3120011
CK 2 OsPR10 2.1298352 1.946979 0.6240021 0.3120011
CK 3 OsPR10 1.3107239 1.946979 0.6240021 0.3120011
CK 4 OsPR10 1.5101879 1.946979 0.6240021 0.3120011
Treatment 1 OsPR10 0.7202223 1.000000 0.2092850 0.1046425
Treatment 2 OsPR10 0.6869024 1.000000 0.2092850 0.1046425
CK 1 OsWAK91 0.1901955 1.000000 0.4515142 0.2257571
CK 2 OsWAK91 0.3025867 1.000000 0.4515142 0.2257571
CK 3 OsWAK91 0.5006031 1.000000 0.4515142 0.2257571
CK 4 OsWAK91 0.2294250 1.000000 0.4515142 0.2257571
Treatment 1 OsWAK91 1.5798934 4.219614 1.3413252 0.6706626
Treatment 2 OsWAK91 1.0000000 4.219614 1.3413252 0.6706626
res[["figure"]]
## Warning: Removed 16 rows containing missing values (geom_text).

References

[1]
LIVAK K J. SCHMITTGEN T D. Analysis of relative gene expression data using real-time quantitative PCR and the 2- \(\Delta\)\(\Delta\)CT method[J]. Methods, 2001, 25(4): 402-408.
[2]
RANCUREL C. VAN TRAN T. ELIE C. 等. SATQPCR: Website for statistical analysis of real-time quantitative PCR data[J]. Molecular and Cellular Probes, 2019, 46: 101418.