Remove trailing blank lines from vclamp_picoforce/README
[hooke.git] / doc / tutorial.txt
index 89a1919a1e09ddcb7b21aca2ad2a37f047ac75c4..be41a0dfc6fd503cbc566a65a2d29df7b74880c0 100644 (file)
@@ -252,10 +252,12 @@ respectively.
 
 If you don't want the entire block, try the ``cut`` command.
 
-Interacting with the plot
--------------------------
+Analysis
+--------
 
-(no plots in command line mode...)
+The commands we have covered so far allow basic bookkeeping.  The
+point of Hooke, though, is to allow you to easily analyze force
+spectroscopy data.  We cover those analysis commands in this section.
 
 Measuring distances and forces
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -282,42 +284,87 @@ two ways around this are:
 Worm like chain and freely jointed chain fitting
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-.. todo:: Update WLC fitting tutorial section.
-
-You can measure by hand the parameters relative to a force peak using
-a worm-like chain fitting with the ``fit`` command.  The command by
-default automatically finds the contact point, asks for two points
-delimiting the portion to fit, and performs a two-variable fit, with
-contour length, persistence length, and their relative errors as
-output.  If desired, one can use the ``noauto`` option to manually
-click the contact point, and/or the ``pl=NUMBER`` options to impose a
-specific persistence or Kuhn length (in nanometers).  You can choose
-which model to use with ``set fit_function wlc`` or ``set fit_function
-fjc``.  See the help of the ``fit`` command from the Hooke command
-line for details.
-
-Multiple curve fitting and measuring
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. todo:: Update multiple curve fitting tutorial section.
-
-You can cycle through all your current playlist obtaining WLC fit, FJC
-fit, rupture force and slope (loading rate) information from each
-curve using the ``multifit`` command.  The collected data can be saved
-in a text file for further analysis in your favourite spreadsheet or
-statistical program.  If you want to check your parameters on the
-current curve before fitting all the files in your playlist, use
-``multifit justone``.  See the ``multifit`` help for more options.
-
-Fast curve reviewing and saving
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-.. todo:: Update curve review tutorial section.
-
-When automatic routines are not good enough to filter your data, use
-``review`` command to cycle through your playlist presenting ten
-curves in the same graph.  You can then enter the numbers of the
-interesting curves and automatically save a copy of them into another
-directory.
+Polymer model fitting is a complicated beast.  To correctly fit your
+chosen model (WLC, FJC, etc.), you need to execute a multi-step
+analysis.  Hooke provides a flexible chain of curve analyisis commands
+that create new data columns (e.g. `deflection (N)`) or store
+information in a curve's `info` dictionary (e.g. `flat filter peaks`).
+You can, if necessary, adjust the names of input and output columns
+and `info` values to combine the available commands in new and useful
+ways.::
+
+    hooke> zero_surface_contact_point --block retract
+    hooke> flat_filter_peaks --block retract --min_points 1
+    hooke> zero_surface_contact_point --block retract
+    ...        --ignore_after_last_peak_info_name 'flat filter peaks'
+    hooke> convert_distance_to_force --block retract
+    ...        --deflection_column 'surface deflection (m)'
+    hooke> remove_cantilever_from_extension --block retract
+    hooke> flat_peaks_to_polymer_peaks --block retract
+    hooke> polymer_fit_peaks --block retract
+    hooke> export_block --block retract --output myblock.dat
+
+See each command's `Help`_ for details.
+
+Command stacks
+~~~~~~~~~~~~~~
+
+Since you are likely to apply similar analysis to several curves,
+Hooke provides :mod:`command stacks <hooke.command_stack>` for
+bundling groups of commands.::
+
+    hooke> start_command_capture
+    hooke> zero_surface_contact_point --block retract
+    hooke> flat_filter_peaks --block retract --min_points 1
+    ...
+    hooke> stop_command_capture
+
+You can check the state of the command stack with
+``get_command_stack`` and the state of capture with
+``get_command_capture_state``.  If you make mistakes, you can pop
+commands from the stack with ``pop_command_from_stack``.  If you stop
+capturing a command stack (e.g. to test a complicated command before
+continuing), you can continue adding to the same stack with
+``restart_command_capture.``
+
+To execute a command stack, run::
+
+    hooke> execute_command_stack
+
+To execute a command stack on every curve in a playlist, run::
+
+    hooke> apply_command_stack_to_playlist
+
+If you decide that there are commands in a curve's stack that you
+don't want, you can clear the stack with::
+
+    hooke> clear_curve_command_stack
+
+You can also save command stacks to disk (and reload them later,
+potentially in a different Hooke session).::
+
+    hooke> save_command_stack --output my_stack
+    hooke> load_command_stack --input my_stack
+
+Multiple curve analysis
+~~~~~~~~~~~~~~~~~~~~~~~
+
+You can analyze multiple curves by combining `Worm like chain and
+freely jointed chain fitting`_ and `Command stacks`_.::
+
+    hooke> start_command_capture
+    hooke> zero_surface_contact_point --block retract
+    hooke> flat_filter_peaks --block retract --min_points 1
+    hooke> zero_surface_contact_point --block retract
+    ...        --ignore_after_last_peak_info_name 'flat filter peaks'
+    hooke> convert_distance_to_force --block retract
+    ...        --deflection_column 'surface deflection (m)'
+    hooke> remove_cantilever_from_extension --block retract
+    hooke> flat_peaks_to_polymer_peaks --block retract
+    hooke> polymer_fit_peaks --block retract
+    hooke> export_block --block retract --output myblock.dat
+    hooke> stop_command_capture
+    hooke> apply_command_stack_to_playlist
 
 Configuring Hooke
 -----------------