mkogg.py: Fix 'self.get_mp4_metadata(self, source)'
[blog.git] / posts / Comparing_velocity_clamp_experiments.mdwn_itex
1 I've been spending some time comparing my [[force spectroscopy]] data
2 with Marisa's, and the main problem has been normalizing the data
3 collected using different systems.  Marisa runs experiments using some
4 home-grown [LabVIEW][] software, which saves the data in [[IGOR binary
5 wave (IBW)|igor]] files.  From my point of view, this is not the best
6 approach, but it has been stable over the time we've been running
7 experiments.
8
9 I run my own experiments using my own code based on [[pyafm]], saving
10 the data in [[HDF5]] files.  I think this approach is much stronger,
11 but it has been a bit of a moving target, and I've spent a good deal
12 of my time working on the framework instead of running experiments.
13
14 Both approaches save the digitized voltages that we read/write during
15 an experiment, but other constants and calibration terms are not
16 always recorded.  My [[pyafm]]-based software has been gradually
17 getting better in this regard, especially since I moved to
18 [[h5config]]-based initialization.  Anyhow, here's a quick runthough
19 of all the important terms.
20
21 For the [TL;DR][tldr] crowd, [[crunch.py]] is my [[Python]] module
22 that crunches your input and prints out all the intermediate constants
23 discussed below.  To use it on your own data, you'll probably have to
24 tweak the bits that read in the data to use your own format.
25
26 <a id="piezo"></a>
27
28 Calibrating the piezo
29 =====================
30
31 <a id="grid"></a>
32
33 Calibration grid
34 ----------------
35
36 We control the surface-tip distance by [[driving a piezo
37 tube|pypiezo]].  We want to know the correspondence between the
38 driving voltage and the piezo position, so we calibrate the piezo by
39 imaging a sample with square pits of a known depth.
40
41 [[!img piezo-good.png
42   alt="Piezo calibration trace"
43   title="Piezo calibration trace"]]
44
45 In this trace, I swept the $x$ position across most of the range of my
46 16-bit DAC.  For each $x$ position, I adjusted the $z$ position until
47 the measured cantilever deflection $d$ crossed a setpoint.  This gives
48 the $z$ voltage required to reach the surface as a function of $x$.
49 You can see the 200 nm deep square pits, as well as a reasonable
50 amount of $x$/$z$ crosstalk.
51
52 Sometimes grid calibrations are even less convincing than the example
53 shown above.  For example, I have traces with odd shoulders on the
54 sides of the pits:
55
56 [[!img piezo.png
57   alt="Funky piezo calibration trace"
58   title="Funky piezo calibration trace"]]
59
60 This is one of the better piezo calibration images I aquired for the
61 piezo used in the pull below, so I'll use numbers from the funky
62 imaging for the remainder of this analysis.  This piezo has
63 less $x$/$y$ range than the one used to measure the first calibration
64 trace, which is why I was unable to aquire a full pit (or pits).
65
66 The calibration constant $\alpha_z$ is the number of $z$ bits per
67 depth meter:
68
69 <a id="eq:alpha_z"></a>
70
71 \[
72   \alpha_z = \frac{\text{grid piezo bits}}{\text{grid depth}}
73     = \frac{2779\pm87\text{ bits}}{200\text{ nm}}
74     = (1.39 \pm 0.04) \cdot 10^{10} \text{ bits/m} \;.
75 \]
76
77 Related conversion factors are
78
79 <a id="eq:gamma_z"></a>
80 <a id="eq:sigma_z"></a>
81
82 \[
83 \begin{aligned}
84   \gamma_z &= \frac{\text{piezo volts}}{\text{piezo bits}}
85     = \frac{20 \text{ piezo volts}}{\text{output volts}}
86       \cdot \frac{10 \text{ output volts}}{2^{15}\text{ piezo bits}}
87     = 6.10 \cdot 10^{-3} \text{ V/bit} \\
88   \sigma_z &= \frac{\text{grid piezo volts}}{\text{grid depth}}
89     = \gamma_z \alpha_z
90     = 8.48 \cdot 10^7 \text{ V/m} \;.
91 \end{aligned}
92 \]
93
94 This is roughly in the ballpark of our piezo (serial number 2253E)
95 which is spec'd at 8.96 nm/V along the $z$ axis, which comes out
96 to $1.12\cdot10^8$ V/m.
97
98 <a id="interference"></a>
99
100 Laser interference
101 ------------------
102
103 Another way to ballpark a piezo calibration that is much closer to a
104 force spectroscopy pull is to use the laser interference pattern as a
105 standard length.  The laser for our [[microscope|MultiMode]] has a
106 wavelength of 670 nm.  We'll assume a geometric gain of
107
108 \[
109   g_\lambda
110     = \frac{\text{increased laser path}}{\text{piezo displacement}}
111     \approx 2 \;.
112 \]
113
114 Measuring the length of an interference wave in bits then gives a
115 standard equivalent to the known-depth pits of the calibration grid.
116
117 [[!img pull-interference.png
118   alt="Laser interference during a velocity-clamp pull"
119   title="Laser interference during a velocity-clamp pull"]]
120
121 \[
122 \begin{aligned}
123   \alpha_z
124     &= \frac{\text{interference piezo bits}}{\text{interference depth}}
125     = \frac{g_\lambda}{\lambda} \cdot \text{interference piezo bits} \\
126     &= \frac{2}{670\cdot10^{-9}\text{ m}} \cdot (28935 - 23721)\text{ bits}
127     = 1.56 \cdot 10^{10}\text{ bits/m} \;.
128 \end{aligned}
129 \]
130
131 The other piezo calibration parameters are found exactly as in the
132 calibration grid case.
133
134 \[
135   \sigma_z = \gamma_z \alpha_z
136     = 9.52 \cdot 10^7 \text{V/m} \;.
137 \]
138
139 which is fairly close to both the spec'd value and grid calibration
140 values.
141
142 <a id="photodiode"></a>
143
144 Calibrating the photodiode
145 ==========================
146
147 During experiments, we measure cantilever deflection via the top and
148 bottom segments of a photodiode.  We need to convert this deflection
149 voltage into a deflection distance, so we'll use the
150 already-calibrated piezo.  When the tip is in contact with the
151 surface, we can move the surface a known distance (using the piezo)
152 and record the change in deflection.
153
154 [[!img bump.png
155   alt="Surface bump for photodiode sensitivity"
156   title="Surface bump for photodiode sensitivity"]]
157
158 The calibration constant $\alpha_d$ is the number of diode bits per
159 piezo bit.
160
161 <a id="eq:alpha_d"></a>
162
163 \[
164   \alpha_d = \frac{\text{bump diode bits}}{\text{bump piezo bits}}
165     = 2.24 \text{ diode bits/piezo bits} \;.
166 \]
167
168 Related conversion factors are
169
170 <a id="eq:gamma_d"></a>
171 <a id="eq:sigma_d"></a>
172
173 \[
174 \begin{aligned}
175   \gamma_d &= \frac{\text{diode volts}}{\text{diode bits}}
176    = \frac{10 \text{ input volts}}{2^{15}\text{ diode bits}}
177    \cdot \frac{\text{diode volts}}{1 \text{input volts}}
178    = 3.05 \cdot 10^{-4} \text{ V/bit} \\
179  \sigma_d &= \frac{\text{bump diode volts}}{\text{bump tip position}}
180    = \gamma_d \alpha_d \alpha_z
181    = 9.52 \cdot 10^6 \text{ V/m} \;.
182 \end{aligned}
183 \]
184
185 <a id="vibration"></a>
186
187 Calibrating the cantilever spring constant
188 ==========================================
189
190 To convert cantilever tip deflection to force, we need to know the
191 spring constant of the cantilever.  After bumping the surface, we move
192 away from the surface and measure the cantilever's thermal vibration.
193 We use the vibration data to calculate the spring constant [[using the
194 equipartition theorem|calibcant]].
195
196 [[!img vibration.png
197   alt="Thermal vibration measurement"
198   title="Thermal vibration measurement"]]
199
200 The deflection variance $\langle d^2 \rangle$ is measured in frequency
201 space, where the power spectral density (PSD) is fitted to the
202 [[expected PSD of a damped harmonic oscillator|thesis]].
203
204 \[
205 \begin{aligned}
206   PSD_f &= \frac{G_{1f}}{(f_0^2 - f^2)^2 + \beta_f^2 f^2} \\
207         \langle d^2 \rangle &= \frac{\pi G_{1f}}{2\beta_f f_0^2} \\
208   \kappa &= \frac{2\beta_f f_0^2}{\pi G_{1f}}(\alpha_d\alpha_z)^2 k_B T
209    = \frac{2 \cdot (4.17 \cdot 10^3\text{ Hz})
210            \cdot (8.14 \cdot 10^3\text{ Hz})^2}
211           {\pi \cdot 3.10 \cdot 10^{13}\text{ bit}^2 \cdot\text{ Hz}^3}
212    \cdot (2.24 \cdot 1.39 \cdot 10^{10}\text{bit/m})^2
213    \cdot (1.38 \cdot 10^{-23}\text{ J/K}) \cdot (294 \text{K})
214    = 22.4 \cdot 10^{-3}\text{ N/m}
215 \end{aligned}
216 \]
217
218 <a id="pull"></a>
219
220 Analyzing a velocity-clamp pull
221 ===============================
222
223 The raw data from a [[velocity-clamp pull|Force_spectroscopy]] is an
224 array of output voltages used to sweep the piezo (moving the surface
225 away from the cantilever tip) and an array of input voltages from the
226 photodiode (measuring cantilever deflection).  There are a number of
227 interesting questions you can ask about such data, so I'll break this
228 up into a few steps.  Lets call the raw piezo data (in
229 bits) $\alpha_v$, with the contact-kink located at $\alpha_{v0}$.
230 Call the raw deflection data (also in bits) $\alpha_{F}$, with the
231 contact-kink located at $\alpha_{F0}$.
232
233 Piezo displacement
234 ------------------
235
236 Using the [piezo calibration parameters](#piezo), we can calculate the
237 raw piezo position using
238
239 \[
240   z_\text{piezo} = \frac{\alpha_v - \alpha_{v0}}{\alpha_z} \;,
241 \]
242
243 measured in meters.
244
245 Surface contact region
246 ----------------------
247
248 During the initial portion of a velocity clamp pull, the cantilever
249 tip is still in contact with the surface.  This allows you to repeat
250 the [photodiode calibration](#photodiode), avoiding problems due to
251 drift in laser alignment or other geometric issues.  This gives a new
252 set of diode calibration parameters $\alpha_d'$ and $\sigma_d'$ (it is
253 unlikely that $\gamma_d$ has changed, but it's easy to rework the
254 following arguments to include $\gamma_d'$ if you feel that it might
255 have changed).
256
257 Tension
258 -------
259
260 We can use the new photodiode calibration and the [cantilever's spring
261 constant](#vibration) to calculate the force from the Hookean
262 cantilever:
263
264 \[
265   F = \frac{\alpha_F - \alpha_{F0}}{\alpha_d' \alpha_z}\cdot\kappa
266     = (\alpha_F - \alpha_{F0})
267       \cdot\frac{2\beta_f f_0^2}{\pi G_{1f}}
268       \cdot\frac{\alpha_d^2\alpha_z}{\alpha_d'}
269       \cdot k_B T \;.
270 \]
271
272 [[!img pull-piezo.png
273   alt="Tension vs. piezo extension during a velocity-clamp pull"
274   title="Tension vs. piezo extension during a velocity-clamp pull"]]
275
276 Protein extension
277 -----------------
278
279 As the piezo pulls on the cantilever/protein system, some of the
280 increased extension is due to protein extension and the rest is due to
281 cantilever extension.  We can use Hooke's law to remove the cantilever
282 extension, leaving only protein extension:
283
284 \[
285   z_\text{protein} = z_\text{piezo} - \frac{F}{\kappa}
286     = \frac{1}{\alpha_z}
287       \left(\alpha_v - \alpha_{v0} - \frac{\alpha_F - \alpha_{F0}}{\alpha_d'}
288       \right)
289 \]
290
291 [[!img pull-protein.png
292   alt="Tension vs. protein extension during a velocity-clamp pull"
293   title="Tension vs. protein extension during a velocity-clamp pull"]]
294
295 Contour-space
296 -------------
297
298 In order to confirm the piezo calibration, we look at changes in the
299 unfolded contour length due to domain unfolding ($\Delta L$).  There
300 have been a number of studies of [[titin I27|I27-synthesis]], starting
301 with [Carrion-Vazquez et al.][carrionvazquez99], that show an contour
302 length increase of 28.1 ± 0.17 nm.  Rather than fitting each loading
303 region with a worm-like chain (WLC) or other polymer model, it is
304 easier to calculate $\Delta L$ by converting the abscissa to
305 contour-length space (following [Puchner et al.][puchner08]).  While
306 the WLC is commonly used, Puchner gets better fits using the [[freely
307 rotating chain (FRC)|FRC]] model.
308
309 In [[crunch.py]], I use either [Bustamante's formula][bustamante94]
310 (WLC) or [Livadaru's equation 49][livadaru03] (FRC) to calculate the
311 contour length of a particular force/distance pair.
312
313 [[!img pull-contour-space.png
314   alt="Tension vs. unfolded contour length during a velocity-clamp pull"
315   title="Tension vs. unfolded contour length during a velocity-clamp pull"]]
316
317 As you can see from the figure, my curves are spaced a bit too far
318 appart.  Because the contour length depends $F$ as well
319 as $z_\text{protein}$, it depends on the cantilever calibration
320 (via $\beta_f$, $f_0$, $G_{1f}$ and $\alpha_d$) as well as the piezo
321 calibration (via $\alpha_z$).  This makes adjusting calibration
322 parameters in an attempt to match your $\Delta L$ with previously
323 determined values a bit awkward.  However, it is likely that my
324 cantilever calibration is too blame.  If we use the value of $\alpha_z$
325 from the interference measurement we get
326
327 [[!img pull-contour-space-interference.png
328   alt="Tension vs. unfolded contour length during a velocity-clamp pull,
329        using laser-interference to calibrate the piezo"
330   title="Tension vs. unfolded contour length during a velocity-clamp pull,
331        using laser-interference to calibrate the piezo"]]
332
333 Which is still a bit too wide, but is much closer.
334
335 [LabVIEW]: http://www.ni.com/labview/
336 [tldr]: http://en.wiktionary.org/wiki/TL;DR
337 [livadaru03]: http://dx.doi.org/10.1021/ma020751g
338 [carrionvazquez99]: http://dx.doi.org/10.1073/pnas.96.20.11288
339 [puchner08]: http://dx.doi.org/10.1529/biophysj.108.129999
340 [bustamante94]: http://dx.doi.org/10.1126/science.8079175
341
342 [[!tag tags/theory]]