statgen / locuszoom

A Javascript/d3 embeddable plugin for interactively visualizing statistical genetic data from customizable sources.
https://statgen.github.io/locuszoom/
MIT License
154 stars 29 forks source link

API enhancement: always fetch the best/newest annotations #232

Closed abought closed 3 years ago

abought commented 3 years ago

🦑 This PR cannot be merged until pending Portaldev API enhancements are released to production.

Purpose

Currently, LocusZoom hardcodes the "best available" dataset ID for common annotations like genes, recombination rate, and GWAS catalog. This is due to an API limitation, but it means that new dataset updates require releasing a new version of LocusZoom. Insofar as most LZ deployments are slow to upgrade, this means that many plots are using outdated annotations.

This is most notable for fast-growing datasets like the EBI GWAS Catalog track, though genes are also occasionally renamed. (sometimes for embarrassing reasons)

This PR leverages a new API feature: if a genome build is provided, it will take precedence and auto-suggest the best available data for that annotation.

How to test this

For now, the new features are only available on the dev instance of the portaldev api server. Change api/ to api_internal_dev/ in the example usages to switch and see the new results.