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

set-default-session does not work since 2.10.2 #4434

Closed heavywatal closed 3 months ago

heavywatal commented 3 months ago

Describe the bug

I have been using jbrowse set-default-session with --view and --tracks options. Unfortunately they were removed in 2.10.2. The removal was announced as a bug fix, but actually that was a breaking change in the existing API, which I think deserves at least a minor version bump. Anyway, now I am struggling to build a new pipeline to setup a new session via CLI in newer versions. The first attempt was to simply remove --view and --tracks options from the command, but the command resulted in an error "Error: Please either provide a default session file". It does not make sense.

To Reproduce

  1. Create a new config: jbrowse create ...
  2. Add an assembly and tracks to the target config: jbrowse add-assembly ...; jbrowse add-track ...
  3. Try to create a default session to the target config: jbrowse set-default-session ...

Expected behavior

A default session can be created with a view and tracks. Even though the previous behavior of set-default-session was not perfect as stated in #2708 and #4146, it was much better than "not provided at all".

Screenshots

Version:

Additional context

cmdcolin commented 3 months ago

thanks for alerting me to this. I actually didn't realize it was working in any state. we can try to restore it back to where it was at least

heavywatal commented 3 months ago

Thank you. But I understand that you don't want to revert and keep incomplete functionalities. So I would suggest not to revert the code, but just to amend the help doc and error messages to guide users properly.

For example, the error message "Error: Please either provide a default session file" was not clear:

If I understand it correctly, I think I can handle it by creating a session.json from scratch and reading it with -s.

These two lines in EXAMPLES section do not work, I guess:

cmdcolin commented 3 months ago

@heavywatal I went ahead and made your suggested documentation fixes!

I think a longer term effort will be to make it so that "defaultSession" format is easier to use, so that it can be hand edited or programmatically generated without as much effort.

There are a couple PR that are open for this but it is a tricky one, so will take some time. Thanks for reporting this though

The related PRs...

https://github.com/GMOD/jbrowse-components/pull/4444 https://github.com/GMOD/jbrowse-components/pull/4148

heavywatal commented 3 months ago

Confirmed 2.12.0 works as expected. I am using hand-made session.jsons to feed set-default-session -s. Thank you for the quick action.