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

Better handling of areas with many SNPs #168

Closed abought closed 3 years ago

abought commented 4 years ago

LocusZoom is limited from showing very large regions (or very dense datasets) by the need to render each element as SVG. We should explore ways to reduce the load on the DOM, given a lot of data. Eg:

  1. Coalesce low-significance SNPs (that are too close together to be visually distinctive) into fewer points. (quadtree with screensize-aware traversal, etc)
  2. Simplify the DOM event listeners to use event capturing, or other mechanisms so that less system resources are used for each point.

If the data is coalesced on the frontend, then all region-based calculations will still work (because subscribing happens at the data layer, and point coalescing would occur at the rendering stage). If data is coalesced on the backend, weight parameters would be needed to preserve the meaning of calculations such as credible sets or aggregation tests.

abought commented 4 years ago

For record keeping: work in progress branch here: https://github.com/abought/locuszoom/tree/feature/gh168-coalesce-snps

This adds the basic coalescing mechanism; much work needs to be done on performance testing dense files, connecting this to rendering, and validating calculation results. Leaving a note to self as I work on a few other features first.