auspice icon indicating copy to clipboard operation
auspice copied to clipboard

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

Open corneliusroemer opened this issue 3 years ago • 2 comments

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

corneliusroemer avatar Jun 11 '21 11:06 corneliusroemer

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...

emmahodcroft avatar Jun 11 '21 13:06 emmahodcroft

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.

trvrb avatar Jul 04 '21 21:07 trvrb