Skip to content

Start Apollo from existing JBrowse config - #839

Open
garrettjstevens wants to merge 12 commits into
v2from
new_startup
Open

garrettjstevens wants to merge 12 commits into
v2from
new_startup

Conversation

@garrettjstevens

Copy link
Copy Markdown
Contributor

This is an experimental branch where instead of adding assemblies to Apollo through the collaboration server, the admin points Apollo to an existing JBrowse config and Apollo sets itself up from there.

@garrettjstevens garrettjstevens self-assigned this Sep 21, 2026
@garrettjstevens
garrettjstevens force-pushed the new_startup branch 2 times, most recently from 8928d5b to 5bb68ca Compare September 23, 2026 22:56
@garrettjstevens
garrettjstevens changed the base branch from main to nest_mongo_update September 23, 2026 23:01
Base automatically changed from nest_mongo_update to main September 29, 2026 23:28
@garrettjstevens
garrettjstevens changed the base branch from main to developer_updates October 21, 2026 23:35
Base automatically changed from developer_updates to v2 October 22, 2026 00:53
@garrettjstevens
garrettjstevens force-pushed the v2 branch 4 times, most recently from c33e411 to 765b48b Compare October 29, 2026 20:38
@garrettjstevens
garrettjstevens force-pushed the v2 branch 6 times, most recently from e702e83 to 7e0a147 Compare November 4, 2026 01:41
Make the collaboration server the entry point for Apollo, driven by one or
more JBrowse config files instead of assemblies and configs stored in MongoDB.

Assemblies:
- At startup, seed assemblies and their refSeqs from the assemblies in each
  config file listed in JBROWSE_CONFIG_FILES (default "config.json"), read
  from JBROWSE_DIR or a JBrowse dev server (JBROWSE_DEV_SERVER_URL). The same
  assembly name may appear in several config files.
- Read sequences through the configured JBrowse sequence adapters (indexed
  and unindexed FASTA, bgzip FASTA, 2bit), with relative URIs resolved
  against the config file.
- Remove creating and deleting assemblies, refSeq aliases, refSeq chunks and
  the stored JBrowse config (changes, CLI commands, UI and docs). Export reads
  sequences from the configured adapters.

Serving the app:
- Serve JBrowse from JBROWSE_DIR (or proxy a dev server). Serve each config
  file at its own path, augmented with Apollo's configuration, tracks and
  plugin. Assemblies (and their tracks) a user may not access are left out.
- Add server-rendered login and logout pages. Logins set an HTTP-only auth
  cookie that the JWT strategy also accepts. Same-origin redirect paths are
  allowed and don't get the token in the URL. Unauthenticated requests get a
  401 so the injected script in index.html can redirect to the login page.

Client:
- Remove ApolloInternetAccount. The session now holds the server connection:
  server-sent events, change catch-up, user locations, the server version
  check and the "no access yet" dialog. It is authenticated by the cookie and
  configured by the plugin configuration the server provides.

Assisted-by: Claude Code:claude-opus-5-5
The server now adds `apollo: true` and the Apollo assembly ID to each served
assembly's `sequence.metadata`, so JBrowse assembly names stay the
human-readable config names. Use that ID wherever the client talks to the
server, and fix the issues this revealed:
- rendering and layouts keyed by assembly
- refName/assembly mismatches in text search and check result warnings
- managing checks per assembly and refreshing check results
- the transcript sequence, exon and six-frame glyphs
- don't connect to a server, or wait for server config, in a local-only
  session, and only clear and restore the session snapshot there

Assisted-by: Claude Code:claude-opus-5-5
Assemblies can no longer be created through the API, so tests use
assemblies seeded from JBrowse config files instead:
- CLI tests: seed from apollo-collaboration-server/test/data/config.json,
  import features into those assemblies and reset assembly checks between
  tests. The server for them uses NODE_ENV=test and .test.env.
- Server SSE e2e tests use a seeded assembly.
- Cypress: seed from jbrowse-plugin-apollo/test_data/jbrowse_config
  (copied into .jbrowse by `copy-jbrowse-test-fixtures`), log in through the
  server's login page, and use a separate .cypress.env. Add tests for
  creating annotations from gene and CRAM evidence tracks.
- Example plugin Cypress tests serve their own config_example.json.

Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Claude Code:claude-opus-5-5
The command asks a series of questions (or takes flags, with --yes for
defaults), then builds the collaboration server from a release's source
tarball side by side under releases/v<version> with a `current` link, adds
the Apollo plugin and Sequence Ontology to an existing JBrowse directory
without overwriting anything, optionally downloads the embedded MongoDB
binary, writes a .env and a start script (.sh, or .cmd on Windows), and
prints how to start and run Apollo. Re-running it upgrades or rolls back,
keeping earlier answers and secrets.

Also adds a quick start docs page for it.

Assisted-by: Claude Code:claude-opus-5-5
In JBrowse v5, the `coord` that `pxToBp()` returns is 1-based, but Apollo
feature coordinates are 0-based, so hovering, clicking, and dragging all
landed one base to the right (e.g. dragging an edge to 9450 set it to 9451).
Use the 0-based `coord0` instead.

The drag test clicked exactly on base boundaries, where floating-point error
can put the click on the neighboring base (the old +1 hid this), so it now
aims inside bases.

Assisted-by: Claude Code:claude-opus-5-5
Without a collaboration server, the plugin config's `role` is its default
empty string. The table editor's context menu and the transcript details
widget used `role ?? 'admin'`, which doesn't fall back for an empty string, so
local assemblies were read-only there (e.g. "Add child feature" was
disabled).

Add a `getApolloRole()` helper that gives local assemblies (those without
Apollo assembly metadata) the "admin" role, as the displays already did, and
use it in the displays, the table editor, and the transcript details widget.

Assisted-by: Claude Code:claude-opus-5-5
Nothing has set it since the local drivers were combined into LocalDriver, so
every assembly had the default "CollaborationServerDriver", and the check that
keeps local assemblies' locations from being posted to the server never
matched. Use `getBackendDriver()`, which decides from the assembly's Apollo
metadata, for that check instead, and remove the field.

Saved snapshots that still have the field load fine, since MST ignores
unknown snapshot properties.

Assisted-by: Claude Code:claude-opus-5-5

This branch has not been deployed

No deployments
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.

1 participant