-
Notifications
You must be signed in to change notification settings - Fork 33
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
Create haddock3-score
CLI
#510
Conversation
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.
Would it be an idea to add a few options to:
-
Possibly printout also the components of the score
-
Save the generated PDB file (now only kept into memory
This command should in principle return a score rather similar to the EM scoring example, right?
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.
User experience is great! but I agree that having the different components would be useful.
I calculated the haddock-score for the first 20 pdbs of 1_emscoring for capri Target218 (check out on tintin if you like). It is highly correlated to the true haddock score, but the pearson coeff. is not super (r~0.88). Should we add more steps to this? Or is it ok as it is?
Where does the difference come from… that’s the question.
The number of EM steps in emscoring in only 50 while it is 200 in emref
And I assume autohis is true for both?
|
Yep, this tool runs
This tool uses the default parameters |
Done
It is saved as |
Possibly printout also the components of the score
Done
As an option?
Save the generated PDB file (now only kept into memoryI
I would rather save it as <original-pdb-filename)_hs.pdb to avoid overwriting it if running on multiple PDBs in the same dir.
|
tools/haddock-score.py
Outdated
print("-----") | ||
print(f"vdw\t{vdw:.4f}") | ||
print(f"elec't{elec:.4f}") | ||
print(f"desolv\t{desolv:.4f}") | ||
print(f"air\t{air:.4f}") | ||
print("HADDOCK-score = (1.0 * vdw) + (0.2 * elec) + (1.0 * desolv) + (0.1 * air)") | ||
print("-----") | ||
print(f"HADDOCK-score (emscoring) = {haddock_score_itw:.4f}") |
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.
air will be in principle 0
may-be more interesting to output the BSA.
And I would not output everything by default, but only as an option (e.g. if the -full
argument is given).
Simpler for incorporating the score in other scripts.
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.
And same thing for outputting the pdb
and psf
files, only if an option is given, e.q. -outpdb
-outpsf
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.
air will be in principle 0
may-be more interesting to output the BSA.
And I would not output everything by default, but only as an option (e.g. if the-full
argument is given).
Simpler for incorporating the score in other scripts.
Added --full
option
And same thing for outputting the
pdb
andpsf
files, only if an option is given, e.q.-outpdb
-outpsf
Added --outputpdb
and --outputpsf
options
Hi, |
.github/workflows/tests.yml
Outdated
@@ -48,5 +48,5 @@ jobs: | |||
uses: codecov/codecov-action@v2 | |||
with: | |||
files: ./coverage.xml | |||
fail_ci_if_error: true | |||
fail_ci_if_error: false |
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.
Why change this to false
?
Codecov Report
@@ Coverage Diff @@
## main #510 +/- ##
==========================================
- Coverage 74.84% 73.40% -1.45%
==========================================
Files 105 103 -2
Lines 6953 6621 -332
==========================================
- Hits 5204 4860 -344
- Misses 1749 1761 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Done |
We figured out that the source of the difference is that @mgiulini was calculating the haddock-scores in the already-minimized models instead of the input ones. |
MANIFEST.in
Outdated
@@ -7,6 +7,8 @@ include LICENSE | |||
include requirements.txt | |||
include requirements.yml | |||
|
|||
recursive-include tools *.py |
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.
I disagree here. I strongly suggest making haddock-score
a CLI.
tools/haddock-score.py
Outdated
for line in tidy_pdbfile(inp_fh): | ||
out_fh.write(line) |
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.
Single call to save to disk
for line in tidy_pdbfile(inp_fh): | |
out_fh.write(line) | |
lines = list(tidy_pdbfile(inp_fh)) | |
out_fh.write(os.linesep.join(lines)) |
tools/haddock-score.py
Outdated
""" | ||
|
||
import argparse | ||
import subprocess |
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.
import subprocess | |
import os | |
import subprocess |
tools/haddock-score.py
Outdated
main_topoaa_cns_script_as_string = Path( | ||
topoaa_module_folder, "cns/generate-topology.cns" | ||
).read_text() |
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.
main_topoaa_cns_script_as_string = Path( | |
topoaa_module_folder, "cns/generate-topology.cns" | |
).read_text() | |
main_topoaa_cns_script_as_string = Path( | |
topoaa_module_folder, | |
"cns", | |
"generate-topology.cns" | |
).read_text() |
tools/haddock-score.py
Outdated
main_emscoring_cns_script_as_string = Path( | ||
emscoring_module_folder, "cns/emscoring.cns" | ||
).read_text() |
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.
main_emscoring_cns_script_as_string = Path( | |
emscoring_module_folder, "cns/emscoring.cns" | |
).read_text() | |
main_emscoring_cns_script_as_string = Path( | |
emscoring_module_folder, | |
"cns", | |
"emscoring.cns", | |
).read_text() |
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.
I just made small code suggestions. I think the topo
and emscoring
wrappers are a great opportunity to try to use the module objects directly, or at least to study and learn why we can't yet (if that's the case) use them here already. Anyway, that can be for another PR if there's rush merging this one.
Finally, I really think we should have haddock-score
as a client as all that is necessary is already placed.
Cheers,
Notethis is not ready to merge. I made an edit in the |
sure! I was testing it and noticed a couple of improvements :) |
…docking/haddock3 into 365-implement-haddock3-score
@mgiulini can you give a look now, also to the new parameter |
All workflows perform correctly despite the change in |
Don't think this makes sense, the idea is to calculate the haddock score according to the defined weights, not use the calculation routine to do minimisation steps. I know it's doable but in my opinion it falls out of scope, sounds like this is the use case for the default workflow pipeline. |
There is however a minimization step and I think it is nice to be able to control the number of steps. Even set it to 0 if you really want the score of the “raw” model
|
But then we need to make this very clear, imagine someone is trying to recalculate the haddock score of a given complex and the numbers are different because the minimisation steps were not the default. Being able to customize the steps is nice indeed, I'm just thinking about reproducibility. Maybe print it out in big letter that's the steps were altered (and also the weights if that's the case) and that this information needs to accompany the publication. (Or leave this option out and let the user use the default workflow running scheme instead) |
My guess is most users will simply use the default settings
|
Hi there! I agree with @rvhonorato that the use of non-default parameters is dangerous and that this should be made very clear during the execution. I created a couple of warnings for that. If you agree l will give the possibility to modify the weights. |
To help solving the discussion, the haddock3-score complex.pdb -p nemsteps 50 w_air 1 electflag True See more with For reporting purposes, users can always save the command line use. I am okay with the warning messages proposed by @mgiulini . For me, it is okay to be merged. 👍 Good work everyone 🚀 |
hello, I changed a bit the code to consider (possibly) new weights in the calculation of the score. |
I cant test or approve now because i am on mobile. Looks great and the
change was necessary because previously if users injected the weights they
were not being used and now they are. Great work!
El mar., 30 ago. 2022 10:52, Marco Giulini ***@***.***>
escribió:
… @mgiulini <https://github.com/mgiulini> requested your review on: #510
<#510> Create haddock3-score
CLI.
—
Reply to this email directly, view it on GitHub
<#510 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWEOMX3NU6QXOKM64B546DV3XDUXANCNFSM54SEAVRQ>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
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.
Sounds good @mgiulini 👍
I deleted the PR template since this is an extra tool and not a module/gear/libs/core/clis/cnsAdds a tool to calculate the haddock-score of a complex.I see quite some more things that can be implemented such as support for pdb.list, custom-weights, use restraints, etc - we can open additional issues for that.(venv) repos/haddock3 » pwd/Users/rodrigo/repos/haddock3(venv) repos/haddock3 » export PYTHONPATH=pwd
/src(venv) repos/haddock3 » time python tools/haddock-score.py examples/data/2oob.pdbHADDOCK-score (emscoring): -53.8110
python tools/haddock-score.py examples/data/2oob.pdb 2.32s user 0.08s system 97% cpu 2.477 total@joaomcteixeira:
libworkflow
machinery to runemscoring
directly on a complex (PDB file) using the command line.Cheers,