https://github.com/isubit/tripal_jbrowse_api
Tip revision: fc8be4e6614b2de653d2ef5770a53717bda652f4 authored by Nick Booher on 16 January 2020, 19:31:11 UTC
Version bump
Version bump
Tip revision: fc8be4e
tripal_jbrowse_api.api.php
<?php
/**
* Allows additional tracks to be added to the trackList.json endpoint
*
* @param $organism
* The organism object loaded from the endpoint URL
*
* @return array
* Additional tracks to expose to JBrowse
*
*/
function hook_jbrowse_tracks($organism) {
$data = array();
$data[] = array(
'category' => 'Tripal JBrowse Tracks',
'label' => 'Tripal_ExampleTrackName',
'type' => 'JBrowse/View/Track/CanvasVariants',
'trackType' => 'JBrowse/View/Track/CanvasVariants',
'key' => 'ExampleTrackName',
'storeClass' => 'JBrowse/Store/SeqFeature/VCFTabix',
'urlTemplate' => 'http://example.com/ExampleTrackName.vcf.gz',
);
return $data;
}
/**
* Allows additional options to be added to the trackList.json endpoint
*
* @param $data
* The array of configuration and tracks to be sent by the trackList.json endpoint
* Keys guaranteed to be present:
* 'refSeqs': the url of the refSeqs.json endpoint
* 'tracks': array of tracks to expose, including those from hook_jbrowse_tracks
*
* @param $organism
* The organism object loaded from the endpoint URL
*/
function hook_jbrowse_tracklist_alter(&$data, $organism) {
$data['aboutThisBrowser'] = array(
'title' => 'Browser for ' . $organism->common_name,
'description' => 'Example description',
);
}