-
Couldn't load subscription status.
- Fork 53
Allow for chain selection in CNS scoring modules #1421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
After discussion with Alex: |
|
It’s “interface_combinationS” not ‘interface_combination” - would be nice to edit this PR description |
|
Smth not right. If I use this new parameter - my run crushes: More details: My tolms: Version2: If I do not use interface_combinations - no errors, [emscoring] ( or smth else? since “ [emscoring] CNS jobs have finished” before error occured) doing fine. Even more details: I have 400 DNA-ligand flexref models, which I modified by splitting DNA into chains A and C, remerging back with ligand (chain B), and putting all 400 models into ensemble. The idea now is to emsore this ensemble with 1. no interface_combinations, 2. interface_combinations = ["A,B”, ”C,B”] and 3. just because I can - only [“A,B”]. Runs here: |
|
Ah, I see a big issue with my testing. Chain B does not exist after emscoring! becuase I mess up my topology. |
|
Turned out atm it dose not matter if chain B exists or not - same behavior in both cases. |
|
Now [emscoring] finished sucesfully. But libutinl in [caprieval] failed: Both when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same workflow with interface_combinations commented out runs without this error, so this error is probably caused by new addition to the code.
|
let me investigate... |
|
After some investigations, it has been observed that for the use of the I applied a small patch to the code to temporary set the The original value of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double interface like interface_combinations = ["A,C","C,B”] is functional, both with per_interface_scoring set to true and false.
Single interface like interface_combinations = ["A,C”] with per_interface_scoring set to true and false creates expected headers in emscoring.pdb:
REMARK Interface Chain1 Chain2 HADDOCKscore Evdw Eelec Edesol BSA
REMARK Interface: A B -40.0928 -30.984 -40.9368 -0.921424 573.25
REMARK Interface: A C -211.158 -196.942 -565.691 98.9224 3194.26
REMARK Interface: B C -38.1605 -26.0944 -55.2351 -1.01912 530.589
REMARK Total HADDOCK score without restraints: -289.411
But then libutil (in between [emscoring] and [caprieval] ) crushes:
[2025-10-28 12:01:37,899 libutil ERROR] local variable 'score' referenced before assignment
Traceback (most recent call last):
File "/trinity/login/arha/dev-h3/haddock3/src/haddock/modules/scoring/__init__.py", line 196, in update_pdb_scores
score = self.compute_interfaces_score(
File "/trinity/login/arha/dev-h3/haddock3/src/haddock/modules/scoring/__init__.py", line 279, in compute_interfaces_score
raise ValueError
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/trinity/login/arha/dev-h3/haddock3/src/haddock/libs/libutil.py", line 382, in log_error_and_exit
yield
File "/trinity/login/arha/dev-h3/haddock3/src/haddock/clis/cli.py", line 193, in main
workflow.run()
File "/trinity/login/arha/dev-h3/haddock3/src/haddock/libs/libworkflow.py", line 43, in run
step.execute()
File "/trinity/login/arha/dev-h3/haddock3/src/haddock/libs/libworkflow.py", line 173, in execute
self.module.run() # type: ignore
File "/trinity/login/arha/dev-h3/haddock3/src/haddock/modules/base_cns_module.py", line 61, in run
self._run()
File "/trinity/login/arha/dev-h3/haddock3/src/haddock/modules/scoring/emscoring/__init__.py", line 92, in _run
output_haddock_models = self.update_pdb_scores(interface_combinations)
File "/trinity/login/arha/dev-h3/haddock3/src/haddock/modules/scoring/__init__.py", line 206, in update_pdb_scores
haddock_score = score
|
Yes, I was throwing a ValueError but excepting a TypeError, my bad. |
|
Seems smth is still not right, or I did smth wrong: In workflow: In capri_ss: So capri shows a full score between all available chains (listed also in emscoring_1.pdb as |
What if you try |
Unfortunately no, this is jsut a quirk of github. Both my quotes are the same, take a look at the cfg: I also tried the interface_combinations = ["A,C", "A,C”] - and capri_ss correctly shows -211.158*2 value. |
|
so when chain combinations are duplicated it is functional but when only one chain is there it is not ? |
Yes! Only one pair of chains, i.e. only 1 interface. I think this is what you meant |
|
I cannot reproduce it so far... |
Checklist
CHANGELOG.mdis updated to incorporate new changesSummary of the Pull Request
This PR adds a new parameters
interface_combinations = []in CNS scoring modules (emscoringandmdscoring).Note that the header of the PDB file is not modified, but only the
scoreattribute written in theio.jsonis affected.As this addition is used by both
emscoringandmdscoringmodules, it has been implemented in their shared classCNSScoringModuleinmodule/scoring/__init__.py.The reading of the score components from PDB files has been displaced from the
CNSScoringModuleto theHaddockModel.Finally, small optimization to reduce IO when performing the
per_interface_output, where now the PDB files are not read twice.Unfortunately had to add antibody-antigen pdb structure + psf file for the integration tests...
Related Issue
Closes #1414