Skip to main content

Information-driven protein-protein docking using a genetic algorithm - Python bindings

Project description

gdock-py

Minimal Python bindings for gdock, an information-driven protein-protein docking engine using a genetic algorithm.

Installation

pip install gdock

Usage

import gdock

receptor_pdb = open("receptor.pdb").read()
ligand_pdb = open("ligand.pdb").read()

# Score a receptor-ligand complex
scores = gdock.score(receptor_pdb, ligand_pdb)
print(scores)  # {"vdw": ..., "elec": ..., "desolv": ..., "total": ...}

# Run the full GA docking pipeline
result = gdock.dock(
    receptor_pdb,
    ligand_pdb,
    restraints=[(10, 20), (15, 25)],  # (receptor_resseq, ligand_resseq) pairs
    max_generations=250,
    seed=42,
)
print(f"Generations run: {result['generationsRun']}")
print(f"Best fitness: {result['models'][0]['fitness']}")
best_pdb = result["models"][0]["pdb"]

# Sampling mode — collect a large pool of unique conformations sorted by fitness
result = gdock.dock(
    receptor_pdb,
    ligand_pdb,
    restraints=[(10, 20), (15, 25)],
    sampling=500,
)
for model in result["models"]:
    print(f"rank={model['rank']} fitness={model['fitness']:.3f}")

API

score(receptor_pdb, ligand_pdb, w_vdw=0.4, w_elec=0.05, w_desolv=3.4) -> dict

Computes VDW, electrostatic and desolvation energy terms for a receptor-ligand complex. Returns {"vdw", "elec", "desolv", "total"}.

dock(receptor_pdb, ligand_pdb, restraints=None, max_generations=250, seed=42, sampling=None) -> dict

Runs the genetic algorithm docking pipeline and returns ranked models:

{
  "generationsRun": int,
  "models": [
    {"rank", "fitness", "vdw", "elec", "desolv", "air", "pdb"},
    ...
  ]
}

By default, returns up to 5 cluster-representative models selected by FCC clustering. When sampling=N is set, the Hall-of-Fame capacity is raised to N and all accumulated unique conformations are returned sorted by fitness — useful for generating a diverse pool for downstream selection.

Development

uv venv --python 3.13 .venv
source .venv/bin/activate
uv pip install maturin pytest
maturin develop
pytest tests/

License

0BSD

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

gdock-0.2.0.tar.gz (33.2 kB view details)

Uploaded Source

Built Distributions

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

gdock-0.2.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.3 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

gdock-0.2.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.1 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

gdock-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

gdock-0.2.0-cp314-cp314-macosx_11_0_arm64.whl (407.6 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gdock-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gdock-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (407.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gdock-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gdock-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (407.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gdock-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

gdock-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (409.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

gdock-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

gdock-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file gdock-0.2.0.tar.gz.

File metadata

  • Download URL: gdock-0.2.0.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gdock-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9140e746f85a54227379ebe3ba7d820b8080ce2af4c996dea44312f9c23c3965
MD5 013dc1cd34b468230d8f67d5ca3cad50
BLAKE2b-256 484bea1295d89defdd4cc7cbb61b92f9a752f61300ef56cb50c616bbfb727492

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0.tar.gz:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e529fa2e3ff26178a28c8d43ee11810cd776e37b5163999266fc874a9c317c87
MD5 b30335749f8eba20385128b298454477
BLAKE2b-256 71c062b991ebd82ddf1e0238ba63af2f4d9c7356865513efeebe9822ff191652

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54b8b5c592a004e71fdcc8c0bf8383b2bc26103c08692671e6dc8026e5add192
MD5 e44994e94c7dbeea773862a16f65ff6a
BLAKE2b-256 124c1050ef2a3b31c29902e45dd548ee2337e03d587ad2cc18d841471ef4b08c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c711c2171273dbe0f34be032ce1ad405edf05cb5cc70f410f9011d69b0acd07c
MD5 64c01382015aa43f86f858ea3ddcb0ea
BLAKE2b-256 4bfe0bfb31ac0292c226916760e2f6bc50f8b6687d1a448d9ff565513874aacc

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4fdce3b3a3704837007f455d75c141e57ae3472e88a0a7b9a66366d80d7b1882
MD5 80790be52103d44cd8ec4c27a9eba033
BLAKE2b-256 012672289b901911fbb8391f7177e96c207803e7c1708f772f4027e6c6e8e609

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b8b3dd5526fda037d150535174a2ac519a87dc604f01f08410364b5833da509
MD5 aef535bf808a0d81d6c667eec81d0d60
BLAKE2b-256 0160cd1a796ac6891c737928f42c1cccd1ca562661f9fdff2ceeb9c28a0a9ad4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 132fbb8a3de4b10a770ce6a20cd6ae494d3805c00b119842efff732e56211839
MD5 f3a03d7d71469809b93ccd35d8015f9c
BLAKE2b-256 3cea9ff3fe16b29a89de87c1e4a6c6ca23b87b1956dc0f3f5e3c711454faa67e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 20ac8dc5f0181f23ae64a4141c4689367b1e7df00931d24da4e59c01b5aa7c6c
MD5 8bb4389de14a1aa64acdb348f71da3ed
BLAKE2b-256 3a9090e050edef6615412106b1ba6a87bcddd9979bc59cbe4caf5f2da61d17eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bbe74654726c0890619ba4fb4d43dc32695b782b5ba1cff536d340225f7bab36
MD5 c564ec3535ef003923137cb216e2b0e4
BLAKE2b-256 a34ed99931abd70980296c33a25c11091877d0156f72411c2baed1ea5b0cfdf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f6e7479766383012d66904bc68e721581b833b170defe00e6ff6aa85c4a8398a
MD5 6304526246adc2e5c0dfc1b742d7a23a
BLAKE2b-256 0083d81e7e0365008632b1a767e2844b32722071b02f2c93886c2ed6be20c120

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4211e75ebab802742a3f54194e5b5caa902e5168cc1e687b06ad848264357502
MD5 314f70279779c6fd7717df23b8e2fd0f
BLAKE2b-256 7e39fe6ce4ed06e1a7d8932f30006991f3175881512ffb92285a4000db2f0daa

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 066dd360432af29e6b02a88ee29b9ac7bc4ce5cb7d978a880a88fe4aefe697d8
MD5 4d02bc3afa521fab23d3bbc87720717c
BLAKE2b-256 1035f13d1e94e2ce7ea91dc85382b50872f23b5c75a2b11b900cadddb180c8fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gdock-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 becb7a0d124d0229a1787904b83dff137ad55e5f4b70e159dbc37f16f5af5b61
MD5 f6e69a6c74c72a5b531207f888359075
BLAKE2b-256 d0a36e0c862384eb6c9eea9a0ad325ea7620e4ccb96b4eb154530216c2b24925

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on rvhonorato/gdock-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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