Skip to main content

No project description provided

Project description

crates.io

DOI:10.26434/chemrxiv-2025-0bfhd Zenodo Open In Colab


Duello
Virial Coefficient and Dissociation Constant Estimation for Rigid Macromolecules


Introduction

Duello is a tool to calculate the potential of mean force (PMF) between two rigid bodies, performing a statistical mechanical average over inter-molecular orientations using subdivided icosahedrons. For each mass center separation, R, the static contribution to the partition function, $\mathcal{Z}(R) = \sum_{\mathbf{\Omega}} e^{-V(R,\mathbf{\Omega})/k_BT}$, is explicitly evaluated to obtain the potential of mean force, $w(R) = -k_BT \ln \mathcal{Z}(R)$ and the thermally averaged energy,

$$ U(R) = \frac{\sum V(R,\mathbf{\Omega}) e^{-V(R,\mathbf{\Omega})/k_BT}} {\mathcal{Z}(R)} $$

where $V(R,\mathbf{\Omega})$ is the total inter-body interaction energy and $\mathbf{\Omega}$ represents a 5D angular space (e.g. two spherical coordinates for each body plus a dihedral angle around the connection line).

The osmotic second virial coefficient, which has dimensions of volume, reports on exactly two-body interactions:

$$ \begin{align} B_2 & = -\frac{1}{16\pi^2} \int_{\mathbf{\Omega}} \int_0^{\infty} \left ( e^{-V(R,\mathbf{\Omega})/k_BT} - 1 \right ) R^2 dR d\mathbf{\Omega}\ & = -2\pi \int_0^{\infty} \left ( e^{-w(R)/k_BT} -1 \right )R^2 dR \ & = B_2^{hs} -2\pi \int_{\sigma}^{\infty} \left ( e^{-w(R)/k_BT} -1 \right )R^2 dR\ \end{align} $$

where $B_2^{hs} = 2\pi\sigma^3/3$ is the hard-sphere contribution and $\sigma$ is a distance of closest approach where $w(R\lt \sigma)=\infty$ is assumed. For systems with net attractive interactions, the dissociation constant, $K_d$, can be estimated by,

$$ K_d^{-1} = 2 N_A\left (B_2^{hs} - B_2\right ) $$

crates.io

Installation

Binary packages are available for Linux and MacOS through PyPI.org:

pip install duello

If you have a Rust toolchain installed, you may alternatively build and install directly from the source code:

cargo install --git https://github.com/mlund/duello

Usage

The command-line tool duello does the 6D scanning and calculates the angularly averaged potential of mean force, A(R) which is used to derive the 2nd virial coefficient and twobody dissociation constant, $K_d$. The two input structures should be in .xyz format and all particle names must be defined in the topology file under atoms. The topology also defines the particular pair-potential to use, see below. Note that currently, a coulomb potential is automatically added and should hence not be specified in the topology.

duello scan \
    --mol1 cppm-p18.xyz \
    --mol2 cppm-p18.xyz \
    --rmin 37 --rmax 50 --dr 0.5 \
    --top topology.yaml \
    --resolution 0.8 \
    --cutoff 1000 \
    --molarity 0.05 \
    --temperature 298.15 \
    --backend auto \
    --grid "type=powerlaw2,size=2000,shift=true"

Spline Grid Options

The --grid option controls interpolation of pair potentials:

Key Values Default Description
type powerlaw2, invr2 powerlaw2 Grid spacing (invr2 avoids sqrt in eval)
size integer 2000 Number of grid points
shift true, false true Shift energy to zero at cutoff

Example: --grid "type=invr2,size=1500,shift=false"

Backend Performance

The program is written in Rust and attempts to use either GPU or all available CPU cores. The following backends are available, with performance measured on the Calvados3 lysozyme example (2.4M poses, 128 atoms per molecule, Apple M4):

Backend Description Poses/ms Speedup
reference Exact potentials (validation) 48 1.0x
cpu Splined potentials 102 2.1x
simd NEON (aarch64) / AVX2 (x86) 131 2.7x
gpu wgpu compute shaders 1065 22x

The auto backend (default) selects GPU if available, otherwise SIMD. All but reference use Cubic Hermite splines for pair potentials.

Preparing PDB files

The following uses pdb2xyz to create a coarse grained XYZ file and Calvados topology for Duello:

pip install pdb2xyz
pdb2xyz -i 4lzt.pdb -o 4lzt.xyz --pH 7.0 --sidechains
duello scan \
  -1 4lzt.xyz -2 4lzt.xyz \
  --rmin 24 --rmax 80 --dr 0.5 \
  --resolution 0.6 \
  --top topology.yaml \
  --molarity 0.05

If pdb2xyz give errors, you may be able to correct your PDB file with pdbfixer.

Examples

Ready run scripts examples are provided in the scripts/ directory:

Command Description
scripts/cppm.sh Spherical, multipolar particles using the CPPM model
scripts/calvados3.sh Two coarse grained lysozyme molecules w. Calvados3 interactions

Interaction models

Each macromolecule is represented by a rigid constellation of beads with properties defined under atoms in the topology file. The inter-molecular energy, $V(R,\Omega)$ is calculated by summing all pairwise interactions between beads using a customizable pair potential, $u_{ij}$. If needed, different pair-potentials can be explicitly defined for specific atom pairs.

The provided examples illustrate the following schemes:

  • Screened Coulomb + AshbaughHatch, for the Calvados model.
  • Screened Coulomb + WeeksChandlerAndersen for the CPPM model.

Many more pair-potentials are available through the interatomic library, e.g. LennardJones, HardSphere etc.

Warning: The electrostatic term, Coulomb is always automatically added and should therefore not be specified in the topology.

Development

This is for development purposes only and details how to create and publish a binary package on pipy.org.

Create pip package using Maturin via a Docker image:

Run this on MacOS, linux (x86 and arm) to get all architectures:

docker run --rm -v $(pwd):/io ghcr.io/pyo3/maturin::v1.11.5 publish -u __token__ -p PYPI_TOKEN

For local Maturin installs, follow the steps below.

pip install ziglang pipx
pipx install maturin # on ubuntu; then restart shell
maturin publish -u __token__ -p PYPI_TOKEN --target=x86_64-unknown-linux-gnu --zig

MacOS targets can be generated without --zig using the targets x86_64-apple-darwin and aarch64-apple-darwin.

rustup target list
rustup target add x86_64-apple-darwin

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

duello-0.2.1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

duello-0.2.1-py3-none-win_amd64.whl (3.5 MB view details)

Uploaded Python 3Windows x86-64

duello-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

duello-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

duello-0.2.1-py3-none-macosx_11_0_arm64.whl (3.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

duello-0.2.1-py3-none-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file duello-0.2.1.tar.gz.

File metadata

  • Download URL: duello-0.2.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for duello-0.2.1.tar.gz
Algorithm Hash digest
SHA256 402c30fe85e7a510581c8335e7c0f864534c04c15a17ce6bd93e1ab3427876d6
MD5 629e802cef42a665ef906c9901c281aa
BLAKE2b-256 a96eb598e9cc31e6032ca76315d3b49b074562732ea490ef0636c3553059708b

See more details on using hashes here.

File details

Details for the file duello-0.2.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: duello-0.2.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for duello-0.2.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b58550993309a7e9b700ac426498c1f49cebe059a9e9c91ebdc84b4242fa777d
MD5 6828e666252b087b14d1843239d5deb8
BLAKE2b-256 83e87218041e32b656d3417616f2a9cde61bffe7870bc612290801c1fd402f3a

See more details on using hashes here.

File details

Details for the file duello-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for duello-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 456d15f11c2726f3bd9ec1f0adaffb21e94ac08eef5b81cf0a7d9deff9c1d605
MD5 9ec44ec6e55a20477e658550c6569c0d
BLAKE2b-256 6dd2325b937798fe4dc3c48044c56d1d403bc5bf282561648eebe5557943aed5

See more details on using hashes here.

File details

Details for the file duello-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for duello-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5824e26dd0a7b7ef10e81121395ec6abf5c4dfbf8f2c3a076f1281a27419b3c9
MD5 6b888bd0e20f9300d096d494bd6dc7b6
BLAKE2b-256 697f3964dc8d611727763816dc826b547f72162d893a9848a47552eb1031d765

See more details on using hashes here.

File details

Details for the file duello-0.2.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for duello-0.2.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d0ab822255fc69e50b5310d0e0ebc1324c9efd70eb8268547d61d5858d0490cf
MD5 d4305b4dee7013f6bd6ca2fcf0d5aa53
BLAKE2b-256 bebd6f01cf8088f8378cdf134d87c0cc2b29fc81fdeccf44c53276a9074934be

See more details on using hashes here.

File details

Details for the file duello-0.2.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for duello-0.2.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 91331bec7b40a114d162be93944ad0658a92afefc77a3746fcddd5855c0a9108
MD5 2801acfab4fe124aae3506b57c524303
BLAKE2b-256 4bcc46bb638a6926e0ec392168553f8a5f238b37758f22dd30c5aa352ea69eec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page