Fix PDB parsing for multi-chain polymers - #237
Open
ryanhulke wants to merge 1 commit into
Open
Conversation
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.
fixes #236.
PDB files can declare one polymer entity with multiple chains, e.g.
COMPND ... CHAIN: A, B. The PDB parser was assigninglabel_seqonly forentity.subchains[0], leaving later subchains withoutlabel_seq_idafter Gemmi converts the PDB to mmCIF.this caused residues in the following subchains to be parsed as
is_present=Falseand then dropped during mmCIF serialization, which could create token/design-mask length mismatches downstream.Changes
label_seqfor every polymer subchain in a multi-chain entityfull_sequence/SEQRES by inferring the sequence from the first non-empty subchainTesting
3K4P, which declaresCHAIN: A, Bparse_pdb(..., use_assembly=False)preserves both chains,A: 444 residues, 438 presentB: 444 residues, 438 presentto_mmcif(...)round-trip preserves both chains with the same countspython -m py_compile src/boltzgen/data/parse/pdb_parser.pypython -m pytest tests/test_residue_constraints.pypython -m pytest tests/test_inverse_fold_constraint_masks.py