GMOD / jbrowse

JBrowse 1, a full-featured genome browser built with JavaScript and HTML5. For JBrowse 2, see https://github.com/GMOD/jbrowse-components.
http://jbrowse.org
Other
460 stars 199 forks source link

How to use REST to load tracks? #840

Closed aishmit closed 7 years ago

aishmit commented 7 years ago

Hey so I just got JBrowse running on my local web server (kind of, still errors coming) and it works pretty well with the test data. I wanna now test with my own data which is acquired from APIs. I have two end points, and I need two tracks for each of these end points. How would I be able to load the tracks with my own data using REST APIs?

Thanks.

nathandunn commented 7 years ago

Have you looked here?

http://gmod.org/wiki/JBrowse_Configuration_Guide#Writing_JBrowse-compatible_Web_Services

There may also be some examples in here:

https://gmod.github.io/jbrowse-registry/

aishmit commented 7 years ago

I have looked here. It seems as if JBrowse requires a particular API. So is there no way to be able to use my existing API without modification?

cmdcolin commented 7 years ago

You can create a custom "storeClass" to do this. This section discusses that http://gmod.org/wiki/JBrowse_Configuration_Guide#Using_JBrowse_with_Existing_Web_Services

With the custom "storeClass", you can write code to adapt to the quirks of the API rather than use that standard REST API format that was mentioned.

The only essential function to implement in your custom storeClass is called getFeatures() which just retrieves features from some interval (chromosome, start, end) from your web service.

Some existing plugins that do this include ga4ghviewer and myvariantviewer and they have code to adapt to the quirks of those apis

aishmit commented 7 years ago

Thank you!!

cmdcolin commented 7 years ago

feel free to reopen if still an issue :)