Skip to content

Commit

Permalink
Fix complex alignment for Chai-1
Browse files Browse the repository at this point in the history
  • Loading branch information
amorehead committed Sep 26, 2024
1 parent ac8b5c3 commit f598865
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ python3 posebench/models/ensemble_generation.py ensemble_methods=\[chai-lab\] in
# NOTE: the suffixes for both `output_dir` and `ensemble_benchmarking_repeat_index` should be modified to e.g., 2, 3, ...
...
# now score the CASP15-compliant submissions using the official CASP scoring pipeline
python3 posebench/analysis/inference_analysis_casp.py method=chai-lab dataset=casp15 repeat_index=1
python3 posebench/analysis/inference_analysis_casp.py method=chai-lab dataset=casp15 repeat_index=1 targets='[H1135, T1127v2, T1146, T1152, T1158v1, T1158v2, T1158v3, T1158v4, T1186, T1187, T1188]'
...
```

Expand Down
11 changes: 8 additions & 3 deletions posebench/analysis/complex_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,11 @@ def main(cfg: DictConfig):
output_protein_files = sorted(
[
item
for item in output_dir.rglob("*protein.pdb")
if any(
for item in output_dir.rglob(
f"pred.model_idx_{cfg.rank_to_align - 1}_protein*.pdb"
)
if "_aligned" not in item.stem
and any(
[item.parent.stem in file.parent.stem for file in output_ligand_files]
)
]
Expand All @@ -426,7 +429,9 @@ def main(cfg: DictConfig):
), f"Numbers of protein ({len(output_protein_files)}) and ligand ({len(output_ligand_files)}) files do not match."

# align protein-ligand complexes
for protein_file, ligand_file in tqdm(zip(output_protein_files, output_ligand_files)):
for protein_file, ligand_file in tqdm(
zip(output_protein_files, output_ligand_files), desc="Aligning complexes"
):
protein_id, ligand_id = protein_file.stem, ligand_file.stem
if protein_id != ligand_id and cfg.method == "dynamicbind":
protein_id, ligand_id = (
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_inference_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"python3 posebench/models/ensemble_generation.py ensemble_methods=[chai-lab] ensemble_ranking_method={ensemble_ranking_method} input_csv_filepath=data/test_cases/casp15/ensemble_inputs.csv output_dir=data/test_cases/casp15/top_chai-lab_ensemble_predictions_{repeat_index} skip_existing=true relax_method_ligands_post_ranking=true relax_protein={relax_protein} export_file_format=casp15 export_top_n=5 combine_casp_output_files=true max_method_predictions=40 method_top_n_to_select=5 resume=true ensemble_benchmarking=true ensemble_benchmarking_dataset=casp15 cuda_device_index={cuda_device_index} ensemble_benchmarking_repeat_index={repeat_index}",
],
"analyze_casp15": [
"python3 posebench/analysis/inference_analysis_casp.py method=chai-lab dataset=casp15 repeat_index={repeat_index} relax_protein={relax_protein}",
"python3 posebench/analysis/inference_analysis_casp.py method=chai-lab dataset=casp15 repeat_index={repeat_index} relax_protein={relax_protein} targets='[H1135, T1127v2, T1146, T1152, T1158v1, T1158v2, T1158v3, T1158v4, T1186, T1187, T1188]'",
],
},
"vina": {
Expand Down

0 comments on commit f598865

Please sign in to comment.