Issue with ORI token in partial diffusion#275
Open
jonfunk21 wants to merge 1 commit into
Open
Conversation
…tial diffusion `_set_origin` for partial diffusion previously hard-coded `ori_token=None` and `infer_ori_strategy="com"`, with two consequences: 1. The user-supplied `ori_token` (and `infer_ori_strategy`) was silently dropped. Documented behavior is that the diffused-region COM ends up within ~5 A of the user's ORI token, but in partial diffusion mode any value passed by the caller had no effect on the output coordinates. 2. The default centering used the COM of the entire input (motif + diffused region) instead of the diffused-region COM. The training pipeline uses `center_option=diffuse` (see `configs/datasets/design_base.yaml`), so the model expects the diffused region's COM at the origin. Joint-COM centering puts the diffused region far from origin in a frame the model never saw at training, which biases denoising to drag the diffused region toward the motif COM. On asymmetric systems (large target, small binder), the binder visibly drifts toward the target with increasing `partial_t` -- consistent with the "binder winds around target" reports. This change updates partial-diffusion centering to: 1. Skip centering for symmetric structures (unchanged). 2. Honor user-supplied `ori_token` / `infer_ori_strategy` if provided. 3. Otherwise center on the diffused-region COM (matches training). Empirical verification on a CD3E binder showed the inward pull at partial_t=15 dropped from -4.46 A (joint-COM centering) to -0.46 A (diffused-COM centering). On a thelma enzyme run, supplying `ori_token=[50,0,0]` now shifts the output frame by -50 A in x as expected (was 0 A before), while fixed-atom RMSD stays at machine precision (~0.02 A Kabsch). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
_set_originfor partial diffusion previously hard-codedori_token=Noneandinfer_ori_strategy="com", with two consequences:The user-supplied
ori_token(andinfer_ori_strategy) was silently dropped. Documented behavior is that the diffused-region COM ends up within ~5 A of the user's ORI token, but in partial diffusion mode any value passed by the caller had no effect on the output coordinates.The default centering used the COM of the entire input (motif + diffused region) instead of the diffused-region COM. The training pipeline uses
center_option=diffuse(seeconfigs/datasets/design_base.yaml), so the model expects the diffused region's COM at the origin. Joint-COM centering puts the diffused region far from origin in a frame the model never saw at training, which biases denoising to drag the diffused region toward the motif COM. On asymmetric systems (large target, small binder), the binder visibly drifts toward the target with increasingpartial_t-- consistent with the "binder winds around target" reports.This change updates partial-diffusion centering to:
ori_token/infer_ori_strategyif provided.