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 defaultSession spec for config.json files to load simplified default sessions #4148

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Dec 20, 2023

Currently, the defaultSession is a raw snapshot of internal app state. There are efforts that can be made to simplify that internal state to some extent, but in addition to or alternative to that, we can create helpers like this PR does that make extra APIs to load data instead of providing raw app state to defaultSession.

This PR is essentially making the "url query param" API available from the config.json on a slot named "defaultSessionSpec", similar to "spec-" type URLs that the jbrowse-web app accepts

@cmdcolin
Copy link
Collaborator Author

A CLI tool could be made to restore the lost functionality from set-default-session --tracks and --view not working, and make it instead set-default-session-spec or something like this

@cmdcolin
Copy link
Collaborator Author

Note: The defaultSessionSpec takes priority over defaultSession, and defaultSession is not used when defaultSessionSpec is available. If this behavior is confusing, we could also make a "session spec" a special type of defaultSession

@cmdcolin
Copy link
Collaborator Author

and just for background, the term spec is short for 'specification' in full...just specifies the parameters for the session

@cmdcolin cmdcolin marked this pull request as draft December 20, 2023 21:09
@cmdcolin cmdcolin force-pushed the default_session_spec branch from 229adc7 to dbac84d Compare December 20, 2023 21:19
@cmdcolin
Copy link
Collaborator Author

in order to avoid confusion between defaultSession and defaultSessionSpec, I propose now making it so it is a special type of defaultSession where defaultSession.type==='spec'

@cmdcolin cmdcolin changed the title Create defaultSessionSpec for config.json files to load simplified default sessions Create defaultSession spec for config.json files to load simplified default sessions Dec 20, 2023
@cmdcolin cmdcolin force-pushed the default_session_spec branch from dbac84d to 767d8ef Compare December 20, 2023 21:31
@cmdcolin cmdcolin force-pushed the default_session_spec branch from 767d8ef to 9c093f1 Compare February 21, 2024 22:10
@abretaud
Copy link

Hi @cmdcolin,
Getting back to JBrowse2-in-galaxy after a looong time...
I thinks this PR would be quite useful for this, considering our old discussion in #3568
So I was wondering what was the status here? Any chance to have it available soon, or is it more a longer term thing?
I'm also exploring using the React component, or playing with iframe with url params

@cmdcolin
Copy link
Collaborator Author

this is a good question. one thing i'm debating in this PR is that currently both the "simplified" and "full" snapshot use the "defaultSession" variable name. possibly the simplified one could use a different name. not sure which is better, maybe less ambiguous to separate them

the other, sort of more radical way to address this issue, is to actually simplify the internal state of the app to some extent, so that the "full snapshots" provide easy to use mechanisms e.g. specifying a locstring. currently, variables like offsetPx and bpPerPx are used in the snapshots, which is not easy to use programmatically. I would really like to get to the stage that this could be done.

if you are interested in trying to find solutions let me know. this i think will probably remain draft for a bit while i ponder it, but you are welcome to try it out ("jbrowse create --branch default_session_spec yournewinstance"). i'd be happy to also advise on other usages like the iframe and embedded too

@abretaud
Copy link

Thanks!

this is a good question. one thing i'm debating in this PR is that currently both the "simplified" and "full" snapshot use the "defaultSession" variable name. possibly the simplified one could use a different name. not sure which is better, maybe less ambiguous to separate them

ok, both should be ok for us I guess, though a separate variable would probably be less ambiguous/easier to document

the other, sort of more radical way to address this issue, is to actually simplify the internal state of the app to some extent, so that the "full snapshots" provide easy to use mechanisms e.g. specifying a locstring. currently, variables like offsetPx and bpPerPx are used in the snapshots, which is not easy to use programmatically. I would really like to get to the stage that this could be done.

sounds like a good plan indeed!

if you are interested in trying to find solutions let me know. this i think will probably remain draft for a bit while i ponder it, but you are welcome to try it out ("jbrowse create --branch default_session_spec yournewinstance"). i'd be happy to also advise on other usages like the iframe and embedded too

ok nice, for now I think I'll go with an iframe and try to ship this galaxy tool asap, but I'd be very happy to test this new way a bit later!

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

Successfully merging this pull request may close these issues.

2 participants