## EXAMPLE 1:
## internal dataset lc96_bACTXY.rdml (in 'data' directory)
## generated by Roche LightCycler 96. Contains qPCR data
## with four targets and two types.
## Import with default settings.
PATH <- path.package("RDML")
filename <- paste(PATH, "/extdata/", "lc96_bACTXY.rdml", sep ="")
lc96 <- RDML$new(filename)
tab <- lc96$AsTable(name.pattern = paste(sample[[react$sample]]$description,
react$id),
quantity = sample[[react$sample]]$quantity$value)
## Show dyes names
unique(tab$target.dyeId)
## Show types of the samples for dye 'FAM'
library(dplyr)
unique(filter(tab, target.dyeId == "FAM")$sample.type)
## Show template quantities for dye 'FAM' type 'std'#'
COPIES <- filter(tab, target.dyeId == "FAM", sample.type == "std")$quantity
## Define calibration curves (type of the samples - 'std').
## No replicates.
library(qpcR)
CAL <- modlist(lc96$GetFData(filter(tab,
target.dyeId == "FAM",
sample.type == "std")),
baseline="lin", basecyc=8:15)
## Define samples to predict (first two samples with the type - 'unkn').
PRED <- modlist(lc96$GetFData(filter(tab,
target.dyeId == "FAM",
sample.type == "unkn")),
baseline="lin", basecyc=8:15)
## Conduct quantification.
calib(refcurve = CAL, predcurve = PRED, thresh = "cpD2",
dil = COPIES)
## EXAMPLE 2:
## internal dataset lc96_bACTXY.rdml (in 'data' directory)
## generated by Roche LightCycler 96. Contains qPCR data
## with four targets and two types.
## Import with default settings.
library(chipPCR)
PATH <- path.package("RDML")
filename <- paste(PATH, "/extdata/", "lc96_bACTXY.rdml", sep ="")
lc96 <- RDML$new(filename)
tab <- lc96$AsTable(name.pattern = paste(sample[[react$sample]]$description,
react$id),
quantity = sample[[react$sample]]$quantity$value)
## Show targets names
unique(tab$target)
## Fetch cycle dependent fluorescence for HEX chanel
tmp <- lc96$GetFData(filter(tab, target == "FAM@bACT", sample.type == "std"))
## Fetch vector of dillutions
dilution <- filter(tab, target.dyeId == "FAM", sample.type == "std")$quantity
## Use plotCurves function from the chipPCR package to
## get an overview of the amplification curves
plotCurves(tmp[,1], tmp[,-1])
par(mfrow = c(1,1))
## Use inder function from the chipPCR package to
## calculate the Cq (second derivative maximum, SDM)
SDMout <- sapply(2L:ncol(tmp), function(i) {
SDM <- summary(inder(tmp[, 1], tmp[, i]), print = FALSE)[2]
})
## Use the effcalc function from the chipPCR package and
## plot the results for the calculation of the amplification
## efficiency analysis.
plot(effcalc(dilution, SDMout), CI = TRUE)
## EXAMPLE 3:
## internal dataset BioRad_qPCR_melt.rdml (in 'data' directory)
## generated by Bio-Rad CFX96. Contains qPCR and melting data.
## Import with custom name pattern.
PATH <- path.package("RDML")
filename <- paste(PATH, "/extdata/", "BioRad_qPCR_melt.rdml", sep ="")
cfx96 <- RDML$new(filename)
## Use plotCurves function from the chipPCR package to
## get an overview of the amplification curves
library(chipPCR)
## Extract all qPCR data
tab <- cfx96$AsTable()
cfx96.qPCR <- cfx96$GetFData(tab)
plotCurves(cfx96.qPCR[,1], cfx96.qPCR[,-1], type = "l")
## Extract all melting data
cfx96.melt <- cfx96$GetFData(tab, data.type = "mdp")
## Show some generated names for samples.
colnames(cfx96.melt)[2L:5]
## Select columns that contain
## samples with dye 'EvaGreen' and have type 'pos'
## using filtering by names.
cols <- cfx96$GetFData(filter(tab, grepl("pos_EvaGreen$", fdata.name)),
data.type = "mdp")
## Conduct melting curve analysis.
library(qpcR)
invisible(meltcurve(cols, fluos = 2:ncol(cols),
temps = rep(1, ncol(cols) - 1)))
Run the code above in your browser using DataLab