@gmod/jbrowse
Version:
JBrowse - client-side genome browser
319 lines (305 loc) • 55.7 kB
HTML
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>JBrowse REST API and Data APIs · JBrowse</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="## Writing JBrowse-compatible Web Services"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="JBrowse REST API and Data APIs · JBrowse"/><meta property="og:type" content="website"/><meta property="og:url" content="https://jbrowse.org/index.html"/><meta property="og:description" content="## Writing JBrowse-compatible Web Services"/><meta name="twitter:card" content="summary"/><link rel="shortcut icon" href="/img/favicon.ico"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><link rel="alternate" type="application/atom+xml" href="https://jbrowse.org/blog/atom.xml" title="JBrowse Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://jbrowse.org/blog/feed.xml" title="JBrowse Blog RSS Feed"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><h2 class="headerTitle">JBrowse</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class=""><a href="/blog" target="_self">Blog</a></li><li class="siteNavGroupActive"><a href="/docs/installation.html" target="_self">Documentation</a></li><li class=""><a href="/en/demos.html" target="_self">Demos</a></li><li class=""><a href="/en/developers.html" target="_self">Developers</a></li><li class=""><a href="/en/contact.html" target="_self">Contact</a></li><li class=""><a href="/en/references.html" target="_self">References</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Other topics</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Tutorial</h3><ul><li class="navListItem"><a class="navItem" href="/docs/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/tutorial.html">Indexed file formats tutorial</a></li><li class="navListItem"><a class="navItem" href="/docs/tutorial_classic.html">Classic quick-start guide</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Configuring tracks</h3><ul><li class="navListItem"><a class="navItem" href="/docs/reference_sequence.html">Reference sequence configuration</a></li><li class="navListItem"><a class="navItem" href="/docs/canvas_features.html">CanvasFeatures</a></li><li class="navListItem"><a class="navItem" href="/docs/html_features.html">HTMLFeatures</a></li><li class="navListItem"><a class="navItem" href="/docs/alignments.html">Alignments tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/bigwig.html">Wiggle/BigWig Tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/variants.html">VCF tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/minimal.html">Minimal JBrowse configurations</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Advanced configuration</h3><ul><li class="navListItem"><a class="navItem" href="/docs/embedding.html">Embedding JBrowse</a></li><li class="navListItem"><a class="navItem" href="/docs/mouse_configs.html">Mouse clicks, menus, and popups</a></li><li class="navListItem"><a class="navItem" href="/docs/configuration_file_formats.html">Configuration File Formats</a></li><li class="navListItem"><a class="navItem" href="/docs/dataset_selector.html">Dataset Selector</a></li><li class="navListItem"><a class="navItem" href="/docs/track_selectors.html">Track Selectors</a></li><li class="navListItem"><a class="navItem" href="/docs/track_metadata.html">Track Metadata</a></li><li class="navListItem"><a class="navItem" href="/docs/global_options.html">Global configuration options</a></li><li class="navListItem"><a class="navItem" href="/docs/compression.html">Compressing JBrowse data</a></li><li class="navListItem"><a class="navItem" href="/docs/authentication.html">HTTP authentication for JBrowse</a></li><li class="navListItem"><a class="navItem" href="/docs/paired_reads.html">Paired read viewing</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Command line</h3><ul><li class="navListItem"><a class="navItem" href="/docs/flatfile-to-json.pl.html">flatfile-to-json.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/remove-track.pl.html">remove-track.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/ucsc-to-json.pl.html">ucsc-to-json.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/generate-names.pl.html">generate-names.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/prepare-refseqs.pl.html">prepare-refseqs.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/biodb-to-json.pl.html">biodb-to-json.pl</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">JBrowse Desktop</h3><ul><li class="navListItem"><a class="navItem" href="/docs/jbrowse_desktop.html">JBrowse Desktop</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">FAQ</h3><ul><li class="navListItem"><a class="navItem" href="/docs/faq.html">JBrowse FAQ</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Other topics</h3><ul><li class="navListItem"><a class="navItem" href="/docs/url_strings.html">JBrowse URL parameters</a></li><li class="navListItem"><a class="navItem" href="/docs/image_tracks.html">Pre-rendered Image Tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/feature_coverage.html">Feature Coverage Tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/screenshots.html">Automating screenshots of JBrowse</a></li><li class="navListItem"><a class="navItem" href="/docs/events.html">JBrowse Subscribe/Publish events</a></li><li class="navListItem"><a class="navItem" href="/docs/perl_config.html">Sample configuration bash script</a></li><li class="navListItem navListItemActive"><a class="navItem" href="/docs/data_formats.html">JBrowse REST API and Data APIs</a></li><li class="navListItem"><a class="navItem" href="/docs/plugins.html">Installing and writing plugins</a></li><li class="navListItem"><a class="navItem" href="/docs/cors.html">Cross-origin resource sharing (CORS)</a></li><li class="navListItem"><a class="navItem" href="/docs/sparql.html">SPARQL configuration</a></li><li class="navListItem"><a class="navItem" href="/docs/data_export.html">Data export</a></li><li class="navListItem"><a class="navItem" href="/docs/usage_stats.html">Usage Statistics</a></li></ul></div></div></section></div><script>
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
const headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
if (event.target.tagName === 'A') {
document.body.classList.remove('tocActive');
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><h1 class="postHeaderTitle">JBrowse REST API and Data APIs</h1></header><article><div><span><h2><a class="anchor" aria-hidden="true" id="writing-jbrowse-compatible-web-services"></a><a href="#writing-jbrowse-compatible-web-services" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Writing JBrowse-compatible Web Services</h2>
<p>Beginning in version 1.9.0, JBrowse ships with a REST data store adapter (JBrowse/Store/SeqFeature/REST) that can provide feature, sequence, and quantitative data for display by any of JBrowse's track types. To use it, a developer can implement server-side web services that satisfy the REST API it expects.</p>
<p>JBrowse version 1.11.0 added a REST adaptor that can look up names and name prefixes (for type-ahead completion) from REST endpoints as well (see JBrowse REST Names API below).</p>
<h3><a class="anchor" aria-hidden="true" id="jbrowse-rest-feature-store-api"></a><a href="#jbrowse-rest-feature-store-api" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>JBrowse REST Feature Store API</h3>
<p>The JBrowse REST feature store requires the following server resources.</p>
<h4><a class="anchor" aria-hidden="true" id="get-base-stats-global"></a><a href="#get-base-stats-global" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>GET (base)/stats/global</code></h4>
<p>Required. Returns a JSON object containing global statistics about the features served by this store.</p>
<p>Example:</p>
<pre><code class="hljs"> {
"featureDensity": 0.02,
"featureCount": 234235,
"scoreMin": 87,
"scoreMax": 87,
"scoreMean": 42,
"scoreStdDev": 2.1
}
</code></pre>
<p>None of the attributes in the example above are required to be present. However, if the store is primarily providing positional data (such as genes), it is recommended to provide at least <code>featureDensity</code> (average number of features per basepair), since JBrowse uses this metric to make many decisions about how to display features. For stores that primarily provide quantitative data, it is recommended to also provide score statistics.</p>
<h4><a class="anchor" aria-hidden="true" id="get-base-stats-region-refseq-name-start-123-end-456"></a><a href="#get-base-stats-region-refseq-name-start-123-end-456" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>GET (base)/stats/region/(refseq_name)?start=123&end=456</code></h4>
<p>Optional, but recommended. Get statistics for a particular region. Returns the same format as <code>stats/global</code> above, but with statistics that apply only to the region specified.</p>
<p>The <code>refseq name</code> URL component, and the <code>start</code> and <code>end</code> query parameters specify the region of interest. Statistics should be calculated for all features that <strong>overlap</strong> the region in question. <code>start</code> and <code>end</code> are in interbase coordinates.</p>
<p>NOTE: If this is not implemented, the statistics will be calculated as needed by actually fetching feature data for the region in question. If your backend *does* implement region stats, set <code>"region_stats": true</code> in the track or store configuration to have JBrowse use them.</p>
<h4><a class="anchor" aria-hidden="true" id="get-base-stats-regionfeaturedensities-refseq-name-start-123-end-456-basesperbin-20000"></a><a href="#get-base-stats-regionfeaturedensities-refseq-name-start-123-end-456-basesperbin-20000" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>GET (base)/stats/regionFeatureDensities/(refseq_name)?start=123&end=456&basesPerBin=20000</code></h4>
<p>Optional, added in JBrowse 1.10.7. Get binned feature counts for a certain region, which are used only by HTMLFeatures tracks to draw density histograms at certain zoom levels. If your backend implements this endpoint, set <code>"region_feature_densities": true</code> in the track or store configuration to have JBrowse use it.</p>
<p>The <code>refseq name</code> URL component, and the <code>start</code> and <code>end</code> query parameters specify the region of interest. <code>start</code> and <code>end</code> are in interbase coordinates.</p>
<p>The <code>basesPerBin</code> is an integer which must be used to determine the number of bins - the endpoint may not choose its own bin size. <code>max</code> should be the maximum value for the density, the global maximum for the entire track.</p>
<p>Example returned JSON:</p>
<pre><code class="hljs">{
"bins": [ 51, 50, 58, 63, 57, 57, 65, 66, 63, 61,
56, 49, 50, 47, 39, 38, 54, 41, 50, 71,
61, 44, 64, 60, 42
],
"stats": {
"basesPerBin": 200,
"max": 88
}
}
</code></pre>
<p>Note that the <code>stats.max</code> attribute sets that Y-axis scale for the entire track, so should probably be set according to the global (or nearly global) max count for bins of that size.</p>
<h4><a class="anchor" aria-hidden="true" id="get-base-features-refseq-name-start-234-end-5678"></a><a href="#get-base-features-refseq-name-start-234-end-5678" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>GET (base)/features/(refseq_name)?start=234&end=5678</code></h4>
<p>Required. Fetch feature data (including quantitative data) for the specified region.</p>
<p>The <code>refseq name</code> URL component, and the <code>start</code> and <code>end</code> query parameters specify the region of interest. All features that <strong>overlap</strong> the region in question should be returned. <code>start</code> and <code>end</code> are in interbase coordinates. Also, track types that display features as boxes laid out on the genome (such as HTMLFeatures, CanvasFeatures, Alignments, and Alignments2 ) require all top-level features to have a globally-unique ID, which should be set as <code>uniqueID</code> in the JSON emitted by the service. <code>uniqueID</code> can be any string or number that is guaranteed to be unique among the features being emitted by this query. It is never shown to the user.</p>
<p>Example return JSON:</p>
<pre><code class="hljs">{
"features": [
/* minimal required data */
{ "start": 123, "end": 456 },
/* typical quantitative data */
{ "start": 123, "end": 456, "score": 42 },
/* Expected format of the single feature expected when the track is a sequence data track. */
{"seq": "gattacagattaca", "start": 0, "end": 14},
/* typical processed transcript with subfeatures */
{ "type": "mRNA", "start": 5975, "end": 9744, "score": 0.84, "strand": 1,
"name": "au9.g1002.t1", "uniqueID": "globallyUniqueString3",
"subfeatures": [
{ "type": "five_prime_UTR", "start": 5975, "end": 6109, "score": 0.98, "strand": 1 },
{ "type": "start_codon", "start": 6110, "end": 6112, "strand": 1, "phase": 0 },
{ "type": "CDS", "start": 6110, "end": 6148, "score": 1, "strand": 1, "phase": 0 },
{ "type": "CDS", "start": 6615, "end": 6683, "score": 1, "strand": 1, "phase": 0 },
{ "type": "CDS", "start": 6758, "end": 7040, "score": 1, "strand": 1, "phase": 0 },
{ "type": "CDS", "start": 7142, "end": 7319, "score": 1, "strand": 1, "phase": 2 },
{ "type": "CDS", "start": 7411, "end": 7687, "score": 1, "strand": 1, "phase": 1 },
{ "type": "CDS", "start": 7748, "end": 7850, "score": 1, "strand": 1, "phase": 0 },
{ "type": "CDS", "start": 7953, "end": 8098, "score": 1, "strand": 1, "phase": 2 },
{ "type": "CDS", "start": 8166, "end": 8320, "score": 1, "strand": 1, "phase": 0 },
{ "type": "CDS", "start": 8419, "end": 8614, "score": 1, "strand": 1, "phase": 1 },
{ "type": "CDS", "start": 8708, "end": 8811, "score": 1, "strand": 1, "phase": 0 },
{ "type": "CDS", "start": 8927, "end": 9239, "score": 1, "strand": 1, "phase": 1 },
{ "type": "CDS", "start": 9414, "end": 9494, "score": 1, "strand": 1, "phase": 0 },
{ "type": "stop_codon", "start": 9492, "end": 9494, "strand": 1, "phase": 0 },
{ "type": "three_prime_UTR", "start": 9495, "end": 9744, "score": 0.86, "strand": 1 }
]
}
]
}
</code></pre>
<h3><a class="anchor" aria-hidden="true" id="configuring-tracks-to-use-a-rest-feature-store"></a><a href="#configuring-tracks-to-use-a-rest-feature-store" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configuring Tracks to Use a REST Feature Store</h3>
<p>Example configuration for an HTMLFeatures track showing features from a REST feature store with URLs based at <a href="http://my.site.com/rest/api/base">http://my.site.com/rest/api/base</a>, and also adding "organism=tyrannosaurus" in the query string of all HTTP requests.</p>
<pre><code class="hljs">{
"label": "my_rest_track",
"key": "REST Test Track",
"type": "JBrowse/View/Track/HTMLFeatures",
"storeClass": "JBrowse/Store/SeqFeature/REST",
"baseUrl": "http://my.site.com/rest/api/base",
"query": {
"organism": "tyrannosaurus"
}
}
</code></pre>
<h3><a class="anchor" aria-hidden="true" id="other-dynamically-servable-formats"></a><a href="#other-dynamically-servable-formats" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Other Dynamically-Servable Formats</h3>
<h4><a class="anchor" aria-hidden="true" id="tracklistjson-format"></a><a href="#tracklistjson-format" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>trackList.json format</h4>
<pre><code class="hljs">{
"tracks": [
{
"label": "my_gene_track", /* Unique, machine readable name */
"key": "Genes", /* Descriptive, meat readable name */
"type": "JBrowse/View/Track/HTMLFeatures",
"storeClass": "JBrowse/Store/SeqFeature/REST",
"baseUrl": "http://my.site.com/rest/api/base",
"query": { /* Your arbitrary set of query parameters, always sent with every request */
"organism": "tyrannosaurus", "soType": "gene"
}
},
{
"label": "my_sequence_track", /* Unique, machine readable name */
"key": "DNA", /* Descriptive, meat readable name */
"type": "JBrowse/View/Track/Sequence",
"storeClass": "JBrowse/Store/SeqFeature/REST",
"baseUrl": "http://my.site.com/rest/api/base",
"query": { /* Your arbitrary set of query parameters, always sent with every request */
"organism": "tyrannosaurus", "sequence": true
}
}
]
}
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="refseqsjson-format"></a><a href="#refseqsjson-format" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>refSeqs.json format</h4>
<p>This will be fetched from the url configured in the config.json file, such that if the config.json file specifies "?data=X/Y/Z" and is itself at "<a href="SCHEME://HOST:PORT/PATH">SCHEME://HOST:PORT/PATH</a>", then JBrowse will request the url "<a href="SCHEME://HOST:PORT/PATH/X/Y/Z/seq/refSeqs.json">SCHEME://HOST:PORT/PATH/X/Y/Z/seq/refSeqs.json</a>".</p>
<pre><code class="hljs">[
{"name": "chr1", "start": 0, "end": 12345678},
{...}
]
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="sequence-data-format"></a><a href="#sequence-data-format" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Sequence data format</h4>
<p>Retrieved from "{BASE}/features/{seqid}".</p>
<p>This is the REST feature store data format, but it expects just a single feature, and that feature should have sequence.</p>
<pre><code class="hljs">{"features": [
{"seq": "gattacagattaca" "start": 0, "end": 14}
]
</code></pre>
<h3><a class="anchor" aria-hidden="true" id="jbrowse-rest-names-api"></a><a href="#jbrowse-rest-names-api" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>JBrowse REST Names API</h3>
<p>Starting in version 1.11.0, JBrowse can use REST web services for looking up features by name, and for type-ahead autocompletion.</p>
<h4><a class="anchor" aria-hidden="true" id="get-url-equals-apple1"></a><a href="#get-url-equals-apple1" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>GET (url)?equals=Apple1</code></h4>
<p>Required. Returns JSON list of genomic locations with names that exactly match the given string.</p>
<p>The JSON format returned is the same as for <code>startswith</code> above.</p>
<h4><a class="anchor" aria-hidden="true" id="get-url-startswith-ap"></a><a href="#get-url-startswith-ap" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>GET (url)?startswith=Ap</code></h4>
<p>Required. Returns JSON list of genomic locations that have names that start with the given string.</p>
<p>Example returned JSON:</p>
<pre><code class="hljs">[
{
"name" : "Apple1", // Name associated with the record. May be a secondary name of the object.
"location" : { // location information for the match
"ref" : "ctgA", // name of the reference sequence
"start" : 9999, // genomic start (interbase coords)
"end" : 11500, // genomic end (interbase coords)
"tracks" : [ // list of track labels that contain this object
"CDS"
],
"objectName" : "Apple1" // canonical/primary name of the object
}
},
...
]
</code></pre>
<h3><a class="anchor" aria-hidden="true" id="configuring-jbrowse-to-use-rest-name-lookup"></a><a href="#configuring-jbrowse-to-use-rest-name-lookup" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configuring JBrowse to Use REST Name Lookup</h3>
<p>Add something like the following to <code>jbrowse.conf</code>:</p>
<p><code>[names]</code>
<code>type = REST</code>
<code>url = /path/to/names/rest/service</code></p>
<h2><a class="anchor" aria-hidden="true" id="publishing-and-subscribing-to-jbrowse-events"></a><a href="#publishing-and-subscribing-to-jbrowse-events" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Publishing and Subscribing to JBrowse Events</h2>
<p>JBrowse client events are implemented using the dojo/topic message bus from the Dojo library. Extensions can subscribe to particular events in order to be notified when certain UI changes happen (for example, highlighting a region generates an event, which can be latched onto with a callback that triggers a request for the server to BLAST that region against a database). In select cases, extensions can also publish events, as a way of forcing the UI into certain states or transitions (for example, events can be used in this way to force the browser to load a new track, in response to some other circumstance or notification).</p>
<h2><a class="anchor" aria-hidden="true" id="json-lazynclist-feature-store"></a><a href="#json-lazynclist-feature-store" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>JSON LazyNCList Feature Store</h2>
<p>One data store type that JBrowse uses is a lazily-loaded nested containment list (LazyNCLists), which is an efficient format for storing feature data in pre-generated static JSON files. A nested containment list is a tree data structure in which the nodes of the tree are intervals themselves features, and edges connecting features that lie `within the bounds of (but are not subfeatures of) another feature. It has some similarities to an R tree. For more on NClists, see <a href="http://bioinformatics.oxfordjournals.org/content/23/11/1386.abstract">the Alekseyenko paper</a>.</p>
<p>This data format is currently used in JBrowse 1.3 for tracks of type <code>FeatureTrack</code>, and the code that actually reads this format is in SeqFeatureStore/NCList.js and ArrayRepr.js.</p>
<p>The LazyNCList format can be broken down into two distinct subformats: the LazyNCList itself, and the array-based JSON representation of the features themselves.</p>
<h3><a class="anchor" aria-hidden="true" id="array-representation-arrayrepr"></a><a href="#array-representation-arrayrepr" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Array Representation (<code>ArrayRepr</code>)</h3>
<p>For speed and memory efficiency, NCList JSON represents features as arrays instead of objects. This is because the JSON representation is much more compact (saving a lot of disk space), and many browsers significantly optimize JavaScript Array objects over more general objects.</p>
<p>Each feature is represented as an array of the form <code>[ class, data, data, ... ]</code>, where the <code>class</code> is an integer index into the store's <code>classes</code> array (more on that in the next section). Each of the elements in the <code>classes</code> array is an <em>array representation</em> that defines the meaning of each of the the elements in the feature array.</p>
<p>An <strong>array representation</strong> specification is encoded in JSON as (comments added):</p>
<pre><code class="hljs">{
<span class="hljs-string">"attributes"</span>: [ <span class="hljs-comment">// array of attribute names for this representation</span>
<span class="hljs-string">"AttributeNameForIndex1"</span>,
<span class="hljs-string">"AttributeNameForIndex2"</span>,
...
],
<span class="hljs-string">"isArrayAttr"</span>: { <span class="hljs-comment">// list of which attributes are themselves arrays</span>
<span class="hljs-string">"AttributeNameForIndexN"</span>: <span class="hljs-number">1</span>,
...
}
}
</code></pre>
<h3><a class="anchor" aria-hidden="true" id="lazy-nested-containment-lists-lazynclist"></a><a href="#lazy-nested-containment-lists-lazynclist" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Lazy Nested-Containment Lists (<code>LazyNCList</code>)</h3>
<p>A JBrowse LazyNCList is a nested containment list tree structure stored as one JSON file that contains the root node of the tree, plus zero or more "lazy" JSON files that contain subtrees of the main tree. These subtree files are lazily fetched: that is, they are only fetched by JBrowse when they are needed to display a certain genomic region.</p>
<p>On disk, the files in an LazyNCList feature store look like this:</p>
<pre><code class="hljs"> <span class="hljs-meta"># stats, metadata, and nclist root node</span>
data<span class="hljs-meta-keyword">/tracks/</span><span class="hljs-params"><track_label></span>/<span class="hljs-params"><refseq_name></span>/trackData.json
<span class="hljs-meta"># lazily-loaded nclist subtrees</span>
data<span class="hljs-meta-keyword">/tracks/</span><span class="hljs-params"><track_label></span>/<span class="hljs-params"><refseq_name></span>/lf-<span class="hljs-params"><chunk_number></span>.json
<span class="hljs-meta"># precalculated feature densities</span>
data<span class="hljs-meta-keyword">/tracks/</span><span class="hljs-params"><track_label></span>/<span class="hljs-params"><refseq_name></span>/hist-<span class="hljs-params"><bin_size></span>.json
...`
</code></pre>
<p>Where the <code>trackData.json</code> file is formatted as (comments added):</p>
<pre><code class="hljs">{
<span class="hljs-string">"featureCount"</span> : <span class="hljs-number">4293</span>, // total number of <span class="hljs-built_in">features</span> <span class="hljs-keyword">in</span> this store
<span class="hljs-string">"histograms"</span> : { // information about precalculated <span class="hljs-built_in">feature</span>-frequency histograms
<span class="hljs-string">"meta"</span> : [
{ // description of each available bin-size <span class="hljs-keyword">for</span> precalculated <span class="hljs-built_in">feature</span> frequencies
<span class="hljs-string">"basesPerBin"</span> : <span class="hljs-string">"100000"</span>,
<span class="hljs-string">"arrayParams"</span> : {
<span class="hljs-string">"length"</span> : <span class="hljs-number">904</span>,
<span class="hljs-string">"chunkSize"</span> : <span class="hljs-number">10000</span>,
<span class="hljs-string">"urlTemplate"</span> : <span class="hljs-string">"hist-100000-{Chunk}.json"</span>
}
},
... // <span class="hljs-keyword">and</span> so on <span class="hljs-keyword">for</span> each bin size
],
<span class="hljs-string">"stats"</span> : [
{ // stats about each precalculated set of binned <span class="hljs-built_in">feature</span> frequencies
<span class="hljs-string">"basesPerBin"</span> : <span class="hljs-string">"100000"</span>, // bin size <span class="hljs-keyword">in</span> bp
<span class="hljs-string">"max"</span> : <span class="hljs-number">51</span>, // <span class="hljs-built_in">max</span> <span class="hljs-built_in">features</span> per bin
<span class="hljs-string">"mean"</span> : <span class="hljs-number">4.93030973451327</span> // <span class="hljs-built_in">mean</span> <span class="hljs-built_in">features</span> per bin
},
...
]
},
<span class="hljs-string">"intervals"</span> : {
<span class="hljs-string">"classes"</span> : [ // classes: <span class="hljs-built_in">array</span> representations used <span class="hljs-keyword">in</span> this <span class="hljs-built_in">feature</span> data (see ArrayRepr section above)
{
<span class="hljs-string">"isArrayAttr"</span> : {
<span class="hljs-string">"Subfeatures"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"attributes"</span> : [
<span class="hljs-string">"Start"</span>,
<span class="hljs-string">"End"</span>,
<span class="hljs-string">"Strand"</span>,
<span class="hljs-string">"Source"</span>,
<span class="hljs-string">"Phase"</span>,
<span class="hljs-string">"Type"</span>,
<span class="hljs-string">"Id"</span>,
<span class="hljs-string">"Name"</span>,
<span class="hljs-string">"Subfeatures"</span>
]
},
...
{ // the <span class="hljs-built_in">last</span> arrayrepr class <span class="hljs-built_in">is</span> the <span class="hljs-string">"lazyClass"</span>: fake <span class="hljs-built_in">features</span> that point to other files
<span class="hljs-string">"isArrayAttr"</span> : {
<span class="hljs-string">"Sublist"</span> : <span class="hljs-number">1</span>
},
<span class="hljs-string">"attributes"</span> : [
<span class="hljs-string">"Start"</span>,
<span class="hljs-string">"End"</span>,
<span class="hljs-string">"Chunk"</span>
]
}
],
<span class="hljs-string">"nclist"</span> : [
[
<span class="hljs-number">2</span>, // arrayrepr class <span class="hljs-number">2</span>
<span class="hljs-number">12962</span>, // <span class="hljs-string">"Start"</span> minimum <span class="hljs-built_in">coord</span> of <span class="hljs-built_in">features</span> <span class="hljs-keyword">in</span> this subtree
<span class="hljs-number">221730</span>, // <span class="hljs-string">"End"</span> maximum <span class="hljs-built_in">coord</span> of <span class="hljs-built_in">features</span> <span class="hljs-keyword">in</span> this subtree
<span class="hljs-number">1</span> // <span class="hljs-string">"Chunk"</span> (indicates this subtree <span class="hljs-built_in">is</span> <span class="hljs-keyword">in</span> lf-<span class="hljs-number">1.</span>json)
],
[
<span class="hljs-number">2</span>, // arrayrepr class <span class="hljs-number">2</span>
<span class="hljs-number">220579</span>, // <span class="hljs-string">"Start"</span> minimum <span class="hljs-built_in">coord</span> of <span class="hljs-built_in">features</span> <span class="hljs-keyword">in</span> this subtree
<span class="hljs-number">454457</span>, // <span class="hljs-string">"End"</span> maximum <span class="hljs-built_in">coord</span> of <span class="hljs-built_in">features</span> <span class="hljs-keyword">in</span> this subtree
<span class="hljs-number">2</span> // <span class="hljs-string">"Chunk"</span> (indicates this subtree <span class="hljs-built_in">is</span> <span class="hljs-keyword">in</span> lf-<span class="hljs-number">2.</span>json)
],
...
],
<span class="hljs-string">"lazyClass"</span> : <span class="hljs-number">2</span>, // index of arrayrepr class that <span class="hljs-built_in">points</span> to a subtree
<span class="hljs-string">"maxEnd"</span> : <span class="hljs-number">90303842</span>, // maximum coordinate of <span class="hljs-built_in">features</span> <span class="hljs-keyword">in</span> this store
<span class="hljs-string">"urlTemplate"</span> : <span class="hljs-string">"lf-{Chunk}.json"</span>, // format <span class="hljs-keyword">for</span> lazily-fetched subtree files
<span class="hljs-string">"minStart"</span> : <span class="hljs-number">12962</span> // minimum coordinate of <span class="hljs-built_in">features</span> <span class="hljs-keyword">in</span> this store
},
<span class="hljs-string">"formatVersion"</span> : <span class="hljs-number">1</span>
}
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="feature-api-and-feature-store-api"></a><a href="#feature-api-and-feature-store-api" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Feature API and Feature Store API</h2>
<p>Classes modeling individual sequence features conform to the <b>Feature API</b> (exemplified by and documented in the source for the class <code>JBrowse/Model/SimpleFeature</code>) by providing accessor methods for various feature attributes (start and endpoint, ID field, tags, score, parent and child relationships for modeling super- and sub-features) some of which are mandatory for the various different types of track. Specifically: “<code>start</code>” and “<code>end</code>” attributes are always required (representing 1-based closed-interval coordinates), a unique “<code>id</code>” attribute is required by non-quantitative tracks (<code>CanvasFeatures</code>, <code>HTMLFeatures</code>, <code>Alignments*</code>, etc) and a “<code>score</code>” attribute is used by quantitative tracks (<code>Wiggle/*</code>) to represent the score for the interval spanned by the feature.</p>
<p>By contrast, classes modeling sources of sequences and sequence features generally inherit from <code>JBrowse/Store/SeqFeature</code> and implement the <b>Feature Store API</b> including methods <code>getGlobalStats</code> (for global statistics about the features in the store), <code>getRegionStats</code> (for statistics about a particular interval), <code>getFeatures</code> (to query the store for features) and <code>getReferenceSequence</code> (to query the store for sequence data).</p>
<p>Typically, different Feature Stores will provide their own custom implementations of the Feature API.</p>
<p>diff --git a/docs/site/configuration_guide.md b/docs/site/configuration_guide.md
index 5ae2f3e..694be77 100644
--- a/docs/site/configuration_guide.md
+++ b/docs/site/configuration_guide.md
@@ -243,289 +243,6 @@ and then your trackList.json
"noExport" : "true",
},</p>
<pre><code class="hljs"><span class="hljs-comment">## Using JBrowse with Existing Web Services</span>
Users can extend JBrowse's functionality <span class="hljs-keyword">to</span> <span class="hljs-keyword">with</span> their own JavaScript code using <span class="hljs-keyword">the</span> JBrowse plugin system. For an overview <span class="hljs-keyword">of</span> plugins <span class="hljs-keyword">and</span> their structure, see [Writing JBrowse Plugins](<span class="hljs-comment">#writing-jbrowse-plugins "wikilink").</span>
To use JBrowse <span class="hljs-keyword">with</span> an existing <span class="hljs-keyword">set</span> <span class="hljs-keyword">of</span> web services, users will want <span class="hljs-keyword">to</span> implement a JBrowse Store module <span class="hljs-keyword">in</span> JavaScript <span class="hljs-keyword">that</span> can fetch data <span class="hljs-keyword">from</span> them <span class="hljs-keyword">and</span> convert <span class="hljs-keyword">it</span> <span class="hljs-keyword">into</span> <span class="hljs-keyword">the</span> internal JavaScript object representations <span class="hljs-keyword">that</span> JBrowse expects. In general terms, <span class="hljs-keyword">the</span> steps <span class="hljs-keyword">to</span> follow <span class="hljs-keyword">to</span> do this would be:
<span class="hljs-number">1.</span> Create a new plugin using `bin/new-plugin.pl` <span class="hljs-keyword">or</span> manually.
<span class="hljs-number">2.</span> Enable <span class="hljs-keyword">the</span> plugin <span class="hljs-keyword">by</span> adding <span class="hljs-keyword">its</span> <span class="hljs-built_in">name</span> <span class="hljs-keyword">to</span> `plugins` <span class="hljs-keyword">in</span> <span class="hljs-keyword">the</span> JBrowse configuration (<span class="hljs-keyword">in</span> jbrowse_conf.json, trackList.json, <span class="hljs-keyword">in</span> <span class="hljs-keyword">the</span> constructor arguments <span class="hljs-keyword">in</span> index.html, <span class="hljs-keyword">or</span> elsewhere).
<span class="hljs-number">3.</span> Create a new data store <span class="hljs-built_in">class</span> <span class="hljs-keyword">in</span> <span class="hljs-k