merenlab / anvio

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

[FEATURE] Inspect Page - Get sequence from contig coordinates #1842

Open matthewlawrenceklein opened 2 years ago

matthewlawrenceklein commented 2 years ago

The need

This feature would add UI elements to the inspect page for the user to manually enter start/stop coordinates based on position within the parent contig and retrieve subsequent sequence information.

The solution's need

At present the inspect page provides, from it's initial backend call, a contigs_data object. Amongst other things, the contigs_data object provides total sequence info for the currently inspected split, as well as each contained gene's start and stop positions in the context of both the split and the contig. This is a good start, but we're lacking some additional context

I think, if I'm understanding the issue correctly, our best bet would be to

meren commented 2 years ago

Perhaps we shouldn't do it in the inspect page, but have a 'jump region' button somewhere on the main display, where you type the contig name and nucleotide range at the contig level, and anvi'o opens the inspect page of the matching split focused on that region :)

matthewlawrenceklein commented 2 years ago

That could work as well! Do you have any thoughts towards where this feature should live in the standard interactive interface? Perhaps under the search tab of the settings panel?

meren commented 2 years ago

Search tab sounds good to me!

Perhaps we can make it only accessible for interactive modes that enable such jumps (i.e., not pangenomics or manual interactive mode, etc).

matthewlawrenceklein commented 2 years ago

@meren - other than input fields for start and stop positions and an inspect contig sequence button, do we need any additional UI elements? A dropdown to select which contig to reference?

meren commented 2 years ago

There may be thousands and thousands of contigs, which may render a combo solution infeasible. We can expect an exact name to be be out in an input box.

matthewlawrenceklein commented 2 years ago

Perfect! So just start, stop numerical input fields, a contig text input field, and a lets go button?

meren commented 2 years ago

I think that's perfectly fine :)

I just thought of this: an amazing addition would have been to be able to save a particular selection in an inspect page as a bookmark (contig, start-stop coordinates, name, and short description), and be able to list existing bookmarks in a contigs database somewhere in the main page. It could serve as a preliminary annotation system.

The best place to store these annotations would be the contigs database, since that way people can import and export such annotations without having to use the inspect page.

I think we should keep this in mind since such information stored in contigs databases can also be shown as a layer in genome view.

matthewlawrenceklein commented 2 years ago

OK, we're adjusting what exactly this is just a bit !

The plan is to continue building off the interactive search tab UI to allow users to input contig-global start, stop, and name values. Anvi'o will then scan through all the splits associated with the contig, mapping their own start/stop values to the contig-global position. The backend will then serve data that the frontend builds into a table, with each row representing a split with a % of contig contained (if the global coordinates contain multiple splits), as well as a button to launch a new inspection for that split. Neat!