winklR: winklR: A function to calculate the angle based on the first...

View source: R/winklR.R

winklRR Documentation

winklR: A function to calculate the angle based on the first and the second derivative of an amplification curve data from a quantitative PCR experiment.

Description

winklR is a function to calculate the in the trajectory of the first and the second derivatives maxima and minima of an amplification curve data from a quantitative PCR experiment. For the determination of the angle (central angle), the origin is the maximum of the first derivative. On this basis, the vectors to the minimum and maximum of the second derivative are determined. This means that systematic off-sets, such as those caused by background, are taken into account. The output contains the angle.

Usage

winklR(x, y, normalize = FALSE, preprocess = TRUE)

Arguments

x

is the cycle numbers (x-axis). By default the first ten cycles are removed.

y

is the cycle dependent fluorescence amplitude (y-axis).

normalize

is a logical parameter, which indicates if the amplification curve data should be normalized to the 99 percent percentile of the amplification curve.

preprocess

is a logical parameter, which indicates if the amplification curve data should be smoothed (moving average filter, useful for noisy, jagged data).

Value

gives a list (S3 class, type of list) as output for the angles from an amplification curve.

Author(s)

Stefan Roediger

See Also

acos diffQ2

Examples


# Calculate the angles for amplification curve data from the RAS002 data set
data(RAS002)

# Plot the data
plot(RAS002[, 1],
  y = RAS002[, 2], xlab = "Cycle", ylab = "RFU",
  main = "RAS002 data set", lty = 1, type = "l"
)
res <- winklR(x = RAS002[, 1], y = RAS002[, 2])
res
plot(rbind(res$origin, res$p1, res$p2), col = c("black", "green", "blue"))

plot(RAS002[, 1],
  y = RAS002[, 7], xlab = "Cycle", ylab = "RFU",
  main = "RAS002 data set", lty = 1, type = "l"
)
res <- winklR(x = RAS002[, 1], y = RAS002[, 7])
res
plot(rbind(res$origin, res$p1, res$p2), col = c("black", "green", "blue"))

res_angles <- unlist(lapply(2:21, function(i) {
  winklR(RAS002[, 1], RAS002[, i])$angle
}))
cdplot(RAS002_decisions[1L:20] ~ res_angles, xlab = "angle", ylab = "decision")

PCRedux documentation built on May 11, 2022, 5:18 p.m.