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.10, 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.2.0

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.2.0
File Size Uploaded Provenance Actions
unzipy-0.2.0.tar.gz 104.3 kB With provenance Details for unzipy-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 195.5 kB

Release files / unzipy-0.2.0.tar.gz

Download URL unzipy-0.2.0.tar.gz
Size 104.3 kB
Tags Source
SHA-256 checksum
How to use checksums
93265a01dd77fcc8ca0d7dd10898fed8bf93fba60440d019abc1a5b49ea21c90
BLAKE2b-256 checksum
How to use checksums
e1dd59abbad125f1e3a1173b20d36e5b6f16d1961e4d9c577e299d6c97c8325a
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 log

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

Download URL unzipy-0.2.0-py3-none-any.whl
Size 91.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73420f4c4ab7e9d5ebeff116abf6a186dde80ad55624e7454f129be8f7c7a0da
BLAKE2b-256 checksum
How to use checksums
59536e61f86a5cb1b1b1644702be7b935e4ed21b9077e95537521ebbf654335b
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 log

Security for unzipy 0.2.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.

Select from 2 files

Attestation for unzipy-0.2.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 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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