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

Sort models from previous module by score in caprieval #234

Merged
merged 2 commits into from
Dec 29, 2021
Merged
Changes from 1 commit
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
9 changes: 5 additions & 4 deletions src/haddock/modules/analysis/caprieval/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,10 @@ def _run(self):
p for p in self.previous_io.output if p.file_type == Format.PDB
]

# by default modes_to_calc should have been sorted by the module
# that produced it
best_model = Path(models_to_calc[0].path, models_to_calc[0].file_name)
# Sort by score
model_l = [(m.score, m) for m in models_to_calc]
model_l.sort()
best_model = Path(model_l[0][1].full_name)

if self.params["reference"]:
reference = Path(self.params["reference"])
Expand All @@ -589,7 +590,7 @@ def _run(self):
else:
self.log(
"No reference was given. "
"Using best ranking structure from previous step")
"Using the structure with the lowest score from previous step")
reference = best_model

# detect the molecule types and use the appropriate atoms
Expand Down