Skip to content

Commit 8222319

Browse files
authored
Make skipping of failed DynamicBind predictions more robust in ensemble_generation.py
1 parent 55094c8 commit 8222319

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/models/ensemble_generation.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,13 +794,20 @@ def get_method_predictions(
794794
if Path(file).stem.replace("_ligand_", "_receptor_")
795795
in {Path(protein_file).stem for protein_file in protein_output_files}
796796
]
797-
elif len(ligand_output_files) < len(protein_output_files):
797+
if len(ligand_output_files) < len(protein_output_files):
798798
protein_output_files = [
799799
file
800800
for file in protein_output_files
801801
if Path(file).stem.replace("_receptor_", "_ligand_")
802802
in {Path(ligand_file).stem for ligand_file in ligand_output_files}
803803
]
804+
if len(protein_output_files) < len(ligand_output_files):
805+
ligand_output_files = [
806+
file
807+
for file in ligand_output_files
808+
if Path(file).stem.replace("_ligand_", "_receptor_")
809+
in {Path(protein_file).stem for protein_file in protein_output_files}
810+
]
804811
assert len(protein_output_files) == len(
805812
ligand_output_files
806813
), "The number of DynamicBind protein and ligand files must match."

0 commit comments

Comments
 (0)