eed629a676202583ea98fb3354c9114f49d6b9b0
[hooke.git] / doc / USAGE
1 Starting Hooke
2 ==============
3
4 Open a terminal, go to the directory Hooke is installed and type
5   python bin/hooke
6 (You may need to give the full path for Python on Windows systems).
7 If everything is OK, Hooke displays a nice splashscreen and starts.
8
9 Once Hooke is launched from the terminal window, you see a text like
10 the following:
11
12   Starting Hooke.
13   Imported plugin fit
14   Imported plugin procplots
15   Imported plugin flatfilts
16   Imported plugin generalclamp
17   Imported plugin generalvclamp
18   Imported plugin massanalysis
19   Imported plugin macro
20   Imported driver picoforce
21   Imported driver hemingclamp
22   Imported driver csvdriver
23   Imported driver tutorialdriver
24   
25   Warning: Invalid work directory.
26   This is Hooke, version 0.8.0 Seinei
27   (c) Massimo Sandal, 2006.
28   Released under the GNU General Public License Version 2.
29   Hooke is Free software.
30   ----
31   hooke:
32
33 Hooke tells you that plugins and drivers have been loaded, and now
34 you’re ready to go. You’re now at the Hooke command line. In the
35 meantime, a splashscreen and a window with a dummy force curve should
36 appear . At the command line, type "help" or "?" to obtain a list of
37 available commands.
38
39 hooke: ?
40 Documented commands (type help <topic>):
41 ========================================
42 addtolist debug        exit     genlist  ls   notelog previous  set
43 cd         derivplot export     getlist  n    p       printlist size
44 contact    dir        flatfilt jump      next plateau pwd       subtplot
45 current    distance    force    loadlist note plot    savelist  wlc
46 Undocumented commands:
47 ======================
48 help
49
50 hooke:
51
52
53 Begin your analysis
54 ===================
55
56 Create a playlist
57 -----------------
58
59 To start analyzing your curves, you first have to build a playlist. The
60 playlist is just an index of the force curve files you want to
61 analyze. Imagine it as a music playlist (that’s why it is called a
62 playlist), but made of data files instead of MP3s (or FLACs :p).
63
64 Suppose you have 100 PicoForce curve files in your curves directory,
65 starting from mycurve.000 and ending in mycurve.100 and you want to
66 analyze them all.
67
68 You then can cd to the directory
69
70   hooke: cd c:\curves
71
72 Type pwd to check the directory is correct
73
74   hooke: pwd
75   c:\curves
76   hooke:
77
78 You can list the files in the directory using ls or dir (they’re synonims)
79
80   hooke: ls
81   [’mycurve.000’, ’mycurve.001’, ...]
82
83 Now you are ready to generate the playlist. The command to use is genlist
84
85   hooke: genlist mycurve.*
86
87 You can also generate a playlist containing all what you find in the
88 directory by typing:
89
90   hooke: genlist c:\curves
91
92 If you want to select what curves to see, based on the filename, you
93 can use wildcards.
94
95   For example:
96
97   hooke: genlist mycurve.05*
98
99 will take only curves from mycurve.050 to mycurve.059.
100
101 Saving and loading playlists
102 ----------------------------
103
104 Note that by using genlist you just generate the playlist in the local
105 session. To save your playlist to a file, thus avoiding to regenerate
106 it, type:
107
108   hooke: savelist mylist
109
110 The list will be saved, in this example, in the file mylist.hkp. Hooke
111 will add the extension .hkp to the playlist if you forget to. The .hkp
112 file is an XML file you can read and edit with any text editor
113 (i.e. Wordpad), if needed. If you want to load it, just issue loadlist
114 mylist.hkp or loadlist mylist, Hooke will handle the missing .hkp
115 extension. This will load the saved playlist, as if you just generated
116 it.
117
118 Generating the playlist, you should see the plot of the first curve
119 appearing. If, generating the playlist, you are including by chance a
120 non-force curve file that Hooke cannot open, it should be (more or
121 less) silently ignored. If it gives some error, or it does not plot
122 anything, try to navigate forward, and see if the next curve is
123 plotted; it is possible you spotted a corrupted file.  Navigate the
124 playlist
125
126 Navigating playlists
127 --------------------
128
129 Now you can navigate through your playlist using the command next and
130 previous or, more easily, their aliases n and p. You don’t need to
131 type n every time to run along a list of curves. If you press Return
132 to an empty prompt, Hooke will repeat the last command you issued
133 explicitly.
134
135 You can also navigate through the command history by using the up and
136 down arrows.
137
138 When arriving to the last curve of your playlist, pressing n will just
139 come back to the first. Analogously, pressing p when at the first
140 curve will jump to the last.
141
142 You can also jump to a given curve, this way:
143
144   hooke: jump c:\curves\mycurve.123
145
146 but be careful to tell Hooke the full path to that curve, otherwise it
147 will not find it.
148
149
150 Taking notes
151 ============
152
153 You can take notes about the curves you are looking at. Just type note
154 followed by the text you want to append to that curve. Hooke will save
155 the text in your current playlis and in an external log file. The
156 output will look like this:
157
158   Notes taken at Sun Sep 17 20:42:07 2006
159   /home/cyclopia/work/tris/20060620a.041 |             This is a note
160   /home/cyclopia/work/tris/20060620a.207 |             This is another note
161   /home/cyclopia/work/tris/20060620a.286 |             This is a third one
162
163 The first time you type note in a session, Hooke will ask you for a
164 filename of the log.
165
166 Usually curves you annotated are useful later. You can copy the curves
167 you annotated in a different directory by using the copylog command,
168
169   hooke: copylog c:\nicecurves
170
171 which will copy all curves you have annotated in the c:\nicecurves
172 directory. Take care that the directory already exists before doing
173 that.
174
175
176 Exporting curves
177 ================
178
179 You can export Hooke curves as images and as text columns. To export
180 as images, issue the export command followed by the
181 filename. Supported formats are PNG (raster) and EPS (Encapsulated
182 Postscript, vector). The export format is determined by the filename
183 extension, so export foo.png and export foo.eps will save a PNG and
184 EPS file respectively.
185
186 To export as text, use the txt command, followed by the filename. The
187 output is a text file containing columns (first two are X and Y of
188 extension, last two are X and Y of retraction).
189
190
191 Interacting with the plot
192 =========================
193
194 Measuring distances and forces
195 ------------------------------
196
197 You can easily zoom in the plot by dragging a rectangle on it with the
198 left mouse button. To zoom out, click the right mouse
199 button. Sometimes by zooming in and out too much, you can lose the
200 picture (this is probably a small bug in Matplotlib). Just type plot
201 at the command line and the curve will be refreshed.
202
203 You can measure distances and forces directly in the plot. Just issue
204 the command distance. You will be asked to click two points: do
205 it. When you click a point, a blue dot should appear. When you click
206 the second point, the distance (in nanometers) will apper on the
207 command line. force works in the same way. You can use delta if you
208 prefer, which gives meaningful values for every kind of graph (not
209 only force curves). If you want to know the coordinates of a single
210 point, use point.
211
212 Hooke automatically adjusts the position of the clicked point at the
213 nearest point in the graph, so you will be always measuring distances
214 and forces between points in the graph.
215
216 The commands force and distance are present in the generalvclamp.py
217 plugin.
218
219 Worm like chain fitting
220 -----------------------
221
222 You can measure by hand the parameters relative to a force peak using
223 a worm-like chain fitting with the wlc command. The command by default
224 automatically finds the contact point, asks for two points delimiting
225 the portion to fit, and performs a two-variable fit, with contour
226 length and persistence length as output, with relative errors. If
227 desired, one can use the noauto option to manually click the contact
228 point, and/or the pl=[number] options to impose a specific persistence
229 length (in nanometers). Please see the help of the wlc command from
230 the Hooke command line for details.
231
232 Variables
233 ---------
234
235 You can set environment variables to influence the behaviour of
236 Hooke. The command to use is set.
237
238 You can alter permanently the behaviour of Hooke by setting these
239 variables in the file conf/hooke.conf. This is a very simple XML file,
240 just change the values of the variables with an ASCII text editor (not
241 Word or a word processor - on Windows, Wordpad should work). Be
242 careful with the correct XML syntax (which you should grasp very
243 easily looking at the default configuration file) otherwise Hooke will
244 crash on the next startup.
245
246 See VariableList for help on individual variables.