Skip to content
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

Propagate cluster related properties in caprieval #978

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/haddock/modules/analysis/caprieval/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ def _run(self) -> None:
)

else:
self.log(
msg="DEPRECATION NOTICE: This execution mode (less_io=False) will no longer be supported in the next version.",
level="warning",
)
jobs = merge_data(jobs)

# Each job created one .tsv, unify them:
Expand Down
8 changes: 5 additions & 3 deletions src/haddock/modules/analysis/caprieval/capri.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,9 +942,11 @@ def extract_data_from_capri_class(
"lrmsd": c.lrmsd,
"ilrmsd": c.ilrmsd,
"dockq": c.dockq,
"cluster_id": None,
"cluster_ranking": None,
"model-cluster_ranking": None,
"cluster_id": c.model.clt_id if c.model.clt_id else None,
"cluster_ranking": c.model.clt_rank if c.model.clt_rank else None,
"model-cluster_ranking": (
c.model.clt_model_rank if c.model.clt_model_rank else None
),
}
if c.model.unw_energies is not None:
data[i].update(c.model.unw_energies)
Expand Down
10 changes: 10 additions & 0 deletions tests/test_module_caprieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,10 @@ def test_extract_data_from_capri_class(mocker):
random_model = PDBFile(
file_name=str(uuid.uuid4()), score=42, unw_energies={"energy": random_energy}
)

random_clt_id = random.randint(0, 100)
random_clt_rank = random.randint(0, 100)
random_clt_model_rank = random.randint(0, 100)
random_md5 = str(uuid.uuid4())
random_score = random.random()
random_irmsd = random.random()
Expand All @@ -1001,6 +1005,9 @@ def test_extract_data_from_capri_class(mocker):
random_dockq = random.random()

c.model = random_model
c.model.clt_id = random_clt_id
c.model.clt_rank = random_clt_rank
c.model.clt_model_rank = random_clt_model_rank
c.md5 = random_md5
c.score = random_score
c.irmsd = random_irmsd
Expand All @@ -1024,3 +1031,6 @@ def test_extract_data_from_capri_class(mocker):
assert observed_data[1]["ilrmsd"] == random_ilrmsd
assert observed_data[1]["dockq"] == random_dockq
assert observed_data[1]["energy"] == random_energy
assert observed_data[1]["cluster_id"] == random_clt_id
assert observed_data[1]["cluster_ranking"] == random_clt_rank
assert observed_data[1]["model-cluster_ranking"] == random_clt_model_rank
Loading