From: ARORA, S. <sz...@ps...> - 2020-08-05 19:49:07
|
That example was exactly what I was looking for, thanks! ________________________________ From: Colin <col...@gm...> Sent: Wednesday, August 5, 2020 9:01 AM To: ARORA, SONNY <sz...@ps...> Cc: gmo...@li... <gmo...@li...> Subject: Re: [Gmod-ajax] Loading a Track to JBrowse using the API If I understand correctly, you might use the addTracks URL parameter can be used to add custom tracks via the URL http://jbrowse.org/docs/url_strings.html<https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjbrowse.org%2Fdocs%2Furl_strings.html&data=02%7C01%7Csza149%40psu.edu%7Ca33564f490eb4935f11708d8393fb98e%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637322293140549760&sdata=gPH4NyOaE77YYS6Expg%2B6X3IQWA7t1%2B20nePKX4Brfo%3D&reserved=0> If you are talking about dynamically adding tracks at runtime, that would probably use the events API, not the URL. That events documentation page has always been kind of difficult to interpret, it needs examples...here is one example of adding a track at runtime var storeName = JBrowse.addStoreConfig(null, { browser: JBrowse, type: "JBrowse/Store/SeqFeature/BAM", baseUrl: ".", urlTemplate: "sample_data/raw/volvox/volvox-sorted.bam", }); JBrowse.publish("/jbrowse/v1/v/tracks/replace", [ { label: "My track", store: storeName }, ]); If you run this from inside of the javascript console on http://jbrowse.org/code/JBrowse-1.16.9/?data=sample_data/json/volvox<https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjbrowse.org%2Fcode%2FJBrowse-1.16.9%2F%3Fdata%3Dsample_data%2Fjson%2Fvolvox&data=02%7C01%7Csza149%40psu.edu%7Ca33564f490eb4935f11708d8393fb98e%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637322293140549760&sdata=wSPifRLx7hGJbXoZyWVojhgFOfhRsyf0w1cWFtSkF8w%3D&reserved=0> then you'll see the track get added -Colin On Wed, Aug 5, 2020 at 3:30 AM ARORA, SONNY <sz...@ps...<mailto:sz...@ps...>> wrote: Hi, I'm interested in embedding JBrowse in my website. I saw the documentation for loading a config at start up here: https://jbrowse.org/docs/embedding.html<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fjbrowse.org%2Fdocs%2Fembedding.html&data=02%7C01%7Csza149%40psu.edu%7Ca33564f490eb4935f11708d8393fb98e%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637322293140559754&sdata=7x13hiL1mf7AJWFuK8Wp9Ir5JnUGZlVB1L9EP%2FTgi6o%3D&reserved=0> On my website users can select tracks and I would like to add these tracks to JBrowse by URL after JBrowse is loaded. I was wondering if JBrowse provides an API to load tracks? The link here mentions being able to publish events to JBrowse: https://jbrowse.org/docs/events.html<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fjbrowse.org%2Fdocs%2Fevents.html&data=02%7C01%7Csza149%40psu.edu%7Ca33564f490eb4935f11708d8393fb98e%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637322293140559754&sdata=Y%2Bs0cwS1hmKOqfgW9jB9yaIi5D0l5pRG0E3Frvc%2FRbg%3D&reserved=0> To me the link above seemed to suggest that it's possible to load a track using an API, but correct me if I'm wrong (I'm not familiar with dojo). If it is possible to load a track from a url using the API, how would I go about doing that? Thanks in advance for your help! Best, Sonny _______________________________________________ Gmod-ajax mailing list Gmo...@li...<mailto:Gmo...@li...> https://lists.sourceforge.net/lists/listinfo/gmod-ajax<https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fgmod-ajax&data=02%7C01%7Csza149%40psu.edu%7Ca33564f490eb4935f11708d8393fb98e%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637322293140569753&sdata=O3qqkQgy6iMRk%2BiR1zgdL0ZDkyNvKhpTTyXOoHQfcn4%3D&reserved=0> |