Skip to content

Commit

Permalink
Make DynamicBind file quantity assessment more robust for inference r…
Browse files Browse the repository at this point in the history
…elaxation
  • Loading branch information
amorehead committed May 29, 2024
1 parent 79d8522 commit 8f182bd
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions src/models/inference_relaxation.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,29 @@ def relax_inference_results(
ligand_filepaths = sorted(ligand_filepaths)
if len(ligand_filepaths) < len(protein_filepaths):
# NOTE: the performance of these loops could likely be improved
protein_filepaths = [
protein_filepath
for protein_filepath in protein_filepaths
if any(
"_".join(protein_filepath.stem.split("_")[:2]) in ligand_filepath.stem
for ligand_filepath in ligand_filepaths
)
or any(
"_".join(protein_filepath.stem.split("_")[:2]) in ligand_filepath.parent.stem
for ligand_filepath in ligand_filepaths
)
]
if cfg.method == "dynamicbind":
protein_filepaths = [
protein_filepath
for protein_filepath in protein_filepaths
if any(
"_".join(protein_filepath.parent.parent.stem.split("_")[-3:])
in ligand_filepath.parent.parent.stem
for ligand_filepath in ligand_filepaths
)
]
else:
protein_filepaths = [
protein_filepath
for protein_filepath in protein_filepaths
if any(
"_".join(protein_filepath.stem.split("_")[:2]) in ligand_filepath.stem
for ligand_filepath in ligand_filepaths
)
or any(
"_".join(protein_filepath.stem.split("_")[:2]) in ligand_filepath.parent.stem
for ligand_filepath in ligand_filepaths
)
]
if cfg.method in ["diffdock", "rfaa"]:
ligand_filepaths = [
ligand_filepath
Expand Down

0 comments on commit 8f182bd

Please sign in to comment.