fix(proteins): match O/P/Q UniProt accessions in looksLikeAccession#104
Merged
Merged
Conversation
The leading character class /^[A-NR-Z0-9].../ excluded O, P and Q — the letters that begin most Swiss-Prot accessions (P04637, P38398, O43426, Q9Y6K9, and the docstring's own P00520). looksLikeAccession is the fast-path guard in the AlphaFold and SIFTS connectors: when it returns false the direct exact-accession lookup is skipped, so the most common human proteins silently fell through to the slower name-search path. Widen the first character to [A-Z0-9] and add coverage for O/P/Q prefixes, long TrEMBL accessions, and rejection of free-text names.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
looksLikeAccessionguarded the AlphaFold and SIFTS connectors' fast-path exact-accession lookup with/^[A-NR-Z0-9][A-Z0-9]{5,9}$/i. The first character class[A-NR-Z0-9]skips O, P and Q — the letters that begin most Swiss-Prot accessions (P04637, P38398, O43426, Q9Y6K9, and the function's ownP00520docstring example).When the guard returns
false, the connector skips the directaccessionlookup and falls through to the slower free-text name search, so the most common human proteins never hit the fast path.Fix
Widen the leading character to
[A-Z0-9].Tests
Adds
test/science/proteins-util.test.tscovering O/P/Q prefixes, 10-char TrEMBL accessions, whitespace trimming, and rejection of free-text names / out-of-range lengths.