merenlab / anvio

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

[FEATURE REQUEST] Organize contigs by length in interactive interface #2100

Closed mschecht closed 1 year ago

mschecht commented 1 year ago

The need

Organizing contigs by continuous and categorical variables is super helpful when investigating sequences genomes and metagenomes. It would be great if the interactive interface could organize contigs by sequence length.

The solution

I don't have experience with the front end of the interactive interface, but it would be great if sequence length could be accessed in the items-order drop-down menu.

Beneficiaries

Anvi'o users who are exploring sequences in the interactive interface

How to reproduce:

cd INFANT-GUT-TUTORIAL 

anvi-interactive -c CONTIGS.db -p PROFILE.db

I circled in red the length continuous variable and point to where it could be in the items-order dropdown menu.

image

Thanks for your consideration!

meren commented 1 year ago

The commit af1ebd70e639d891ed87bb99d983e1c71e52aee5 solves this issue.

Here is an example with the IGD (data layers are removed for simplicity).

This is the default items order based on "Seq. Composition + Diff Coverage":

image

And this is when one selects the new item order called <> Length which should appear in the items order menu after this commit:

image

The algorithm is smart and orders items by keeping in mind the length of their parents (rather than merely ordering 'splits' based on their lengths). For projects with long contigs, the length order will not break the connection between splits. It shouldn't matter for projects with shorter contigs (i.e., EcoPhylo outputs, tRNA-seq displays, etc).

meren commented 1 year ago

@mschecht, please make sure it is working well for you, and close the issue if there are no problems.

mschecht commented 1 year ago

@meren I tested this on IGD and my own data and it's performing as expected!

image

Thanks for the help!