Characterization of intermolecular and intramolecular interactions with the atomic force microscope