sliwin(object, wsize = 6, basecyc = 1:6, base = 0, border = NULL,
type = c("rsq", "slope"), plot = TRUE, verbose = TRUE, ...)
6
. A sequence such as 4:6
can be used to optimize the window size.base != 0
, which cycles to use for an initial baseline estimation based on the averaged fluorescence values.0
for no baseline optimization, or a scalar defining multiples of the standard deviation of all baseline points obtained from basecyc
. These are iteratively subtracted from the raw data. See 'Details' and 'Examples'.NULL
(default) or a two-element vector which defines the border from the take-off point to points nearby the upper asymptote (saturation phase). See 'Details'."rsq"
) or best baseline + minimal variance in slope + maximum $R^2$ ("slope"
).TRUE
, the result is plotted with the logarithmized curve, sliding window, regression line and baseline.TRUE
, more information is displayed in the console window.border
s.sliwin
, this is by default (base = NULL
) the region in the curve starting at the take-off cycle ($top$) as calculated from takeoff
and ending at the transition region to the upper asymptote (saturation region). The latter is calculated from the first and second derivative maxima: $asympt = cpD1 + (cpD1 - cpD2)$. If the border is to be set by the user, border
values such as c(-2, 4)
extend these values by $top + border[1]$ and $asympt + border[2]$. The $log_{10}$ transformed raw fluorescence values are regressed against the cycle number $log_{10}(F) = n\beta + \epsilon$ and the efficiency is then calculated by $E = 10^{slope}$. For the baseline optimization, 100 baseline values $Fb_i$ are interpolated in the range of the data: $$F_{min} \le Fb_i \le base \cdot \sigma(F_{basecyc[1]}...F_{basecyc[2]})$$ and subtracted from $F_n$. If type = "rsq"
, the best window in terms of $R^2$ is selected from all iterations, as defined by wsize
and border
. If type = "slope"
, the baseline value delivering the smallest variance in the slope of the upper/lower part of the sliding window and highest $R^2$ is selected. This approach is quite similar to the one in Ruijter et al. (2009) but has to be tweaked in order to obtain the same values as in the 'LinRegPCR' software. Especially the border
value has significant influence on the calculation of the best window's efficiency value.## sliding window of size 5 between
## take-off point and upper
## asymptote, no baseline optimization
m1 <- pcrfit(reps, 1, 2, l4)
sliwin(m1, wsize = 5)
## optimizing with window sizes of 4 to 6,
## between 0/+2 from lower/upper border,
## and baseline up to 2 standard deviations
sliwin(m1, wsize = 4:6, border = c(0, 2), base = 2)
Run the code above in your browser using DataLab