Repository navigation
Skip template mmCIFs that biopython cannot parse (#610) - #866
Open
AtharvaTilewale wants to merge 1 commit into
Open
AtharvaTilewale wants to merge 1 commit into
AtharvaTilewale wants to merge 1 commit into
Conversation
mk_hhsearch_db parses every file in the template directory, so a single malformed entry of a local PDB mirror (e.g. 4udf or 1ejg, "Atom C defined twice") raised PDBConstructionException and aborted the whole run. Warn and skip that file instead, so the remaining templates are still used. Fixes sokrypton#610
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.
Problem
With
--templates --local-pdb-path ..., a single malformed entry in a local PDB mirror aborts the wholecolabfold_batchrun:Reported in #610 for entries such as
4udfand1ejg.Root cause
mk_hhsearch_dbparses every*.cifin the template directory withMMCIFParserand has no exception handling, so one unparsable file ends the run even though the other templates are fine. The surrounding code already warns-and-continues for the comparable cases (multiple models, insertion codes).What the fix does
Catch
PDBConstructionExceptionaroundparser.get_structure, log a warning naming the file, and continue with the next template. A skipped file is simply absent from the hhsearch database, so it cannot be selected as a hit.Other failure modes (e.g. the
ValueErrorthatvalidate_and_fix_mmcifraises for mmCIFs that are missing required fields) are deliberately left untouched here.Validation
Added
tests/test_templates.py, which writes two synthetic one-residue mmCIFs into a temp directory — one valid, one with an atom defined twice, as in the report — runsmk_hhsearch_dbon it, and checks that the run completes, the bad file is warned about, and the good chain is inpdb70_a3m.ffdatawhile the bad one is not.Pre-patch (
git stash push colabfold/batch.py, test kept):Post-patch:
The 7 errors are
tests/test_colabfold.pyprediction tests, which need network access to download parameters/MSAs; they error identically on unmodifiedmainin this environment (baseline there is28 passed, 20 skipped, 7 errors).Fixes #610
Disclosure: this change was prepared with AI assistance and validated locally as described above.