biocore / empress

A fast and scalable phylogenetic tree viewer for microbiome data analysis
BSD 3-Clause "New" or "Revised" License
48 stars 31 forks source link

Support alternate (smaller) display for taxonomy levels with ancestor information #489

Open fedarko opened 3 years ago

fedarko commented 3 years ago

One consequence of the fix implemented in #487 is that it makes individual taxonomic classifications at each level much longer than before (since now we're including ancestor information). See the example screenshots below of the moving pictures tree, colored by Level 4 (order) taxonomic classifications.

Old New (#487)
old new

It's not a major thing, but some users might prefer the thinner legends in older versions of EMPress. Ideally, we would want to minimize the amount of text in each legend while still preventing ambiguity. I'm not sure of how to do this! (At least in a way that is both easy for users to understand and not super slow on the JS side of things.)

One potential solution that might work is trying to only show the lowest selected value (e.g. if Level 7 is selected, just showing species-level classifications -- e.g. s__), and only adding ancestor levels to the taxonomy string displayed in the legend as needed to disambiguate things. So this might look something like

... That being said, mixing things up like this might confuse users more -- so I'm not sure.

ElDeveloper commented 3 years ago

@fedarko Your suggested approach would work very well. Would just probably need to account for things like f__Lactobacillaceae; g__; s__ so that these aren't displayed as g__; s__. What about making this a setting in the settings tab. Something like Labeling strategy. Could be one of:

The default should probably be smallest unique subsequence. And it would be nice if the title attribute of the labels in the legend had the full name (so that users could readily see the full name if needed).