Skip to content

Add optional ML tranche-prioritization classifier for ATG Primary Screen#5

Open
akshat998 wants to merge 1 commit into
QuantumAI4Bio:developfrom
akshat998:feature/ml-tranche-prioritization-classifier
Open

Add optional ML tranche-prioritization classifier for ATG Primary Screen#5
akshat998 wants to merge 1 commit into
QuantumAI4Bio:developfrom
akshat998:feature/ml-tranche-prioritization-classifier

Conversation

@akshat998

@akshat998 akshat998 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional machine learning classifier to the ATG-VS (Adaptive Target-Guided Virtual Screening) pipeline. After tranches/collections are selected for the ATG Primary Screen, this classifier scores every ligand in each selected collection (not just the sparse sample docked during the ATG Prescreen) and keeps only the ones predicted worth docking, which can substantially reduce the number of ligands actually docked.

The classifier is a fully-connected network over 1024-bit/radius-2 Morgan fingerprints (1024-512-256-128-1, ReLU/ReLU/ReLU/Sigmoid), trained on the ATG Prescreen's own docking results (top-25% most-negative scores labeled positive, with majority-class undersampling).

  • tools/templates/ml_classifier.py: the classifier itself -- model definition, training (Adam, BCE loss, early stopping), atomic save/load, and batched inference.
  • tools/afvs_train_ml_classifier.py: one-shot host-side CLI that trains the classifier on postprocessed ATG Prescreen results (supports both the AWS/Athena ranking file and the raw Slurm per-collection summary CSVs).
  • tools/afvs_apply_ml_classifier_atg-primaryscreen.py: fetches each tranche-selected collection's full ligand set -- reusing afvs_run.py's own unpack_item()/get_attrs() and afvs_prepare_workunits.py's collection-addressing helpers directly rather than reimplementing them -- and writes a csv_collection_key_ligand-format ligand list. This is an existing, already-supported collection_list_type in all.ctrl, so no changes are needed to the docking engine (afvs_run.py) itself.
  • afvs_prepare_atg-primary-screen-folders.sh: two new optional trailing arguments, ml_classifier_model:<path> and ml_classifier_cutoff:<value>, following the script's existing prefix-tagged argument convention. When omitted, behavior is unchanged.
  • docker/Dockerfile: adds the CPU-only torch wheel and rdkit, the classifier's only new dependencies.
  • Tutorial docs (tutorials/tutorial-1-afvs-on-aws and tutorial-2-afvs-on-slurm, preparing-the-atg-primary-screen.md): usage instructions for training and applying the classifier.

Adds a machine learning classifier that, after tranche selection, scores
every ligand of every tranche-selected collection and keeps only the ones
predicted worth docking, reducing the number of ligands actually docked in
the ATG Primary Screen.

- tools/templates/ml_classifier.py: FNN classifier (Morgan fingerprints ->
  1024-512-256-128-1, ReLU/ReLU/ReLU/Sigmoid) with training, atomic
  save/load, and batched inference helpers.
- tools/afvs_train_ml_classifier.py: trains the classifier on postprocessed
  ATG Prescreen results (AWS ranking file or raw Slurm summary CSVs).
- tools/afvs_apply_ml_classifier_atg-primaryscreen.py: fetches each
  tranche-selected collection's full ligand set (reusing afvs_run.py's
  unpack_item()/get_attrs() and afvs_prepare_workunits.py's collection
  addressing helpers) and writes a csv_collection_key_ligand-format ligand
  list consumable by the existing collection_list_type mechanism, with no
  changes needed to the docking engine itself.
- afvs_prepare_atg-primary-screen-folders.sh: optional ml_classifier_model:
  and ml_classifier_cutoff: arguments wire the filtered ligand list into a
  new Primary Screen run's all.ctrl. Fully backward compatible when omitted.
- docker/Dockerfile: adds the CPU-only torch and rdkit dependencies needed
  by the classifier.
- Tutorial docs updated with usage instructions for both the AWS and Slurm
  workflows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant