statgen / locuszoom

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

Refactor existing data sources to allow for flexible field definitions #85

Closed Frencil closed 6 years ago

Frencil commented 7 years ago

The Gene source currently implements a method whereby the data source doesn't care what fields are present in the response, allowing for much greater flexibility in the upstream data provider for that source. Other sources, especially the association source, could benefit greatly from this flexibility as an optional alternative to defining expected fields up front.

Frencil commented 7 years ago

The new PheWAS source, built-in as of v0.5.5, operates with this more flexible approach. Also the deferred transformations in display strings introduced in the same release effective allow for flexible field definitions in all data sources at the display layer.

Leaving this issue open until legacy data sources (e.g. association) are able to be properly refactored.

abought commented 6 years ago

134 introduces several new methods to address the goals of this issue. (parsing is now broken into 4 discrete steps: normalize, annotate, extract, combine)

This isn't a perfect solution, but it allows an individual source (or subclass) to be defined in a way that returns all its fields, without redefining too much core code.

Closing this issue, but as always feedback is welcomed. https://github.com/statgen/locuszoom/pull/134