Repository navigation
Fall back to the query sequence for empty custom MSAs (#770) - #865
Open
AtharvaTilewale wants to merge 1 commit into
Open
AtharvaTilewale wants to merge 1 commit into
AtharvaTilewale wants to merge 1 commit into
Conversation
A custom a3m that contains only paired sequences makes unserialize_msa return a list of empty strings for the unpaired MSA instead of None, so generate_input_feature passed "" to build_monomer_feature and make_msa_features raised "MSA 0 must contain at least one sequence". Treat an empty entry like None and use the query sequence instead, for both the unpaired and the paired MSA. Fixes sokrypton#770
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
A custom a3m for a complex that contains only paired sequences (every row has residues in every segment, no unpaired block) aborts prediction with
both in
colabfold_batchand in the notebook. Reported in #770.Root cause
unserialize_msaroutes every row that has residues in more than one segment to the paired chunks, so for a paired-only a3m the unpaired MSA comes back as a list of empty strings (['', '']), not asNone.generate_input_featureonly falls back to the single-sequence MSA whenunpaired_msa is None, so it passes''tobuild_monomer_featureandpipeline.make_msa_featuresraisesMSA 0 must contain at least one sequence.What the fix does
Treat an empty MSA entry like
Noneingenerate_input_feature, i.e. use>{101 + sequence_index}\n{sequence}for that chain. The same guard is applied to the paired MSA in the multimer branch, which has the symmetric problem for an a3m with only unpaired sequences.Validation
Added
tests/test_paired_only_custom_msaintests/test_msa.py: it builds a paired-only heterodimer a3m, runs it throughunserialize_msa(asserting the unpaired MSA really is['', '']) and then throughgenerate_input_featurewith a multimer model type.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 #770
Disclosure: this change was prepared with AI assistance and validated locally as described above.