Software module for DNA structure generation and analysis
Project description
MDNA: a software module for DNA structure generation and analysis
Description
MDNA is a Python toolkit for building, modifying and analyzing double stranded DNA structures at atomic resolution. It generates arbitrary DNA shapes through spline based mapping, supports canonical and non canonical base modifications, and applies Monte Carlo minimization to obtain physically consistent configurations. The toolkit implements full rigid base analysis, including intra base pair parameters shear, stretch, stagger, buckle, propeller, and opening, as well as inter base pair step parameters shift, slide, rise, tilt, roll, and twist. With built in linking number calculations and seamless interoperability with MDTraj and OpenMM, MDNA unifies structure generation, editing, and analysis in a single modular framework for complex DNA and DNA protein assemblies.
Installation
To install MDNA use pip:
pip install mdna
Or if you want to install the most recent version of MDNA, follow these steps:
git clone https://github.com/heezch/mdna.git
cd mdna
pip install .
Usage
See our documentation page
Citation
If you use MDNA in your research, please cite:
Link to the publication
If you use the Monte Carlo simulation / minimization features, please also cite the underlying PMCpy work:
Enrico Skoruppa, Helmut Schiessel, Systematic coarse-graining of sequence-dependent structure and elasticity of double-stranded DNA, Physical Review Research 7, 013044 (2025). DOI: 10.1103/PhysRevResearch.7.013044
Willem Vanderlinden, Enrico Skoruppa, Pauline J. Kolbeck, Enrico Carlon, Jan Lipfert, DNA fluctuations reveal the size and dynamics of topological domains, PNAS Nexus 1(5), pgac268 (2022). DOI: 10.1093/pnasnexus/pgac268
Contributing
We welcome contributions from the community! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
Please ensure your code adheres to our coding standards and includes relevant tests.
Integrated Monte Carlo engine
MDNA includes a fully integrated Monte Carlo simulation engine (mdna.simulate) based on PMCpy by Enrico Skoruppa. The original PMCpy code — including its SO3, pyConDec, and PyLk submodules — has been vendored and adapted so that no external git submodules or separate installation steps are required. This engine powers dna.minimize() and provides sequence-dependent conformational sampling with features such as excluded volume, automated equilibration, and writhe/linking-number evaluation. See mdna/simulate/README.md for details on the integration.
Optional full filament dataset (tutorial)
The filament tutorial runs in minimal mode by default using bundled filament_minimal data.
If you want full-trajectory mode, download the optional dataset:
cd examples
export MDNA_FILAMENT_DATASET_URL='https://doi.org/10.6084/m9.figshare.31423193'
python ./scripts/fetch_filament_dataset.py --output-root ./data
Optional integrity check (only if you know the real archive hash):
cd examples
export MDNA_FILAMENT_DATASET_URL='https://doi.org/10.6084/m9.figshare.31423193'
export MDNA_FILAMENT_DATASET_SHA256='<REAL_SHA256>'
python ./scripts/fetch_filament_dataset.py --output-root ./data --force
If you do not have a published SHA256 yet, leave MDNA_FILAMENT_DATASET_SHA256 unset and run the download command without checksum verification.
What happens behind the scenes: the DOI points to a Figshare item page, and the fetch script automatically resolves the direct file download URL before downloading and unpacking the archive into examples/data/filament_dataset.
Optional: build PyLk Cython extensions (faster + no fallback warnings)
MDNA bundles PyLk at mdna/simulate/Evals/PyLk. If you see warnings like
"Cython version of writhemap/linkingnumber not compiled", you can compile the extensions in-place:
Prerequisite: ensure Cython is installed in the same environment where you run MDNA.
pip install Cython
# from repository root
cd mdna/simulate/Evals/PyLk
python setup.py build_ext --inplace
Quick verification:
from mdna.simulate.Evals.PyLk.pylk import writhemap, linkingnumber
print('PyLk import OK:', writhemap.__name__, linkingnumber.__name__)
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdna-0.2.0.tar.gz.
File metadata
- Download URL: mdna-0.2.0.tar.gz
- Upload date:
- Size: 17.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fc6059080b994a8b9d2a7bf4fc1536097ae2277ff3f11b2e403c8eb04bbf346
|
|
| MD5 |
65fe625d2970be9ea57c1a8c20484caf
|
|
| BLAKE2b-256 |
07cee8310f19db8c018c23ab8cf830ced8060aebad6ac1aad777b4b6869a0501
|
File details
Details for the file mdna-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mdna-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8153143665d1f0206ca5d68e88fc033c5294e5fa9de05cfefeb25fa9e10b3216
|
|
| MD5 |
37f247992dfc582f7e693be1f139413d
|
|
| BLAKE2b-256 |
7ac3bc17e7ac18f370b3ab852e61544e3ecee72ffdd111f1b71918372e3c471b
|