merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
413 stars 142 forks source link

[BUG] The interactive interface does not care about layer orders stored in the state #2252

Closed meren closed 2 months ago

meren commented 2 months ago

Short description of the problem

Even when the user stores a state file, the interactive interface does not care about the order of layers.

anvi'o version

anvio-dev

System info

This is a os/system independent problem.

Files / commands to reproduce the issue

Here is how one can reproduce this issue. First, generate a test output using anvi-self-test with the interactive-interface suite:

anvi-self-test --suite interactive-interface -o interactive-interface-test --no-interactive
cd interactive-interface-test

Then visualize the result:

anvi-interactive -f fasta.fa -d view_data.txt -p test.db -t tree.txt --manual-mode

This is what you see in the Layers part of the display:

image

Which is how it looks in the main panel (it is very annoying that what is on top in the display is on bottom in the panel -- it is the same for Items display, but the order there is 'inside-out' -- maybe we should change both, but that is not even the bug I am reporting):

image

Let's say I changed the position of the Stacked Bar layer:

image

When I redraw, it indeed works as intended:

image

Then I save the state, and it is confirmed that it is saved:

image

I double-checked using anvi-export-state before and after, these changes certainly appear in state. So import/export/save works.

Then I kill the server, and re-run the visualization:

anvi-interactive -f fasta.fa -d view_data.txt -p test.db -t tree.txt --manual-mode

The stacked bar layer is back on top:

image

Matching to the Display of layers:

image

Despite the state suggests a different order.

This problem does not happen with the display order of items:

image

They are being read from the state accurately.

meren commented 2 months ago

Thank you very much, Mete! :)