Skip to content

re-introduce gdock module#1576

Open
rvhonorato wants to merge 43 commits into
mainfrom
gdock
Open

re-introduce gdock module#1576
rvhonorato wants to merge 43 commits into
mainfrom
gdock

Conversation

@rvhonorato

@rvhonorato rvhonorato commented Jun 15, 2026

Copy link
Copy Markdown
Member

Checklist

  • Tests added for the new code
  • Documentation added for the code changes
  • Modifications / enhancements are reflected on the haddock3 user-manual
    • non-applicable, we still need to do some deeper evaluation of the integration
  • CHANGELOG.md is updated to incorporate new changes
  • Does not break licensing
    • gdock has a zero-clause license so it's fully compatible here
  • Does not add any dependencies, if it does please add a thorough explanation
    • adds gdock-py which has no parent dependencies

Summary of the Pull Request

This PR re-introduces gdock as a sampling module. It was first introduced in #72 and then removed in #1454. The reason for removal is that gdock depended on an external dependency for its scoring function that was no longer available - so the whole software was not functional anymore.

Since then I have completely re-written gdock from scratch and implemented the energy calculation myself (see the release notes for more info about the re-write)

To fulfill this integration into haddock3 I have written thin bindings (bits of code that wrap the gdock's source code in python) to make the addition here simpler - see gdock-py.

Since haddock uses ambiguous restraints, I have also added this concept in gdock so it can seamlessly read haddock's tbl file and can handle the OR logic. I have implemented, to the best of my knowledge, the same function that haddock uses for its AIR restraint calculation - https://github.com/rvhonorato/gdock/pull/64

As for the integration itself I also added some compatibility to be in line with the other sampling module; [gdock] can handle ensembles by running each combination and it can also handle crossdock=True.

The key parameters I have exposed in the gdock interface are:

Parameter Default Description
ambig_fname "" AIR restraints .tbl file
max_generations 250 GA generation limit
number_of_individuals 150 GA population size
sampling 1000 Models to collect per input pair**
seed 42 Random seed
crossdock true Dock all receptor × ligand combinations

**sampling is a special parameter I added just for this integration, it will go bypass gdock's selection and return up to N models that are different enough based on its HoF (Hall-of-Fame) definition

I have also created some example files for the compatible scenarios replacing rigidbody with gdock - however we cannot make a one-to-one comparison given that gdock and haddock are using different formulations of the OPLS forcefields.

We would need a deeper investigation to properly parametrize which parameter and module configurations we should use to obtain similar results - this is however way far beyond the scope of this PR.

Here I am "just" adding gdock as a module and I think this can also serve as a good example of how to add new (external)-modules, so please keep the discussion in this PR so it serves for future reference.

Related Issue

#1595

Additional Info

Please have a look at gdock.org for full information about how gdock works. I did not add the whole information here since its described elsewhere.

@rvhonorato rvhonorato added feature Adding something new to the codebase m|gdock gdock module labels Jun 16, 2026
@rvhonorato rvhonorato self-assigned this Jun 16, 2026
@rvhonorato

rvhonorato commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

The gdock module is properly implemented and functional.

However I've hit a conceptual wall in the way restraints are treated. gdock currently (v2.1.0) can only handle PAIRS of restraints. So while running a gdock x rigidbody comparison in the cherry-picked examples I was naively just "reducing" the restraints to a set of pairs, but this creates a set of impossible to satisfy constraints which results in models with a lot of clashes.

So I will pause work on this while I implement ambiguous restraints in gdock, follow here: https://github.com/rvhonorato/gdock/pull/64

For now I'll keep the PR open since its just additive - but if the code diverges too much I'll reopen it.

@rvhonorato rvhonorato linked an issue Jun 30, 2026 that may be closed by this pull request
@rvhonorato rvhonorato requested a review from amjjbonvin June 30, 2026 09:18
@rvhonorato rvhonorato marked this pull request as ready for review June 30, 2026 09:18
@rvhonorato

Copy link
Copy Markdown
Member Author

@amjjbonvin please add whoever else you think is relevant for this review

@rvhonorato rvhonorato enabled auto-merge June 30, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adding something new to the codebase m|gdock gdock module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

re-implement gdock as a sampling module

1 participant