-
Notifications
You must be signed in to change notification settings - Fork 46
Voroscoring #867
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
Draft
VGPReys
wants to merge
46
commits into
main
Choose a base branch
from
voroscoring
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Voroscoring #867
Changes from 38 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
05ffc37
first draft voroscoring module
VGPReys 1c8e160
fix writing
VGPReys c37370d
fix types
VGPReys ef856c9
upgrade haddock module init
VGPReys 75a69ad
import Any type
VGPReys 8ba5ae7
redefine scoring modules classes
VGPReys 2320357
add output attribute
VGPReys 6757ae9
output Path type
VGPReys 8601649
output var name
VGPReys e1ab6c8
get base_workdir from class attribute
VGPReys 44b41e0
Path to str for .join() method
VGPReys 1e9d612
voro scoring example
VGPReys 042f484
output tsv file writing from self.output()
VGPReys 319056d
remove import
VGPReys 5c05779
solve error in recombine arguments
VGPReys 0dd02ba
finetunings
VGPReys b431e6a
tidy types and lints
VGPReys d8a1322
reversing scores for systematic ascenting sorting
VGPReys 994bea4
adding tests
VGPReys 69245cd
fixed conflict
mgiulini f832c0c
add header information in generated final output file
VGPReys a5a3656
make sure line is terminated
VGPReys ac409ac
fix tuple error
VGPReys 60c9ee6
Merge remote-tracking branch 'origin' into voroscoring
VGPReys 795682a
tests
VGPReys 1e0d578
Merge branch 'main' into voroscoring
VGPReys 7e8ac73
change
ntxxt 4370daf
fixes to adapt to new hardware
VGPReys 80e112e
mergeing main and solve conflicts
VGPReys fbe08c0
Merge branch 'main' into voroscoring
rvhonorato e7055a8
Merge branch 'main' into voroscoring
VGPReys 4d6253b
check
ntxxt 9791476
Merge branch 'voroscoring' of https://github.com/haddocking/haddock3 …
ntxxt b4a8048
Merge branch 'main' into voroscoring
VGPReys 7dd1d5f
Update how to obtain defaults.yaml filename
VGPReys bee2709
Updating the SLURM job
VGPReys 46217f9
Updating tests to reflect the 3 digits outputs
VGPReys fd08d85
Update INSTALL.md for voroscoring module
VGPReys e188b74
Removing the chain contatenation parameter as not implemented
VGPReys e23861a
Merge branch 'main' into voroscoring
VGPReys ae9fc56
Merge branch 'main' into voroscoring
VGPReys 17482fd
update GPU scheduler
VGPReys bbddcad
update install
VGPReys fcf5df3
removing parameters
VGPReys 0d054fd
updating module to run in local mode
VGPReys d039548
loading gnu 13 module
VGPReys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# ==================================================================== | ||
# Scoring example | ||
|
||
# directory in which the scoring will be done | ||
run_dir = "run1-voroscoring-test" | ||
clean = false | ||
|
||
# execution mode | ||
ncores = 3 | ||
mode = "local" | ||
|
||
# ensemble of different complexes to be scored | ||
molecules = ["data/T161-rescoring-ens.pdb", | ||
"data/HY3.pdb", | ||
"data/protein-dna_1w.pdb", | ||
"data/protein-protein_1w.pdb", | ||
"data/protein-protein_2w.pdb", | ||
"data/protein-trimer_1w.pdb" | ||
] | ||
|
||
# ==================================================================== | ||
# Parameters for each stage are defined below | ||
|
||
[topoaa] | ||
|
||
[voroscoring] | ||
|
||
[seletop] | ||
select = 3 | ||
|
||
[caprieval] | ||
|
||
# ==================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
"""Voro scoring module. | ||
|
||
This module performs scoring of input pdb models using ftdmp voro-mqa-all tool. | ||
For more information, please check: https://github.com/kliment-olechnovic/ftdmp | ||
|
||
It is a third party module, and requires the appropriate set up and intallation | ||
for it to run without issue. | ||
""" | ||
from os import linesep | ||
from pathlib import Path | ||
|
||
from haddock.core.defaults import MODULE_DEFAULT_YAML | ||
from haddock.core.typing import Any, FilePath | ||
from haddock.modules import get_engine | ||
from haddock.modules.scoring import ScoringModule | ||
from haddock.modules.scoring.voroscoring.voroscoring import ( | ||
VoroMQA, | ||
update_models_with_scores, | ||
) | ||
|
||
RECIPE_PATH = Path(__file__).resolve().parent | ||
DEFAULT_CONFIG = Path(RECIPE_PATH, MODULE_DEFAULT_YAML) | ||
|
||
|
||
class HaddockModule(ScoringModule): | ||
""".""" | ||
|
||
name = RECIPE_PATH.name | ||
|
||
def __init__( | ||
self, | ||
order: int, | ||
path: Path, | ||
*ignore: Any, | ||
init_params: FilePath = DEFAULT_CONFIG, | ||
**everything: Any, | ||
) -> None: | ||
"""Initialize class.""" | ||
super().__init__(order, path, init_params) | ||
|
||
@classmethod | ||
def confirm_installation(cls) -> None: | ||
"""Confirm module is installed.""" | ||
# FIXME ? Check : | ||
# - if conda env is accessible | ||
# - if ftdmp is accessible | ||
return | ||
|
||
def _run(self) -> None: | ||
"""Execute module.""" | ||
# Retrieve previous models | ||
try: | ||
models_to_score = self.previous_io.retrieve_models( | ||
individualize=True | ||
) | ||
except Exception as e: | ||
self.finish_with_error(e) | ||
|
||
# Initiate VoroMQA object | ||
output_fname = Path("voro_mqa_all.tsv") | ||
voromqa = VoroMQA( | ||
models_to_score, | ||
'./', | ||
self.params, | ||
output=output_fname, | ||
) | ||
|
||
# Launch machinery | ||
jobs: list[VoroMQA] = [voromqa] | ||
# Run Job(s) | ||
self.log("Running Voro-mqa scoring") | ||
Engine = get_engine(self.params['mode'], self.params) | ||
engine = Engine(jobs) | ||
engine.run() | ||
self.log("Voro-mqa scoring finished!") | ||
|
||
# Update score of output models | ||
try: | ||
self.output_models = update_models_with_scores( | ||
output_fname, | ||
models_to_score, | ||
metric=self.params["metric"], | ||
) | ||
except ValueError as e: | ||
self.finish_with_error(e) | ||
|
||
# Write output file | ||
scoring_tsv_fpath = f"{RECIPE_PATH.name}.tsv" | ||
self.output( | ||
scoring_tsv_fpath, | ||
header_comments=f"# Note that negative of the value are reported in the case of non-energetical predictions{linesep}", # noqa : E501 | ||
) | ||
# Export to next module | ||
self.export_io_models() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
metric: | ||
default: jury_score | ||
type: string | ||
choices: | ||
- jury_score | ||
- GNN_sum_score | ||
- GNN_pcadscore | ||
- voromqa_dark | ||
- voromqa_light | ||
- voromqa_energy | ||
- gen_voromqa_energy | ||
- clash_score | ||
- area | ||
minchars: 1 | ||
maxchars: 50 | ||
title: VoroMQA metric used to score. | ||
short: VoroMQA metric used to score. | ||
long: VoroMQA metric used to score. | ||
group: analysis | ||
explevel: easy | ||
|
||
conda_install_dir: | ||
default: "/trinity/login/vreys/miniconda3/" | ||
type: string | ||
minchars: 1 | ||
maxchars: 158 | ||
title: Path to conda intall directory. | ||
short: Absolute path to conda intall directory. | ||
long: Absolute path to conda intall directory. | ||
group: execution | ||
explevel: easy | ||
|
||
conda_env_name: | ||
default: "ftdmp5" | ||
type: string | ||
minchars: 1 | ||
maxchars: 100 | ||
title: Name of the ftdmp conda env. | ||
short: Name of the ftdmp conda env. | ||
long: Name of the ftdmp conda env. | ||
group: execution | ||
explevel: easy | ||
|
||
ftdmp_install_dir: | ||
default: "/trinity/login/vreys/Venclovas/ftdmp/" | ||
type: string | ||
minchars: 1 | ||
maxchars: 158 | ||
title: Path to ftdmp intall directory. | ||
short: Absolute path to ftdmp intall directory. | ||
long: Absolute path to ftdmp intall directory. | ||
group: execution | ||
explevel: easy | ||
|
||
nb_gpus: | ||
default: 1 | ||
type: integer | ||
min: 1 | ||
max: 420 | ||
title: Number of accessible gpu on the device. | ||
short: Number of accessible gpu on the device. | ||
long: Number of accessible gpu on the device. | ||
group: execution | ||
explevel: easy | ||
|
||
concat_chain_: | ||
default: [] | ||
type: list | ||
minitems: 0 | ||
maxitems: 100 | ||
title: List of residues supposed to be buried | ||
short: List of residues supposed to be buried | ||
long: concat_chain_* is an expandable parameter. You can provide concat_chain_1, | ||
concat_chain_2, concat_chain_3, etc. For each selection, enlisted chains will | ||
be concatenated as one prior to scoring. | ||
group: analysis | ||
explevel: expert | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.