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, population_size=150, 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.3.0.tar.gz (33.9 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.3.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.7 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

gdock-0.3.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.2 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

gdock-0.3.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.0 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

gdock-0.3.0-cp314-cp314-macosx_11_0_arm64.whl (407.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gdock-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gdock-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (408.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gdock-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gdock-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (407.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gdock-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

gdock-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (410.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

gdock-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (485.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

gdock-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (486.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for gdock-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cb8b5b122b0fdc03729f5b1dc2b4221bfd033e585af2ba90065d93ae0552d8ef
MD5 5a30a46da97954b6ae7e5cdfa67c4d00
BLAKE2b-256 e96dbd137b93e52508d3977984ffc4dae90e962e77d548953817be9fbb051c80

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5f3b77e1d6961d6432dc7425c3bca6f66fad5723f3519b52a855d0138780f48f
MD5 bf2e1fc29ad95e40d8dd4c1e8c38abdf
BLAKE2b-256 c365fff7007ca2ca451d5b96b6a5acddd503cc4b1ec4d0589bf56e8d27376f14

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5a34040542f1d5b4dfa5254b646cdd620392a18582041c7d092f9f22780c592
MD5 7daa09e0957cd0f861c3ec3a19cae2d6
BLAKE2b-256 3f0fc057957606296c6a4642d1f2fd9477ab040a125db91345ddfee588ec22ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c06f30ba190bba9dec15268c13414e8bdfa6953e9604bf6ab385f7d2184a18a9
MD5 c97260998dc910ccf7147409b86ed342
BLAKE2b-256 2aa257741955d99819d1eb5f9b6dcd783fe78c0ad9f8b6fd82904f3e76270ec3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2f05f45e234d1a8cd5088a807b9b02d6154c2465423a8f561df9520106e3388
MD5 ce3aeb99bf914272d7b65a88afa0c87b
BLAKE2b-256 b3d92914731e1dfb41c2d2aa8beeeb827eef154d61be7d9d2d1716a53a2a0cdc

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5b07a286e0178221455b8eef19f01adb825cfb182ec5543dfb5db957130c87e1
MD5 9a82f35b003a778fc5305471498d4c4a
BLAKE2b-256 fe03cab16a0402167d617aa16c0c318947bee10bf2147da437263c5447f06b3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c783ba38525c7a8a4d513b34af8fff23b4f9a846f1b83e8e0a91937c01409cdf
MD5 eb84871f9e03f9794546208f206e54d3
BLAKE2b-256 c5d14e2158d484dbb89f145a71f904246b81d9648dd2e5126c30e00d32c3b84e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 94ff71bca6bf9c848d138ec9f70b3b01fd2494561a1e261d4d5566a4420c23e2
MD5 0379412aa6539ef924954e305eca165a
BLAKE2b-256 b28424f5bc515866eff0ae0f2afe7a48b4df513a8942ad77eafe246f95291422

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 81c9a035bd49c4710b7000ec18c05c1c9a786ba026bdb477c674e93315363553
MD5 2501da354e244fb32201c9983546538e
BLAKE2b-256 eda4eb349fcb0610887e5b8bfba55607039fb1abca0346009c8bd8af5dd07d26

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cfbd13b70cfd4fe180bee7b6df6f8686f4dadd8b02ff04cd21aefb5f0be2532b
MD5 e47ea5a561e106ad8827fe915f10018e
BLAKE2b-256 84708d8edf6f99cec5ebfa1fb76989e037ea82fbc91b03bbbc4f61c1a62cd2b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11677c3bf6bb99adf257404b9a4f7dceaa240b76dbe0be42c8e05def4ab6fca5
MD5 0d86dbdb06d0debc0f1b6de29a76287f
BLAKE2b-256 2b1efcbd0ad8086f174e22b5ac3817006c8952e0dd93951e6e47dd1568dc75b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac2d2facab4b39e0873d69eb83b12c6af7bb6be776a0bfeebe52fdb56560f639
MD5 c6f64bc60db9ca1a875d45f433c29be6
BLAKE2b-256 c0c939d76ddceb1f1f2f5f0c2928f611abd17de9a0fb84402237abbd6eb2b24d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gdock-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 71e5a05084d603c2d440579d78650dcba4adc4eae13ad3469959fd18032ecb45
MD5 e444fe40cbaf039c927db6f13e5b3c60
BLAKE2b-256 bd6148996f548377fdc0189768ac1d812e2868beb39c62f5dfa9b28b40bfba29

See more details on using hashes here.

Provenance

The following attestation bundles were made for gdock-0.3.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