afmDetachPoint {afmToolkit}R Documentation

Detach point


Find the detach point (or unbinding point) for the Force-Distance curve following the local regression and two thresholds methods described in Microscopy Research and Technique 2013 (see reference).

The procedure is similar to the one used by the afmContactPoint() function for obtaining the contact point.


afmDetachPoint(afmdata,width=1,mul1,mul2, lagdiff = width, Delta=TRUE,
  loessSmooth = FALSE)



A Force-Distance curve with the afmdata structure. It should be a list with at least the 'data' field with a data frame of at least 4 columns.


Width of the window for the local regression (in vector position units)


First multiplier for the first alarm threshold


Second multiplier for the second alarm threshold


Lag for estimating the differences in Delta (or slopes) signal. By default it takes the same value as the window with.


Logical. If TRUE, then the statistic for determining the contact point is the differences between two consecutive values of the slope of the local regression line. If FALSE then the slope itself is used.


Logical If TRUE, a loess smoothing (via loess.smooth()) is done prior to the determination of the contact point. The span of the smoothing is 0.05 (5 approach segment.


An afmdata class variable which will consist on the original input afmdata variable plus a new list named DP with the following fields:

DP The detach point value.

iDP The position in the array for the detach point value.

delta The delta signal.

noise The noise of the delta signal


Benitez R., Moreno-Flores S., Bolos V. J. and Toca-Herrera J.L. (2013). "A new automatic contact point detection algorithm for AFM force curves". Microscopy research and technique, 76 (8), pp. 870-876.

See Also



data <- afmReadJPK("force-save-JPK-3h.txt.gz", path = path.package("afmToolkit"))
width <- 10
mul1 <- 2
mul2 <- 40
data <- afmDetachPoint(data, width = width, mul1 = mul1, mul2 = mul2)
## Not run: 
plot(data, segment = "retract") + geom_vline(xintercept = data$DP$DP, lty = 2)

## End(Not run)

[Package afmToolkit version 0.0.1 Index]