afmContactPoint {afmToolkit}R Documentation

Contact point


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


afmContactPoint(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 CP with the following fields:

CP The contact point value.

iCP The position in the array for the contact 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



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

## End(Not run)

[Package afmToolkit version 0.0.1 Index]