aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristian2016-08-05 15:51:44 +0200
committerchristian2016-08-05 15:51:44 +0200
commite826ee732b9b7b900427d85e6e94f645c83586c9 (patch)
treeb48a36d24ebb5f03e40f5cfd7a4e603a94f03002
parentc55bb30fd7cd54a5065074f19cd6ed64fa6d79f1 (diff)
downloadgenenetwork2-e826ee732b9b7b900427d85e6e94f645c83586c9.tar.gz
Add functions for creating, configuring BD browser
-rw-r--r--wqflask/wqflask/static/new/javascript/biodalliance.js55
1 files 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;
+};