Skip to main content

DNA curvature analysis

Dnacurve is a Python library, console script, and web application to calculate the global 3D structure of a B-DNA molecule from its nucleotide sequence according to the dinucleotide wedge model. Local bending angles and macroscopic curvature are calculated at each nucleotide.

Author:

Christoph Gohlke

License:

BSD-3-Clause

Version:

2026.10.22

DOI:

10.5281/zenodo.7135499

Quickstart

Install the dnacurve package and all dependencies from the Python Package Index:

python -m pip install -U "dnacurve[all]"

Print the console script usage:

python -m dnacurve --help

Run the web application:

python -m dnacurve --web

See Examples and Documentation for using the programming interface.

Try the online calculator at https://www.cgohlke.com/dnacurve/.

Source code and support are available on GitHub.

Requirements

This revision was tested with the following requirements and dependencies (other versions may work):

Revisions

2026.10.22

  • Fix initializing Model from Model instance.

  • Fix maxlen not enforced for Sequence instances in CurvedDNA.

  • Fix comments in sequence files discarded.

  • Fix main function ignoring argv argument.

  • Fix command line returning exit code 0 on failure.

  • Replace optparse with argparse.

  • Add maxlen command line option.

  • Add DNACURVE_MAXLEN environment variable to web application.

2026.8.15

  • Add HTML application based on Pyodide.

2026.6.9

  • Fix code review issues.

  • Use HTML Living Standard in web application.

  • Drop support for Python 3.11, support Python 3.15.

2026.1.8

  • …

Refer to the CHANGES file for older revisions.

Notes

The algorithms, plots, and PDB format are not meant to be used with very long sequences. By default, sequences are truncated to 510 nucleotides, which can be overridden by the user.

The generated PDB files can be visualized interactively using UCSF Chimera.

Dnacurve.py was derived from DNACG.PAS (c) 1993, and DNACURVE.CPP (c) 1995.

References

  1. Bending and curvature calculations in B-DNA. Goodsell DS, Dickerson RE. Nucleic Acids Res 22, 5497-503, 1994. See also http://mgl.scripps.edu/people/goodsell/research/bend/index.html.

  2. Curved DNA without A-A: experimental estimation of all 16 DNA wedge angles. Bolshoy A et al. Proc Natl Acad Sci USA 88, 2312-6, 1991.

  3. A comparison of six DNA bending models. Tan RK and Harvey SC. J Biomol Struct Dyn 5, 497-512, 1987.

  4. Curved DNA: design, synthesis, and circularization. Ulanovsky L et al. Proc Natl Acad Sci USA 83, 862-6, 1986.

  5. The ten helical twist angles of B-DNA. Kabsch W, Sander C, and Trifonov EN. Nucleic Acids Res 10, 1097-1104, 1982.

  6. Rod models of DNA: sequence-dependent anisotropic elastic modelling of local bending phenomena. Munteanu MG et al. Trends Biochem Sci 23(9), 341-7, 1998.

Examples

>>> from dnacurve import CurvedDNA
>>> cdna = CurvedDNA('ATGCAAATTG' * 5, 'trifonov', name='Example')
>>> cdna.curvature[:, 18:22]
array([[0.58061616, 0.58163338, 0.58277938, 0.583783  ],
       [0.08029914, 0.11292516, 0.07675816, 0.03166286],
       [0.57923902, 0.57580064, 0.57367815, 0.57349872]])
>>> cdna.write_csv('_test.csv')
>>> cdna.write_pdb('_test.pdb')
>>> cdna.plot('_test.png', dpi=120)

Metadata

Release files for dnacurve 2026.10.22

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

Source distribution (sdist)

Source distribution for dnacurve 2026.10.22
File Size Uploaded Provenance
dnacurve-2026.10.22.tar.gz 31.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 59.7 kB

Release files / dnacurve-2026.10.22.tar.gz

Download URL dnacurve-2026.10.22.tar.gz
Size 31.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d3c47ac5aee198f217aa100eb3f8e9641452b03dea99f30fd627cf88ef80473c
BLAKE2b-256 checksum
How to use checksums
3346da39ca72726b7143c0665587c87df762361d1f870682e7e64af763d179f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / dnacurve-2026.10.22-py3-none-any.whl

Download URL dnacurve-2026.10.22-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdc21bbf5f0c18879e6c3304996798387e1a2a0cc0c8925e67491026c37a47ff
BLAKE2b-256 checksum
How to use checksums
204b722143508741cf1766a77f0f1a6da5644ab6601f00e9dfc7806ae39f452b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Security for dnacurve 2026.10.22

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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