5 `A short video showing Hooke in action`_! (courtesy of Fabrizio
6 Benedetti, EPFL, Lausanne)
8 .. _A short video showing Hooke in action:
9 https://documents.epfl.ch/users/f/fb/fbenedet/www/hooke_short_demostration.ogv
14 This tutorial will focus on the command-line interface as the most
15 powerful, and leave the GUI interface to another document.
17 .. _command-line: `Command-line interface`_
23 See the Installation_ page for details on downloading and installing
26 .. _Installation: install.txt
29 Command-line interface
30 ======================
32 Running the hooke shell
33 -----------------------
35 Hooke has a set of commands that depend on the loaded plugins_.
36 To access these commands, you'll need to run the Hooke shell.::
40 If you are running hooke from the source directory (see
41 Installation_), the equivalent command is::
45 You may need to give the full path for Python on Windows systems.
47 As Hooke launches, you should see something like the following in your
52 Imported plugin procplots
53 Imported plugin flatfilts
54 Imported plugin generalclamp
55 Imported plugin generalvclamp
56 Imported plugin massanalysis
58 Imported driver picoforce
59 Imported driver hemingclamp
60 Imported driver csvdriver
61 Imported driver tutorialdriver
63 Warning: Invalid work directory.
64 This is Hooke, version 0.8.0 Seinei
65 (c) Massimo Sandal, 2006. Released under the GNU General Public License Version 2
66 Hooke is Free software.
70 The final line, ``hooke>``, is the Hooke prompt. It allows you to
71 enter commans to interact with the interpreter.
76 All commands have help text explaining their purpose and usage. The
77 text is stored in the code itself, and therefore more likely to be up
78 to date than this tutorial. You can get a list of commands and topics
83 Or see specific help on ``TOPIC`` with::
91 will give help on the ``current`` command.
96 To start analyzing your curves, you first have to build a playlist. The
97 playlist is just an index of the force curve files you want to
98 analyze. Imagine it as a music playlist (that’s why it is called a
99 playlist), but with data files instead of audio files.
101 Suppose you have 100 PicoForce curve files in your curves directory,
102 starting from ``mycurve.000`` and ending in ``mycurve.100`` and you
103 want to analyze them all.
105 You then can ``cd`` (change directory) to the directory::
109 Type ``pwd`` (print working directory) to check the directory is correct.::
114 You can list the files in the directory using ``ls`` or ``dir`` (they’re
118 [’mycurve.000’, ’mycurve.001’, ...
121 Now you are ready to generate the playlist. The command to use is
124 hooke> genlist mycurve.*
126 You can also generate a playlist containing all what you find in the
129 hooke> genlist c:\curves
131 If you want to select what curves to see, based on the filename, you
132 can use wildcards. For example::
134 hooke> genlist mycurve.05*
136 will take only curves from mycurve.050 to mycurve.059.
138 Note that by using ``genlist`` you just generate the playlist in the
139 local session. To save your playlist to a file for future reuse,
142 hooke> savelist mylist
144 In this example, the list will be saved in the file ``mylist.hkp``.
145 Hooke will add the extension ``.hkp`` (Hooke playlist) to the playlist
146 if you forget to. The ``.hkp`` file is an XML file you can read and
147 edit with any text editor (i.e. Wordpad), if needed. If you want to
148 load it, simply issue ``loadlist mylist.hkp`` or ``loadlist mylist``,
149 Hooke will add ``.hkp`` if necessary.
151 If, generating the playlist, you are including by chance a non-force
152 curve file that Hooke cannot open, Hooke will print an error and
155 Navigating the playlist
156 -----------------------
158 Now you can navigate through your playlist using the commands ``next``
159 and ``previous`` or, their aliases ``n`` and ``p``. You don’t need to
160 type ``n`` every time to run along a list of curves. If you press
161 Return to an empty prompt, Hooke will repeat the last command you
162 issued explicitly. You can also navigate through the command history
163 by using the up and down arrows. From the last curve of your
164 playlist, ``n`` will wrap around to the first curve. Analogously,
165 issuing ``p`` at the first curve will jump to the last.
167 You can also jump to a given curve::
169 hooke> jump c:\curves\mycurve.012
171 where the path can be either an absolute path, or a path relative to
172 the directory holding the playlist file.
177 You can take notes about the curves you are looking at. Just type
178 ``note`` followed by the text you want to append to that curve. Hooke
179 will save the text in your current playlist and in an external log
180 file. The output will look like this:
182 Notes taken at Sun Sep 17 20:42:07 2006
183 /home/cyclopia/work/tris/20060620a.041 | This is a note
184 /home/cyclopia/work/tris/20060620a.207 | This is another note
185 /home/cyclopia/work/tris/20060620a.286 | This is a third one
187 The log file name can be configured_, but it defaults to hooke.log.
189 .. _configured: config.txt
191 Usually curves you annotated are useful later. You can copy the curves
192 you annotated to a different directory by using the ``copylog``
195 hooke> copylog c:\nicecurves
197 will copy all curves you have annotated to the c:\nicecurves
198 directory. Make sure that the directory already exists before doing
199 that. TODO: replace with::
201 hooke> copylist --log c:\curves\nice.hkp
206 You can export Hooke curves as images and as text columns. To export
207 as images, issue the ``export`` command followed by the filename.
208 Supported formats are PNG (raster) and EPS (Encapsulated Postscript,
209 vectorial). The export format is determined by the filename
210 extension, so ``export foo.png`` and ``export foo.eps`` will save
211 PNG and EPS files respectively.
213 To export as text, use the ``txt`` command, followed by the
214 filename. The output is a text file containing columns (first two are
215 X and Y of extension, second two are X and Y of retraction).
217 TODO: multiple cycles? Solution: blank lines for "breaks", add option
218 to extract specific sections using Python's slice notation.
221 Interacting with the plot (no plots in command line mode...)
222 -------------------------
224 Measuring distances and forces
225 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
227 You can easily zoom in the plot by dragging a rectangle on it with the
228 left mouse button. To zoom out, click the right mouse
229 button. Sometimes by zooming in and out too much, you can lose the
230 picture (this is probably a small bug in Matplotlib). Just type
231 ``plot`` at the command line and the curve will be refreshed.
233 You can measure distances and forces directly in the plot. Just issue
234 the command ``distance``. You will be asked to click two points.
235 When you click a point, a blue dot should appear. When you click the
236 second point, the distances (in nanometers and piconewtons) will
237 appear on the command line. You can use ``delta`` if you prefer,
238 which gives meaningful values for every kind of graph (not only force
239 curves). If you want to know the coordinates of a single point, use
242 Hooke automatically adjusts the position of the clicked point to the
243 nearest point in the graph, so you will be always measuring distances
244 and forces between points in the graph.
246 The commands ``force`` and ``distance`` are present in the
247 ``generalvclamp`` plugin.
249 Worm like chain and freely jointed chain fitting
250 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
252 You can measure by hand the parameters relative to a force peak using
253 a worm-like chain fitting with the ``fit`` command. The command by
254 default automatically finds the contact point, asks for two points
255 delimiting the portion to fit, and performs a two-variable fit, with
256 contour length, persistence length, and their relative errors as
257 output. If desired, one can use the ``noauto`` option to manually
258 click the contact point, and/or the ``pl=NUMBER`` options to impose a
259 specific persistence or Kuhn length (in nanometers). You can choose
260 which model to use with ``set fit_function wlc`` or ``set fit_function
261 fjc``. See the help of the ``fit`` command from the Hooke
262 command line for details.
264 Multiple curve fitting and measuring
265 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267 You can cycle through all your current playlist obtaining WLC fit, FJC
268 fit, rupture force and slope (loading rate) information from each
269 curve using the ``multifit`` command. The collected data can be saved
270 in a text file for further analysis in your favourite spreadsheet or
271 statistical program. If you want to check your parameters on the
272 current curve before fitting all the files in your playlist, use
273 ``multifit justone``. See the ``multifit`` help for more options.
275 Fast curve reviewing and saving
276 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278 When automatic routines are not good enough to filter your data, use
279 ``review`` command to cycle through your playlist presenting ten
280 curves in the same graph. You can then enter the numbers of the
281 interesting curves and automatically save a copy of them into another
287 You can set environment variables to influence the behaviour of
288 Hooke. The command to use is ``set``.
290 You can alter permanently the behaviour of Hooke by setting these
291 variables in a Hooke configuration file. See the `Configuring Hooke`_
294 .. _Configuring Hooke: config.txt