unzipy
Single-molecule force spectroscopy and nonequilibrium statistical physics in Python.
unzipy collects the analysis methods used for optical- and magnetic-tweezers pulling experiments
on nucleic-acid hairpins, as a tested, vectorised, importable library:
- polymer elasticity (worm-like chain with Bouchiat correction, extensible WLC, freely jointed chain);
- free-energy estimation from work (Jarzynski with bias correction, Bennett acceptance ratio, Crooks fluctuation theorem, dissipated work), for position-controlled and force-controlled pulling;
- recovery of folding free energies at zero force by subtracting trap, handle and molecule stretching (effective-stiffness method and a full elastic-model fit);
- unzipping analysis: force–distance-curve alignment, rupture-force rates, event detection, equilibrium force–distance curves from sequence energies;
- nearest-neighbour hairpin energies, free-energy landscapes and a stochastic pulling simulation.
Status: alpha — the API may still change before 1.0.
Install
pip install git+https://github.com/amartinez118/unzipy # or, from a clone: pip install -e ".[dev]"
Requires Python ≥ 3.10, numpy ≥ 2.0 and scipy ≥ 1.13. Optional extras: unzipy[fast] (numba, faster
curve alignment), unzipy[plot] (matplotlib).
Quick start
import numpy as np
from unzipy.polymer import wlc_extension
from unzipy.fluctuation import bennett, bennett_error
x = wlc_extension(5.0, p=50.0) # relative extension of a WLC at 5 pN
rng = np.random.default_rng(0)
w_f, w_r = (
rng.normal(7, 2, 500),
rng.normal(-3, 2, 500),
) # work values (kT): dG = 5 kT
print(
bennett(w_f, w_r), "+/-", bennett_error(w_f, w_r)
) # free energy from forward + reverse work
Conventions: forces in pN, lengths in nm, energies in kT (kcal/mol where stated), temperature 25 °C unless passed. Work is the work done on the system. Molecules are always parametrised by their stem length and loop length (or their sequence): nothing assumes a particular hairpin.
| subpackage | contents |
|---|---|
unzipy.polymer |
WLC, eWLC, FJC: force↔extension, energies, compliances |
unzipy.fluctuation |
Jarzynski (+ bias model and corrected estimator), Bennett (+ error), Crooks, matching, dissipated work; position_ensemble and force_ensemble pipelines |
unzipy.stats |
bootstrap, KDE with optimal bandwidth, outlier tests, Gaussian mixtures |
unzipy.fitting |
fits of force-extension data to elastic models (WLC, eWLC, FJC, eFJC, dipole, trap, series chains) in x(f) or f(x), with uncertainties, bootstrap intervals and AIC/BIC model comparison |
unzipy.unzipping |
curve alignment, rupture rates, event detection, elastic fits and stretching model, equilibrium FDC, trace splitting |
unzipy.landscape |
nearest-neighbour stacks (SantaLucia 1998, Huguet 2010), sequential-opening landscape, mutant libraries |
unzipy.simulation |
two-state hairpin pulling simulation |
A command-line interface covers the common workflows (unzipy --help). See
docs/guide.md for workflows and docs/methods.md for the methods,
references and how each is validated; examples/quickstart.py is a runnable tour.
Validation
Each module is tested against an independent reference wherever one exists: analytic limits and numerical integrals (elasticity), exact Gaussian-work results (Jarzynski, Bennett), brute-force simulation of the Jarzynski bias, Bell–Evans kinetics (rupture rates), equilibrium free energies from a model landscape (simulation through Crooks/Bennett), MFOLD stacking energies, a quasi-static force-ensemble protocol, and published numbers (Table 1 of J. Stat. Mech. (2019) 124001; the ensemble rate ratio of Phys. Rev. E 98, 032146). See docs/methods.md for the list and its limits.
Contributing, license, citation
Issues and pull requests are welcome; see CONTRIBUTING.md. Released under the MIT license.
Citing
If you use unzipy in your work, please cite it using CITATION.cff
(GitHub's "Cite this repository" button gives BibTeX and APA).
Metadata
Release files for unzipy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| unzipy-0.1.0.tar.gz | 102.9 kB | With provenance | Details for unzipy-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| unzipy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for unzipy-0.1.0-py3-none-any.whl |
Total release size: 193.8 kB
Release files / unzipy-0.1.0.tar.gz
| Download URL | unzipy-0.1.0.tar.gz |
|---|---|
| Size | 102.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3385a34b99043bf1c6c9154cd10fd37619a3a5384b259860b1253f782de48775
|
|
BLAKE2b-256 checksum How to use checksums |
4ddd6fa9d84fff72479c17fba31588e074baa6035ca2b11b51d737683667bca7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / unzipy-0.1.0-py3-none-any.whl
| Download URL | unzipy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 90.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eac5c79844a23dcad168a1fd1ce14474e6e3d069466f497a36070631603c20c3
|
|
BLAKE2b-256 checksum How to use checksums |
371372f5794f902efd02d69ea711b426ae2b3bee1e559b8afdf2985ebf983b9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for unzipy 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for unzipy-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.