Pages related to Hooke.


Available in a git repository.
Repository: hooke
Browsable repository: hooke
Author: W. Trevor King

Hooke is a force spectroscopy data analysis package. For example, Hooke can extract unfolding forces from your experimental data. You can then fit the unfolding forces to models using my sawsim simulator. Of course, some experiments (e.g. force clamp) need no Monte Carlo analysis, so for those, Hooke alone provides a complete analysis package.

Getting started

I've tested Hooke on Gentoo and Debian, and I've got an ebuild in my Gentoo overlay. It should also run fine on Windows, etc., but I don't have easy access to Windows boxes with Python, so I don't test it there as often.

See the manual and PyPI page for more details.

Numpydoc and Sphinx 1.0

I finally got around to upgrading the environment on the server that autogenerates my Hooke documentation.

The new setup is:

The main effect of the change is that the hooke module documentation is now generated in its entirety, while the previous implementation only generated documentation for Python 2.5-compatible submodules.


In an earlier post, I reported seeing surface distance (m) (m) columns in my playlist files, but had been unable to reproduce them. Today, after fixing bugs with Curve copying, I did reproduce them with:

$ ./bin/
    -c 'load_playlist test/data/vclamp_picoforce/playlist'
    -c 'start_command_capture'
    -c 'zero_surface_contact_point --block approach'
    -c 'zero_surface_contact_point --block retract'
    -c 'stop_command_capture'
    -c 'apply_command_stack_to_playlist --enable-evaluate'
    -c 'flat_filter_playlist --block retract --min_points 1'
Expected a list of Peaks, not <class 'hooke.command.Failure'>:
  surface distance (m) not in retract (['z piezo (m)', 'deflection (m)',
  'surface distance (m) (m)', 'surface deflection (m) (m)']):
  list.index(x): x not in list

It appears to be a problem with curve reloading, since it doesn't come up when I use a playlist with less than 100 (Playlist._max_loaded) curves.

I'll update this post once I've tracked down the culprit.

Update: fixed.


Minor tweaks to Hooke's command stacks. I can now execute the GUI alternative of

    -c 'new_playlist'
    -c 'glob_curves_to_playlist *'
    -c 'start_command_capture'
    -c 'zero_surface_contact_point --block retract'
    -c 'stop_command_capture'
    -c 'apply_command_stack_to_playlist'
    -c 'curve_info'

Issues resolved today:

  • GUI-generated commands clogging the command stack instead of being executed. Fixed with CommandMessage.explicit_user_call.
  • Playlist._loaded desyncronization from old 'apply command stack to playlist'. Fixed with Playlist.unload().


After fixing up a few more bugs, I successfully ran:

    -c 'new_playlist'
    -c 'glob_curves_to_playlist *'
    -c 'start_command_capture'
    -c 'zero_surface_contact_point --block retract'
    -c 'flat_filter_peaks --block retract --min_points 1'
    -c 'zero_surface_contact_point --block retract --ignore_after_last_peak_info_name "flat filter peaks"'
    -c 'convert_distance_to_force --block retract --deflection_column "surface deflection (m)"'
    -c 'remove_cantilever_from_extension --block retract'
    -c 'flat_peaks_to_polymer_peaks --block retract'
    -c 'polymer_fit_peaks --block retract'
    -c 'stop_command_capture'
    -c 'apply_command_stack_to_playlist --enable-evaluate'
    -c 'save_playlist --output o.hkp'

on 2400 curves with the command line UI. Tomorrow I'll run through those with the GUI.


I ran through with the above command with the GUI. Same results :D. It did, however turn up a couple of outstanding issues:

  • lots of useless !!python/unicode 'retract' tags. If the strings are all in ASCII, I don't really care if they are loaded as unicode or string objects. (fixed)
  • surface distance (m) (m) column. Obviously someone is adding units twice. I need to figure out who it is ;). (Reproduced)