Add counter-target selectivity - #10
Open
ssiddhantsharma wants to merge 1 commit into
Open
Conversation
Fold each round's designs against one or more off-target ligands in addition to the on-target ligand, and add two objectives that reward on-target binding minus the worst-case off-target binding (iptm_selectivity, pbind_selectivity) so designs can be steered away from a similar molecule. The off-target fold reuses predict_complex_structures / get_boltz_yaml_boilerplate, writes to its own offtarget_<i>_boltz_inputs dir, and the worst-case metrics are keyed by Boltz stem and injected into confidence_data. Off by default (--counter-target-smiles). Wires the flag through run_nise_boltz2x_cli.py and adds tests/test_selectivity.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds counter-target selectivity to the loop: alongside the on-target ligand, each
round's designs are also folded against one or more off-target ligands, and two
objectives reward on-target binding minus the worst-case off-target binding:
iptm_selectivity—on_iptm - max(offtarget_iptm)pbind_selectivity—on_affinity_probability - max(offtarget_affinity_probability)This is the paired on-minus-off difference: a design that binds the target but not
the counter-target scores highest, so you can steer designs away from a similar
molecule you don't want bound.
Off by default; enabled with
--counter-target-smiles <SMILES> [...](orcounter_target_smiles=[...]).How it fits
Same seams as the existing objectives, no restructuring:
fold_counter_targets()folds each design against each counter-target using theexisting
predict_complex_structures()/get_boltz_yaml_boilerplate(), writes toits own
offtarget_<i>_boltz_inputsdir, and keeps the worst-case (strongest)off-target binding per design keyed by Boltz stem. Off-target structures are only
scored, never promoted to backbones.
parse_boltz_binding_metrics()reads iptm (+ affinity_probability_binary whenpredicting affinity) from the Boltz outputs.
identify_backbone_candidates()injectsofftarget_*into the existingconfidence_datadict, socompute_objective_function()just sees new keys.Wired through
run_nise_boltz2x_cli.pytoo (--counter-target-smilesplus the newobjectives in the choices list).
Notes
nanmax, so a design that bindsany of them is penalised, and a missing off-target affinity is skipped rather than
propagated as nan.
combine it with an on-target objective/threshold if you want that.
Testing
tests/test_selectivity.pycovers the objectives (including a case where aselective design beats a promiscuous one) and the Boltz metric parser.
expects and parses correctly; the fold reuses the same predict path NISE already
runs for the on-target ligand.