Skip to content

fix(proteins): match O/P/Q UniProt accessions in looksLikeAccession#104

Merged
Aayam Bansal (aayambansal) merged 1 commit into
mainfrom
fix/uniprot-opq-accession
Jul 6, 2026
Merged

fix(proteins): match O/P/Q UniProt accessions in looksLikeAccession#104
Aayam Bansal (aayambansal) merged 1 commit into
mainfrom
fix/uniprot-opq-accession

Conversation

@aayambansal

Copy link
Copy Markdown
Member

What

looksLikeAccession guarded 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 own P00520 docstring example).

When the guard returns false, the connector skips the direct accession lookup 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.ts covering O/P/Q prefixes, 10-char TrEMBL accessions, whitespace trimming, and rejection of free-text names / out-of-range lengths.

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.
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openscience Ready Ready Preview, Comment Jul 6, 2026 3:16pm

Request Review

@aayambansal Aayam Bansal (aayambansal) merged commit b67b692 into main Jul 6, 2026
11 checks passed
@aayambansal Aayam Bansal (aayambansal) deleted the fix/uniprot-opq-accession branch July 6, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant