feat: CSV/TSV download of a gene's eQTL table (#7)#33
Open
boxiangliu wants to merge 2 commits into
Open
Conversation
Junbin provisioned a dedicated read-only account (`locuscompare`). Promote it to THE serving account in the connect how-to + .env.example; demote the public `locusview_test` demo login to exploration-only. - how-to §0: new `locuscompare` section (password via secret store / gitignored .env, never committed); verified read-only + PII-safe (990 SELECT/USAGE grants, `user` denied). Old §0 demo → §0b, marked superseded. - Access-model table + §2 note + §4 env block/URL updated to `locuscompare`. - .env.example: user=locuscompare, port=31987, host filled; password stays blank. No secret committed (verified: password only in gitignored .env). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GET /gene/{key}/download?format=csv|tsv streams the current gene-page view as a
downloadable file (Content-Disposition attachment). Backend only — the in-page
download button waits for the gene-page redesign (#23, Liu Fei).
- web.py: `download` route using the csv stdlib (proper escaping); plain-text
errors (404 unknown gene, 400 bad format) to keep the diff minimal vs #25.
- Advances #7 (CSV/TSV + a documented endpoint); the Parquet/tabix part of #7 is
obsolete under ADR-0008 (we serve from the shared DB).
- 100% coverage in CI; verified live: TP53 -> 1250 data rows.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
GET /gene/{key}/download?format=csv|tsv— streams the current gene-page eQTL view as a downloadable CSV/TSV (properContent-Dispositionattachment, header row,csvstdlib escaping).Advances #7. Uses the data layer we already have (
eqtls_for_gene).Why now
It's the one download deliverable that needs no design decision — pure backend on top of the existing repository. (The Parquet/tabix part of #7 is obsolete under ADR-0008; we serve from the shared DB.)
Scope / what's deferred
gene.html, which is under Liu Fei's redesign (design: gene-page visualizations (regional plot + body map) #23) — so it lands with the frontend, not here.Testing
ruff/mypy --strictgreen; 100% coverage in CI (locally shows 1 line because a dev.envsets the DB host → default app picks the real repo; CI has no.env). Verified live (read-only):TP53→ HTTP 200,text/csv, 1,250 data rows.Reviewer note
Touches
web.pynear where #25 adds its/apiroutes → a trivial insertion-point conflict is possible if #25 merges first; one-line resolve.