From e826ee732b9b7b900427d85e6e94f645c83586c9 Mon Sep 17 00:00:00 2001 From: christian Date: Fri, 5 Aug 2016 15:51:44 +0200 Subject: Add functions for creating, configuring BD browser --- .../wqflask/static/new/javascript/biodalliance.js | 55 +++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/wqflask/wqflask/static/new/javascript/biodalliance.js b/wqflask/wqflask/static/new/javascript/biodalliance.js index 6b082fbb..2dde6365 100644 --- a/wqflask/wqflask/static/new/javascript/biodalliance.js +++ b/wqflask/wqflask/static/new/javascript/biodalliance.js @@ -1,6 +1,13 @@ "use strict"; -var createBDBrowser = function(chr, start, end, sources) { +var bd_browser = null; +var bd_data = {}; + +var getChrLen = function(chr) { + return js_data[chr * 1]; +}; + +var createBDBrowser = function(chr, start, end, speciesName, sources) { console.log("creating BD browser"); var b = new Browser({ chr: chr, @@ -8,7 +15,7 @@ var createBDBrowser = function(chr, start, end, sources) { viewEnd: end, coordSystem: { - speciesName: 'Mouse' + speciesName: speciesName }, sources: sources, @@ -22,3 +29,47 @@ var createBDBrowser = function(chr, start, end, sources) { console.log("created BD browser"); return b; }; + +var showBDButton = function() { + $('#open_bd').show(); + $('#close_bd').hide(); +}; + +var hideBDButton = function() { + $('#close_bd').show(); + $('#open_bd').hide(); +}; + + +var setBDData = function(chr, length) { + // bd_data = { chr: chr, length: length }; + bd_data.chr = chr; + bd_data.length = length; +}; + +var setBDSpecies = function(species) { + bd_data.species = species; +}; + + +var openBDBrowser = function() { + console.log("opening browser"); + if (!bd_browser) { + bd_browser = createBDBrowser(bd_data.chr, 0, bd_data.length * 1000000, bd_data.species, + [{name: 'Genome', + twoBitURI: 'http://www.biodalliance.org/datasets/GRCm38/mm10.2bit', + desc: 'Mouse reference genome build GRCm38', + tier_type: 'sequence', + provides_entrypoints: true}, + {name: 'QTL', + tier_type: 'qtl', + uri: 'http://gsocbox:8880/static/qtl/lod2.csv', + stylesheet_uri: "http://gsocbox:8880/stylesheets/qtl-stylesheet.xml" + }] + ); + } else { + bd_browser.setLocation(bd_data.chr, 0, bd_data.length * 1000000); + } + + bd_browser.maxViewWidth = bd_data.length * 1000000; +}; -- cgit v1.2.3