Closed garrettjstevens closed 2 weeks ago
@kyostiebi I created a branch here to experiment with this: https://github.com/GMOD/Apollo3/tree/359_serve_config_json
I'd like you to continue using that branch and flesh it out more. The idea is that instead of generating the configs in packages/jbrowse-plugin-apollo/src/session/session.ts
on the client side, they'll get generated on the server side in packages/apollo-collaboration-server/src/jbrowse/jbrowse.service.ts
.
Currently in that branch the getConfig
method in packages/apollo-collaboration-server/src/jbrowse/jbrowse.service.ts
already has most of the logic from the afterCreate
of packages/jbrowse-plugin-apollo/src/session/session.ts
. It creates the assemblies and adds them to an "assemblies" entry in the config.
The next thing to do is to copy over the addApolloTrackConfig
logic from packages/jbrowse-plugin-apollo/src/session/session.ts
to the JBrowseService and use it to create the track configs. They will be added to a "tracks" entry in the config.
To test this out you'll need to open Apollo with the URL http://localhost:3000/?config=http://localhost:3999/config.json
(instead of the usual http://localhost:3000/?config=http://localhost:9000/jbrowse_config.json
).
@kyostiebi as discussed earlier today, I'd also like to experiment with having extra JBrowse track configurations stored in MongoDB and then adding them to the list of dynamically created tracks discussed above. For example, a single track entry might look like this:
{
"type": "SyntenyTrack",
"trackId": "Pchabaudichabaudi_vs_Pfalciparum3D7 (minimap2)",
"name": "P. chabaudi vs P. falciparum (minimap2)",
"assemblyNames": [
"655d6b2dbbe3b64fded919fb",
"655d45e0e7078c08e27047e5"
],
"category": [
"Synteny"
],
"adapter": {
"type": "PAFAdapter",
"assemblyNames": [
"655d6b2dbbe3b64fded919fb",
"655d45e0e7078c08e27047e5"
],
"pafLocation": {
"locationType": "UriLocation",
"uri": "data/Pchabaudichabaudi_Pfalciparum/Pchabaudichabaudi_vs_Pfalciparum3D7.minimap2.paf"
}
}
}
I think maybe each track would be a document in a new tracks collection, and they would get retrieved and added to the config.json generated by jbrowse.service.ts
.
Track menu now contains Add track to Apollo and Remove track from Apollo -items. Track configuration is saved to tracks -schema in Mongo.
Done in #371
Investigate how to take a request for a
/config.json
files in nestjs and dynamically create a JBrowse config file and return it. Combined with #358, this would enable JBrowse to use the default config file location when being served by the collaboration server. This issue only includes assemblies and Apollo annotation tracks, not evidence tracks.