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"Converged early: {result['convergedEarly']}")
print(f"Best fitness: {result['models'][0]['fitness']}")
best_pdb = result["models"][0]["pdb"]

# Pass restraints as a HADDOCK TBL file
result = gdock.dock(receptor_pdb, ligand_pdb, restraints="ambig.tbl")

# 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}")

Restraints

Restraints tell the GA which receptor and ligand residues should be in contact. They can be provided as:

  • A list of integer pairs[(rec_resseq, lig_resseq), ...]
  • A HADDOCK TBL file pathrestraints="ambig.tbl" (string ending in .tbl)

Restraints use OR-group semantics (HADDOCK-style ambiguous AIR): a residue pair is satisfied when any of the specified partners are within the target distance, not all of them simultaneously.

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,       # generations actually executed
  "convergedEarly": bool,      # true if stopped before max_generations
  "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.5.0.tar.gz (36.4 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.5.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

gdock-0.5.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

gdock-0.5.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

gdock-0.5.0-cp314-cp314-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gdock-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gdock-0.5.0-cp313-cp313-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gdock-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gdock-0.5.0-cp312-cp312-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gdock-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

gdock-0.5.0-cp311-cp311-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

gdock-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

gdock-0.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for gdock-0.5.0.tar.gz
Algorithm Hash digest
SHA256 3f61d871252bf0672f7032b6b61810490d3f9529b7fd0dedec099b8ab6a622f8
MD5 1eb3ecc96651a67d3fef133a16569295
BLAKE2b-256 5f270834a8a05fa523618b5be009f6d23e4975ed252de2d9003131d87f5d3d09

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81e8980a5dbb3ce157def873d9441fd2c8ca548e7aba3490bab6d08277738e57
MD5 ace77817ec906617fe3633cf43f3c0b9
BLAKE2b-256 efe1c499519ee81ccbdece4415396163c0afb0695fb66035b6c1affcaca8ed51

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3623e3b828e84f137d07cbd2264b72ff421fc9b70a82d6053e6b4463a40a9b30
MD5 1d47f7e93766bf5e7110e36f1c71b7ea
BLAKE2b-256 3957a5ac274d6e7063b7c05d975a97f7ff325fc5c0cca86e08c2e13901762f98

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 846d315cd37ea50f2fa3cf042857094eda1c386e7f25bda8a2ef27c6afc8ae29
MD5 5dcb43977fbe623135a75096703451e1
BLAKE2b-256 b365514f2cfd78b2c31142466a8199a6776e3301903fe81f3dcf8996c95a149b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e49c33d634c44fc1536631deb3b1611db37e3a516f47c5dcb86f0d9f3d7015b1
MD5 49e220cc1abffbed25d5087356521d0e
BLAKE2b-256 a9e8c6923d136bc3b455fa5437b96b335a3c4335091a5ee6ce9b43612c6d4c1b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 741bd5f899a43b42821b27383eb551c48bd7f9bbc5ccb07ab06cda854f7c9f87
MD5 86d0c2aad971d119c05989cfd6a180a2
BLAKE2b-256 8a5fc8ef0df538b3e89a89f4f5baf628f38255c5f78a68a73a1ee3915d1b8b76

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1717eb4a522cc926e0d43156e2c4128400f426a916920836ec6f1deb7a9c91df
MD5 fb576b24fbcc4f63c4b7fc6aa31d5d6b
BLAKE2b-256 ba40b73d27585afb7f53fa039ec5a193a0ae87db28a76b579039533fbb503f51

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2f098e741b5f2b5784a29422141fdad0ce47f47ea20e35d180812b94cb73d975
MD5 661baf63fcf5056d3e0d5592bc262841
BLAKE2b-256 60e42e98447c232bc2b7c348cd917f74dc362a7490519c115980b3313360b548

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bd41559608edfb967ee5bff37fc2eb903f29d26ba4019d6b6e15c5b45bc444fe
MD5 d15ef9279e36c422b0e4015089e9fb12
BLAKE2b-256 c970227cef81b67805400257cb88d955a8f4bea9c0e160d9df895b071317fab3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 018ee1c596fbf56980cf6b245786dc5908f0247e012f3e8698689eee919f5152
MD5 73031a295c596846155f33686f29e70b
BLAKE2b-256 660ad2b1882734e35148984e714703239cf52d6a2384fa56d71a8160454f6712

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ca36e2794d7ade696928481798f9bc30140a545735dadb719c2ff13996ab140
MD5 437af59ea8276ec66f76ef6ea1583886
BLAKE2b-256 f46d30d53c04cffd15fca1123c739057265d8d21aa388fd9f82688a43c906e8d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a33e51dea09369ea8f882fd56b42957ec36426106d101dd54a4d5d3d93bd6945
MD5 c58e36cd382fbd1aeae930cd5205a584
BLAKE2b-256 a4d9a2e90cb483b9672613f8a5d11cc54bb62341cb9ce95cfcdab5a8f6f361b8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gdock-0.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 82b07a6fb61c0dfbdeb83372aad763eb6609b482f294d3a30aa6d5af9056a382
MD5 21c96aa196ecc0daa8329a89e5cbbc6e
BLAKE2b-256 faaebb5d532a93b6a207f3ffc5bbb9d944dbcf9f7b3855f011717df5fcb20b39

See more details on using hashes here.

Provenance

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