@@ -317,7 +317,6 @@ def _print_usage_and_exit() -> None:
317317
318318[bold]Options:[/bold]
319319 -g, --device TEXT Device: auto, cpu, cuda, cuda:N, mps
320- --n-samples INT Poses per ligand (default: 20)
321320 --gpus TEXT Multi-GPU ids for batch mode, e.g. 2,3
322321 --n-samples INT Poses per ligand (default: 20)
323322 --scorer TEXT gnina / custom / none (default: gnina)
@@ -382,7 +381,7 @@ def run_matcha(
382381 from omegaconf import OmegaConf # noqa: F811
383382 from rdkit import Chem # noqa: F811
384383 from matcha .utils .esm_utils import compute_esm_embeddings , compute_sequences
385- from matcha .utils .inference_utils import run_v2_inference_pipeline
384+ from matcha .utils .inference_utils import run_v2_inference_pipeline , compute_fast_filters_from_sdf
386385 from matcha .utils .multigpu import parse_gpus , run_multigpu_batch
387386 from matcha .scoring import create_scorer
388387 from matcha .utils .device import resolve_device
@@ -679,8 +678,8 @@ def _read_scored_sdf_affinity(sdf_path: Path) -> List[float]:
679678
680679 # Optional GNINA scoring
681680 scorer_used = False
682- sdf_scored = preds_root / dataset_name / "scored_sdf_predictions "
683- best_scored_dir = preds_root / dataset_name / "best_scored_predictions "
681+ sdf_scored = preds_root / dataset_name / "minimized_sdf_predictions "
682+ best_scored_dir = preds_root / dataset_name / "best_minimized_predictions "
684683 if scorer_type != "none" and scorer_type .startswith ("gnina" ) and not resolved_device .startswith ("cuda" ):
685684 console .print (f"[bold yellow][matcha][/bold yellow] GNINA requires CUDA; skipping scoring on { resolved_device } " )
686685 scorer_type = "none"
@@ -690,7 +689,7 @@ def _read_scored_sdf_affinity(sdf_path: Path) -> List[float]:
690689 scorer = create_scorer (scorer_type , scorer_path = str (scorer_path ) if scorer_path else None ,
691690 minimize = scorer_minimize )
692691 sdf_input = preds_root / dataset_name / "sdf_predictions"
693- filters_path = preds_root / dataset_name / "filters_results .json"
692+ filters_path = preds_root / dataset_name / "filters_results_minimized .json"
694693 if scorer_type .startswith ("gnina" ) and batch_mode :
695694 if gnina_batch_mode not in {"combined" , "per-ligand" }:
696695 raise typer .BadParameter ("--gnina-batch-mode must be 'combined' or 'per-ligand'" )
@@ -702,8 +701,14 @@ def _read_scored_sdf_affinity(sdf_path: Path) -> List[float]:
702701 n_samples = n_samples ,
703702 device = cuda_device_idx ,
704703 )
704+ compute_fast_filters_from_sdf (conf , run_name , sdf_type = 'minimized' , n_preds_to_use = n_samples )
705+ scorer .select_top_poses (
706+ str (sdf_scored ), str (best_scored_dir ),
707+ filters_path = str (filters_path ), n_samples = n_samples
708+ )
705709 else :
706710 scorer .score_poses (str (receptor ), str (sdf_input ), str (sdf_scored ), device = cuda_device_idx )
711+ compute_fast_filters_from_sdf (conf , run_name , sdf_type = 'minimized' , n_preds_to_use = n_samples )
707712 scorer .select_top_poses (str (sdf_scored ), str (best_scored_dir ),
708713 filters_path = str (filters_path ), n_samples = n_samples )
709714 scorer_used = True
0 commit comments