Learn R Programming

MBmca (version 0.0.3-3)

diffQ2: Calculation of the melting temperatures (Tm, Tm1D2 and Tm2D2) from the first and the second derivative

Description

diffQ2() calls instances of diffQ() to calculate the Tm1D2 and Tm2D2. The options are similar to diffQ(). Both diffQ() and diffQ2() return objects of the class list. To accessing components of lists is done as described elsewhere either be name or by number. diffQ2 has no standalone plot function. For sophisticated analysis and plots its recommended to use diffQ2 as presented in the examples as part of algorithms.

Usage

diffQ2(xy, fct = max, fws = 8, col = 2, plot = FALSE, 
       verbose = FALSE, peak = FALSE, deriv = FALSE, 
       negderiv = TRUE, derivlimits = FALSE, 
       derivlimitsline = FALSE, vertiline = FALSE, 
       rsm = FALSE, inder = FALSE)

Arguments

xy
is a data.frame containing in the first column the temperature and in the second column the fluorescence values. Preferably the output from mcaSmoother is used.
fct
accepts min or max as option and is used to define whether to find a local minimum (``negative peak'') or local maximum (``positive peak'').
fws
defines the number (n) of left and right neighbors to use for the calculation of the quadratic polynomial.
col
is a graphical parameter used to define the length of the line used in the plot.
peak
shows the peak in the plot.
plot
shows a plot of a single melting curve with (Tm) as vertical line and the second derivatives (Tm1D2 and Tm2D2). To draw multiple curves in a single plot set plot = FALSE and create and empty plot instead (see examples).
verbose
shows additional information (e.g., first and second approximate derivatives, ranges used for calculation, approximate Tm, Tm1D2, Tm2D2) of the calculation.
negderiv
calculates the negative derivative (default). If FALSE the positive first negative is calculated.
deriv
shows the first derivative with the color assigned to col (see examples).
derivlimits
shows the number (n) used to calculate the Tm as points in the plot (see examples).
derivlimitsline
shows the number (n) used to calculate the Tm as line in the plot (see examples).
vertiline
draws a vertical line at the Tms (see examples).
rsm
performs a doubling of the temperature resolution by calculation of the mean temperature and mean fluorescence between successive temperature steps. Note: mcaSmoother has the "n" parameter with a similar but advanced functionality.
inder
Interpolates derivatives using the five-point stencil. See chipPCR package for details.

Value

  • $TmD1TmD1 returns a comprehensive list (if parameter verbose is TRUE) with results from the first derivative. The list includes a data.frame of the derivative ("xy"). The temperature range ("limits.xQ") and fluorescence range ("limits.diffQ") to calculate the peak value. "fluo.x" is the approximate fluorescence at the approximate melting temperature. The calculated melting temperature ("Tm") with the corresponding fluorescence intensity ("fluoTm"). The number of points ("fws") and the adjusted R-squared ("adj.r.squared") to fit.
  • $TmD1$Tmreturns the calculated melting temperature ("Tm") from the first derivative.
  • $TmD1$fluoTmreturns the calculated fluorescence at the calculated melting temperature ("Tm").
  • $TmD1$Tm.approxreturns the approximate melting temperature ("Tm") from the first derivative.
  • $TmD1$fluo.xreturns the approximate fluorescence at the calculated melting temperature ("Tm").
  • $TmD1$xyis a data.frame containing in the first column the temperature and in the second column the fluorescence values. Preferably the output from mcaSmoother is used.
  • $TmD1$limits.xQreturns a data range of temperature values used to calculate the melting temperature.
  • $TmD1$limits.diffQreturns a data range of fluorescence values used to calculate the melting temperature.
  • $TmD1$adj.r.squaredreturns the adjusted R-squared from the quadratic model fitting function (see also fit) of the first derivative.
  • $TmD1$NRMSEreturns the normalized root-mean-squared-error (NRMSE) from the quadratic model fitting function (see also fit) of the first derivative.
  • $TmD1$fwsreturns the number of points used for the calculation of the melting temperature of the first derivative.
  • $TmD1$devsumreturns measures to show the difference between the approximate and calculated melting temperature of the first derivative.
  • $TmD1$fitreturns the summary of the results of the quadratic model fitting function of the first derivative.
  • $Tm1D2returns the "left" melting temperature ("Tm1D2 ") values from the second derivative.
  • $Tm1D2$Tmreturns the "left" calculated melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$fluoTmreturns the "left" calculated fluorescence at the calculated melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$Tm.approxreturns the "left" approximate melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$fluo.xreturns the "left" approximate fluorescence at the calculated melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$xyis a data.frame containing in the first column the temperature and in the second column the fluorescence values of the "left" melting temperature ("Tm1D2") from the second derivative. Preferably the output from mcaSmoother is used.
  • $Tm1D2$limits.xQreturns a data range of temperature values used to calculate the melting temperature of the "left" melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$limits.diffQreturns a data range of fluorescence values used to calculate the melting temperature of the "left" melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$adj.r.squaredreturns the adjusted R-squared from the quadratic model fitting function (see also fit) of the "left" melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$NRMSEreturns normalized root-mean-squared-error (NRMSE) from the quadratic model fitting function (see also fit) of the "left" melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$fwsreturns the number of points used for the calculation of the melting temperature of the "left" melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$devsumreturns measures to show the difference between the approximate and alculated melting temperature of the "left" melting temperature ("Tm1D2") from the second derivative.
  • $Tm1D2$fitreturns the summary of the results of the quadratic model fitting function of the "left" melting temperature ("Tm1D2") from the second derivative.
  • $Tm2D2returns the "right" melting temperature ("Tm2D2 ") values from the second derivative.
  • $Tm2D2$Tmreturns the "right" calculated melting temperature ("Tm2D2") from the second derivative.
  • $Tm2D2$fluoTmreturns the "right" calculated fluorescence at the calculated melting temperature ("Tm2D2") from the second derivative.
  • $Tm2D2$Tm.approxreturns the "right" approximate melting temperature ("Tm1D2") from the second derivative.
  • $Tm2D2$fluo.xreturns the "left" approximate fluorescence at the calculated melting temperature ("Tm2D2") from the second derivative.
  • $Tm2D2$xyis a data.frame containing in the first column the temperature and in the second column the fluorescence values of the "right" melting temperature ("Tm2D2") from the second derivative. Preferably the output from mcaSmoother is used.
  • $Tm2D2$limits.xQreturns a data range of temperature values used to calculate the melting temperature of the "right" melting temperature ("Tm2D2") from the second derivative.
  • $Tm2D2$limits.diffQreturns a data range of fluorescence values used to calculate the melting temperature of the "right" melting temperature ("Tm"D2") from the second derivative.
  • $Tm2D2$adj.r.squaredreturns the adjusted R-squared from the quadratic model fitting function (see also fit) of the "right" melting temperature ("Tm2D2") from the second derivative.
  • $Tm2D2$NRMSEreturns normalized root-mean-squared-error (NRMSE) from the quadratic model fitting function (see also fit) of the "right" melting temperature ("Tm2D2") from the second derivative.
  • $Tm2D2$fwsreturns the number of points used for the calculation of the melting temperature of the "right" melting temperature ("Tm2D2") from the second derivative.
  • $Tm2D2$devsumreturns measures to show the difference between the approximate and calculated melting temperature of the "right" melting temperature ("Tm2D2") from the second derivative.
  • $Tm2D2$fitreturns the summary of the results of the quadratic model fitting function of the "right" melting temperature ("Tm2D2") from the second derivative.
  • $xTm1.2.D2returns only the "left" and right calculated melting temperature ("Tm1D2, Tm2D2") from the second derivative.
  • $yTm1.2.D2returns only the "left" and right calculated fluorescence ("Tm1D2, Tm2D2") from the second derivative.
  • $temperaturereturns measures to investigate the temperature resolution of the melting curve. Raw fluorescence measurements at irregular temperature resolutions (intervals) can introduce artifacts and thus lead to wrong melting point estimations.
  • $temperature$T.deltareturns the difference between two successive temperature steps.
  • $temperature$mean.T.deltareturns the mean difference between two temperature steps.
  • $temperature$sd.T.deltareturns the standard deviation of the temperature.
  • $temperature$RSD.T.deltareturns the relative standard deviation (RSD) of the temperature in percent.

References

A Highly Versatile Microscope Imaging Technology Platform for the Multiplex Real-Time Detection of Biomolecules and Autoimmune Antibodies. S. Roediger, P. Schierack, A. Boehm, J. Nitschke, I. Berger, U. Froemmel, C. Schmidt, M. Ruhland, I. Schimke, D. Roggenbuck, W. Lehmann and C. Schroeder. Advances in Biochemical Bioengineering/Biotechnology. 133:33--74, 2013. http://www.ncbi.nlm.nih.gov/pubmed/22437246

Nucleic acid detection based on the use of microbeads: a review. S. Roediger, C. Liebsch, C. Schmidt, W. Lehmann, U. Resch-Genger, U. Schedler, P. Schierack. Microchim Acta 2014:1--18. DOI: 10.1007/s00604-014-1243-4

Roediger S, Boehm A, Schimke I. Surface Melting Curve Analysis with R. The R Journal 2013;5:37--53.

See Also

diffQ, mcaSmoother

Examples

Run this code
# First Example
# Plot the first and the second derivative melting curves of MLC-2v
# for a single melting curve. Should give a warning message but the graph 
# will show you that the calculation is ok
data(MultiMelt)
tmp <- mcaSmoother(MultiMelt[, 1], MultiMelt[, 14])
diffQ2(tmp, fct = min, verbose = FALSE, plot = TRUE)

# Second Example
# Calculate the maximum fluorescence of a melting curve, Tm, 
# Tm1D2 and Tm2D2 of HRPT1 for 12 microbead populations and assign the 
# values to the matrix HRPT1
data(MultiMelt)
HPRT1 <- matrix(NA,12,4,
	dimnames = list(colnames(MultiMelt[, 2L:13]),
	    c("Fluo", "Tm", "Tm1D2", "Tm2D2")))
for (i in 2L:13) {
       tmp <- mcaSmoother(MultiMelt[, 1], 
                     MultiMelt[, i])
       tmpTM <- diffQ2(tmp, fct = min, verbose = TRUE)
       HPRT1[i-1, 1] <- max(tmp$y)
       HPRT1[i-1, 2] <- tmpTM$TmD1$Tm
       HPRT1[i-1, 3] <- tmpTM$Tm1D2$Tm
       HPRT1[i-1, 4] <- tmpTM$Tm2D2$Tm
}
HPRT1

# Third Example
# Use diffQ2 to determine the second derivative.

data(MultiMelt)
HPRT1 <- matrix(NA,12,4,
	dimnames = list(colnames(MultiMelt[, 2L:13]),
	    c("Fluo", "Tm", "Tm1D2", "Tm2D2")))
for (i in 2L:13) {
       tmp <- mcaSmoother(MultiMelt[, 1], 
                     MultiMelt[, i])
       tmpTM <- diffQ2(tmp, fct = min, verbose = TRUE)
       HPRT1[i-1, 1] <- max(tmp[["y.sp"]])
       HPRT1[i-1, 2] <- tmpTM[["TmD1"]][["Tm"]]
       HPRT1[i-1, 3] <- tmpTM[["Tm1D2"]][["Tm"]]
       HPRT1[i-1, 4] <- tmpTM[["Tm2D2"]][["Tm"]]
}
plot(HPRT1[, 1], HPRT1[, 2], 
       xlab = "refMFI", ylab = "Temperature", 
       main = "HPRT1", xlim = c(2.1,2.55),
       ylim = c(72,82), pch = 19,
       col = 1:12, cex = 1.8)
points(HPRT1[, 1], HPRT1[, 3], pch = 15)
points(HPRT1[, 1], HPRT1[, 4], pch = 15)
abline(lm(HPRT1[, 2] ~ HPRT1[, 1]))
abline(lm(HPRT1[, 3] ~ HPRT1[, 1]))
abline(lm(HPRT1[, 4] ~ HPRT1[, 1]))

# Fourth Example
# Use diffQ2 with inder parameter to determine the second derivative.
data(MultiMelt)

tmp <- mcaSmoother(MultiMelt[, 1], MultiMelt[, 14])
diffQ2(tmp, fct = min, verbose = FALSE, plot = TRUE, inder = FALSE)
diffQ2(tmp, fct = min, verbose = FALSE, plot = TRUE, inder = TRUE)
par(mfrow = c(1,1))

Run the code above in your browser using DataLab