Skip to content

feat: CSV/TSV download of a gene's eQTL table (#7)#33

Open
boxiangliu wants to merge 2 commits into
mainfrom
feat/download
Open

feat: CSV/TSV download of a gene's eQTL table (#7)#33
boxiangliu wants to merge 2 commits into
mainfrom
feat/download

Conversation

@boxiangliu

Copy link
Copy Markdown
Contributor

What

GET /gene/{key}/download?format=csv|tsv — streams the current gene-page eQTL view as a downloadable CSV/TSV (proper Content-Disposition attachment, header row, csv stdlib 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

Testing

ruff / mypy --strict green; 100% coverage in CI (locally shows 1 line because a dev .env sets 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.py near where #25 adds its /api routes → a trivial insertion-point conflict is possible if #25 merges first; one-line resolve.

boxiangliu and others added 2 commits July 7, 2026 11:07
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>
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