GMOD / jbrowse-components

Source code for JBrowse 2, a modern React-based genome browser
https://jbrowse.org/jb2
Apache License 2.0
205 stars 61 forks source link

Multi-level synteny rendering #4430

Closed cmdcolin closed 1 day ago

cmdcolin commented 3 months ago

it has been a long standing issue to try to make multiple layers of comparisons. if we assume that the data structure is series of pairwise, then the problem is a bit less mind boggling

the "mst model" used to be that linear synteny view held a list of "synteny tracks" (all tracks overplotting each other in the same rendering area)

now it holds a list of "layers" that contains a list of "tracks" (each layer behaving like before with overplotting, but each layer bridges two LGV views)

here is hg19 vs hg38 vs hs1

image

image

it is admittedly a somewhat simple example data-size-wise because the assembly-to-assembly liftovers are relatively small compared to whole genome alignments of different species, but...that's sort of a separate topic (it could be related if we said that tracks somehow needed to all be instead of a single track pointing at a graph or multi-synteny structure though)

in order to make this UI wise, i made it so the search boxes in the synteny view header are hidden by default, and also made the import form able to add arbitrary number of levels

image

cmdcolin commented 3 months ago

note: mouseovers in the third row are off currently. there are still a couple places assuming only "two rows"

cmdcolin commented 2 months ago

one of the only things now about this PR are

a) sort of user testing to see how it feels b) fixing how the "synteny track selector" works. it has been mentioned before that the synteny track selector is already a weird concept, but it could get a little complex after this PR because each "level" can have it's own datasets selected c) considering how a "single synteny track" could supply the data for multiple levels (right now it's a series of pairwise synteny tracks)

cmdcolin commented 3 days ago

example with grape vs peach vs cacao https://jbrowse.org/code/jb2/multilevelsynteny/?config=%2Fdemos%2Fplant_synteny_demo%2Fconfig2.json&session=share-OzIsqrPjDb&password=0T2Qs

image

cmdcolin commented 2 days ago

I am going to boldly go ahead an mark this as ready. This is somewhat technical detail but:

I did not approach any type of system where a single "track" can automatically toggle across all levels. That could be considered in the future, but I think the current low level granularity will be an ok "primitive" to build off of.