R: R6 class 'RDML' - contains methods to read and overview...
RDML
R Documentation
R6 class RDML – contains methods to read and overview fluorescence
data from RDML v1.1 and v1.2 format files
Description
Main purpose of this class is to work with RDML format data (Lefever et al.
2009) and transform it to the appropriate format of the qpcR (Ritz et
al. 2008, Spiess et al. 2008) and chipPCR packages (see
RDML.new for import details).
Real-time PCR Data Markup Language (RDML) is the recommended file format
element in the Minimum Information for Publication of Quantitative Real-Time
PCR Experiments (MIQE) guidelines (Bustin et al. 2009). Inner structure of
imported data mimics structure of RDML file v1.2. All data except fluorescence values
can be represented as data.frame by method AsTable. Such variant of data representation allows easy samples
filtering (by targets, types, etc.) and serves as request for GetFData
method – gets fluorescence data for specified samples.
Usage
RDML
Format
An R6Class generator object.
Fields
Type, structure of data and description of fields can be
viewed at RDML v1.2 file description. Names of fields are first level of
XML tree.
Methods
new
creates new instance of RDML
class object (see RDML.new)
AsTable
represent RDML data as
data.frame (see RDML.AsTable)
GetFData
gets
fluorescence data (see RDML.GetFData)
SetFData
sets
fluorescence data (see RDML.SetFData)
Merge
merges two
RDML to one (see MergeRDMLs)
AsDendrogram
represents structure of RDML object as dendrogram(see RDML.AsDendrogram)
Author(s)
Konstantin A. Blagodatskikh <k.blag@yandex.ru>, Stefan Roediger
<stefan.roediger@b-tu.de>, Michal Burdukiewicz
<michalburdukiewicz@gmail.com>
References
RDML format http://www.rdml.org/ R6 package
http://cran.r-project.org/web/packages/R6/index.html
Ritz, C., Spiess, A.-N., 2008. qpcR: an R package for sigmoidal model
selection in quantitative real-time polymerase chain reaction analysis.
Bioinformatics 24, 1549–1551. doi:10.1093/bioinformatics/btn227
Spiess, A.-N., Feig, C., Ritz, C., 2008. Highly accurate sigmoidal fitting
of real-time PCR data by introducing a parameter for asymmetry. BMC
Bioinformatics 9, 221. doi:10.1186/1471-2105-9-221
Bustin, S.A., Benes, V., Garson, J.A., Hellemans, J., Huggett, J., Kubista,
M., Mueller, R., Nolan, T., Pfaffl, M.W., Shipley, G.L., Vandesompele, J.,
Wittwer, C.T., 2009. The MIQE guidelines: minimum information for
publication of quantitative real-time PCR experiments. Clin. Chem.
55, 611–622. doi:10.1373/clinchem.2008.112797
Lefever, S., Hellemans, J., Pattyn, F., Przybylski, D.R., Taylor, C.,
Geurts, R., Untergasser, A., Vandesompele, J., RDML consortium, 2009. RDML:
structured language and reporting guidelines for real-time quantitative PCR
data. Nucleic Acids Res. 37, 2065–2069. doi:10.1093/nar/gkp056
Examples
## 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$id]]$description,
react$id$id),
quantity = sample[[react$sample$id]]$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'#'
## Not run:
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)
## End(Not run)
## Not run:
## 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$id]]$description,
react$id$id),
quantity = sample[[react$sample$id]]$quantity$value)
## Show targets names
unique(tab$target)
## Fetch cycle dependent fluorescence for HEX chanel
tmp <- lc96$GetFData(filter(tab, target == "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)
## End(Not run)
## Not run:
## 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, dp.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)),
dp.type = "mdp")
## Conduct melting curve analysis.
library(qpcR)
invisible(meltcurve(cols, fluos = 2:ncol(cols),
temps = rep(1, ncol(cols) - 1)))
## End(Not run)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(RDML)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RDML/RDML.Rd_%03d_medium.png", width=480, height=480)
> ### Name: RDML
> ### Title: R6 class 'RDML' - contains methods to read and overview
> ### fluorescence data from RDML v1.1 and v1.2 format files
> ### Aliases: RDML
> ### Keywords: Bio--Rad CFX96 IO LightCycler RDML StepOne file qPCR
>
> ### ** Examples
>
> ## 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)
Unzipping /home/ddbj/local/lib64/R/library/RDML/extdata/lc96_bACTXY.rdml...
Parsing Roche(?) data...OK
Parsing Roche standards data...OK
Parsing Roche conditions data...NONE
Parsing Roche reference genes data...NONE
Getting dateMade
Getting dateUpdated
Getting id
Getting experementer
Getting documentation
Getting dye
Getting sample
Getting target
Getting thermalCyclingConditions
Getting experiment: ca1eb225-ecea-4793-9804-87bfbb45f81d
run: 65aeb1ec-b377-4ef6-b03f-92898d47488b
Adding Roche ref genes
Adding Roche quantities
Adding Roche conditions
>
> tab <- lc96$AsTable(name.pattern = paste(sample[[react$sample$id]]$description,
+ react$id$id),
+ quantity = sample[[react$sample$id]]$quantity$value)
> ## Show dyes names
> unique(tab$target.dyeId)
[1] "FAM" "Hex" "Texas Red" "Cy5"
> ## Show types of the samples for dye 'FAM'
> library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
> unique(filter(tab, target.dyeId == "FAM")$sample.type)
[1] "std" "unkn"
>
> ## Show template quantities for dye 'FAM' type 'std'#'
> ## Not run:
> ##D COPIES <- filter(tab, target.dyeId == "FAM", sample.type == "std")$quantity
> ##D ## Define calibration curves (type of the samples - 'std').
> ##D ## No replicates.
> ##D library(qpcR)
> ##D CAL <- modlist(lc96$GetFData(filter(tab,
> ##D target.dyeId == "FAM",
> ##D sample.type == "std")),
> ##D baseline="lin", basecyc=8:15)
> ##D ## Define samples to predict (first two samples with the type - 'unkn').
> ##D PRED <- modlist(lc96$GetFData(filter(tab,
> ##D target.dyeId == "FAM",
> ##D sample.type == "unkn")),
> ##D baseline="lin", basecyc=8:15)
> ##D ## Conduct quantification.
> ##D calib(refcurve = CAL, predcurve = PRED, thresh = "cpD2",
> ##D dil = COPIES)
> ## End(Not run)
> ## Not run:
> ##D ## EXAMPLE 2:
> ##D ## internal dataset lc96_bACTXY.rdml (in 'data' directory)
> ##D ## generated by Roche LightCycler 96. Contains qPCR data
> ##D ## with four targets and two types.
> ##D ## Import with default settings.
> ##D library(chipPCR)
> ##D PATH <- path.package("RDML")
> ##D filename <- paste(PATH, "/extdata/", "lc96_bACTXY.rdml", sep ="")
> ##D lc96 <- RDML$new(filename)
> ##D
> ##D tab <- lc96$AsTable(name.pattern = paste(sample[[react$sample$id]]$description,
> ##D react$id$id),
> ##D quantity = sample[[react$sample$id]]$quantity$value)
> ##D ## Show targets names
> ##D unique(tab$target)
> ##D ## Fetch cycle dependent fluorescence for HEX chanel
> ##D tmp <- lc96$GetFData(filter(tab, target == "bACT", sample.type == "std"))
> ##D ## Fetch vector of dillutions
> ##D dilution <- filter(tab, target.dyeId == "FAM", sample.type == "std")$quantity
> ##D
> ##D ## Use plotCurves function from the chipPCR package to
> ##D ## get an overview of the amplification curves
> ##D plotCurves(tmp[,1], tmp[,-1])
> ##D par(mfrow = c(1,1))
> ##D ## Use inder function from the chipPCR package to
> ##D ## calculate the Cq (second derivative maximum, SDM)
> ##D SDMout <- sapply(2L:ncol(tmp), function(i) {
> ##D SDM <- summary(inder(tmp[, 1], tmp[, i]), print = FALSE)[2]
> ##D })
> ##D
> ##D ## Use the effcalc function from the chipPCR package and
> ##D ## plot the results for the calculation of the amplification
> ##D ## efficiency analysis.
> ##D plot(effcalc(dilution, SDMout), CI = TRUE)
> ## End(Not run)
> ## Not run:
> ##D ## EXAMPLE 3:
> ##D ## internal dataset BioRad_qPCR_melt.rdml (in 'data' directory)
> ##D ## generated by Bio-Rad CFX96. Contains qPCR and melting data.
> ##D ## Import with custom name pattern.
> ##D PATH <- path.package("RDML")
> ##D filename <- paste(PATH, "/extdata/", "BioRad_qPCR_melt.rdml", sep ="")
> ##D cfx96 <- RDML$new(filename)
> ##D ## Use plotCurves function from the chipPCR package to
> ##D ## get an overview of the amplification curves
> ##D library(chipPCR)
> ##D ## Extract all qPCR data
> ##D tab <- cfx96$AsTable()
> ##D cfx96.qPCR <- cfx96$GetFData(tab)
> ##D plotCurves(cfx96.qPCR[,1], cfx96.qPCR[,-1], type = "l")
> ##D
> ##D ## Extract all melting data
> ##D cfx96.melt <- cfx96$GetFData(tab, dp.type = "mdp")
> ##D ## Show some generated names for samples.
> ##D colnames(cfx96.melt)[2L:5]
> ##D ## Select columns that contain
> ##D ## samples with dye 'EvaGreen' and have type 'pos'
> ##D ## using filtering by names.
> ##D cols <- cfx96$GetFData(filter(tab, grepl("pos_EvaGreen$", fdata.name)),
> ##D dp.type = "mdp")
> ##D ## Conduct melting curve analysis.
> ##D library(qpcR)
> ##D invisible(meltcurve(cols, fluos = 2:ncol(cols),
> ##D temps = rep(1, ncol(cols) - 1)))
> ## End(Not run)
>
>
>
>
>
> dev.off()
null device
1
>