Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create general "highlight"/"marker" indicators #599

Closed
cmdcolin opened this issue Nov 2, 2019 · 16 comments
Closed

Create general "highlight"/"marker" indicators #599

cmdcolin opened this issue Nov 2, 2019 · 16 comments

Comments

@cmdcolin
Copy link
Collaborator

cmdcolin commented Nov 2, 2019

The idea of a generic "highlight" that can span a region of the view would be useful to have, that could be similar to jbrowse 1 (interactive, draw a single region) or multiple (could come from a data store such as the peaks similar to https://github.com/cmdcolin/wigglehighlighter)

Could be track specific and/or view specific

The idea of a single bp "flag" to represent the breakpoints in the BreakpointSplitView was also discussed

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Nov 2, 2019

If the "highlights" come from a datasource, it could possibly be like a track that could be turned on and off

@rbuels
Copy link
Contributor

rbuels commented May 24, 2021

How about having a highlight attr on the session model that can contain either a feature, or a region object (assembly, ref, start, end), or something else, and all views would draw a highlight in their view if that thing is set and if they understand what it is?

And add some UI in the LGV and at some point in the other views to set the highlight

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented May 24, 2021

not to be too prodding, but why is this topic coming up currently?

@rbuels
Copy link
Contributor

rbuels commented May 24, 2021

@teresam856 and I just happened to talk about it in pairing just now

@cmdcolin
Copy link
Collaborator Author

it can just help to have a specific context or application in mind to refer to when rebooting a discussion

in this example above, if it is a highlight attr on session model, it is a little unclear how that would work with a data adapter like what i put in my original PR, and may even be a little bit tricky (if it is a data adapter, probably dont want it to appear in snapshots), but possibly that could be "separate" and more like a bookmark thing, though they could share some similarity with highlighting (note, jbrowse 1 has a "bookmarks concept" that basically represents multiple highlights that can fetch from remote files, or the url bar, or the config https://jbrowse.org/docs/url_strings.html#addbookmarks)

@bbimber
Copy link
Contributor

bbimber commented Dec 15, 2021

I put some comments in #2316 on our usage, but the feature to highlight a region by coordinates is something we used a lot of JB1 that would be great to have in JB2

@scottcain
Copy link
Member

Ha, I just did the same as @bbimber , adding a comment on #2316 because I need a more general highlight functionality too.

@cmdcolin
Copy link
Collaborator Author

some interest from twitter here :) https://twitter.com/gregor_rot/status/1593540025001574403

@grexor
Copy link

grexor commented Nov 21, 2022

Great work on JBrowse everyone, yes the general highlight feature (already present in JBrowse 1) also for version 2 would be great in my opinion, please direct me in case I can help with development, thank you!

@carolinebridge
Copy link
Contributor

@cmdcolin is there anything left on this ticket to extract/do or can we close?

@cmdcolin
Copy link
Collaborator Author

I think it is probably close-able. if there are any sort of follow up discussions can get new thread :) nice work @carolinebridge-oicr

@cmdcolin
Copy link
Collaborator Author

anyone wants to try they can get latest main branch with e.g. jbrowse create --nightly newinst

and use url param http://yourinstance.com/?loc=ctgA:1-100&assembly=yourassembly&highlight=ctgA:50-60

@bbimber
Copy link
Contributor

bbimber commented Feb 28, 2024

@cmdcolin: thanks, this is a really useful feature. Could you confirm two things:

  1. do you have an estimate on the timing of your next release which might include this?

  2. is there an example of how highlight translates into an embedded LGV? As-is, our code creates the LGV using createViewState():

    export default function createViewState(opts: ViewStateOptions) {
    . ViewStateOptions does not appear to support highlight. Our existing code is approximately:

createViewState({
        assembly: genome.assembly ?? genome.assemblies,
        tracks: genome.tracks,
        configuration: genome.configuration,
        plugins: plugins.concat(nativePlugins),
        location: genome.location,
        defaultSession: genome.defaultSession,
        onChange: genome.onChange
    })

I'm happy to look for another entry point to make a LGV. While createViewState doesnt support highlight, the model in the LGV plugin seems to :

.

Thanks for any ideas.

@cmdcolin
Copy link
Collaborator Author

with createViewState, one option would be to imperatively call "setHighlight" after creation (i know it isn't a nice "declarative" api that way, but hopefully helps)

const state=createViewState({
        assembly: genome.assembly ?? genome.assemblies,
        tracks: genome.tracks,
        configuration: genome.configuration,
        plugins: plugins.concat(nativePlugins),
        location: genome.location,
        defaultSession: genome.defaultSession,
        onChange: genome.onChange
    })
state.session.views[0].setHighlight({refName:'chr1',start:1,end:100,assemblyName:'yourassembly'})

as far as the next release, i'd be happy to try to get one out soon, prolly by early next week

@bbimber
Copy link
Contributor

bbimber commented Feb 28, 2024

OK, got it. I assume I need to parse the raw string into a LocString, but I can do that here.

No urgency on the timing of the next release, but once you make one I will give this a try.

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Mar 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants