Cifs direct template structure #37
Open
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
Add CIF direct template mode to OpenFold3, allowing users to provide template structures as CIF files without pre-computed alignments. The system automatically aligns template chains to query sequences and selects the best match based on sequence identity × coverage.
Changes
Core Implementation
Template Processing
template_cif_pathsfield toChainmodel with validation to ensure mutual exclusivity withtemplate_alignment_file_pathCifDirectParserclass (openfold3/core/data/io/sequence/template.py) to parse CIF files directlyTemplatePreprocessorInputInference(openfold3/core/data/pipelines/preprocessing/template.py) to support both alignment-based and CIF-direct modes_parse_templates_from_cif_files()method for CIF-direct processingDocumentation
User Guides (
docs/source/Inference.md,docs/source/template_how_to.md)Example Files
Query JSONs
query_homomer_with_direct_cif_templates.json- Homomer examplequery_multimer_with_direct_cif_templates.json- Multimer exampleTemplate CIFs (15 files total)
1dgc.cif,1ysa.cif,1zta.cif,4dmd.cif,4dme.cif6l06.cif,6l07.cif,7cnw.cif,7cnx.cif,7cnz.cif(2 chain groups)Related Issues
N/A
Testing
I've created a script to test the CIF direct template feature across three template modes: no templates, ColabFold MSA server templates, and CIF direct templates (user-provided). The script runs 6 end-to-end inference tests to compare prediction quality across these modes for both homomer and multimer queries.
Test Script
Test Output
Summary
Test Configuration:
--use_templates false)--use_templates truewith automatic template discovery)Results:
Key Findings:
Technical Validation:
template_preprocessor_settings.create_logs: trueOther Notes
N/A