Repository navigation
fix(science): send the UCSC start coordinate 0-relative - #797
Merged
Ishaan Gangwani (ishaan1124) merged 1 commit intoSep 29, 2026
Conversation
ANIRUDDHA ADAK (aniruddhaadak80)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
September 28, 2026 16:34
|
ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
Ishaan Gangwani (ishaan1124)
force-pushed
the
fix/ucsc-sequence-coordinates
branch
from
September 29, 2026 01:24
bf3bd5e to
b281215
Compare
A browser position is 1-based inclusive, but the API documents start as 0-relative and end as 1-relative, so the start has to shift down one base. A single-base position also failed end > start and fell through to the search endpoint, answering a single-nucleotide lookup with full-text search results.
Ishaan Gangwani (ishaan1124)
force-pushed
the
fix/ucsc-sequence-coordinates
branch
from
September 29, 2026 01:30
b281215 to
d9fbdd7
Compare
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
A genomic position like
chr1:100000-100010is 1-based and inclusive (UCSC's own position bar, Ensembl, VEP). The UCSC JSON API'sstartis documented as 0-relative and itsendas 1-relative:The connector passed both numbers through unconverted, and its range check also rejected single-base positions:
Why it matters
This is a scientific connector, so the failure is a silently wrong sequence rather than an error.
chr1:100-200means 1-based bases 100-200 (101 bases). The request asked for 1-based 101-200 — the wrong first base, and one base short. Nothing about the response looks wrong; the mistake only surfaces when the region is a promoter, an ATGC motif, or a short exon boundary, which is exactly where an off-by-one matters.And
end > startrejectedend == start, sochr17:7676154-7676154— the single-nucleotide lookup — fell through to/search?search=chr17%3A7676154-7676154and returned whatever a full-text search happened to match.Verification
New file —
ucscwas covered by no test. Three of four fail before the fix:After the fix:
The surrounding connector suites are unaffected —
connector-formats,connector-fetch, and the new file together: 61 pass, 0 fail. No network access in any of them;fetchis stubbed the same way the existing connector tests do it.The change
cappedis deliberately unchanged: the API'sendis already 1-relative, so the existing 50,000-base cap was correct. The addedstart >= 1also keepschr1:0-0on the search path rather than asking for a negative offset.bun run typecheckclean; touched files are Prettier-clean (checked on LF-normalized copies — this checkout hascore.autocrlf=true, which makes Prettier flag every file in the repo).Fixes #796