GenBank flat-file record card on the Sequence Detail page¶
Motivation¶
A researcher compared the dashboard's Sequence Detail page (/sequence/:accession)
with the public NCBI nuccore page for accession OZ254605.1 and noted that NCBI
leads with the canonical GenBank flat-file header block
(LOCUS / DEFINITION / ACCESSION / VERSION / DBLINK / KEYWORDS / SOURCE / ORGANISM),
while the dashboard only showed the same data scattered across structured cards.
They asked whether the dashboard could reproduce that familiar layout.
User-facing change¶
- The Sequence Detail page now renders a "GenBank record" card directly under the header summary. It reproduces the NCBI flat-file header block verbatim in a monospace block with the classic 12-column tag field, 79-column line width, and continuation lines indented to column 13.
- The block is composed from data the page already fetches via
getNuccoreGenBank(LOCUS line from locus/length/moltype/topology/division/update_date, wrapped DEFINITION, ACCESSION, VERSION, DBLINK fromxrefs, KEYWORDS, SOURCE, and the ORGANISM sub-keyword with the wrapped taxonomy lineage). - The existing structured cards (Sample & source, Taxonomy, Features, References, FASTA preview) are unchanged — the flat-file card is purely additive.
API / IaC diff summary¶
- Backend (
api/services/ncbi/nuccore.py): added_parse_keywordsto parse theGBSeq_keywords→GBKeywordlist (cap 32, each truncated to 120 chars) and a newkeywords: list[str]field in thefetch_nuccore_genbankreturn dict. This was the only GenBank header field not already exposed, so KEYWORDS now renders faithfully (.when empty, matching the GenBank convention). No route/model change — the/ncbi/nuccore/{accession}/genbankroute returns the dict directly. - Frontend types (
web/src/api/ncbi.ts): addedkeywords: string[]to theNuccoreGenBankinterface. - Frontend page (
web/src/pages/sequence/SequenceDetail.tsx): added module-levelgenbankTag/genbankWrap/genbankFlatLineshelpers, aflatRecordmemo, and the "GenBank record" glass card. - No IaC change.
Validation evidence¶
uv run pytest -q api/tests/test_ncbi_nuccore.py→ 52 passed (includes the updatedtest_fetch_nuccore_genbank_parses_recordassertingkeywords == ["RefSeq", "MANE Select"]against the extendedGBSeq_keywordsfixture).uv run ruff check api/services/ncbi/nuccore.py api/tests/test_ncbi_nuccore.py→ clean.cd web && npm run build→ built successfully (SequenceDetail-*.jsemitted).