nextstrain / auspice

Web app for visualizing pathogen evolution
https://docs.nextstrain.org/projects/auspice/
GNU Affero General Public License v3.0
291 stars 162 forks source link

Mutations are atomic, yet minor gridlines of 0.2 mutations are shown #1359

Open corneliusroemer opened 3 years ago

corneliusroemer commented 3 years ago

Current Behavior
When selecting divergence as opposed to time for branch length, minor gridlines at spacings smaller than 1 mutation can be shown. This makes no sense as mutations cannot occur in units smaller than 1.

Fix Gridlines should only occur in multiples of 1 for divergence.

image

image

Source: https://nextstrain.org/groups/neherlab/ncov/21A.S.478K?c=country&dmin=2020-03-11&gmax=25439&gmin=21507&label=mlabel:21A/S.478K/G22813T&m=div&p=grid&r=division

emmahodcroft commented 3 years ago

My guess would be this is coming from the fact that we try to reconcile enabling two types of divergence view. One is what's used for SARS-CoV-2 (actually, was implement because of SARS-CoV-2!), where we show actual # of mutations, as you show above. However, for most other viruses we don't have such small divergences that this is useful - so we show divergence in terms of subs per site per year - and here we do want to draw very fine-grained lines if needed:

https://nextstrain.org/enterovirus/d68/genome?m=div image

I believe at the moment Auspice just makes a guess as to which way to display the divergence, based on total number (but I could be misremembering here). So my guess would be we'd want to add something else to that which changes how gridlines are plotted, depending on which display is being used...

trvrb commented 3 years ago

This relates to a broader issue of how we calculate intervals for colors as well. Integer data may get non-integer coloring stops. Be nice to improve, but this is more of a feature than a bug fix in my eyes.