feat: Add atom-wise RASA conditioning for ligand orientation design#35
Open
daylight-00 wants to merge 3 commits intoRosettaCommons:mainfrom
Open
feat: Add atom-wise RASA conditioning for ligand orientation design#35daylight-00 wants to merge 3 commits intoRosettaCommons:mainfrom
daylight-00 wants to merge 3 commits intoRosettaCommons:mainfrom
Conversation
- Clamp bucket indices to valid range [0, n-1] - Fix off-by-one error in bucket assignment - Ensure values below 'low' go to first bucket - Ensure values above 'high' go to last bucket
Enable ligand atom information to be accessible during feature computation: - Store metadata (including ligand_atom_names) in Sampler.sample_init() - Pass metadata to get_extra_tXd_inference() calls via kwargs - Enables features like atom-wise RASA to map atom names to values This infrastructure is required for per-atom feature specification, where different atoms in a ligand can have different conditioning values.
Add parse_atomwise_rasa_config() to support per-atom RASA values: - Parse configuration strings like '0.0,O7:0.8,C8:1.0,C9:1.0' - Map ligand atom names to specific RASA values - Fall back to global RASA when atom-specific values not provided - Add validation and logging for atom matching Update get_relative_sasa_inference() to: - Use new parsing function - Accept metadata via kwargs - Print summary statistics of applied RASA values
Author
|
Resolves #11 |
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.
Summary
This PR implements atom-wise RASA conditioning for ligands, enabling precise control over which atoms should be buried or exposed. This allows fine-grained control of ligand orientation during protein-ligand design.
Key Point: The model was already trained with atom-level RASA features (
rf_diffusion/sasa.pycomputes SASA per atom). This PR simply exposes that capability to users at inference time, ensuring backward compatibility with existing global RASA specifications.Changes
rasa='global_rasa,ATOM1:value1,ATOM2:value2,...'to control individual atomsone_hot_buckets()functionTechnical Details
Usage Examples
Control ligand orientation by specifying which atoms should be exposed:
4yhy_m3l.pdb
Inward Orientation
→ M3L backbone faces outward (backbone atoms have high RASA values)
Outward Orientation
→ M3L side chain faces outward (side chain atoms have high RASA values)
Why This Matters
Validated with successful test cases (see examples above). Happy to address any feedback!