afmToolkit: an R Package for Automated AFM Force-Distance Curves Analysis

Atomic force microscopy (AFM) is widely used to measure molecular and colloidal inter actions as well as mechanical properties of biomaterials. In this paper the afmToolkit R package is introduced. This package allows the user to automatically batch process AFM force-distance and force-time curves. afmToolkit capabilities range from importing ASCII files and preprocessing the curves (contact point detection, baseline correction. . . ) for finding relevant physical information, such as Young’s modulus, adhesion energies and exponential decay for force relaxation and creep experiments. This package also contains plotting, summary and feature extraction functions. The package also comes with several data sets so the user can test the aforementioned features with ease. The package afmToolkit eases the basic processing of large amount of AFM F-d/t curves at once. It is also flexible enough to easily incorporate new functions as they are needed and can be seen as a programming infrastructure for further algorithm development.

Rafael Benítez , Vicente J. Bolós , José-Luis Toca-Herrera

Supplementary materials

Supplementary materials are available in addition to this article. It can be downloaded at

CRAN packages used

afmToolkit, devtools, ggplot2, minpack.lm, gridExtra, scales, dplyr

CRAN Task Views implied by cited packages

ChemPhys, Graphics, Optimization, Phylogenetics


Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".


For attribution, please cite this work as

Benítez, et al., "The R Journal: afmToolkit: an R Package for Automated AFM Force-Distance Curves Analysis", The R Journal, 2017

BibTeX citation

  author = {Benítez, Rafael and Bolós, Vicente J. and Toca-Herrera, José-Luis},
  title = {The R Journal: afmToolkit: an R Package for Automated AFM Force-Distance Curves Analysis},
  journal = {The R Journal},
  year = {2017},
  note = {},
  doi = {10.32614/RJ-2017-045},
  volume = {9},
  issue = {2},
  issn = {2073-4859},
  pages = {291-308}