Skip to content

Download and cache HGNC aliases in one call - #441

Merged
iskandr merged 2 commits into
mainfrom
feat/cached-hgnc-aliases
Oct 5, 2026
Merged

iskandr merged 2 commits into
mainfrom
feat/cached-hgnc-aliases

Conversation

@iskandr

@iskandr iskandr commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Human alias lookup required visiting HGNC and manually downloading a TSV before calling PyEnsembl. Add GeneNameAliases.download_hgnc() to download the complete set once and return a usable alias mapping. Later calls reuse the cached snapshot without network access.

Reuse PyEnsembl's atomic download/provenance path under aliases/homo_sapiens/hgnc. Separate sources by URL so archived snapshots and mirrors with identical filenames cannot collide. Support a custom cache directory, source URL and explicit overwrite=True refresh. Preserve from_hgnc(path) for selected local snapshots; detect gzip from its contents so compressed URLs also work with query strings or extensionless endpoints. Ordinary gene queries retain their existing behavior.

The alias guide now starts with the one-call workflow and an actual p53 result, followed by offline reuse, refresh, pinned snapshots and custom mappings.

Validation: ./lint.sh and TEST_SH_MAX=2 ./test.sh passed (538 passed, 1 opt-in benchmark skipped). Real local-HTTP tests cover acquisition, offline reuse, refresh, source separation, gzip, cache placement, failed refresh preservation and invalid URLs. ./docs.sh passed with complete API coverage, and all five home/query examples matched their documented output. The official HGNC complete set loaded 98,547 names and resolved p53 to TP53 / ENSG00000141510 against installed human release 93. Version: 2.23.0.

Closes #440.

Cross-version validation: lint, the complete suite (538 passed, one opt-in benchmark skipped), and all five documented examples passed in separate local environments for Python 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14. GitHub's strict documentation build passed; its test matrix is delayed by the ongoing https://www.githubstatus.com/ Actions hosted-runner assignment incident. No required status check is configured on main. Clean-main deployment will run the ordinary lint/test gates.

Release: merged at 85bb9b6 and published as 2.23.0 on PyPI (wheel and source archive verified). Clean-main ./deploy.sh passed lint and 538 tests, one opt-in benchmark skipped, and pushed v2.23.0. The final main documentation build passed on GitHub and locally. Its hosted publish job remained queued, so the same validated site was pushed with ghp-import to gh-pages at 3fbd3e8. GitHub Pages deployment completed successfully on 2026-10-06 after rerunning https://github.com/openvax/pyensembl/actions/runs/37369599482. Verified the public home/examples, cached HGNC guide and API, and both old tutorial fragments in the browser.

@iskandr
iskandr merged commit 85bb9b6 into main Oct 5, 2026
1 check passed
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.

Provide one-call cached HGNC alias loading instead of manual downloads

1 participant