* Improve PTM bond handling in RFdiffusion3 input parsing
Replace the old _restore_bonds_for_nonstandard_residues approach with a
more robust bond restoration system that properly handles unindexed
components, backbone-like bonds for non-standard residues (PTMs), and
cross-residue bond preservation from source structures. Adds the legacy
counterpart and regression tests for both code paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Apply ruff formatting to PTM bond handling files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove is_motif_atom guards from legacy input parsing
The bare is_motif_atom annotation is being abolished; remove the
guards that were adding it when missing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Gate bond restoration behind nonstandard-residue check
Only run _restore_component_bonds, _add_backbone_bonds_for_nonstandard_residues,
and _sort_bonds when the source structure actually has backbone connections
to nonstandard residues.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix ligand res_id offset to match AF3 output convention
RFD3 was offsetting ligand res_id values from the protein max, causing
(chain_id, res_id, atom_name) pairing to fail against AF3 predictions
which always start ligand res_id at 1. Replace the offset with dense
rank-based per-chain renumbering (1, 2, ...) and add a chain A
validation with an override option (allow_ligand_on_chain_a).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Generalize chain validation to all existing chains
Rename allow_ligand_on_chain_a → allow_ligand_on_existing_chain and
check against all chains already present in the built atom array,
not just chain A.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Error on multiple ligands per chain; preserve gaps in override mode
When allow_ligand_on_existing_chain is False, raise an error if
multiple ligand residues share the same chain. Reset res_id min to 1
per chain, preserving relative gaps when ligands share a chain
(override mode).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Use legacy res_id offset when allow_ligand_on_existing_chain is True
The override path now matches the old behaviour (offset from protein
max res_id). The default path (separate chains) sets each ligand
chain's res_id to 1.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Note in errors that override restores old behaviour
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
I created a contribution guide for foundry that is meant to live both in the main directory and in the external documentation. Since this file lives outside of the `docs` folder but I still wanted it in the external documentation, the `contributing_link.rst` file is necessary. The content in the guide is based on the Atomworks contribution guide and some of the information provided in the Foundry README. Since this is mean to be rendered both on GitHub and Sphinx, I had to suppress Sphinx's `xref_missing` warnings because while these references are hidden in the Sphinx-built docs, they are visible in the GitHub rendered docs.
While creating this file I realized that a docs_requirements.txt file needed to be created so that contributors could easily make the necessary docs environment to run Sphinx.
* Expose n_recycle as inference sampler parameter and improve docs
The n_recycle parameter was previously hardcoded in the diffusion module
config and not overridable at inference time. This exposes it through the
inference sampler so users can control recycling iterations via CLI
(e.g. inference_sampler.n_recycle=3). Also adds num_timesteps and
n_recycle to the "Other CLI Options" docs section, and makes the
InputSpecification reference more prominent in the README.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds support for running inference on Apple Silicon MPS devices.
Key changes:
- Handle bfloat16 -> float32 fallback on MPS (bfloat16 unsupported)
- Add scatter_mean utility with MPS fallback (index_reduce unsupported)
- Guard masked_scatter_/boolean indexing in block_utils with MPS paths
- Use expand (zero-copy) on CUDA/CPU, repeat (contiguous) on MPS for
torch.where compatibility
- Add .contiguous() calls for scatter/gather ops that require it on MPS
- Replace hardcoded "cuda" in autocast dtype queries with device_of()
- Store torch.linalg.det result before torch.sign to avoid MPS in-place
op issues on autograd graph leaves
- Auto-detect MPS accelerator and enforce float32 precision
- Add MPS installation instructions to README
Based on work by @fnachon in PR #257 with additional fixes:
- expand/repeat if-else to avoid O(L^2) allocation on non-MPS backends
- ruff 0.8.3 formatting to pass CI lint checks
Co-Authored-By: fnachon
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Uploading and editing the first enzyme design tutorial from the Tutorial Hackathon
This tutorial was written by Johannes and Florian and is meant to be an intermediate enzyme design tutorial.
* Updated draft of Intermediate Enzyme Design Tutorial
* Added explanations for the fixed atom and unfixed motif constraints
* Added more detail about the metrics to quickly determine if a design is 'good'
* Adding example input and output files
- Removal of 1mg5.cif and 1mg5_motif.pdb.cif as they are not necessary for the tutorial.
- Creation of an `outputs.zip` that contains example output files for this tutorial
- Edits to the tutorial document to point to these files.
* Updated description of catalytic structure
Updated the description of the catalytic structure to better cite the literature.
* Docs: Installation FAQ space and minor RFD3 docs updates
Installation FAQ: created a document to specify any common installation issues and questions. Should be continuously updated based on logged issues and questions. Not specific to any model.
RFD3:
- changed the checkpoint files specified in the examples to rfd3_latest.ckpt
- updated information in input.md to clarify information based on recent issues that had been submitted
* Docs: Symlinks for RF3 and MPNN docs, RFD3 README minor edits
RF3 and MPNN: folders, index files, and symlinks were created in order to provide space for eventual RF3 and MPNN docs.
Several small changes in the RFD3 README to improve readability and add a pointer to the PPI tutorial as a starting point for someone new to RFdiffusion tools.
* First draft of enzyme design tutorial. Minor typo fixes in other documents.
* First draft of nucleic acid binder tutorial, minor edits to the other tutorials
* Completed enzyme design tutorial, removal of NA binder tutorial from index
Made changes based on edits from Saman, added images, and created zip file containing sample outputs for an enzyme design tutorial.
I am waiting on edits for the NA binder design tutorial, so for now I have removed it from the documentation index.
* First drafts of content for NA binder design tutorial
This tutorial is being created in collaboration with Raktim Mitra.
* Adding images to NA binder design tutorial
* Final draft of NA binder tutorial
* Create unfix.zip
* Updated images for na binder tutorial
* fix: restore exact python version constraint (==3.12)
Commit 49187c3 unintentionally reverted requires-python from ==3.12
back to >=3.12 as a side-effect of the inference fix. This restores
the exact version constraint originally introduced in 8aeacba.
* fix: relax python version constraint to allow 3.12.x
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* RF3 README update and moving RF3 examples
I updated the RF3 README for installation instructions that matched the RFD3 installation instructions. For the first example, I improve the instructions for running and fixed the output file descriptions to match what is now output by running the example. I commented out the 'Templating a Small Molecule' section because many of the files in that section were not present in the repository. The rest of the changes were mostly typo fixes.
I moved the examples from `foundry/docs/releases` to `foundry/models/rf3/docs` to match the organization of RFD3. The changes made to the JSON files just reflect this change of location.
* Changed paths in example JSON files to point to new RF3 examples location
* Updated the landing page for the RF3 documentation so that it links out to the README
* Docs: Installation FAQ space and minor RFD3 docs updates
Installation FAQ: created a document to specify any common installation issues and questions. Should be continuously updated based on logged issues and questions. Not specific to any model.
RFD3:
- changed the checkpoint files specified in the examples to rfd3_latest.ckpt
- updated information in input.md to clarify information based on recent issues that had been submitted
* Docs: Symlinks for RF3 and MPNN docs, RFD3 README minor edits
RF3 and MPNN: folders, index files, and symlinks were created in order to provide space for eventual RF3 and MPNN docs.
Several small changes in the RFD3 README to improve readability and add a pointer to the PPI tutorial as a starting point for someone new to RFdiffusion tools.
* First draft of enzyme design tutorial. Minor typo fixes in other documents.
* First draft of nucleic acid binder tutorial, minor edits to the other tutorials
* Completed enzyme design tutorial, removal of NA binder tutorial from index
Made changes based on edits from Saman, added images, and created zip file containing sample outputs for an enzyme design tutorial.
I am waiting on edits for the NA binder design tutorial, so for now I have removed it from the documentation index.
* Removing file related to in-progress NA binder tutorial
* Removing file related to in-progress NA binder tutorial
* Final version of the enzyme design tutorial
Made small edits, created example files.
* Resolving merge conflicts
* Docs: Installation FAQ space and minor RFD3 docs updates
Installation FAQ: created a document to specify any common installation issues and questions. Should be continuously updated based on logged issues and questions. Not specific to any model.
RFD3:
- changed the checkpoint files specified in the examples to rfd3_latest.ckpt
- updated information in input.md to clarify information based on recent issues that had been submitted
* Docs: Symlinks for RF3 and MPNN docs, RFD3 README minor edits
RF3 and MPNN: folders, index files, and symlinks were created in order to provide space for eventual RF3 and MPNN docs.
Several small changes in the RFD3 README to improve readability and add a pointer to the PPI tutorial as a starting point for someone new to RFdiffusion tools.
* First draft of enzyme design tutorial. Minor typo fixes in other documents.
* First draft of nucleic acid binder tutorial, minor edits to the other tutorials
* Completed enzyme design tutorial, removal of NA binder tutorial from index
Made changes based on edits from Saman, added images, and created zip file containing sample outputs for an enzyme design tutorial.
I am waiting on edits for the NA binder design tutorial, so for now I have removed it from the documentation index.
* Removing file related to in-progress NA binder tutorial
* Removing file related to in-progress NA binder tutorial
* Update ppi_design_tutorial.md
- Added information about useful CLI arguments
- Cleaned up the introduction
- Added section for what one might do with the designs from RFD3
- Added a note about hotspot residues also being in the `contig` (information from Rafi's TTT talk)
- Fixed minor sphinx heading issue
* Reorganizing RFD3 documentation
Reorganized files into an `examples` and a `tutorials` folders to clean up the RFD3 docs folder and align its organization with the RF3 docs folder. Any edits made in the files are related to changing the paths to reflect these changes.
* Docs: Designability vs. Diversity document
Created a document describing the settings that can impact the designability and diversity of structures output by RFdiffusion3, the information is based on the talk Rafi gave at Tech Tea Time in January.
* Minor grammar fixes in designability vs diversity document
* Update models/rfd3/docs/tutorials/ppi_design_tutorial.md
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
* Update models/rfd3/docs/tutorials/enzyme_design_tutorial.md
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
* Update models/rfd3/docs/designability_vs_diversity.md
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
* Update models/rfd3/docs/designability_vs_diversity.md
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
---------
Co-authored-by: Jasper Butcher <66851659+Ubiquinone-dot@users.noreply.github.com>
Co-authored-by: Rafael Brent <105883594+RafiBrent@users.noreply.github.com>
* Create Issue Templates
Created templates for bug reports, feature requests, and usage questions. The main goal is to encourage users to provide files and details required to understand their problem/request/question so that minimal back and forth needs to occur before a solution is reached.
* Revise issue template for clarity and detail
Updated issue template to include a request for images of expected behavior and streamlined the reproduction steps section.
* Upload Dockerfile to examples
* Update Foundry README with Docker information
- There is an image for Foundry on DockerHub
- Example recipe is in `foundry/examples/docker`
---------
Co-authored-by: Rachel Clune <rachel.clune@omsf.io>
* Docs: Installation FAQ space and minor RFD3 docs updates
Installation FAQ: created a document to specify any common installation issues and questions. Should be continuously updated based on logged issues and questions. Not specific to any model.
RFD3:
- changed the checkpoint files specified in the examples to rfd3_latest.ckpt
- updated information in input.md to clarify information based on recent issues that had been submitted
* Docs: Symlinks for RF3 and MPNN docs, RFD3 README minor edits
RF3 and MPNN: folders, index files, and symlinks were created in order to provide space for eventual RF3 and MPNN docs.
Several small changes in the RFD3 README to improve readability and add a pointer to the PPI tutorial as a starting point for someone new to RFdiffusion tools.
feat: Add Intel XPU support for all models
- Add XPU accelerator, precision, and strategy classes
- Update DDP utilities to detect and use Intel XPU
- Add XPU trainer configs for RF3 and RFD3
- Update MPNN inference engine for XPU compatibility
- Update README with XPU documentation
Right now going to the GH pages site just shows the README, this is likely because GH is only building the README with Jekyll even though this workflow should override it without the added lines.
* Starting to put together the foundry and RFD3 external documentation
Set up the foundation for Sphinx to be able to build the external docs, first draft of a ppi_design_tutorial has been completed.
* Add RFdiffusion3 documentation and update toctree
Added initial documentation for RFdiffusion3 under models/rfd3/docs/index.rst and linked it in the main docs toctree. Updated toctree maxdepth for better navigation and added a symlink for the rfd3 model documentation.
* Update and expand RFdiffusion3 documentation
Added introductory and reference documentation files, improved the index structure with general information and examples, and enhanced the PPI design tutorial with additional notes, figures, and clarifications. Also fixed a typo in a PDB filename.
* Update RFD3 documentation and tutorial content
Expanded the Sphinx static path to include RFD3 assets and made minor formatting and clarity improvements in the main and RFD3-specific documentation. The PPI design tutorial was revised for clarity, improved step-by-step instructions, and better separation of setup and execution steps.
* Update RFD3 documentation and tutorials
Added source_suffix to Sphinx conf.py for Markdown support. Updated index.rst to include new documentation sections. Expanded intro_inference_calculations.md with detailed instructions on inference input formats, job configuration, and output files. Improved input.md formatting for appendices and FAQs. Revised ppi_design_tutorial.md for clarity, added details on settings, and expanded explanations for hotspots and batch inference.
* Update RFD3 docs: clarify input specs and file formats
Expanded and clarified the documentation for RFdiffusion3 input specifications, including more detailed explanations of the 'contig' string, input file types, and example YAML/JSON formats. Improved the intro to inference calculations to better explain the structure and usage of settings files, and updated descriptions for job configuration and output files. Added a placeholder for configuration options documentation.
* Update RFdiffusion3 input documentation and examples
Expanded and clarified the documentation for RFdiffusion3 input specification, including detailed explanations of CLI arguments, InputSpecification fields, the InputSelection mini-language, contig string formatting, and advanced options such as partial diffusion and CIF parser arguments. Added more examples, debugging recommendations, and an updated FAQ. Also updated the output file naming explanation for clarity. Removed the obsolete configuration_options.md file.
Note that images are still not being rendered correctly in many of the md files. Fix will be in future commit.
* PPI tutorial and RFD3 docs update
Created output files for PPI tutorial and listed their locations. Made edits to files to add labels to sections to remove sphinx warnings.
* Delete docs/source/conf.py~
This is an auto-save file from emacs - it does not need to be in the repo.
* Delete docs/source/index.rst~
This is an auto-saved copy of index.rst, it does not need to be in the repo
* Adding missing images and fixing docs symlink
* Fix grammatical error in RFdiffusion3 documentation
Fixed typo, clarified enzyme design language.
* Fix typos and enhance clarity in inference docs
Corrected typos and improved clarity in the documentation regarding inference settings and file formats.
* Improve 'unindex' field description in input_parsing.py
Updated the description for the 'unindex' field to clarify its purpose and usage.
* Make format