VariantEffect / mavedb-api

MaveDB API
GNU Affero General Public License v3.0
8 stars 2 forks source link

Data model for external links #225

Closed jstone-uw closed 1 month ago

jstone-uw commented 1 month ago

These changes implement the data model to support display of score-set-specific links to the UCSC Genome Browser and other sites and services.

Notes on the data model

The latter option seems too specific when we know we're likely to add more links. But I'm not sure it's worth adding table relationships for this yet, so I've opted to add a JSONB column to the score sets table. This is the intended usage of the new external_links column:

{
  "ucscGenomeBrowser": {
    "url": "https://genome.ucsc.edu/cgi-bin/hgTracks?db=hg38&position=chr17:43051063-43051117&hubUrl=https://public.gi.ucsc.edu/~cline/mavedb/hub/hub.txt&Variant_Effect_Maps_hideKids=1&BRCA1_00000097-s-1=dense"
  }
}

That is, it's an object whose keys identify the target site or service. The values are objects that currently only include URLs, but we can add metadata as necessary later. On the API side, the structure above is exposed and enforced by explicit Pydantic models.

Release notes

After releasing this code change, populate the new column using the attached SQL file. I've opted not to add this to the code base as a data migration, since the contents are contingent and will continue to be updated. I'm inclined to treat these links as on par with other user-contributed data.

jstone-uw commented 1 month ago

Seed data:

ucsc_genome_browser_links.sql.txt