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
19 This tutorial will focus on the command-line interface as the most
20 powerful, and leave the GUI interface to another document.
22 .. _command-line: `Command-line interface`_
28 See the Installation_ page for details on downloading and installing
31 .. _Installation: install.txt
34 Command-line interface
35 ======================
37 Running the hooke shell
38 -----------------------
40 Hooke has a set of commands that depend on the loaded plugins_.
41 To access these commands, you'll need to run the Hooke shell.::
45 If you are running hooke from the source directory (see
46 Installation_), the equivalent command is::
50 You may need to give the full path for Python on Windows systems.
52 .. _plugins: hooke/hooke.plugin.txt
54 As Hooke launches, you should see something like the following in your
57 Hooke version 0.8.0 Seinei
63 The final line, `hooke>`, is the Hooke prompt. It allows you to
64 enter commans to interact with the interpreter.
69 All commands have help text explaining their purpose and usage. The
70 text is stored in the code itself, and therefore more likely to be up
71 to date than this tutorial. You can get a list of commands and topics
76 Or see specific help on `TOPIC` with::
84 will give help on the `current` command.
89 To start analyzing your curves, you first have to build a playlist. The
90 playlist is just an index of the force curve files you want to
91 analyze. Imagine it as a music playlist (that’s why it is called a
92 playlist), but with data files instead of audio files.
94 Suppose you have 100 PicoForce curve files in your curves directory,
95 starting from `mycurve.000` and ending in `mycurve.100` and you
96 want to analyze them all.
98 You then can `cd` (change directory) to the directory::
102 Type `pwd` (print working directory) to check the directory is correct.::
107 You can list the files in the directory using `ls` or `dir` (they’re
111 [’mycurve.000’, ’mycurve.001’, ...
114 Now you are ready to generate the playlist. The command to use is
117 hooke> genlist mycurve.*
119 You can also generate a playlist containing all what you find in the
122 hooke> genlist c:\curves
124 If you want to select what curves to see, based on the filename, you
125 can use wildcards. For example::
127 hooke> genlist mycurve.05*
129 will take only curves from mycurve.050 to mycurve.059.
131 Note that by using `genlist` you just generate the playlist in the
132 local session. To save your playlist to a file for future reuse,
135 hooke> savelist mylist
137 In this example, the list will be saved in the file `mylist.hkp`.
138 Hooke will add the extension `.hkp` (Hooke playlist) to the playlist
139 if you forget to. The `.hkp` file is an XML file you can read and
140 edit with any text editor (i.e. Wordpad), if needed. If you want to
141 load it, simply issue `loadlist mylist.hkp` or `loadlist mylist`,
142 Hooke will add `.hkp` if necessary.
144 If, generating the playlist, you are including by chance a non-force
145 curve file that Hooke cannot open, Hooke will print an error and
148 Navigating the playlist
149 -----------------------
151 Now you can navigate through your playlist using the commands `next`
152 and `previous` or, their aliases `n` and `p`. You don’t need to
153 type `n` every time to run along a list of curves. If you press
154 Return to an empty prompt, Hooke will repeat the last command you
155 issued explicitly. You can also navigate through the command history
156 by using the up and down arrows. From the last curve of your
157 playlist, `n` will wrap around to the first curve. Analogously,
158 issuing `p` at the first curve will jump to the last.
160 You can also jump to a given curve::
162 hooke> jump c:\curves\mycurve.012
164 where the path can be either an absolute path, or a path relative to
165 the directory holding the playlist file.
170 You can take notes about the curves you are looking at. Just type
171 `note` followed by the text you want to append to that curve. Hooke
172 will save the text in your current playlist and in an external log
173 file. The output will look like this:
175 Notes taken at Sun Sep 17 20:42:07 2006
176 /home/cyclopia/work/tris/20060620a.041 | This is a note
177 /home/cyclopia/work/tris/20060620a.207 | This is another note
178 /home/cyclopia/work/tris/20060620a.286 | This is a third one
180 The log file name can be configured_, but it defaults to hooke.log.
182 .. _configured: config.txt
184 Usually curves you annotated are useful later. You can copy the curves
185 you annotated to a different directory by using the `copylog`
188 hooke> copylog c:\nicecurves
190 will copy all curves you have annotated to the c:\nicecurves
191 directory. Make sure that the directory already exists before doing
192 that. TODO: replace with::
194 hooke> copylist --log c:\curves\nice.hkp
199 You can export Hooke curves as images and as text columns. To export
200 as images, issue the `export` command followed by the filename.
201 Supported formats are PNG (raster) and EPS (Encapsulated Postscript,
202 vectorial). The export format is determined by the filename
203 extension, so `export foo.png` and `export foo.eps` will save
204 PNG and EPS files respectively.
206 To export as text, use the `txt` command, followed by the
207 filename. The output is a text file containing columns (first two are
208 X and Y of extension, second two are X and Y of retraction).
210 TODO: multiple cycles? Solution: blank lines for "breaks", add option
211 to extract specific sections using Python's slice notation.
214 Interacting with the plot
215 -------------------------
217 (no plots in command line mode...)
219 Measuring distances and forces
220 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
222 You can easily zoom in the plot by dragging a rectangle on it with the
223 left mouse button. To zoom out, click the right mouse
224 button. Sometimes by zooming in and out too much, you can lose the
225 picture (this is probably a small bug in Matplotlib). Just type
226 `plot` at the command line and the curve will be refreshed.
228 You can measure distances and forces directly in the plot. Just issue
229 the command `distance`. You will be asked to click two points.
230 When you click a point, a blue dot should appear. When you click the
231 second point, the distances (in nanometers and piconewtons) will
232 appear on the command line. You can use `delta` if you prefer,
233 which gives meaningful values for every kind of graph (not only force
234 curves). If you want to know the coordinates of a single point, use
237 Hooke automatically adjusts the position of the clicked point to the
238 nearest point in the graph, so you will be always measuring distances
239 and forces between points in the graph.
241 The commands `force` and `distance` are present in the
242 `generalvclamp` plugin.
244 Worm like chain and freely jointed chain fitting
245 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
247 You can measure by hand the parameters relative to a force peak using
248 a worm-like chain fitting with the `fit` command. The command by
249 default automatically finds the contact point, asks for two points
250 delimiting the portion to fit, and performs a two-variable fit, with
251 contour length, persistence length, and their relative errors as
252 output. If desired, one can use the `noauto` option to manually
253 click the contact point, and/or the `pl=NUMBER` options to impose a
254 specific persistence or Kuhn length (in nanometers). You can choose
255 which model to use with `set fit_function wlc` or `set fit_function
256 fjc`. See the help of the `fit` command from the Hooke
257 command line for details.
259 Multiple curve fitting and measuring
260 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
262 You can cycle through all your current playlist obtaining WLC fit, FJC
263 fit, rupture force and slope (loading rate) information from each
264 curve using the `multifit` command. The collected data can be saved
265 in a text file for further analysis in your favourite spreadsheet or
266 statistical program. If you want to check your parameters on the
267 current curve before fitting all the files in your playlist, use
268 `multifit justone`. See the `multifit` help for more options.
270 Fast curve reviewing and saving
271 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273 When automatic routines are not good enough to filter your data, use
274 `review` command to cycle through your playlist presenting ten
275 curves in the same graph. You can then enter the numbers of the
276 interesting curves and automatically save a copy of them into another
282 You can set environment variables to influence the behaviour of
283 Hooke. The command to use is `set`.
285 You can alter permanently the behaviour of Hooke by setting these
286 variables in a Hooke configuration file. See the `Configuring Hooke`_
289 .. _Configuring Hooke: config.txt