fix(utils): assign unique chain IDs when parsing multi-record FASTAs - #59
Open
omar-A-hassan wants to merge 1 commit into
Open
fix(utils): assign unique chain IDs when parsing multi-record FASTAs#59omar-A-hassan wants to merge 1 commit into
omar-A-hassan wants to merge 1 commit into
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.
Summary of Changes
Fixes a silent chain-truncation bug in
parse_fasta(src/simplefold/utils/fasta_utils.py).Currently,
parse_fastahardcodes"id": "A"for every record in a multi-record FASTA:When parsing a multi-record FASTA (e.g., Heavy Chain + Light Chain),
parse_boltz_schemastores parsed chains in a dictionary keyed by"id". Because every record getsid: "A", subsequent records overwrite preceding records under key"A". This causesparse_fastato silently drop all chains except the last record without raising an error.Proposed Fix
Enumerate record indices and assign unique chain identifiers (
"A","B","C", ...):Verification
Verified using
parse_fastaon a 2-record FASTA (Heavy + Light chains):Chain A, 23 residues). Heavy chain dropped.Chain A, 26 residues;Chain B, 23 residues).