vanallenlab / moalmanac-browser

Web portal interface for browsing the Molecular Oncology Almanac
https://moalmanac.org
GNU General Public License v2.0
1 stars 1 forks source link

Update feature display via api #32

Closed brendanreardon closed 3 years ago

brendanreardon commented 3 years ago

The api endpoints to display features have been updated to display values instead of indexes.

Previously, https://moalmanac.org/api/features/1 returned

{
  "attributes": [
    {
      "value": "Fusion"
    }, 
    {
      "value": "BCR"
    }, 
    {
      "value": "ABL1"
    }, 
    {
      "value": null
    }
  ], 
  "feature_definition": {
    "attribute_definitions": [
      {
        "name": "rearrangement_type"
      }, 
      {
        "name": "gene1"
      }, 
      {
        "name": "gene2"
      }, 
      {
        "name": "locus"
      }
    ], 
    "name": "rearrangement"
  }, 
  "feature_id": 1
}

And it now returns

{
  "attributes": [
    {
      "feature_type": "rearrangement", 
      "gene1": "BCR", 
      "gene2": "ABL1", 
      "locus": null, 
      "rearrangement_type": "Fusion"
    }
  ], 
  "feature_type": "rearrangement"
}

This should be more readable to users and is a "lock" of our API, no further changes are currently planned. This format allows for flexibility for the future feature type "connections" which will store multiple molecular features within the attributes list as records.