Skip to main content

unzipy

Lint, test and build PyPI Python License: MIT

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 unzipy

Requires Python ≥ 3.11, numpy ≥ 2.0 and scipy ≥ 1.13. Optional extras: unzipy[fast] (numba, faster curve alignment), unzipy[plot] (matplotlib), for example pip install "unzipy[fast,plot]".

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

See docs/methods.md.

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.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unzipy 0.3.1
File Size Uploaded Provenance Actions
unzipy-0.3.1.tar.gz 104.3 kB With provenance Details for unzipy-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unzipy 0.3.1
File Interpreter ABI Platform Actions
unzipy-0.3.1-py3-none-any.whl Python 3 none any Details for unzipy-0.3.1-py3-none-any.whl

Total release size: 195.5 kB

Release files / unzipy-0.3.1.tar.gz

Download URL unzipy-0.3.1.tar.gz
Size 104.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d7fc8582742b59c6763e43aa4eb421f3f9f7446859697722e063a3b2037ce5cb
BLAKE2b-256 checksum
How to use checksums
158393ece717c67ab5770bd96eb6c1cda8afd43f4953707fbae64b7da5acd7d2
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 27, 2026.

Transparency log

Release files / unzipy-0.3.1-py3-none-any.whl

Download URL unzipy-0.3.1-py3-none-any.whl
Size 91.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
093cba173f7e98b03a25d82280cd7dd9b0271f2139503a1cdae6be9c305fa5e4
BLAKE2b-256 checksum
How to use checksums
6447da4adb6bd704aa1530034763c1aeae60ea1dcfc36541e74e83b35d825a6a
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 27, 2026.

Transparency log

Security for unzipy 0.3.1

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.

Select from 2 files

Attestation for unzipy-0.3.1.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 27, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page