Bug Fix: Preserve full FASTA ID in alignment directory parsing to prevent truncation errors#485
Open
juliocesar-io wants to merge 1 commit intoaqlaboratory:mainfrom
Open
Bug Fix: Preserve full FASTA ID in alignment directory parsing to prevent truncation errors#485juliocesar-io wants to merge 1 commit intoaqlaboratory:mainfrom
juliocesar-io wants to merge 1 commit intoaqlaboratory:mainfrom
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.
Background
When running inference with
run_pretrained_openfold.pyand using precomputed alignments, theparse_fastafunction is partially extracting the FASTA tag/ID from the original ID used to generate the alignments output folder. It removes special characters, such as hyphens (-) or periods (.), which are often used in FASTA IDs.This causes the inference to fail, as the partially extracted ID does not match the alignments folder.
For example, if you have a FASTA file like this:
Then, after running the
precompute_alignments.pyscript, the following alignments are generated (as expected):However, when you run the
run_pretrained_openfold.pyscript with the--use_precomputed_alignmentsflag, you will encounter the following error:Fix
The error occurs because of the truncation performed by
parse_fasta, causing it to look for "my" instead of the expected "my-fasta-sequence". I have updated theparse_fastafunction to fix this issue.Previously, the part of the code that split the IDs using the regex
(re.split('\W|\|', t))was cutting off parts of the ID. For the workflow using precomputed alignments to function correctly, the full ID must be preserved so that it matches the folder.Changes:
>is treated as the ID.