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, ncores=None, 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.4.0.tar.gz (34.3 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.4.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.6 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

gdock-0.4.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (497.6 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

gdock-0.4.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

gdock-0.4.0-cp314-cp314-macosx_11_0_arm64.whl (420.6 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gdock-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gdock-0.4.0-cp313-cp313-macosx_11_0_arm64.whl (420.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gdock-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gdock-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (420.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gdock-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

gdock-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (423.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

gdock-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

gdock-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for gdock-0.4.0.tar.gz
Algorithm Hash digest
SHA256 627ae77b7eb01d338e5d11f068c6c45880aba879027dd9861c0e921a076f96b7
MD5 4099c204782d68a2f26050ff27e91641
BLAKE2b-256 3c67d6d2f38b6e7491b9b8c658166967acaf6fe5fadf06f78f6e7907764c3555

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a53a32319ee7fbddf64f9659334a4fbb2f881bc14a2b5066ffad912f61388e15
MD5 c10f635b1806cc8eb1b2317f8acc149a
BLAKE2b-256 e203fbc094ff20b0dbac7d89e75266d2d53e6006a15bc44ce8fc55e406277895

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b9654623bfbeb9e823630cbed3032e5dd61a833406dcfc9c757d1dab7d6172ba
MD5 a5d9e793a39c9ce1e65fbe262a61fda0
BLAKE2b-256 8ef3ad79d74ff710a55e745def84e3275731e326c7e2630312e7cab5f326f4f2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e7198930420fde04f426f82dddbb6ac88bb845050f92d862ac4a8dfa0b8dd27
MD5 178f498c448c66b390cee7b7d9896af8
BLAKE2b-256 92a9bdc22390c670f335272b0f4f397cef1d790dc155577ba7669fd8b0e7d357

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a575df39159d36b66edafef76fc075daaa1252d80be97d3a26a9324096b44b43
MD5 eb2494d590b5e122f6bd842d223e5102
BLAKE2b-256 feb2046147ae6b2b46df4d26f08803e8acc453c4a48c030c47723602bd0636ad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a43f6750e167a7982430818b98e1d13120025b2d4c1ac8e13faf730b379137dc
MD5 beb4a1174205df4a8690bbf377b16366
BLAKE2b-256 a3a9a525b6e81e8a2f91111675163ad7bfb3c329dcc124d850fccabd412e8fbc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a4d5fe5d8ec2a71f248f25ba36f41fa10bbf95e4287eaa838da402f81e465797
MD5 31895170afb5d4feec8ac5bba2b18dce
BLAKE2b-256 9d4bdcd969d9d19d4212d8e35ace8684ca1a831f31fba7d2af84b478df9f27e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 851a41fd259d0b48db972e2de22062f6773a5bd18d7ef7b10700ea19045527dc
MD5 0c93eb9ff30d49b358cf895d4b27bdc8
BLAKE2b-256 32f984330214e317e78a3aff9bf315b8c7089a5a78c4c35516f0e2e3a1b43768

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 411838e8fd910e62e72a2d8157c868434f3c32fbc91200f01d8179f4c0b8150d
MD5 5e4f4a06bd32e244425b646e60666547
BLAKE2b-256 640d343c448425c2519581fd5e7c0a73de53879cf99a0cc31e325cda4caf6897

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 700da84563ae99c98dd42840d041657276d614baa66ae1a8d755a910081a27ca
MD5 ea6171ee442c11bb09b550cbe61890f4
BLAKE2b-256 1ce413a3de14b2593cf0557b1c5bb898975d26bf37a57c529174d2d35585bfee

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 35d567f9f03c7766f259e292acd3e29a17b0254b3a026b3417736e79e7c93745
MD5 7a4f8a22d64f5e8dd475708888a11d0f
BLAKE2b-256 890687c6dd1847e169415449d26da60737407e77db12a20ead8910a7283a4235

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7703aad9bc439a21ee61fd1e9d349ccc795e73571617e1205bbfeb8ab1e3cbda
MD5 4788b8971d794db773e151d673c31fd4
BLAKE2b-256 b10549de4fba07df3b8bb4c33d9835402f020729c926ba65f284958df58c325e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ed8474ab1f0c5e026cbabde0cb4ba3149891931cdded442e6c2640368005d93
MD5 15c1ab2e4f4d6110cda5b219b29b6ded
BLAKE2b-256 4bb9892a62c6b570e5c8ac51fd8266869e47cab53e20a648638e066cf7327577

See more details on using hashes here.

Provenance

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