tags/programmingunfolding disastershttp://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/unfolding disastersikiwiki2011-12-02T01:43:14Zmailcaphttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/mailcap/2011-12-02T01:43:14Z2011-12-02T01:43:14Z
<p>Mailcap files, defined in <a href="http://tools.ietf.org/html/rfc1524">RFC 1524</a>, allow you to tell you
mail clients, web browsers, and other programs how you want to view
and edit various MIME types. Since interaction with your mailcap
files often occurs deep within the bowels of your program, I've
written up a very simple <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Python/">Python</a> script to test your mailcap
entries: <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/mailcap/mailcap-test.py">mailcap-test.py</a>. Enjoy!</p>
cookbookhttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/cookbook/2011-08-05T17:59:01Z2011-08-05T17:59:01Z
<p><span class="infobox">
Available in a <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../git/">git</a> repository.<br />
Repository: <a href="http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=cookbook.git" rel="vcs-git" title="cookbook repository">cookbook</a><br />
Author: W. Trevor King<br />
</span></p>
<p>I've been running a home-rolled recipe webapp for a year now, and it
worked fairly well in a bare-bones sort of way. However, I recently
had to make some changes to my personal website (since EveryDNS and
aparently most other free DNS providers were bought by Dyn), which
prompted me to translate <code>cookbook</code> into a <a href="https://www.djangoproject.com/">Django</a> app. Thanks to
the wonders of Django, <a href="https://github.com/sehmaschine/django-grappelli">Grappelli</a>, and <a href="https://github.com/alex/django-taggit">django-taggit</a>, the code
is now leaner, meaner, and prettier!</p>
<p>See the <a href="http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=cookbook.git;a=blob;f=README;hb=HEAD">README</a> for details. </p>
h5confighttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/h5config/2011-07-28T16:25:06Z2011-07-28T16:25:06Z
<p><span class="infobox">
Available in a <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../git/">git</a> repository.<br />
Repository: <a href="http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=h5config.git" rel="vcs-git" title="h5config repository">h5config</a><br />
Author: W. Trevor King<br />
</span></p>
<p>Since the number of packages mooching off <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/pypiezo/">pypiezo</a>'s configuration
scheme was growing, I've split it out into it's own package. Now
there's a general package for all your <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/HDF5/">HDF5</a>-based configuration
needs.</p>
<p>The <code>README</code> is posted on the <a href="http://pypi.python.org/pypi/h5config/">PyPI page</a>.</p>
pypidhttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/pypid/2011-07-27T16:06:19Z2011-07-27T16:06:19Z
<p><span class="infobox">
Available in a <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../git/">git</a> repository.<br />
Repository: <a href="http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=pypid.git" rel="vcs-git" title="pypid repository">pypid</a><br />
Author: W. Trevor King<br />
</span></p>
<p>I've just finished rewriting my <a href="http://en.wikipedia.org/wiki/PID_controller">PID</a> temperature control package in
pure-Python, and it's now clean enough to go up on PyPI. Features:</p>
<ul>
<li>Backend-agnostic architecture. I've written a first-order process
with dead time (FOPDT) test backend and a <a href="http://code.google.com/p/pymodbus/">pymodbus</a>-based backend
for our Melcor MTCA controller, but it should be easy to plug in
your own custom backend.</li>
<li>The general PID controller will automatically tune your backend
using any of a variety of tuning rules.</li>
</ul>
<p>The <code>README</code> is posted on the <a href="http://pypi.python.org/pypi/pypid/">PyPI page</a>.</p>
insiderhttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/insider/2011-07-21T22:35:46Z2011-07-21T22:30:33Z
<p><span class="infobox">
Available in a <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../git/">git</a> repository.<br />
Repository: <a href="http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=insider.git" rel="vcs-git" title="insider repository">insider</a><br />
Author: W. Trevor King<br />
</span></p>
<p>Insider is a little <a href="https://www.djangoproject.com/">Django</a> app I wrote to help my brother,
Garrett, track insider trading with a simple, familiar web interface.
It's a pretty simple app, partly thanks to Bradley Ayers'
<a href="https://github.com/bradleyayers/django-tables2/">django-tables2</a>, which does the table formatting. Just goes to
show that a good scripting language and framework make developing
simple apps a breeze!</p>
<p>The <code>README</code> is posted on the <a href="http://pypi.python.org/pypi/insider/">PyPI page</a>.</p>
Open source force spectroscopyhttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/Open_source_force_spectroscopy/2011-05-11T20:58:36Z2011-04-23T19:00:17Z
<p>There are a number of open source packages dealing with aspects of
<a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Force_spectroscopy/">single-molecule force spectroscopy</a>. Here's a
list of everything I've heard about to date.</p>
<table>
<thead>
<tr><th>Package</th><th>License</th><th>Purpose</th></tr>
</thead>
<tbody>
<tr><td>calibcant</td><td>GPL v3+</td>
<td>Cantilever thermal calibration</td></tr>
<tr><td>fs_kit</td><td>GPL v2+</td>
<td>Force spectra analysis pattern recognition</td></tr>
<tr><td>Hooke</td><td>LGPL v3+</td>
<td>Force spectra analysis and unfolding force extraction</td></tr>
<tr><td>sawsim</td><td>GPL v3+</td>
<td>Monte Carlo unfolding/refolding simulation and fitting</td></tr>
<tr><td>refolding</td><td>Apache v2.0</td>
<td>Double-pulse experiment control and analysis</td></tr>
</tbody>
</table>
<h1>calibcant</h1>
<p><a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/calibcant/">Calibcant</a> is my <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Python/">Python</a> module for AFM cantilever calibration
via the thermal tune method. It's based on <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Comedi/">Comedi</a>, so it needs
work if you want to use it on a non-Linux system. If you're running a
Linux kernel, it should be pretty easy to get it running on your
system. Email me if there's any way I can help set it up for your
lab.</p>
<h1>fs_kit</h1>
<p><a href="http://fskit.blogspot.com/">fs_kit</a> is a package for force spectra analysis pattern
recognition. It was developed by Michael Kuhn and Maurice Hubain at
Daniel Müller's lab when they were at TU Dresden
(<a href="http://dx.doi.org/10.1111/j.1365-2818.2005.01478.x">paper</a>). It has an <span class="createlink">Igor</span> interface, but the bulk
of the project is in <span class="createlink">C++</span> with a <a href="http://www.wxwidgets.org/">wxWidgets</a> interface. fs_kit
is versioned in CVS at <code>bioinformatics.org</code>, and you can check out
their code with:</p>
<pre><code>$ cvs -d:pserver:anonymous@bioinformatics.org:/cvsroot checkout fskit
</code></pre>
<p>The last commit was on 2005/05/16, so it's a bit crusty. I patched
things up back in 2008 so it would compile again,</p>
<p>
<a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Open_source_force_spectroscopy/0001-Added-math.h-include-to-fs_align_histogram2d.h.patch">0001-Added-math.h-include-to-fs align histogram2d.h.patch</a><br />
<i>
Posted <span class="date">Sat Apr 23 15:00:17 2011</span>
</i>
</p>
<p>
<a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Open_source_force_spectroscopy/0002-changed-abs-double-to-fabs-double-in-fs_fit_spectr.patch">0002-changed-abs-double-to-fabs-double-in-fs fit spectr.patch</a><br />
<i>
Posted <span class="date">Sat Apr 23 15:00:17 2011</span>
</i>
</p>
<p>
<a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Open_source_force_spectroscopy/0003-Updated-wxWindows-code-to-compile-on-wx-2.8.patch">0003-Updated-wxWindows-code-to-compile-on-wx-2.8.patch</a><br />
<i>
Posted <span class="date">Sat Apr 23 15:00:17 2011</span>
</i>
</p>
<p>
<a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Open_source_force_spectroscopy/0004-Added-wxglade-entry-to-Makefile-for-regenerating-aut.patch">0004-Added-wxglade-entry-to-Makefile-for-regenerating-aut.patch</a><br />
<i>
Posted <span class="date">Sat Apr 23 15:00:17 2011</span>
</i>
</p>
<p>but when I emailed Michael with the patches I got this:</p>
<pre><code>On Thu, Oct 23, 2008 at 11:21:42PM +0200, Michael Kuhn wrote:
> Hi Trevor,
>
> I'm glad you could fix fs-kit, the project is otherwise pretty dead,
> as was the link. I found an old file which should be the tutorial,
> hopefully in the latest version. The PDF is probably lost.
>
> bw, Michael
</code></pre>
<p>So, it's a bit of a fixer-upper, but it was the first open source
package in this field that I know of. I've put up a <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Open_source_force_spectroscopy/fs_kit_tutorial.pdf">PDF
version</a> of the tutorial Michael sent me in case
you're interested.</p>
<h1>Hooke</h1>
<p><a href="http://code.google.com/p/hooke/">Hooke</a> is a force spectroscopy data analysis package written in
<a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Python/">Python</a>. It was initially developed by Massimo Sandal, Fabrizio
Benedetti, Marco Brucale, Alberto Gomez-Casado while at Bruno Samorì's
lab at U Bologna (<a href="http://dx.doi.org/10.1093/bioinformatics/btp180">paper</a>; surprisingly, there are
commits by all of the authors except Samorì himself). Hooke provides
the interface between your raw data and theory. It has a drivers for
reading most force spectroscopy file formats, and a large number of
commands for manipulating and analyzing the data.</p>
<p>I liked Hooke so much I threw out my already-written package that had
been performing a similar role and proceeded to work over Hooke to
merge together the diverging command-line and GUI forks.
Unfortunately, my fork has not yet been merged back in as the main
branch, but I'm optimistic that it will eventually. The homepage for
my branch is <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Hooke/">here</a>.</p>
<h1>sawsim</h1>
<p>While programs like Hooke can extract unfolding forces from
velocity-clamp experiments, the unfolding force histograms are
generally compared to simulated data to estimate the underlying
kinetic parameters. <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/sawsim/">Sawsim</a> is my package for performing such
simulations and fitting them to the experimental histograms
(<a href="http://dx.doi.org/10.1016/j.ijbiomac.2009.12.001">paper</a>). The single-pull simulator is written in
<a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/C/">C</a>, and there is a nice <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Python/">Python</a> wrapper that manages the
thousands of simulated pulls needed to explore the possible model
parameter space. The whole package ends up being pretty fast,
flexible, and convenient.</p>
<h1>refolding</h1>
<p><a href="http://code.google.com/p/refolding/">Refolding</a> is a suite for performing and analyzing
double-pulse refolding experiments. It was initially developed by
Daniel Aioanei, also at the Samorí lab in Bologna (these guys are
great!). The experiment-driver is mostly written in <span class="createlink">Java</span> with the
analysis code in <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/Python/">Python</a>. The driver is curious; it uses the
NanoScope scripting interface to drive the experiment <em>through</em> the
NanoScope software by impersonating a mouse-wielding user (like
<a href="http://seleniumhq.org/">Selenium</a> does for web browsers). See the <code>RobotNanoDriver.java</code>
code for details.</p>
pyriskhttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/pyrisk/2011-04-19T19:30:21Z2011-04-19T19:18:29Z
<p><span class="infobox">
Available in a <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../git/">git</a> repository.<br />
Repository: <a href="http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=pyrisk.git" rel="vcs-git" title="pyrisk repository">pyrisk</a><br />
Author: W. Trevor King<br />
</span></p>
<p>Play Risk (or similar games) over email!</p>
<p>The <code>README</code> is posted on the <a href="http://pypi.python.org/pypi/PyRisk/">PyPI page</a>.</p>
pycomedihttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/pycomedi/2011-05-11T20:58:36Z2011-04-19T19:18:29Z
<p><span class="infobox">
Available in a <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../git/">git</a> repository.<br />
Repository: <a href="http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=pycomedi.git" rel="vcs-git" title="pycomedi repository">pycomedi</a><br />
Author: W. Trevor King<br />
</span></p>
<p>I was getting frustrated with <a href="http://www.comedi.org/">Comedi</a>'s <a href="http://www.swig.org/">SWIG</a> wrappers, so I
wrote a more object-oriented wrapper using <a href="http://cython.org/">Cython</a>.</p>
<p>The <code>README</code> is posted on the <a href="http://pypi.python.org/pypi/pycomedi/">PyPI page</a>.</p>
pypiezohttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/pypiezo/2011-04-19T19:18:29Z2011-04-19T19:18:29Z
<p><span class="infobox">
Available in a <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../git/">git</a> repository.<br />
Repository: <a href="http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=pypiezo.git" rel="vcs-git" title="pypiezo repository">pypiezo</a><br />
Author: W. Trevor King<br />
</span></p>
<p>This is a piezo-actuator control library based on <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/pycomedi/">pycomedi</a>. It
also contains some atomic-force-microscope-specific logic. The
higher-level library <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/pyafm/">pyafm</a> extends the AFM-control framework with
coarse positioning.</p>
<p>The <code>README</code> is posted on the <a href="http://pypi.python.org/pypi/pypiezo/">PyPI page</a>.</p>
pyafmhttp://www.physics.drexel.edu/~wking/unfolding-disasters/posts/pyafm/2011-04-19T19:18:29Z2011-04-19T19:18:29Z
<p><span class="infobox">
Available in a <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../git/">git</a> repository.<br />
Repository: <a href="http://www.physics.drexel.edu/~wking/code/git/gitweb.cgi?p=pyafm.git" rel="vcs-git" title="pyafm repository">pyafm</a><br />
Author: W. Trevor King<br />
</span></p>
<p>Here is my Python module for AFM cantilever positioning, combining
both the fine adjustment of <a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/pypiezo/">pypiezo</a> and the coarse adjustment of
<a href="http://www.physics.drexel.edu/~wking/unfolding-disasters/tags/programming/../../posts/stepper/">stepper</a>.</p>
<p>The <code>README</code> is posted on the <a href="http://pypi.python.org/pypi/pyafm/">PyPI page</a>.</p>