Skip to content

Resolve "Support configurable display of annotation"

Description

Add possibility to configure what and how annotation should be displayed in the front end. This is done using the view-column in the annotationconfig-table. Created a few generic components in which annotation can be shown.

Backend/datalayer:

  • Add example view config to src/vardb/testdata/annotation-config.yml
  • Added endpoint for annotation configs: /api/v1/annotationconfigs
  • Load annotation config id in the AnnotationSchema
  • Remove ClinVar "star counting" from config (Now: hard coded in externalfilter.py and clinvarDetails.directive.js)

Frontend:

  • Get relevant annotation configs from backend*
  • Removed old, highly specific, annotation conversion tools (getClinVarAnnotation.js, getFrequencyAnnotation.js)
  • The function getUrls in processAlleles.js has now been removed, as these URLs can now be specified in the config.
  • Removed hard coded annotation components in src/webui/src/js/store/modules/views/workflows/actions/prepareComponents.js, and populate it for each allele based on the annotation config**
  • Create (more or less) generic components for displaying annotation data (frequencyDetails.directive.js, itemList.directive.js, keyValue.directive.js)
  • Replaced some annotation components with generic components (alleleInfoFrequency*.directive -> frequencyDetails.directive, alleleInfoDBsnp.directive->itemList.directive, alleleInfoHgmd.directive->itemList.directive )
  • Refactored alleleInfoClinvar.directive to clinvarDetails.directive to avoid a lot of unnecessary complexity. Changed sort order for ClinVar submissions. Was: clinical significance, then date. Now: Only date.
  • Refactor aclip.directive.js to cerebral, and add function to generate template strings with a restricted set of interpolations supported (restricted to the allele object and attrs.linkText)

* Annotation configs to load are defined by the set of annotation config ids in the loaded annotation, and used to determine which annotation to show for each allele

** This required prepareComponents to be moved down the sequence, and to be run after allele data (and subsequently annotation configs) have been loaded

Related issues

Notes to review (code/docs/QA)

QA: Test all links

Tests

General

  • Tests have been added that prove my fix is effective or that my feature works
  • Related tests have been modified/removed

Hypothesis testing:

  • Soak testing has been done
  • Distribution between positive / negative cases has been checked

Database

  • Includes changes to database schema
  • Includes necessary database migrations

Configuration

  • Includes changes to configuration
  • Includes configuration migration instructions in documentation

Merge checklist

  • Self-review of code has been performed.
  • Feature review and validation against specification has been performed (if applicable). Apply label: QAdone
  • Need for documentation has been evaluated and, if necessary, updated. Apply label: docsdone
  • Code and implementation has been reviewed by other core developer (including any changes based on initial review). Apply label: code reviewdone

#171 (closed)

Edited by Tor Solli-Nowlan

Merge request reports