galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
August 2011
- 1 participants
- 106 discussions
commit/galaxy-central: kanwei: Simplified Custom Builds page... show less by default
by Bitbucket 24 Aug '11
by Bitbucket 24 Aug '11
24 Aug '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/e85b513b66be/
changeset: e85b513b66be
user: kanwei
date: 2011-08-24 07:11:54
summary: Simplified Custom Builds page... show less by default
affected #: 1 file (261 bytes)
--- a/templates/user/dbkeys.mako Wed Aug 24 00:45:31 2011 -0400
+++ b/templates/user/dbkeys.mako Wed Aug 24 01:11:54 2011 -0400
@@ -56,6 +56,10 @@
pre.toggle();
});
});
+ $("#installed_builds").hide();
+ $("#show_installed_builds").click(function() {
+ $("#installed_builds").show();
+ });
});
</script>
@@ -72,10 +76,8 @@
% elif lines_skipped > 0:
<div class="warningmessagelarge">Skipped ${lines_skipped} lines that could not be parsed. (Line was either blank or not 2-column, with 2nd column being an integer)</div>
% endif
-
- <h2>Custom Database/Builds</h2>
- <p>Current custom builds:</p>
+ <h3>Current Custom Builds:</h3>
% if dbkeys:
<table id="custom_dbkeys" class="colored" cellspacing="0" cellpadding="0">
@@ -110,12 +112,17 @@
% else:
<p>You currently have no custom builds.</p>
% endif
- <p>Builds with system-installed len files: <em>${installed_len_files}</em></p>
- <br />
+ <p>
+ <a id="show_installed_builds" href="javascript:void(0);">Show loaded, system-installed builds</a>
+ <blockquote id="installed_builds">${installed_len_files}</blockquote>
+ </p>
+
+ <hr />
+ <h3>Add a Custom Build</h3><form action="dbkeys" method="post" enctype="multipart/form-data"><div class="toolForm" style="float: left;">
- <div class="toolFormTitle">Add a Custom Build</div>
+ <div class="toolFormTitle">New Build</div><div class="toolFormBody"><div class="form-row"><label for="name">Build Name (eg: Mouse):</label>
@@ -128,8 +135,8 @@
<div class="form-row"><label for="len_file">Upload .len file:</label><input type="file" id="len_file" name="len_file" /><br />
- <label for="len_text">Or paste length info below:</label>
- <textarea id="len_text" name="len_text" cols="30" rows="10"></textarea>
+ <label for="len_text">Or enter/paste length info below:</label>
+ <textarea id="len_text" name="len_text" cols="30" rows="8"></textarea></div><div class="form-row"><input type="submit" name="add" value="Submit"/></div>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: kanwei: Tool versioning: now store version information in hda/ldda tables. Information is kept when copied between hda/ldda, and now displayed in the "Show Info" pages for hdas and lddas.
by Bitbucket 23 Aug '11
by Bitbucket 23 Aug '11
23 Aug '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/f3a18916bfd4/
changeset: f3a18916bfd4
user: kanwei
date: 2011-08-24 06:45:31
summary: Tool versioning: now store version information in hda/ldda tables. Information is kept when copied between hda/ldda, and now displayed in the "Show Info" pages for hdas and lddas.
affected #: 6 files (761 bytes)
--- a/lib/galaxy/jobs/__init__.py Tue Aug 23 17:27:58 2011 -0400
+++ b/lib/galaxy/jobs/__init__.py Wed Aug 24 00:45:31 2011 -0400
@@ -534,7 +534,7 @@
if self.version_string_cmd:
version_filename = self.get_version_string_path()
if os.path.exists(version_filename):
- self.version_string = "Tool version: %s" % open(version_filename).read()
+ self.version_string = open(version_filename).read()
os.unlink(version_filename)
if self.app.config.outputs_to_working_directory:
@@ -587,7 +587,8 @@
dataset.blurb = 'done'
dataset.peek = 'no peek'
- dataset.info = context['stdout'] + context['stderr'] + self.version_string
+ dataset.info = context['stdout'] + context['stderr']
+ dataset.tool_version = self.version_string
dataset.set_size()
if context['stderr']:
dataset.blurb = "error"
--- a/lib/galaxy/model/__init__.py Tue Aug 23 17:27:58 2011 -0400
+++ b/lib/galaxy/model/__init__.py Wed Aug 24 00:45:31 2011 -0400
@@ -753,7 +753,7 @@
"""A base class for all 'dataset instances', HDAs, LDAs, etc"""
states = Dataset.states
permitted_actions = Dataset.permitted_actions
- def __init__( self, id=None, hid=None, name=None, info=None, blurb=None, peek=None, extension=None,
+ def __init__( self, id=None, hid=None, name=None, info=None, blurb=None, peek=None, tool_version=None, extension=None,
dbkey=None, metadata=None, history=None, dataset=None, deleted=False, designation=None,
parent_id=None, validation_errors=None, visible=True, create_dataset=False, sa_session=None ):
self.name = name or "Unnamed dataset"
@@ -761,6 +761,7 @@
self.info = info
self.blurb = blurb
self.peek = peek
+ self.tool_version = tool_version
self.extension = extension
self.designation = designation
self.metadata = metadata or dict()
@@ -1020,6 +1021,7 @@
info=self.info,
blurb=self.blurb,
peek=self.peek,
+ tool_version=self.tool_version,
extension=self.extension,
dbkey=self.dbkey,
dataset = self.dataset,
@@ -1057,6 +1059,7 @@
info=self.info,
blurb=self.blurb,
peek=self.peek,
+ tool_version=self.tool_version,
extension=self.extension,
dbkey=self.dbkey,
dataset=self.dataset,
@@ -1410,6 +1413,7 @@
info=self.info,
blurb=self.blurb,
peek=self.peek,
+ tool_version=self.tool_version,
extension=self.extension,
dbkey=self.dbkey,
dataset=self.dataset,
@@ -1434,6 +1438,7 @@
info=self.info,
blurb=self.blurb,
peek=self.peek,
+ tool_version=self.tool_version,
extension=self.extension,
dbkey=self.dbkey,
dataset=self.dataset,
--- a/lib/galaxy/model/mapping.py Tue Aug 23 17:27:58 2011 -0400
+++ b/lib/galaxy/model/mapping.py Wed Aug 24 00:45:31 2011 -0400
@@ -113,6 +113,7 @@
Column( "info", TrimmedString( 255 ) ),
Column( "blurb", TrimmedString( 255 ) ),
Column( "peek" , TEXT ),
+ Column( "tool_version" , TEXT ),
Column( "extension", TrimmedString( 64 ) ),
Column( "metadata", MetadataType(), key="_metadata" ),
Column( "parent_id", Integer, ForeignKey( "history_dataset_association.id" ), nullable=True ),
@@ -305,6 +306,7 @@
Column( "info", TrimmedString( 255 ) ),
Column( "blurb", TrimmedString( 255 ) ),
Column( "peek" , TEXT ),
+ Column( "tool_version" , TEXT ),
Column( "extension", TrimmedString( 64 ) ),
Column( "metadata", MetadataType(), key="_metadata" ),
Column( "parent_id", Integer, ForeignKey( "library_dataset_dataset_association.id" ), nullable=True ),
--- a/templates/library/common/ldda_info.mako Tue Aug 23 17:27:58 2011 -0400
+++ b/templates/library/common/ldda_info.mako Wed Aug 24 00:45:31 2011 -0400
@@ -100,6 +100,13 @@
${ldda.get_size( nice_size=True )}
<div style="clear: both"></div></div>
+ %if ldda.tool_version:
+ <div class="form-row">
+ <label>Tool version:</label>
+ ${ldda.tool_version}
+ <div style="clear: both"></div>
+ </div>
+ %endif
<div class="form-row"><label>Data type:</label>
${ldda.ext}
@@ -154,7 +161,7 @@
%endfor
%if ldda.peek != "no peek":
<div class="form-row">
- <div id="info${ldda.id}" class="historyItemBody">
+ <div id="info${ldda.id}" class="historyItemBody"><label>Peek:</label><div><pre id="peek${ldda.id}" class="peek">${ldda.display_peek()}</pre></div></div>
--- a/templates/show_params.mako Tue Aug 23 17:27:58 2011 -0400
+++ b/templates/show_params.mako Wed Aug 24 00:45:31 2011 -0400
@@ -49,6 +49,7 @@
<tr><td>Filesize:</td><td>${nice_size(hda.dataset.file_size)}</td></tr><tr><td>Dbkey:</td><td>${hda.dbkey}</td></tr><tr><td>Format:</td><td>${hda.ext}</td></tr>
+ <tr><td>Tool Version:</td><td>${hda.tool_version}</td></tr></table><br /><table class="tabletip">
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Trackster: remove throttling during dynamic filtering because it's not needed with requestAnimationFrame.
by Bitbucket 23 Aug '11
by Bitbucket 23 Aug '11
23 Aug '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/1447e4ebe7c8/
changeset: 1447e4ebe7c8
user: jgoecks
date: 2011-08-23 23:27:58
summary: Trackster: remove throttling during dynamic filtering because it's not needed with requestAnimationFrame.
affected #: 1 file (645 bytes)
--- a/static/scripts/trackster.js Tue Aug 23 17:21:37 2011 -0400
+++ b/static/scripts/trackster.js Tue Aug 23 17:27:58 2011 -0400
@@ -1419,25 +1419,14 @@
max: -Number.MIN_VALUE,
values: [0, 0],
slide: function(event, ui) {
- //
- // Always update UI values, but set timeout for doing more--especially drawing--
- // so that viz is more responsive.
- // TODO: remove this because it's no longer necessary as we have requestAnimationFrame().
- //
- prev_values = ui.values;
- values_span.text(ui.values[0] + "-" + ui.values[1]);
- setTimeout(function() {
- if (ui.values[0] == prev_values[0] && ui.values[1] == prev_values[1]) {
- var values = ui.values;
- // Set new values in UI.
- values_span.text(values[0] + "-" + values[1]);
- // Set new values in filter.
- filter.low = values[0];
- filter.high = values[1];
- // Redraw track.
- manager.track.draw(true, true);
- }
- }, 50);
+ var values = ui.values;
+ // Set new values in UI.
+ values_span.text(values[0] + "-" + values[1]);
+ // Set new values in filter.
+ filter.low = values[0];
+ filter.high = values[1];
+ // Redraw track.
+ manager.track.draw(true, true);
},
change: function(event, ui) {
filter.control_element.slider("option", "slide").call(filter.control_element, event, ui);
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Trackster: make it possible to set features' transparency based on attribute values.
by Bitbucket 23 Aug '11
by Bitbucket 23 Aug '11
23 Aug '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/dbc0cf838411/
changeset: dbc0cf838411
user: jgoecks
date: 2011-08-23 23:21:37
summary: Trackster: make it possible to set features' transparency based on attribute values.
affected #: 4 files (4.8 KB)
--- a/static/june_2007_style/blue/trackster.css Mon Aug 22 16:31:50 2011 -0400
+++ b/static/june_2007_style/blue/trackster.css Tue Aug 23 17:21:37 2011 -0400
@@ -39,9 +39,12 @@
.top-labeltrack{position:relative;border-bottom:solid #999 1px;}
.nav-labeltrack{border-top:solid #999 1px;border-bottom:solid #333 1px;}
input{font:10px verdana;}
-.dynamic-tool,.filters{width:410px;margin-left:0.25em;padding-bottom:0.5em;}
+.dynamic-tool,.filters{margin-left:0.25em;padding-bottom:0.5em;}
+.filters>.sliders,.display-controls{float:left;margin:1em;}
+.sliders{width:410px;}
+.display-controls{border-left:solid 2px #DDDDDD;padding-left:1em}
.slider-row{margin-top:0.4em;margin-left:1em;}
-.slider-label{float:left;font-weight:bold;}
+.elt-label{float:left;font-weight:bold;margin-right:1em;}
.slider{float:right;width:200px;position:relative;}
.tool-name{font-size:110%;font-weight:bold;}
.param-row{margin-top:0.2em;margin-left:1em;}
--- a/static/june_2007_style/trackster.css.tmpl Mon Aug 22 16:31:50 2011 -0400
+++ b/static/june_2007_style/trackster.css.tmpl Tue Aug 23 17:21:37 2011 -0400
@@ -231,17 +231,28 @@
font: 10px verdana;
}
.dynamic-tool, .filters {
- width: 410px;
margin-left: 0.25em;
padding-bottom:0.5em;
}
+.filters > .sliders, .display-controls {
+ float: left;
+ margin: 1em;
+}
+.sliders{
+ width: 410px;
+}
+.display-controls{
+ border-left: solid 2px #DDDDDD;
+ padding-left: 1em
+}
.slider-row {
margin-top: 0.4em;
margin-left: 1em;
}
-.slider-label {
+.elt-label {
float: left;
font-weight: bold;
+ margin-right: 1em;
}
.slider {
float: right;
--- a/static/scripts/packed/trackster.js Mon Aug 22 16:31:50 2011 -0400
+++ b/static/scripts/packed/trackster.js Tue Aug 23 17:21:37 2011 -0400
@@ -1,1 +1,1 @@
-var class_module=function(b,a){var c=function(){var f=arguments[0];for(var e=1;e<arguments.length;e++){var d=arguments[e];for(key in d){f[key]=d[key]}}return f};a.extend=c};var BEFORE=1001,CONTAINS=1002,OVERLAP_START=1003,OVERLAP_END=1004,CONTAINED_BY=1005,AFTER=1006;var compute_overlap=function(e,b){var g=e[0],f=e[1],d=b[0],c=b[1],a;if(g<d){if(f<d){a=BEFORE}else{if(f<=c){a=OVERLAP_START}else{a=CONTAINS}}}else{if(g>c){a=AFTER}else{if(f<=c){a=CONTAINED_BY}else{a=OVERLAP_END}}}return a};var is_overlap=function(c,b){var a=compute_overlap(c,b);return(a!==BEFORE&&a!==AFTER)};var trackster_module=function(f,T){var n=f("class").extend,p=f("slotting"),I=f("painters");var Z=function(aa,ab){this.document=aa;this.default_font=ab!==undefined?ab:"9px Monaco, Lucida Console, monospace";this.dummy_canvas=this.new_canvas();this.dummy_context=this.dummy_canvas.getContext("2d");this.dummy_context.font=this.default_font;this.char_width_px=this.dummy_context.measureText("A").width;this.patterns={};this.load_pattern("right_strand","/visualization/strand_right.png");this.load_pattern("left_strand","/visualization/strand_left.png");this.load_pattern("right_strand_inv","/visualization/strand_right_inv.png");this.load_pattern("left_strand_inv","/visualization/strand_left_inv.png")};n(Z.prototype,{load_pattern:function(aa,ae){var ab=this.patterns,ac=this.dummy_context,ad=new Image();ad.src=image_path+ae;ad.onload=function(){ab[aa]=ac.createPattern(ad,"repeat")}},get_pattern:function(aa){return this.patterns[aa]},new_canvas:function(){var aa=this.document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(aa)}aa.manager=this;return aa}});var C=function(aa,ab){aa.bind("drag",{handle:ab,relative:true},function(af,ag){var ae=$(this).parent();var ad=ae.children();var ac;for(ac=0;ac<ad.length;ac++){if(ag.offsetY<$(ad.get(ac)).position().top){break}}if(ac===ad.length){if(this!==ad.get(ac-1)){ae.append(this)}}else{if(this!==ad.get(ac)){$(this).insertBefore(ad.get(ac))}}}).bind("dragstart",function(){$(this).css({"border-top":"1px solid blue","border-bottom":"1px solid blue"})}).bind("dragend",function(){$(this).css("border","0px")})};T.sortable=C;var D=9,A=20,O=D+2,w=100,F=12000,M=200,z=5,s=10,H=5000,t=100,m="There was an error in indexing this dataset. ",G="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",B="No data for this chrom/contig.",q="Currently indexing... please wait",v="Tool cannot be rerun: ",a="Loading data...",U="Ready for display",d=10,r=5,y=5;function u(aa){return Math.round(aa*1000)/1000}var c=function(aa){this.num_elements=aa;this.clear()};n(c.prototype,{get:function(ab){var aa=this.key_ary.indexOf(ab);if(aa!==-1){if(this.obj_cache[ab].stale){this.key_ary.splice(aa,1);delete this.obj_cache[ab]}else{this.move_key_to_end(ab,aa)}}return this.obj_cache[ab]},set:function(ab,ac){if(!this.obj_cache[ab]){if(this.key_ary.length>=this.num_elements){var aa=this.key_ary.shift();delete this.obj_cache[aa]}this.key_ary.push(ab)}this.obj_cache[ab]=ac;return ac},move_key_to_end:function(ab,aa){this.key_ary.splice(aa,1);this.key_ary.push(ab)},clear:function(){this.obj_cache={};this.key_ary=[]},size:function(){return this.key_ary.length}});var N=function(ab,aa,ac){c.call(this,ab);this.track=aa;this.subset=(ac!==undefined?ac:true)};n(N.prototype,c.prototype,{load_data:function(aj,ae,ah,ab,ag){var ai=this.track.view.chrom,ad={chrom:ai,low:aj,high:ae,mode:ah,resolution:ab,dataset_id:this.track.dataset_id,hda_ldda:this.track.hda_ldda};$.extend(ad,ag);if(this.track.filters_manager){var ak=[];var aa=this.track.filters_manager.filters;for(var af=0;af<aa.length;af++){ak[ak.length]=aa[af].name}ad.filter_cols=JSON.stringify(ak)}var ac=this;return $.getJSON(this.track.data_url,ad,function(al){ac.set_data(aj,ae,ah,al)})},get_data:function(aa,ae,af,ab,ad){var ac=this.get_data_from_cache(aa,ae,af);if(ac){return ac}ac=this.load_data(aa,ae,af,ab,ad);this.set_data(aa,ae,af,ac);return ac},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(ai,ad,ah,ac,ag,ae){var aj=this.get_data_from_cache(ai,ad,ah);if(!aj){console.log("ERROR: no current data for: ",this.track,ai,ad,ah,ac,ag);return}aj.stale=true;var ab=ai;if(ae===this.DEEP_DATA_REQ){$.extend(ag,{start_val:aj.data.length+1})}else{if(ae===this.BROAD_DATA_REQ){ab=aj.data[aj.data.length-1][2]+1}}var aa=this,af=this.load_data(ab,ad,ah,ac,ag);new_data_available=$.Deferred();this.set_data(ai,ad,ah,new_data_available);$.when(af).then(function(ak){if(ak.data){ak.data=aj.data.concat(ak.data);if(ak.message){ak.message=ak.message.replace(/[0-9]+/,ak.data.length)}}aa.set_data(ai,ad,ah,ak);new_data_available.resolve(ak)});return new_data_available},get_data_from_cache:function(aa,ab,ac){return this.get(this.gen_key(aa,ab,ac))},set_data:function(ab,ac,ad,aa){return this.set(this.gen_key(ab,ac,ad),aa)},gen_key:function(aa,ac,ad){var ab=aa+"_"+ac+"_"+ad;return ab},split_key:function(aa){return aa.split("_")}});var E=function(ab,aa,ac){N.call(this,ab,aa,ac)};n(E.prototype,N.prototype,c.prototype,{load_data:function(ac,aa,ae,af,ab,ad){if(ab>1){return}return N.prototype.load_data.call(this,ac,aa,ae,af,ab,ad)}});var Y=function(aa,ad,ac,ab,ae){this.container=aa;this.chrom=null;this.vis_id=ac;this.dbkey=ab;this.title=ad;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.num_tracks=0;this.track_id_counter=0;this.zoom_factor=3;this.min_separation=30;this.has_changes=false;this.init(ae);this.canvas_manager=new Z(aa.get(0).ownerDocument);this.reset()};n(Y.prototype,{init:function(ae){var ac=this.container,aa=this;this.top_container=$("<div/>").addClass("top-container").appendTo(ac);this.content_div=$("<div/>").addClass("content").css("position","relative").appendTo(ac);this.bottom_container=$("<div/>").addClass("bottom-container").appendTo(ac);this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(this.top_container);this.viewport_container=$("<div/>").addClass("viewport-container").addClass("viewport-container").appendTo(this.content_div);this.intro_div=$("<div/>").addClass("intro").appendTo(this.viewport_container).hide();var ad=$("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function(){add_tracks()});this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);this.nav_container=$("<div/>").addClass("nav-container").prependTo(this.top_container);this.nav=$("<div/>").addClass("nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.bottom_container);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_close=$("<a href='javascript:void(0);'>Close Overview</a>").addClass("overview-close").hide().appendTo(this.overview_viewport);this.overview_highlight=$("<div/>").addClass("overview-highlight").hide().appendTo(this.overview_viewport);this.overview_box_background=$("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_select=$("<select/>").attr({name:"chrom"}).css("width","15em").addClass("no-autocomplete").append("<option value=''>Loading</option>").appendTo(this.nav_controls);var ab=function(af){if(af.type==="focusout"||(af.keyCode||af.which)===13||(af.keyCode||af.which)===27){if((af.keyCode||af.which)!==27){aa.go_to($(this).val())}$(this).hide();$(this).val("");aa.location_span.show();aa.chrom_select.show()}};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keyup focusout",ab).appendTo(this.nav_controls);this.location_span=$("<span/>").addClass("location").appendTo(this.nav_controls);this.location_span.click(function(){aa.location_span.hide();aa.chrom_select.hide();aa.nav_input.val(aa.chrom+":"+aa.low+"-"+aa.high);aa.nav_input.css("display","inline-block");aa.nav_input.select();aa.nav_input.focus()});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.nav_controls)}this.zo_link=$("<a id='zoom-out' />").click(function(){aa.zoom_out();aa.redraw()}).appendTo(this.nav_controls);this.zi_link=$("<a id='zoom-in' />").click(function(){aa.zoom_in();aa.redraw()}).appendTo(this.nav_controls);this.load_chroms({low:0},ae);this.chrom_select.bind("change",function(){aa.change_chrom(aa.chrom_select.val())});this.content_div.click(function(af){$(this).find("input").trigger("blur")});this.content_div.bind("dblclick",function(af){aa.zoom_in(af.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(af,ag){this.current_x=ag.offsetX}).bind("drag",function(af,ah){var ai=ah.offsetX-this.current_x;this.current_x=ah.offsetX;var ag=Math.round(ai/aa.viewport_container.width()*(aa.max_high-aa.max_low));aa.move_delta(-ag)});this.overview_close.click(function(){aa.reset_overview()});this.viewport_container.bind("draginit",function(af,ag){if(af.clientX>aa.viewport_container.width()-16){return false}}).bind("dragstart",function(af,ag){ag.original_low=aa.low;ag.current_height=af.clientY;ag.current_x=ag.offsetX}).bind("drag",function(ah,aj){var af=$(this);var ak=aj.offsetX-aj.current_x;var ag=af.scrollTop()-(ah.clientY-aj.current_height);af.scrollTop(ag);aj.current_height=ah.clientY;aj.current_x=aj.offsetX;var ai=Math.round(ak/aa.viewport_container.width()*(aa.high-aa.low));aa.move_delta(ai)}).bind("mousewheel",function(ah,aj,ag,af){if(ag){var ai=Math.round(-ag/aa.viewport_container.width()*(aa.high-aa.low));aa.move_delta(ai)}});this.top_labeltrack.bind("dragstart",function(af,ag){return $("<div />").css({height:aa.content_div.height()+aa.top_labeltrack.height()+aa.nav_labeltrack.height()+1,top:"0px",position:"absolute","background-color":"#ccf",opacity:0.5,"z-index":1000}).appendTo($(this))}).bind("drag",function(aj,ak){$(ak.proxy).css({left:Math.min(aj.pageX,ak.startX),width:Math.abs(aj.pageX-ak.startX)});var ag=Math.min(aj.pageX,ak.startX)-aa.container.offset().left,af=Math.max(aj.pageX,ak.startX)-aa.container.offset().left,ai=(aa.high-aa.low),ah=aa.viewport_container.width();aa.update_location(Math.round(ag/ah*ai)+aa.low,Math.round(af/ah*ai)+aa.low)}).bind("dragend",function(ak,al){var ag=Math.min(ak.pageX,al.startX),af=Math.max(ak.pageX,al.startX),ai=(aa.high-aa.low),ah=aa.viewport_container.width(),aj=aa.low;aa.low=Math.round(ag/ah*ai)+aj;aa.high=Math.round(af/ah*ai)+aj;$(al.proxy).remove();aa.redraw()});this.add_label_track(new X(this,this.top_labeltrack));this.add_label_track(new X(this,this.nav_labeltrack));$(window).bind("resize",function(){aa.resize_window()});$(document).bind("redraw",function(){aa.redraw()});this.reset();$(window).trigger("resize");this.update_intro_div()},update_intro_div:function(){if(this.num_tracks===0){this.intro_div.show()}else{this.intro_div.hide()}},update_location:function(aa,ab){this.location_span.text(commatize(aa)+" - "+commatize(ab));this.nav_input.val(this.chrom+":"+commatize(aa)+"-"+commatize(ab))},load_chroms:function(ab,ac){ab.num=t;$.extend(ab,(this.vis_id!==undefined?{vis_id:this.vis_id}:{dbkey:this.dbkey}));var aa=this;$.ajax({url:chrom_url,data:ab,dataType:"json",success:function(ae){if(ae.chrom_info.length===0){alert("Invalid chromosome: "+ab.chrom);return}if(ae.reference){aa.add_label_track(new x(aa))}aa.chrom_data=ae.chrom_info;var ah='<option value="">Select Chrom/Contig</option>';for(var ag=0,ad=aa.chrom_data.length;ag<ad;ag++){var af=aa.chrom_data[ag].chrom;ah+='<option value="'+af+'">'+af+"</option>"}if(ae.prev_chroms){ah+='<option value="previous">Previous '+t+"</option>"}if(ae.next_chroms){ah+='<option value="next">Next '+t+"</option>"}aa.chrom_select.html(ah);if(ac){ac()}aa.chrom_start_index=ae.start_index},error:function(){alert("Could not load chroms for this dbkey:",aa.dbkey)}})},change_chrom:function(ae,ab,ag){if(!ae||ae==="None"){return}var ad=this;if(ae==="previous"){ad.load_chroms({low:this.chrom_start_index-t});return}if(ae==="next"){ad.load_chroms({low:this.chrom_start_index+t});return}var af=$.grep(ad.chrom_data,function(ai,aj){return ai.chrom===ae})[0];if(af===undefined){ad.load_chroms({chrom:ae},function(){ad.change_chrom(ae,ab,ag)});return}else{if(ae!==ad.chrom){ad.chrom=ae;ad.chrom_select.val(ad.chrom);ad.max_high=af.len-1;ad.reset();ad.redraw(true);for(var ah=0,aa=ad.tracks.length;ah<aa;ah++){var ac=ad.tracks[ah];if(ac.init){ac.init()}}}if(ab!==undefined&&ag!==undefined){ad.low=Math.max(ab,0);ad.high=Math.min(ag,ad.max_high)}ad.reset_overview();ad.redraw()}},go_to:function(ae){var ai=this,aa,ad,ab=ae.split(":"),ag=ab[0],ah=ab[1];if(ah!==undefined){try{var af=ah.split("-");aa=parseInt(af[0].replace(/,/g,""),10);ad=parseInt(af[1].replace(/,/g,""),10)}catch(ac){return false}}ai.change_chrom(ag,aa,ad)},move_fraction:function(ac){var aa=this;var ab=aa.high-aa.low;this.move_delta(ac*ab)},move_delta:function(ac){var aa=this;var ab=aa.high-aa.low;if(aa.low-ac<aa.max_low){aa.low=aa.max_low;aa.high=aa.max_low+ab}else{if(aa.high-ac>aa.max_high){aa.high=aa.max_high;aa.low=aa.max_high-ab}else{aa.high-=ac;aa.low-=ac}}aa.redraw()},add_track:function(aa){aa.view=this;aa.track_id=this.track_id_counter;this.tracks.push(aa);if(aa.init){aa.init()}aa.container_div.attr("id","track_"+aa.track_id);C(aa.container_div,".draghandle");this.track_id_counter+=1;this.num_tracks+=1;this.update_intro_div()},add_label_track:function(aa){aa.view=this;this.label_tracks.push(aa)},remove_track:function(ab){this.has_changes=true;delete this.tracks[this.tracks.indexOf(ab)];this.num_tracks-=1;var aa=this;ab.container_div.fadeOut("slow",function(){$(this).remove();aa.update_intro_div()})},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},redraw:function(ah){var ag=this.high-this.low,af=this.low,ab=this.high;if(af<this.max_low){af=this.max_low}if(ab>this.max_high){ab=this.max_high}if(this.high!==0&&ag<this.min_separation){ab=af+this.min_separation}this.low=Math.floor(af);this.high=Math.ceil(ab);this.resolution=Math.pow(z,Math.ceil(Math.log((this.high-this.low)/M)/Math.log(z)));this.zoom_res=Math.pow(s,Math.max(0,Math.ceil(Math.log(this.resolution,s)/Math.log(s))));var aa=(this.low/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ae=((this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ai=13;this.overview_box.css({left:aa,width:Math.max(ai,ae)}).show();if(ae<ai){this.overview_box.css("left",aa-(ai-ae)/2)}if(this.overview_highlight){this.overview_highlight.css({left:aa,width:ae})}this.update_location(this.low,this.high);if(!ah){for(var ac=0,ad=this.tracks.length;ac<ad;ac++){if(this.tracks[ac]&&this.tracks[ac].enabled){this.tracks[ac].draw()}}for(ac=0,ad=this.label_tracks.length;ac<ad;ac++){this.label_tracks[ac].draw()}}},zoom_in:function(ab,ac){if(this.max_high===0||this.high-this.low<this.min_separation){return}var ad=this.high-this.low,ae=ad/2+this.low,aa=(ad/this.zoom_factor)/2;if(ab){ae=ab/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(ae-aa);this.high=Math.round(ae+aa);this.redraw()},zoom_out:function(){if(this.max_high===0){return}var ab=this.high-this.low,ac=ab/2+this.low,aa=(ab*this.zoom_factor)/2;this.low=Math.round(ac-aa);this.high=Math.round(ac+aa);this.redraw()},resize_window:function(){this.viewport_container.height(this.container.height()-this.top_container.height()-this.bottom_container.height());this.nav_container.width(this.container.width());this.redraw()},set_overview:function(aa){$.when(aa.get_overview_tile()).then(function(ab){view.overview_viewport.find(".track-tile").remove();view.overview_close.show();view.overview_viewport.append(ab.canvas);view.overview_highlight.show().height(ab.canvas.height());view.overview_viewport.height(ab.canvas.height()+view.overview_box.height());view.resize_window();if(view.overview_track){view.overview_track.set_is_overview(false)}view.overview_track=aa;view.has_changes=true;aa.set_is_overview(true)})},reset_overview:function(){this.overview_viewport.find(".track-tile").remove();this.overview_viewport.height(this.default_overview_height);this.overview_box.height(this.default_overview_height);this.overview_close.hide();this.overview_highlight.hide();view.resize_window();if(view.overview_track){view.overview_track.set_is_overview(false)}view.overview_track=null}});var o=function(ac,ag){this.track=ac;this.name=ag.name;this.params=[];var an=ag.params;for(var ad=0;ad<an.length;ad++){var ai=an[ad],ab=ai.name,am=ai.label,ae=unescape(ai.html),ao=ai.value,ak=ai.type;if(ak==="number"){this.params[this.params.length]=new g(ab,am,ae,ao,ai.min,ai.max)}else{if(ak=="select"){this.params[this.params.length]=new K(ab,am,ae,ao)}else{console.log("WARNING: unrecognized tool parameter type:",ab,ak)}}}this.parent_div=$("<div/>").addClass("dynamic-tool").hide();this.parent_div.bind("drag",function(aq){aq.stopPropagation()}).click(function(aq){aq.stopPropagation()}).bind("dblclick",function(aq){aq.stopPropagation()});var al=$("<div class='tool-name'>").appendTo(this.parent_div).text(this.name);var aj=this.params;var ah=this;$.each(this.params,function(ar,av){var au=$("<div>").addClass("param-row").appendTo(ah.parent_div);var aq=$("<div>").addClass("param-label").text(av.label).appendTo(au);var at=$("<div/>").addClass("slider").html(av.html).appendTo(au);at.find(":input").val(av.value);$("<div style='clear: both;'/>").appendTo(au)});this.parent_div.find("input").click(function(){$(this).select()});var ap=$("<div>").addClass("param-row").appendTo(this.parent_div);var af=$("<input type='submit'>").attr("value","Run on complete dataset").appendTo(ap);var aa=$("<input type='submit'>").attr("value","Run on visible region").css("margin-left","3em").appendTo(ap);var ah=this;aa.click(function(){ah.run_on_region()});af.click(function(){ah.run_on_dataset()})};n(o.prototype,{get_param_values_dict:function(){var aa={};this.parent_div.find(":input").each(function(){var ab=$(this).attr("name"),ac=$(this).val();aa[ab]=JSON.stringify(ac)});return aa},get_param_values:function(){var ab=[];var aa={};this.parent_div.find(":input").each(function(){var ac=$(this).attr("name"),ad=$(this).val();if(ac){ab[ab.length]=ad}});return ab},run_on_dataset:function(){var aa=this;aa.run({dataset_id:this.track.original_dataset_id,tool_id:aa.name},null,function(ab){show_modal(aa.name+" is Running",aa.name+" is running on the complete dataset. Tool outputs are in dataset's history.",{Close:hide_modal})})},run_on_region:function(){var aa={dataset_id:this.track.original_dataset_id,chrom:this.track.view.chrom,low:this.track.view.low,high:this.track.view.high,tool_id:this.name},ac=this.track,ab=aa.tool_id+ac.tool_region_and_parameters_str(aa.chrom,aa.low,aa.high),ad;if(ac instanceof e){ad=new Q(ab,view,ac.hda_ldda,undefined,{},{},ac);ad.change_mode(ac.mode)}this.track.add_track(ad);ad.content_div.text("Starting job.");this.run(aa,ad,function(ae){ad.dataset_id=ae.dataset_id;ad.content_div.text("Running job.");ad.init()})},run:function(ab,ac,ad){$.extend(ab,this.get_param_values_dict());var aa=function(){$.getJSON(rerun_tool_url,ab,function(ae){if(ae==="no converter"){ac.container_div.addClass("error");ac.content_div.text(G)}else{if(ae.error){ac.container_div.addClass("error");ac.content_div.text(v+ae.message)}else{if(ae==="pending"){ac.container_div.addClass("pending");ac.content_div.text("Converting input data so that it can be used quickly with tool.");setTimeout(aa,2000)}else{ad(ae)}}}})};aa()}});var K=function(ab,aa,ac,ad){this.name=ab;this.label=aa;this.html=ac;this.value=ad};var g=function(ac,ab,ae,af,ad,aa){K.call(this,ac,ab,ae,af);this.min=ad;this.max=aa};var h=function(ab,aa,ac,ad){this.name=ab;this.index=aa;this.tool_id=ac;this.tool_exp_name=ad};var R=function(ab,aa,ac,ad){h.call(this,ab,aa,ac,ad);this.low=-Number.MAX_VALUE;this.high=Number.MAX_VALUE;this.min=Number.MAX_VALUE;this.max=-Number.MAX_VALUE;this.container=null;this.slider=null;this.slider_label=null};n(R.prototype,{applies_to:function(aa){if(aa.length>this.index){return true}return false},keep:function(aa){if(!this.applies_to(aa)){return true}var ab=parseInt(aa[this.index]);return(isNaN(ab)||(ab>=this.low&&ab<=this.high))},update_attrs:function(ab){var aa=false;if(!this.applies_to(ab)){return aa}if(ab[this.index]<this.min){this.min=Math.floor(ab[this.index]);aa=true}if(ab[this.index]>this.max){this.max=Math.ceil(ab[this.index]);aa=true}return aa},update_ui_elt:function(){if(this.min!=this.max){this.container.show()}else{this.container.hide()}var ac=function(af,ad){var ae=ad-af;return(ae<=2?0.01:1)};var ab=this.slider.slider("option","min"),aa=this.slider.slider("option","max");if(this.min<ab||this.max>aa){this.slider.slider("option","min",this.min);this.slider.slider("option","max",this.max);this.slider.slider("option","step",ac(this.min,this.max));this.slider.slider("option","values",[this.min,this.max])}}});var W=function(ac,al){this.track=ac;this.filters=[];for(var ag=0;ag<al.length;ag++){var aa=al[ag],ab=aa.name,ak=aa.type,ai=aa.index,an=aa.tool_id,ad=aa.tool_exp_name;if(ak==="int"||ak==="float"){this.filters[ag]=new R(ab,ai,an,ad)}else{console.log("ERROR: unsupported filter: ",ab,ak)}}var aj=function(ao,ap,aq){ao.click(function(){var ar=ap.text();max=parseFloat(aq.slider("option","max")),input_size=(max<=1?4:max<=1000000?max.toString().length:6),multi_value=false;if(aq.slider("option","values")){input_size=2*input_size+1;multi_value=true}ap.text("");$("<input type='text'/>").attr("size",input_size).attr("maxlength",input_size).attr("value",ar).appendTo(ap).focus().select().click(function(at){at.stopPropagation()}).blur(function(){$(this).remove();ap.text(ar)}).keyup(function(ax){if(ax.keyCode===27){$(this).trigger("blur")}else{if(ax.keyCode===13){var av=aq.slider("option","min"),at=aq.slider("option","max"),aw=function(ay){return(isNaN(ay)||ay>at||ay<av)},au=$(this).val();if(!multi_value){au=parseFloat(au);if(aw(au)){alert("Parameter value must be in the range ["+av+"-"+at+"]");return $(this)}}else{au=au.split("-");au=[parseFloat(au[0]),parseFloat(au[1])];if(aw(au[0])||aw(au[1])){alert("Parameter value must be in the range ["+av+"-"+at+"]");return $(this)}}aq.slider((multi_value?"values":"value"),au)}}})})};this.parent_div=$("<div/>").addClass("filters").hide();this.parent_div.bind("drag",function(ao){ao.stopPropagation()}).click(function(ao){ao.stopPropagation()}).bind("dblclick",function(ao){ao.stopPropagation()}).bind("keydown",function(ao){ao.stopPropagation()});var ae=this;$.each(this.filters,function(ar,au){au.container=$("<div/>").addClass("slider-row").appendTo(ae.parent_div);var at=$("<div/>").addClass("slider-label").appendTo(au.container);var aq=$("<span/>").addClass("slider-name").text(au.name+" ").appendTo(at);var ap=$("<span/>");var aw=$("<span/>").addClass("slider-value").appendTo(at).append("[").append(ap).append("]");var ao=$("<div/>").addClass("slider").appendTo(au.container);au.control_element=$("<div/>").attr("id",au.name+"-filter-control").appendTo(ao);var av=[0,0];au.control_element.slider({range:true,min:Number.MAX_VALUE,max:-Number.MIN_VALUE,values:[0,0],slide:function(ax,ay){av=ay.values;ap.text(ay.values[0]+"-"+ay.values[1]);setTimeout(function(){if(ay.values[0]==av[0]&&ay.values[1]==av[1]){var az=ay.values;ap.text(az[0]+"-"+az[1]);au.low=az[0];au.high=az[1];ae.track.draw(true,true)}},50)},change:function(ax,ay){au.control_element.slider("option","slide").call(au.control_element,ax,ay)}});au.slider=au.control_element;au.slider_label=ap;aj(aw,ap,au.control_element);$("<div style='clear: both;'/>").appendTo(au.container)});if(this.filters.length!=0){var am=$("<div>").addClass("param-row").appendTo(this.parent_div);var ah=$("<input type='submit'>").attr("value","Run on complete dataset").appendTo(am);var af=this;ah.click(function(){af.run_on_dataset()})}};n(W.prototype,{reset_filters:function(){for(var aa=0;aa<this.filters.length;aa++){filter=this.filters[aa];filter.slider.slider("option","values",[filter.min,filter.max])}},run_on_dataset:function(){var ai=function(am,ak,al){if(!(ak in am)){am[ak]=al}return am[ak]};var ac={},aa,ab,ad;for(var ae=0;ae<this.filters.length;ae++){aa=this.filters[ae];if(aa.tool_id){if(aa.min!=aa.low){ab=ai(ac,aa.tool_id,[]);ab[ab.length]=aa.tool_exp_name+" >= "+aa.low}if(aa.max!=aa.high){ab=ai(ac,aa.tool_id,[]);ab[ab.length]=aa.tool_exp_name+" <= "+aa.high}}}var ag=[];for(var aj in ac){ag[ag.length]=[aj,ac[aj]]}var ah=ag.length;(function af(aq,an){var al=an[0],am=al[0],ap=al[1],ao="("+ap.join(") and (")+")",ak={cond:ao,input:aq,target_dataset_id:aq,tool_id:am},an=an.slice(1);$.getJSON(run_tool_url,ak,function(ar){if(ar.error){show_modal("Filter Dataset","Error running tool "+am,{Close:hide_modal})}else{if(an.length===0){show_modal("Filtering Dataset","Filter(s) are running on the complete dataset. Outputs are in dataset's history.",{Close:hide_modal})}else{af(ar.dataset_id,an)}}})})(this.track.dataset_id,ag)}});var V=function(aa){this.track=aa.track;this.params=aa.params;this.values={};if(aa.saved_values){this.restore_values(aa.saved_values)}this.onchange=aa.onchange};n(V.prototype,{restore_values:function(aa){var ab=this;$.each(this.params,function(ac,ad){if(aa[ad.key]!==undefined){ab.values[ad.key]=aa[ad.key]}else{ab.values[ad.key]=ad.default_value}})},build_form:function(){var ab=this;var aa=$("<div />");$.each(this.params,function(af,ad){if(!ad.hidden){var ac="param_"+af;var ak=$("<div class='form-row' />").appendTo(aa);ak.append($("<label />").attr("for",ac).text(ad.label+":"));if(ad.type==="bool"){ak.append($('<input type="checkbox" />').attr("id",ac).attr("name",ac).attr("checked",ab.values[ad.key]))}else{if(ad.type==="color"){var ah=ab.values[ad.key];var ag=$("<input />").attr("id",ac).attr("name",ac).val(ah);var ai=$("<div class='tipsy tipsy-north' style='position: absolute;' />").hide();var ae=$("<div style='background-color: black; padding: 10px;'></div>").appendTo(ai);var aj=$("<div/>").appendTo(ae).farbtastic({width:100,height:100,callback:ag,color:ah});$("<div />").append(ag).append(ai).appendTo(ak).bind("click",function(al){ai.css({left:$(this).position().left+($(ag).width()/2)-60,top:$(this).position().top+$(this.height)}).show();$(document).bind("click.color-picker",function(){ai.hide();$(document).unbind("click.color-picker")});al.stopPropagation()})}else{ak.append($("<input />").attr("id",ac).attr("name",ac).val(ab.values[ad.key]))}}}});return aa},update_from_form:function(aa){var ac=this;var ab=false;$.each(this.params,function(ad,af){if(!af.hidden){var ag="param_"+ad;var ae=aa.find("#"+ag).val();if(af.type==="float"){ae=parseFloat(ae)}else{if(af.type==="int"){ae=parseInt(ae)}else{if(af.type==="bool"){ae=aa.find("#"+ag).is(":checked")}}}if(ae!==ac.values[af.key]){ac.values[af.key]=ae;ab=true}}});if(ab){this.onchange()}}});var b=function(ac,ab,aa,ad){this.index=ac;this.low=ac*M*ab;this.high=(ac+1)*M*ab;this.resolution=ab;this.canvas=$("<div class='track-tile'/>").append(aa);this.data=ad;this.stale=false};var l=function(ac,ab,aa,ad,ae){b.call(this,ac,ab,aa,ad);this.max_val=ae};var L=function(ac,ab,aa,ae,ad){b.call(this,ac,ab,aa,ae);this.message=ad};var j=function(ab,aa,ae,ac,ad){this.name=ab;this.view=aa;this.parent_element=ae;this.data_url=(ac?ac:default_data_url);this.data_url_extra_params={};this.data_query_wait=(ad?ad:H);this.dataset_check_url=converted_datasets_state_url;this.container_div=$("<div />").addClass("track").css("position","relative");if(!this.hidden){this.header_div=$("<div class='track-header' />").appendTo(this.container_div);if(this.view.editor){this.drag_div=$("<div class='draghandle' />").appendTo(this.header_div)}this.name_div=$("<div class='menubutton popup' />").appendTo(this.header_div);this.name_div.text(this.name);this.name_div.attr("id",this.name.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase())}this.content_div=$("<div class='track-content'>").appendTo(this.container_div);this.parent_element.append(this.container_div)};n(j.prototype,{get_type:function(){if(this instanceof X){return"LabelTrack"}else{if(this instanceof x){return"ReferenceTrack"}else{if(this instanceof k){return"LineTrack"}else{if(this instanceof S){return"ReadTrack"}else{if(this instanceof Q){return"ToolDataFeatureTrack"}else{if(this instanceof P){return"VcfTrack"}else{if(this instanceof e){return"FeatureTrack"}}}}}}}return""},init:function(){var aa=this;aa.enabled=false;aa.tile_cache.clear();aa.data_manager.clear();aa.initial_canvas=undefined;aa.content_div.css("height","auto");aa.container_div.removeClass("nodata error pending");if(!aa.dataset_id){return}$.getJSON(converted_datasets_state_url,{hda_ldda:aa.hda_ldda,dataset_id:aa.dataset_id,chrom:aa.view.chrom},function(ab){if(!ab||ab==="error"||ab.kind==="error"){aa.container_div.addClass("error");aa.content_div.text(m);if(ab.message){var ad=aa.view.tracks.indexOf(aa);var ac=$(" <a href='javascript:void(0);'></a>").text("View error").click(function(){show_modal("Trackster Error","<pre>"+ab.message+"</pre>",{Close:hide_modal})});aa.content_div.append(ac)}}else{if(ab==="no converter"){aa.container_div.addClass("error");aa.content_div.text(G)}else{if(ab==="no data"||(ab.data!==undefined&&(ab.data===null||ab.data.length===0))){aa.container_div.addClass("nodata");aa.content_div.text(B)}else{if(ab==="pending"){aa.container_div.addClass("pending");aa.content_div.text(q);setTimeout(function(){aa.init()},aa.data_query_wait)}else{if(ab.status==="data"){if(ab.valid_chroms){aa.valid_chroms=ab.valid_chroms;aa.make_name_popup_menu()}aa.content_div.text(U);if(aa.view.chrom){aa.content_div.text("");aa.content_div.css("height",aa.height_px+"px");aa.enabled=true;$.when(aa.predraw_init()).done(function(){aa.container_div.removeClass("nodata error pending");aa.draw()})}}}}}}})},predraw_init:function(){},update_name:function(aa){this.old_name=this.name;this.name=aa;this.name_div.text(this.name)},revert_name:function(){this.name=this.old_name;this.name_div.text(this.name)}});var J=function(ah,af,ai){var ab=this,aj=ab.view;this.filters_manager=(ah!==undefined?new W(this,ah):undefined);this.filters_available=false;this.filters_visible=false;this.tool=(af!==undefined&&obj_length(af)>0?new o(this,af):undefined);this.is_overview=false;this.parent_track=ai;this.child_tracks=[];if(ab.hidden){return}if(this.parent_track){this.header_div.find(".draghandle").removeClass("draghandle").addClass("child-track-icon").addClass("icon-button");this.parent_element.addClass("child-track");this.tool=undefined}ab.child_tracks_container=$("<div/>").addClass("child-tracks-container").hide();ab.container_div.append(ab.child_tracks_container);if(this.filters_manager){this.filters_div=this.filters_manager.parent_div;this.header_div.after(this.filters_div)}if(this.tool){this.dynamic_tool_div=this.tool.parent_div;this.header_div.after(this.dynamic_tool_div)}if(ab.display_modes!==undefined){if(ab.mode_div===undefined){ab.mode_div=$("<div class='right-float menubutton popup' />").appendTo(ab.header_div);var ac=(ab.track_config&&ab.track_config.values.mode?ab.track_config.values.mode:ab.display_modes[0]);ab.mode=ac;ab.mode_div.text(ac);var aa={};for(var ad=0,ag=ab.display_modes.length;ad<ag;ad++){var ae=ab.display_modes[ad];aa[ae]=function(ak){return function(){ab.change_mode(ak)}}(ae)}make_popupmenu(ab.mode_div,aa)}else{ab.mode_div.hide()}}this.make_name_popup_menu()};n(J.prototype,j.prototype,{change_mode:function(ab){var aa=this;aa.mode_div.text(ab);aa.mode=ab;aa.track_config.values.mode=ab;aa.tile_cache.clear();aa.draw()},make_name_popup_menu:function(){var ab=this;var aa={};aa[(this.is_overview?"Hide overview":"Set as overview")]=function(){if(ab.is_overview){ab.view.reset_overview()}else{ab.view.set_overview(ab)}};aa["Edit configuration"]=function(){var ah=function(){hide_modal();$(window).unbind("keypress.check_enter_esc")},af=function(){ab.track_config.update_from_form($(".dialog-box"));hide_modal();$(window).unbind("keypress.check_enter_esc")},ag=function(ai){if((ai.keyCode||ai.which)===27){ah()}else{if((ai.keyCode||ai.which)===13){af()}}};$(window).bind("keypress.check_enter_esc",ag);show_modal("Configure Track",ab.track_config.build_form(),{Cancel:ah,OK:af})};if(ab.filters_available>0){var ae=(ab.filters_div.is(":visible")?"Hide filters":"Show filters");aa[ae]=function(){ab.filters_visible=(ab.filters_div.is(":visible"));if(ab.filters_visible){ab.filters_manager.reset_filters()}ab.filters_div.toggle();ab.make_name_popup_menu()}}if(ab.tool){var ae=(ab.dynamic_tool_div.is(":visible")?"Hide tool":"Show tool");aa[ae]=function(){if(!ab.dynamic_tool_div.is(":visible")){ab.update_name(ab.name+ab.tool_region_and_parameters_str())}else{menu_option_text="Show dynamic tool";ab.revert_name()}ab.dynamic_tool_div.toggle();ab.make_name_popup_menu()}}if(ab.valid_chroms){aa["List chrom/contigs with data"]=function(){show_modal("Chrom/contigs with data","<p>"+ab.valid_chroms.join("<br/>")+"</p>",{Close:function(){hide_modal()}})}}var ac=view;var ad=function(){$("#no-tracks").show()};if(this.parent_track){ac=this.parent_track;ad=function(){}}aa.Remove=function(){ac.remove_track(ab);if(ac.num_tracks===0){ad()}};make_popupmenu(ab.name_div,aa)},set_is_overview:function(aa){this.is_overview=aa;this.make_name_popup_menu()},get_overview_tile:function(){var aa=this;view=aa.view,resolution=Math.pow(z,Math.ceil(Math.log((view.max_high-view.max_low)/M)/Math.log(z))),view_width=view.container.width(),w_scale=view_width/(view.max_high-view.max_low),overview_tile=$.Deferred();$.when(aa.data_manager.get_data(view.max_low,view.max_high,"Auto",resolution,aa.data_url_extra_params)).then(function(ab){var ad=aa._gen_tile_cache_key(view_width,w_scale,0),af=aa.tile_cache.get(ad);if(af){var ai=$(af.canvas.find("canvas")),ae=ai.clone(),ah=ai.get(0).getContext("2d"),ac=ae.get(0).getContext("2d"),ag=ah.getImageData(0,0,ah.canvas.width,ah.canvas.height);ac.putImageData(ag,-aa.left_offset,(af.data.dataset_type==="summary_tree"?O:0));af=new b(-1,resolution,ae)}else{af=aa.draw_tile(ab,resolution,null,w_scale,null,true);aa.tile_cache.set(ad,af)}overview_tile.resolve(af)});return overview_tile},_gen_tile_cache_key:function(ab,ac,aa){return ab+"_"+ac+"_"+aa},draw:function(aa,ac){if(!this.dataset_id){return}var at=this.view.low,ag=this.view.high,ai=ag-at,ak=this.view.container.width(),ae=ak/ai,al=this.view.resolution,ad=$("<div style='position: relative;'></div>");if(!ac){this.content_div.children().remove()}this.content_div.append(ad);this.max_height=0;var an=Math.floor(at/al/M);var af=[];var ao=0;while((an*M*al)<ag){var ar=this._gen_tile_cache_key(ak,ae,an);var ah=this.tile_cache.get(ar);var ap=an*M*this.view.resolution;var ab=ap+M*this.view.resolution;if(!aa&&ah){af.push(ah);this.show_tile(ah,ad,ae)}else{this.delayed_draw(aa,ar,an,al,ad,ae,af)}an+=1;ao++}var aj=this;var aq=setInterval(function(){if(af.length===ao){clearInterval(aq);aj.postdraw_actions(af,ac)}},50);for(var am=0;am<this.child_tracks.length;am++){this.child_tracks[am].draw(aa,ac)}},postdraw_actions:function(ae,aa){var ac=this;var ad=false;for(var ab=0;ab<ae.length;ab++){if(ae[ab].message){ad=true;break}}if(ad){for(var ab=0;ab<ae.length;ab++){tile=ae[ab];if(!tile.message){tile.canvas.css("padding-top",A)}}}},delayed_draw:function(ab,ai,ac,ae,aj,am,ak,af){var ad=this,ag=ac*M*ae,al=ag+M*ae;var ah=function(av,an,ap,ao,at,au,aq){var ar=ad.draw_tile(an,ap,ao,au,aq);ad.tile_cache.set(ai,ar);if(ar===undefined){return}ad.show_tile(ar,at,au);ak.push(ar)};var aa=setTimeout(function(){if(ag<=ad.view.high&&al>=ad.view.low){var an=(ab?undefined:ad.tile_cache.get(ai));if(an){ad.show_tile(an,aj,am);ak.push(an)}else{$.when(ad.data_manager.get_data(ag,al,ad.mode,ae,ad.data_url_extra_params)).then(function(ao){n(ao,af);if(view.reference_track&&am>view.canvas_manager.char_width_px){$.when(view.reference_track.data_manager.get_data(ag,al,ad.mode,ae,view.reference_track.data_url_extra_params)).then(function(ap){ah(aa,ao,ae,ac,aj,am,ap)})}else{ah(aa,ao,ae,ac,aj,am)}})}}},50)},show_tile:function(ah,aj,ak){var ac=this,ab=ah.canvas,ag=ab;if(ah.message){var al=$("<div/>"),ai=$("<div/>").addClass("tile-message").text(ah.message).css({height:A-1,width:ah.canvas.width}).appendTo(al),ae=$("<a href='javascript:void(0);'/>").addClass("icon more-down").appendTo(ai),aa=$("<a href='javascript:void(0);'/>").addClass("icon more-across").appendTo(ai);al.append(ab);ag=al;ae.click(function(){ah.stale=true;ac.data_manager.get_more_data(ah.low,ah.high,ac.mode,ah.resolution,{},ac.data_manager.DEEP_DATA_REQ);ac.draw()}).dblclick(function(am){am.stopPropagation()});aa.click(function(){ah.stale=true;ac.data_manager.get_more_data(ah.low,ah.high,ac.mode,ah.resolution,{},ac.data_manager.BROAD_DATA_REQ);ac.draw()}).dblclick(function(am){am.stopPropagation()})}var af=this.view.high-this.view.low,ad=(ah.low-this.view.low)*ak;if(this.left_offset){ad-=this.left_offset}ag.css({position:"absolute",top:0,left:ad,height:""});aj.append(ag);ac.max_height=Math.max(ac.max_height,ag.height());ac.content_div.css("height",ac.max_height+"px");aj.children().css("height",ac.max_height+"px")},tool_region_and_parameters_str:function(ac,aa,ad){var ab=this,ae=(ac!==undefined&&aa!==undefined&&ad!==undefined?ac+":"+aa+"-"+ad:"all");return" - region=["+ae+"], parameters=["+ab.tool.get_param_values().join(", ")+"]"},add_track:function(aa){aa.track_id=this.track_id+"_"+this.child_tracks.length;aa.container_div.attr("id","track_"+aa.track_id);this.child_tracks_container.append(aa.container_div);C(aa.container_div,".child-track-icon");if(!$(this.child_tracks_container).is(":visible")){this.child_tracks_container.show()}this.child_tracks.push(aa);this.view.has_changes=true},remove_track:function(aa){aa.container_div.fadeOut("slow",function(){$(this).remove()})}});var X=function(aa,ab){this.hidden=true;j.call(this,null,aa,ab);this.container_div.addClass("label-track")};n(X.prototype,j.prototype,{draw:function(){var ac=this.view,ad=ac.high-ac.low,ag=Math.floor(Math.pow(10,Math.floor(Math.log(ad)/Math.log(10)))),aa=Math.floor(ac.low/ag)*ag,ae=this.view.container.width(),ab=$("<div style='position: relative; height: 1.3em;'></div>");while(aa<ac.high){var af=(aa-ac.low)/ad*ae;ab.append($("<div class='label'>"+commatize(aa)+"</div>").css({position:"absolute",left:af-1}));aa+=ag}this.content_div.children(":first").remove();this.content_div.append(ab)}});var x=function(aa){this.hidden=true;j.call(this,null,aa,aa.top_labeltrack);J.call(this);aa.reference_track=this;this.left_offset=200;this.height_px=12;this.container_div.addClass("reference-track");this.content_div.css("background","none");this.content_div.css("min-height","0px");this.content_div.css("border","none");this.data_url=reference_url;this.data_url_extra_params={dbkey:aa.dbkey};this.data_manager=new E(y,this,false);this.tile_cache=new c(r)};n(x.prototype,J.prototype,{draw_tile:function(ai,af,ab,ak){var ae=this,ac=M*af;if(ak>this.view.canvas_manager.char_width_px){if(ai===null){ae.content_div.css("height","0px");return}var ad=this.view.canvas_manager.new_canvas();var aj=ad.getContext("2d");ad.width=Math.ceil(ac*ak+ae.left_offset);ad.height=ae.height_px;aj.font=aj.canvas.manager.default_font;aj.textAlign="center";for(var ag=0,ah=ai.length;ag<ah;ag++){var aa=Math.round(ag*ak);aj.fillText(ai[ag],aa+ae.left_offset,10)}return new b(ab,af,ad,ai)}this.content_div.css("height","0px")}});var k=function(ae,ac,af,aa,ad){var ab=this;this.display_modes=["Histogram","Line","Filled","Intensity"];this.mode="Histogram";j.call(this,ae,ac,ac.viewport_container);J.call(this);this.min_height_px=16;this.max_height_px=400;this.height_px=80;this.hda_ldda=af;this.dataset_id=aa;this.original_dataset_id=aa;this.data_manager=new N(y,this);this.tile_cache=new c(r);this.track_config=new V({track:this,params:[{key:"color",label:"Color",type:"color",default_value:"black"},{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:this.height_px,hidden:true}],saved_values:ad,onchange:function(){ab.vertical_range=ab.prefs.max_value-ab.prefs.min_value;$("#linetrack_"+ab.track_id+"_minval").text(ab.prefs.min_value);$("#linetrack_"+ab.track_id+"_maxval").text(ab.prefs.max_value);ab.tile_cache.clear();ab.draw()}});this.prefs=this.track_config.values;this.height_px=this.track_config.values.height;this.vertical_range=this.track_config.values.max_value-this.track_config.values.min_value;this.add_resize_handle()};n(k.prototype,J.prototype,{add_resize_handle:function(){var aa=this;var ad=false;var ac=false;var ab=$("<div class='track-resize'>");$(aa.container_div).hover(function(){ad=true;ab.show()},function(){ad=false;if(!ac){ab.hide()}});ab.hide().bind("dragstart",function(ae,af){ac=true;af.original_height=$(aa.content_div).height()}).bind("drag",function(af,ag){var ae=Math.min(Math.max(ag.original_height+ag.deltaY,aa.min_height_px),aa.max_height_px);$(aa.content_div).css("height",ae);aa.height_px=ae;aa.draw(true)}).bind("dragend",function(ae,af){aa.tile_cache.clear();ac=false;if(!ad){ab.hide()}aa.track_config.values.height=aa.height_px}).appendTo(aa.container_div)},predraw_init:function(){var aa=this,ab=aa.view.tracks.indexOf(aa);aa.vertical_range=undefined;return $.getJSON(aa.data_url,{stats:true,chrom:aa.view.chrom,low:null,high:null,hda_ldda:aa.hda_ldda,dataset_id:aa.dataset_id},function(ac){aa.container_div.addClass("line-track");var ae=ac.data;if(isNaN(parseFloat(aa.prefs.min_value))||isNaN(parseFloat(aa.prefs.max_value))){aa.prefs.min_value=ae.min;aa.prefs.max_value=ae.max;$("#track_"+ab+"_minval").val(aa.prefs.min_value);$("#track_"+ab+"_maxval").val(aa.prefs.max_value)}aa.vertical_range=aa.prefs.max_value-aa.prefs.min_value;aa.total_frequency=ae.total_frequency;aa.container_div.find(".yaxislabel").remove();var af=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+ab+"_minval").text(u(aa.prefs.min_value));var ad=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+ab+"_maxval").text(u(aa.prefs.max_value));ad.css({position:"absolute",top:"24px",left:"10px"});ad.prependTo(aa.container_div);af.css({position:"absolute",bottom:"2px",left:"10px"});af.prependTo(aa.container_div)})},draw_tile:function(ak,ae,ab,aj){if(this.vertical_range===undefined){return}var af=ab*M*ae,ad=M*ae,aa=Math.ceil(ad*aj),ah=this.height_px;var ac=this.view.canvas_manager.new_canvas();ac.width=aa,ac.height=ah;var ai=ac.getContext("2d");var ag=new I.LinePainter(ak.data,af,af+ad,this.prefs,this.mode);ag.draw(ai,aa,ah);return new b(ab,ae,ac,ak.data)}});var e=function(aa,af,ae,ai,ah,ac,ad,ag){var ab=this;this.display_modes=["Auto","Histogram","Dense","Squish","Pack"];this.track_config=new V({track:this,params:[{key:"block_color",label:"Block color",type:"color",default_value:"#444"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:true},],saved_values:ah,onchange:function(){ab.tile_cache.clear();ab.draw()}});this.prefs=this.track_config.values;j.call(this,aa,af,af.viewport_container);J.call(this,ac,ad,ag);this.height_px=0;this.container_div.addClass("feature-track");this.hda_ldda=ae;this.dataset_id=ai;this.original_dataset_id=ai;this.show_labels_scale=0.001;this.showing_details=false;this.summary_draw_height=30;this.inc_slots={};this.start_end_dct={};this.tile_cache=new c(d);this.data_manager=new N(20,this);this.left_offset=200;this.painter=I.LinkedFeaturePainter};n(e.prototype,J.prototype,{postdraw_actions:function(ao,an){J.prototype.postdraw_actions.call(this,ao,an);var ac=this;if(an){var ae=ac.content_div.children();var af=false;for(var ad=ae.length-1,aj=0;ad>=aj;ad--){var ab=$(ae[ad]);if(af){ab.remove()}else{if(ab.children().length!==0){af=true}}}}if(ac.mode=="Histogram"){var ai=-1;for(var ad=0;ad<ao.length;ad++){var am=ao[ad].max_val;if(am>ai){ai=am}}for(var ad=0;ad<ao.length;ad++){if(ao[ad].max_val!==ai){var al=ao[ad];al.canvas.remove();ac.delayed_draw(true,ac._gen_tile_cache_key(width,w_scale,al.index),al.index,al.resolution,parent_element,w_scale,[],{max:ai})}}}if(ac.filters_manager){var aa=ac.filters_manager.filters;for(var ah=0;ah<aa.length;ah++){aa[ah].update_ui_elt()}var ag=false,ak;for(var ad=0;ad<ao.length;ad++){if(ao[ad].data.length){ak=ao[ad].data[0];for(var ah=0;ah<aa.length;ah++){if(aa[ah].applies_to(ak)){ag=true;break}}}}if(ac.filters_available!==ag){ac.filters_available=ag;if(!ac.filters_available){ac.filters_div.hide()}ac.make_name_popup_menu()}}},update_auto_mode:function(aa){if(this.mode=="Auto"){if(aa=="no_detail"){aa="feature spans"}else{if(aa=="summary_tree"){aa="coverage histogram"}}this.mode_div.text("Auto ("+aa+")")}},incremental_slots:function(ae,ab,ad){var ac=this.view.canvas_manager.dummy_context,aa=this.inc_slots[ae];if(!aa||(aa.mode!==ad)){aa=new (p.FeatureSlotter)(ae,ad==="Pack",w,function(af){return ac.measureText(af)});aa.mode=ad;this.inc_slots[ae]=aa}return aa.slot_features(ab)},get_summary_tree_data:function(ae,ah,ac,ap){if(ap>ac-ah){ap=ac-ah}var al=Math.floor((ac-ah)/ap),ao=[],ad=0;var af=0,ag=0,ak,an=0,ai=[],am,aj;var ab=function(at,ar,au,aq){at[0]=ar+au*aq;at[1]=ar+(au+1)*aq};while(an<ap&&af!==ae.length){var aa=false;for(;an<ap&&!aa;an++){ab(ai,ah,an,al);for(ag=af;ag<ae.length;ag++){ak=ae[ag].slice(1,3);if(is_overlap(ak,ai)){aa=true;break}}if(aa){break}}data_start_index=ag;ao[ao.length]=am=[ai[0],0];for(;ag<ae.length;ag++){ak=ae[ag].slice(1,3);if(is_overlap(ak,ai)){am[1]++}else{break}}if(am[1]>ad){ad=am[1]}an++}return{max:ad,delta:al,data:ao}},draw_tile:function(an,aw,aA,aj,ad,ar){var at=this,aC=aA*M*aw,ab=(aA+1)*M*aw,ap=ab-aC,au=Math.ceil(ap*aj),aq=this.mode,aG=25,ae=this.left_offset,ao,af;if(aq==="Auto"){if(an.dataset_type==="summary_tree"){aq=an.dataset_type}else{if(an.extra_info==="no_detail"){aq="no_detail"}else{var aF=an.data;if(this.view.high-this.view.low>F){aq="Squish"}else{aq="Pack"}}}this.update_auto_mode(aq)}if(aq==="summary_tree"||aq==="Histogram"){af=this.summary_draw_height;this.container_div.find(".yaxislabel").remove();var aa=$("<div />").addClass("yaxislabel");aa.text(an.max);aa.css({position:"absolute",top:"24px",left:"10px",color:this.prefs.label_color});aa.prependTo(this.container_div);var ac=this.view.canvas_manager.new_canvas();ac.width=au+ae;ac.height=af+(!ar?O:0);if(an.dataset_type!="summary_tree"){var ak=this.get_summary_tree_data(an.data,aC,ab,200);if(an.max){ak.max=an.max}an=ak}var aD=new I.SummaryTreePainter(an,aC,ab,this.prefs);var av=ac.getContext("2d");if(!ar){av.translate(ae,O)}aD.draw(av,au,af);return new l(aA,aw,ac,an.data,an.max)}var ao,ah=1;if(aq==="no_detail"||aq==="Squish"||aq==="Pack"){ah=this.incremental_slots(aj,an.data,aq);ao=this.inc_slots[aj].slots}var ai=[];if(an.data){var al=this.filters_manager.filters;for(var ax=0,az=an.data.length;ax<az;ax++){var ag=an.data[ax];var ay=false;var am;for(var aB=0,aE=al.length;aB<aE;aB++){am=al[aB];am.update_attrs(ag);if(!am.keep(ag)){ay=true;break}}if(!ay){ai.push(ag)}}}var aD=new (this.painter)(ai,aC,ab,this.prefs,aq,ad);var af=aD.get_required_height(ah);var ac=this.view.canvas_manager.new_canvas();ac.width=au+ae;ac.height=af;var av=ac.getContext("2d");av.fillStyle=this.prefs.block_color;av.font=av.canvas.manager.default_font;av.textAlign="right";this.container_div.find(".yaxislabel").remove();if(an.data){if(!ar){av.translate(ae,0)}aD.draw(av,au,af,ao)}return new L(aA,aw,ac,an.data,an.message)}});var P=function(ad,ab,af,aa,ac,ae){e.call(this,ad,ab,af,aa,ac,ae);this.painter=I.VariantPainter};n(P.prototype,J.prototype,e.prototype);var S=function(ad,ab,af,aa,ac,ae){e.call(this,ad,ab,af,aa,ac,ae);this.track_config=new V({track:this,params:[{key:"block_color",label:"Block color",type:"color",default_value:"#444"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:false},{key:"show_differences",label:"Show differences only",type:"bool",default_value:true},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:true},],saved_values:ac,onchange:function(){this.track.tile_cache.clear();this.track.draw()}});this.prefs=this.track_config.values;this.painter=I.ReadPainter;this.make_name_popup_menu()};n(S.prototype,J.prototype,e.prototype);var Q=function(ae,ac,ag,aa,ad,af,ab){e.call(this,ae,ac,ag,aa,ad,af,{},ab);this.data_url=raw_data_url;this.data_query_wait=1000;this.dataset_check_url=dataset_state_url};n(Q.prototype,J.prototype,e.prototype,{predraw_init:function(){var ab=this;var aa=function(){if(ab.data_manager.size()===0){setTimeout(aa,300)}else{ab.data_url=default_data_url;ab.data_query_wait=H;ab.dataset_state_url=converted_datasets_state_url;$.getJSON(ab.dataset_state_url,{dataset_id:ab.dataset_id,hda_ldda:ab.hda_ldda},function(ac){})}};aa()}});T.View=Y;T.LineTrack=k;T.FeatureTrack=e;T.ReadTrack=S};var slotting_module=function(c,b){var e=c("class").extend;var d=2,a=5;b.FeatureSlotter=function(j,h,f,g){this.slots={};this.start_end_dct={};this.w_scale=j;this.include_label=h;this.max_rows=f;this.measureText=g};e(b.FeatureSlotter.prototype,{slot_features:function(m){var p=this.w_scale,s=this.slots,h=this.start_end_dct,y=[],A=[],n=0,z=this.max_rows;for(var w=0,x=m.length;w<x;w++){var l=m[w],o=l[0];if(s[o]!==undefined){n=Math.max(n,s[o]);A.push(s[o])}else{y.push(w)}}var q=function(G,H){for(var F=0;F<=z;F++){var D=false,I=h[F];if(I!==undefined){for(var C=0,E=I.length;C<E;C++){var B=I[C];if(H>B[0]&&G<B[1]){D=true;break}}}if(!D){return F}}return -1};for(var w=0,x=y.length;w<x;w++){var l=m[y[w]],o=l[0],u=l[1],f=l[2],r=l[3],g=Math.floor(u*p),k=Math.ceil(f*p),v=this.measureText(r).width,j;if(r!==undefined&&this.include_label){v+=(d+a);if(g-v>=0){g-=v;j="left"}else{k+=v;j="right"}}var t=q(g,k);if(t>=0){if(h[t]===undefined){h[t]=[]}h[t].push([g,k]);s[o]=t;n=Math.max(n,t)}else{}}return n+1}})};var painters_module=function(j,w){var t=j("class").extend;var o=function(H,z,F,y,E,C){if(C===undefined){C=4}var B=y-z;var A=E-F;var D=Math.floor(Math.sqrt(B*B+A*A)/C);var I=B/D;var G=A/D;var x;for(x=0;x<D;x++,z+=I,F+=G){if(x%2!==0){continue}H.fillRect(z,F,C,1)}};var p=function(A,z,x,D){var C=z-D/2,B=z+D/2,E=x-Math.sqrt(D*3/2);A.beginPath();A.moveTo(C,E);A.lineTo(B,E);A.lineTo(z,x);A.lineTo(C,E);A.strokeStyle=this.fillStyle;A.fill();A.stroke();A.closePath()};var m=function(z,B,x,y,A){this.data=z;this.view_start=B;this.view_end=x;this.prefs=t({},this.default_prefs,y);this.mode=A};m.prototype.default_prefs={};var u=function(z,B,x,y,A){m.call(this,z,B,x,y,A)};u.prototype.default_prefs={show_counts:false};u.prototype.draw=function(M,z,L){var E=this.view_start,O=this.view_end-this.view_start,N=z/O;var J=this.data.data,I=this.data.delta,G=this.data.max,B=L;delta_x_px=Math.ceil(I*N);M.save();for(var C=0,D=J.length;C<D;C++){var H=Math.floor((J[C][0]-E)*N);var F=J[C][1];if(!F){continue}var K=F/G*L;if(F!==0&&K<1){K=1}M.fillStyle=this.prefs.block_color;M.fillRect(H,B-K,delta_x_px,K);var A=4;if(this.prefs.show_counts&&(M.measureText(F).width+A)<delta_x_px){M.fillStyle=this.prefs.label_color;M.textAlign="center";M.fillText(F,H+(delta_x_px/2),10)}}M.restore()};var c=function(x,B,D,E,z){m.call(this,x,B,D,E,z);if(this.prefs.min_value===undefined){var F=Infinity;for(var y=0,A=this.data.length;y<A;y++){F=Math.min(F,this.data[y][1])}this.prefs.min_value=F}if(this.prefs.max_value===undefined){var C=-Infinity;for(var y=0,A=this.data.length;y<A;y++){C=Math.max(C,this.data[y][1])}this.prefs.max_value=C}};c.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Histogram",color:"#000",overflow_color:"#F66"};c.prototype.draw=function(M,L,J){var E=false,G=this.prefs.min_value,C=this.prefs.max_value,I=C-G,x=J,z=this.view_start,K=this.view_end-this.view_start,A=L/K,H=this.mode,S=this.data;M.save();var T=Math.round(J+G/I*J);if(H!=="Intensity"){M.fillStyle="#aaa";M.fillRect(0,T,L,1)}M.beginPath();var Q,D,B;if(S.length>1){B=Math.ceil((S[1][0]-S[0][0])*A)}else{B=10}for(var N=0,O=S.length;N<O;N++){M.fillStyle=this.prefs.color;Q=Math.round((S[N][0]-z)*A);D=S[N][1];var P=false,F=false;if(D===null){if(E&&H==="Filled"){M.lineTo(Q,x)}E=false;continue}if(D<G){F=true;D=G}else{if(D>C){P=true;D=C}}if(H==="Histogram"){D=Math.round(D/I*x);M.fillRect(Q,T,B,-D)}else{if(H==="Intensity"){D=255-Math.floor((D-G)/I*255);M.fillStyle="rgb("+D+","+D+","+D+")";M.fillRect(Q,0,B,x)}else{D=Math.round(x-(D-G)/I*x);if(E){M.lineTo(Q,D)}else{E=true;if(H==="Filled"){M.moveTo(Q,x);M.lineTo(Q,D)}else{M.moveTo(Q,D)}}}}M.fillStyle=this.prefs.overflow_color;if(P||F){var R;if(H==="Histogram"||H==="Intensity"){R=B}else{Q-=2;R=4}if(P){M.fillRect(Q,0,R,3)}if(F){M.fillRect(Q,x-3,R,3)}}M.fillStyle=this.prefs.color}if(H==="Filled"){if(E){M.lineTo(Q,T);M.lineTo(0,T)}M.fill()}else{M.stroke()}M.restore()};var n=function(z,B,x,y,A){m.call(this,z,B,x,y,A)};n.prototype.default_prefs={block_color:"#FFF",connector_color:"#FFF"};t(n.prototype,{get_required_height:function(y){var x=y_scale=this.get_row_height(),z=this.mode;if(z==="no_detail"||z==="Squish"||z==="Pack"){x=y*y_scale}return x+Math.max(Math.round(y_scale/2),5)},draw:function(J,A,I,F){var D=this.data,G=this.view_start,K=this.view_end;J.save();J.fillStyle=this.prefs.block_color;J.textAlign="right";var N=this.view_end-this.view_start,M=A/N,z=this.get_row_height();for(var C=0,E=D.length;C<E;C++){var L=D[C],B=L[0],x=L[1],y=L[2],H=(F&&F[B]!==undefined?F[B]:null);if((x<K&&y>G)&&(this.mode=="Dense"||H!==null)){this.draw_element(J,this.mode,L,H,G,K,M,z,A)}}J.restore()},draw_element:function(D,z,F,B,A,C,E,y,x){}});var d=10,h=3,l=5,v=10,f=1,r=3,e=3,a=9,k=2,g="#ccc";var q=function(z,B,x,y,A){n.call(this,z,B,x,y,A)};t(q.prototype,n.prototype,{get_row_height:function(){var y=this.mode,x;if(y==="Dense"){x=d}else{if(y==="no_detail"){x=h}else{if(y==="Squish"){x=l}else{x=v}}}return x},draw_element:function(J,C,R,E,L,ab,af,ag,x){var O=R[0],ad=R[1],V=R[2],M=R[3],W=Math.floor(Math.max(0,(ad-L)*af)),K=Math.ceil(Math.min(x,Math.max(0,(V-L)*af))),U=(C==="Dense"?0:(0+E))*ag,I,Z,N=null,ah=null,A=this.prefs.block_color,Y=this.prefs.label_color;if(C=="Dense"){E=1}if(C==="no_detail"){J.fillStyle=A;J.fillRect(W,U+5,K-W,f)}else{var H=R[4],T=R[5],X=R[6],B=R[7];if(T&&X){N=Math.floor(Math.max(0,(T-L)*af));ah=Math.ceil(Math.min(x,Math.max(0,(X-L)*af)))}var ae,P;if(C==="Squish"||C==="Dense"){ae=1;P=e}else{ae=5;P=a}if(!B){if(R.strand){if(R.strand==="+"){J.fillStyle=J.canvas.manager.get_pattern("right_strand_inv")}else{if(R.strand==="-"){J.fillStyle=J.canvas.manager.get_pattern("left_strand_inv")}}}else{J.fillStyle=A}J.fillRect(W,U,K-W,P)}else{var G,Q;if(C==="Squish"||C==="Dense"){J.fillStyle=g;G=U+Math.floor(e/2)+1;Q=1}else{if(H){var G=U;var Q=P;if(H==="+"){J.fillStyle=J.canvas.manager.get_pattern("right_strand")}else{if(H==="-"){J.fillStyle=J.canvas.manager.get_pattern("left_strand")}}}else{J.fillStyle=g;G+=(e/2)+1;Q=1}}J.fillRect(W,G,K-W,Q);for(var ac=0,z=B.length;ac<z;ac++){var D=B[ac],y=Math.floor(Math.max(0,(D[0]-L)*af)),S=Math.ceil(Math.min(x,Math.max((D[1]-L)*af)));if(y>S){continue}J.fillStyle=A;J.fillRect(y,U+(P-ae)/2+1,S-y,ae);if(N!==undefined&&X>T&&!(y>ah||S<N)){var aa=Math.max(y,N),F=Math.min(S,ah);J.fillRect(aa,U+1,F-aa,P);if(B.length==1&&C=="Pack"){if(H==="+"){J.fillStyle=J.canvas.manager.get_pattern("right_strand_inv")}else{if(H==="-"){J.fillStyle=J.canvas.manager.get_pattern("left_strand_inv")}}if(aa+14<F){aa+=2;F-=2}J.fillRect(aa,U+1,F-aa,P)}}}}if(C==="Pack"&&ad>L){J.fillStyle=Y;if(L===0&&W-J.measureText(M).width<0){J.textAlign="left";J.fillText(M,K+k,U+8)}else{J.textAlign="right";J.fillText(M,W-k,U+8)}J.fillStyle=A}}}});var b=function(z,B,x,y,A){n.call(this,z,B,x,y,A)};t(b.prototype,n.prototype,{draw_element:function(Q,L,F,B,T,z,I,R,O){var F=data[i],H=F[0],P=F[1],A=F[2],K=F[3],D=Math.floor(Math.max(0,(P-T)*I)),G=Math.ceil(Math.min(O,Math.max(0,(A-T)*I))),C=(L==="Dense"?0:(0+B))*R,x,U,y=null,J=null;if(no_label){Q.fillStyle=block_color;Q.fillRect(D+left_offset,C+5,G-D,1)}else{var S=F[4],N=F[5],E=F[6];x=9;U=1;Q.fillRect(D+left_offset,C,G-D,x);if(L!=="Dense"&&K!==undefined&&P>T){Q.fillStyle=label_color;if(T===0&&D-Q.measureText(K).width<0){Q.textAlign="left";Q.fillText(K,G+2+left_offset,C+8)}else{Q.textAlign="right";Q.fillText(K,D-2+left_offset,C+8)}Q.fillStyle=block_color}var M=S+" / "+N;if(P>T&&Q.measureText(M).width<(G-D)){Q.fillStyle="white";Q.textAlign="center";Q.fillText(M,left_offset+D+(G-D)/2,C+8);Q.fillStyle=block_color}}}});var s=function(A,C,x,z,B,y){n.call(this,A,C,x,z,B);this.ref_seq=y};s.prototype.default_prefs=t({},n.prototype.default_prefs,{show_insertions:false});t(s.prototype,n.prototype,{get_row_height:function(){var x,y=this.mode;if(y==="Dense"){x=d}else{if(y==="Squish"){x=l}else{x=v;if(this.prefs.show_insertions){x*=2}}}return x},draw_read:function(T,O,K,Y,z,S,H,E,D){T.textAlign="center";var R=this,y=[Y,z],N=0,U=0,Q=0;ref_seq=this.ref_seq,char_width_px=T.canvas.manager.char_width_px;var ad=[];if((O==="Pack"||this.mode==="Auto")&&E!==undefined&&K>char_width_px){Q=Math.round(K/2)}if(!H){H=[[0,E.length]]}for(var L=0,W=H.length;L<W;L++){var I=H[L],A="MIDNSHP=X"[I[0]],M=I[1];if(A==="H"||A==="S"){N-=M}var F=S+N,ac=Math.floor(Math.max(0,(F-Y)*K)),G=Math.floor(Math.max(0,(F+M-Y)*K));if(ac===G){G+=1}switch(A){case"H":break;case"S":case"M":case"=":if(is_overlap([F,F+M],y)){var P=E.slice(U,U+M);if(Q>0){T.fillStyle=this.prefs.block_color;T.fillRect(ac-Q,D+1,G-ac,9);T.fillStyle=g;for(var aa=0,x=P.length;aa<x;aa++){if(this.prefs.show_differences&&ref_seq){var J=ref_seq[F-Y+aa];if(!J||J.toLowerCase()===P[aa].toLowerCase()){continue}}if(F+aa>=Y&&F+aa<=z){var ab=Math.floor(Math.max(0,(F+aa-Y)*K));T.fillText(P[aa],ab,D+9)}}}else{T.fillStyle=this.prefs.block_color;T.fillRect(ac,D+4,G-ac,e)}}U+=M;N+=M;break;case"N":T.fillStyle=g;T.fillRect(ac-Q,D+5,G-ac,1);N+=M;break;case"D":T.fillStyle="red";T.fillRect(ac-Q,D+4,G-ac,3);N+=M;break;case"P":break;case"I":var X=ac-Q;if(is_overlap([F,F+M],y)){var P=E.slice(U,U+M);if(this.prefs.show_insertions){var C=ac-(G-ac)/2;if((O==="Pack"||this.mode==="Auto")&&E!==undefined&&K>char_width_px){T.fillStyle="yellow";T.fillRect(C-Q,D-9,G-ac,9);ad[ad.length]={type:"triangle",data:[X,D+4,5]};T.fillStyle=g;switch(seq_tile_overlap){case (OVERLAP_START):P=P.slice(Y-F);break;case (OVERLAP_END):P=P.slice(0,F-z);break;case (CONTAINED_BY):break;case (CONTAINS):P=P.slice(Y-F,F-z);break}for(var aa=0,x=P.length;aa<x;aa++){var ab=Math.floor(Math.max(0,(F+aa-Y)*K));T.fillText(P[aa],ab-(G-ac)/2,D)}}else{T.fillStyle="yellow";T.fillRect(C,D+(this.mode!=="Dense"?2:5),G-ac,(O!=="Dense"?e:r))}}else{if((O==="Pack"||this.mode==="Auto")&&E!==undefined&&K>char_width_px){ad[ad.length]={type:"text",data:[P.length,X,D+9]}}else{}}}U+=M;break;case"X":U+=M;break}}T.fillStyle="yellow";var Z,B,ae;for(var V=0;V<ad.length;V++){Z=ad[V];B=Z.type;ae=Z.data;if(B==="text"){T.save();T.font="bold "+T.font;T.fillText(ae[0],ae[1],ae[2]);T.restore()}else{if(B=="triangle"){p(T,ae[0],ae[1],ae[2])}}}},draw_element:function(Q,L,D,A,T,y,H,R,O){var G=D[0],P=D[1],z=D[2],I=D[3],C=Math.floor(Math.max(0,(P-T)*H)),E=Math.ceil(Math.min(O,Math.max(0,(z-T)*H))),B=(L==="Dense"?0:(0+A))*R,U=this.prefs.block_color,F=this.prefs.label_color,N=0;if((L==="Pack"||this.mode==="Auto")&&H>Q.canvas.manager.char_width_px){var N=Math.round(H/2)}Q.fillStyle=U;if(D[5] instanceof Array){var M=Math.floor(Math.max(0,(D[4][0]-T)*H)),K=Math.ceil(Math.min(O,Math.max(0,(D[4][1]-T)*H))),J=Math.floor(Math.max(0,(D[5][0]-T)*H)),x=Math.ceil(Math.min(O,Math.max(0,(D[5][1]-T)*H)));if(D[4][1]>=T&&D[4][0]<=y&&D[4][2]){this.draw_read(Q,L,H,T,y,D[4][0],D[4][2],D[4][3],B)}if(D[5][1]>=T&&D[5][0]<=y&&D[5][2]){this.draw_read(Q,L,H,T,y,D[5][0],D[5][2],D[5][3],B)}if(J>K){Q.fillStyle=g;o(Q,K-N,B+5,J-N,B+5)}}else{Q.fillStyle=U;this.draw_read(Q,L,H,T,y,P,D[4],D[5],B)}if(L==="Pack"&&P>T){Q.fillStyle=this.prefs.label_color;var S=1;if(S===0&&C-Q.measureText(I).width<0){Q.textAlign="left";Q.fillText(I,E+k-N,B+8)}else{Q.textAlign="right";Q.fillText(I,C-k-N,B+8)}Q.fillStyle=U}}});w.SummaryTreePainter=u;w.LinePainter=c;w.LinkedFeaturePainter=q;w.ReadPainter=s;w.VariantPainter=b};(function(d){var c={};var b=function(e){return c[e]};var a=function(f,g){var e={};g(b,e);c[f]=e};a("class",class_module);a("slotting",slotting_module);a("painters",painters_module);a("trackster",trackster_module);for(key in c.trackster){d[key]=c.trackster[key]}})(window);
\ No newline at end of file
+var class_module=function(b,a){var c=function(){var f=arguments[0];for(var e=1;e<arguments.length;e++){var d=arguments[e];for(key in d){f[key]=d[key]}}return f};a.extend=c};var requestAnimationFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b,a){window.setTimeout(b,1000/60)}})();var BEFORE=1001,CONTAINS=1002,OVERLAP_START=1003,OVERLAP_END=1004,CONTAINED_BY=1005,AFTER=1006;var compute_overlap=function(e,b){var g=e[0],f=e[1],d=b[0],c=b[1],a;if(g<d){if(f<d){a=BEFORE}else{if(f<=c){a=OVERLAP_START}else{a=CONTAINS}}}else{if(g>c){a=AFTER}else{if(f<=c){a=CONTAINED_BY}else{a=OVERLAP_END}}}return a};var is_overlap=function(c,b){var a=compute_overlap(c,b);return(a!==BEFORE&&a!==AFTER)};var trackster_module=function(f,U){var n=f("class").extend,p=f("slotting"),I=f("painters");var ab=function(ac,ad){this.document=ac;this.default_font=ad!==undefined?ad:"9px Monaco, Lucida Console, monospace";this.dummy_canvas=this.new_canvas();this.dummy_context=this.dummy_canvas.getContext("2d");this.dummy_context.font=this.default_font;this.char_width_px=this.dummy_context.measureText("A").width;this.patterns={};this.load_pattern("right_strand","/visualization/strand_right.png");this.load_pattern("left_strand","/visualization/strand_left.png");this.load_pattern("right_strand_inv","/visualization/strand_right_inv.png");this.load_pattern("left_strand_inv","/visualization/strand_left_inv.png")};n(ab.prototype,{load_pattern:function(ac,ag){var ad=this.patterns,ae=this.dummy_context,af=new Image();af.src=image_path+ag;af.onload=function(){ad[ac]=ae.createPattern(af,"repeat")}},get_pattern:function(ac){return this.patterns[ac]},new_canvas:function(){var ac=this.document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(ac)}ac.manager=this;return ac}});var C=function(ac,ad){ac.bind("drag",{handle:ad,relative:true},function(ah,ai){var ag=$(this).parent();var af=ag.children();var ae;for(ae=0;ae<af.length;ae++){if(ai.offsetY<$(af.get(ae)).position().top){break}}if(ae===af.length){if(this!==af.get(ae-1)){ag.append(this)}}else{if(this!==af.get(ae)){$(this).insertBefore(af.get(ae))}}}).bind("dragstart",function(){$(this).css({"border-top":"1px solid blue","border-bottom":"1px solid blue"})}).bind("dragend",function(){$(this).css("border","0px")})};U.sortable=C;var aa=16,D=9,A=20,P=D+2,w=100,F=12000,N=200,z=5,s=10,H=5000,t=100,m="There was an error in indexing this dataset. ",G="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",B="No data for this chrom/contig.",q="Currently indexing... please wait",v="Tool cannot be rerun: ",a="Loading data...",V="Ready for display",d=10,r=5,y=5;function u(ac){return Math.round(ac*1000)/1000}var c=function(ac){this.num_elements=ac;this.clear()};n(c.prototype,{get:function(ad){var ac=this.key_ary.indexOf(ad);if(ac!==-1){if(this.obj_cache[ad].stale){this.key_ary.splice(ac,1);delete this.obj_cache[ad]}else{this.move_key_to_end(ad,ac)}}return this.obj_cache[ad]},set:function(ad,ae){if(!this.obj_cache[ad]){if(this.key_ary.length>=this.num_elements){var ac=this.key_ary.shift();delete this.obj_cache[ac]}this.key_ary.push(ad)}this.obj_cache[ad]=ae;return ae},move_key_to_end:function(ad,ac){this.key_ary.splice(ac,1);this.key_ary.push(ad)},clear:function(){this.obj_cache={};this.key_ary=[]},size:function(){return this.key_ary.length}});var O=function(ad,ac,ae){c.call(this,ad);this.track=ac;this.subset=(ae!==undefined?ae:true)};n(O.prototype,c.prototype,{load_data:function(al,ag,aj,ad,ai){var ak=this.track.view.chrom,af={chrom:ak,low:al,high:ag,mode:aj,resolution:ad,dataset_id:this.track.dataset_id,hda_ldda:this.track.hda_ldda};$.extend(af,ai);if(this.track.filters_manager){var am=[];var ac=this.track.filters_manager.filters;for(var ah=0;ah<ac.length;ah++){am[am.length]=ac[ah].name}af.filter_cols=JSON.stringify(am)}var ae=this;return $.getJSON(this.track.data_url,af,function(an){ae.set_data(al,ag,aj,an)})},get_data:function(ac,ag,ah,ad,af){var ae=this.get_data_from_cache(ac,ag,ah);if(ae){return ae}ae=this.load_data(ac,ag,ah,ad,af);this.set_data(ac,ag,ah,ae);return ae},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(ak,af,aj,ae,ai,ag){var al=this.get_data_from_cache(ak,af,aj);if(!al){console.log("ERROR: no current data for: ",this.track,ak,af,aj,ae,ai);return}al.stale=true;var ad=ak;if(ag===this.DEEP_DATA_REQ){$.extend(ai,{start_val:al.data.length+1})}else{if(ag===this.BROAD_DATA_REQ){ad=al.data[al.data.length-1][2]+1}}var ac=this,ah=this.load_data(ad,af,aj,ae,ai);new_data_available=$.Deferred();this.set_data(ak,af,aj,new_data_available);$.when(ah).then(function(am){if(am.data){am.data=al.data.concat(am.data);if(am.message){am.message=am.message.replace(/[0-9]+/,am.data.length)}}ac.set_data(ak,af,aj,am);new_data_available.resolve(am)});return new_data_available},get_data_from_cache:function(ac,ad,ae){return this.get(this.gen_key(ac,ad,ae))},set_data:function(ad,ae,af,ac){return this.set(this.gen_key(ad,ae,af),ac)},gen_key:function(ac,ae,af){var ad=ac+"_"+ae+"_"+af;return ad},split_key:function(ac){return ac.split("_")}});var E=function(ad,ac,ae){O.call(this,ad,ac,ae)};n(E.prototype,O.prototype,c.prototype,{load_data:function(ae,ac,ag,ah,ad,af){if(ad>1){return}return O.prototype.load_data.call(this,ae,ac,ag,ah,ad,af)}});var Z=function(ac,af,ae,ad,ag){this.container=ac;this.chrom=null;this.vis_id=ae;this.dbkey=ad;this.title=af;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.num_tracks=0;this.track_id_counter=0;this.zoom_factor=3;this.min_separation=30;this.has_changes=false;this.init(ag);this.canvas_manager=new ab(ac.get(0).ownerDocument);this.reset()};n(Z.prototype,{init:function(ag){var ae=this.container,ac=this;this.top_container=$("<div/>").addClass("top-container").appendTo(ae);this.content_div=$("<div/>").addClass("content").css("position","relative").appendTo(ae);this.bottom_container=$("<div/>").addClass("bottom-container").appendTo(ae);this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(this.top_container);this.viewport_container=$("<div/>").addClass("viewport-container").addClass("viewport-container").appendTo(this.content_div);this.intro_div=$("<div/>").addClass("intro").appendTo(this.viewport_container).hide();var af=$("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function(){add_tracks()});this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);this.nav_container=$("<div/>").addClass("nav-container").prependTo(this.top_container);this.nav=$("<div/>").addClass("nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.bottom_container);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_close=$("<a href='javascript:void(0);'>Close Overview</a>").addClass("overview-close").hide().appendTo(this.overview_viewport);this.overview_highlight=$("<div/>").addClass("overview-highlight").hide().appendTo(this.overview_viewport);this.overview_box_background=$("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_select=$("<select/>").attr({name:"chrom"}).css("width","15em").addClass("no-autocomplete").append("<option value=''>Loading</option>").appendTo(this.nav_controls);var ad=function(ah){if(ah.type==="focusout"||(ah.keyCode||ah.which)===13||(ah.keyCode||ah.which)===27){if((ah.keyCode||ah.which)!==27){ac.go_to($(this).val())}$(this).hide();$(this).val("");ac.location_span.show();ac.chrom_select.show()}};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keyup focusout",ad).appendTo(this.nav_controls);this.location_span=$("<span/>").addClass("location").appendTo(this.nav_controls);this.location_span.click(function(){ac.location_span.hide();ac.chrom_select.hide();ac.nav_input.val(ac.chrom+":"+ac.low+"-"+ac.high);ac.nav_input.css("display","inline-block");ac.nav_input.select();ac.nav_input.focus()});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.nav_controls)}this.zo_link=$("<a id='zoom-out' />").click(function(){ac.zoom_out();ac.request_redraw()}).appendTo(this.nav_controls);this.zi_link=$("<a id='zoom-in' />").click(function(){ac.zoom_in();ac.request_redraw()}).appendTo(this.nav_controls);this.load_chroms({low:0},ag);this.chrom_select.bind("change",function(){ac.change_chrom(ac.chrom_select.val())});this.content_div.click(function(ah){$(this).find("input").trigger("blur")});this.content_div.bind("dblclick",function(ah){ac.zoom_in(ah.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(ah,ai){this.current_x=ai.offsetX}).bind("drag",function(ah,aj){var ak=aj.offsetX-this.current_x;this.current_x=aj.offsetX;var ai=Math.round(ak/ac.viewport_container.width()*(ac.max_high-ac.max_low));ac.move_delta(-ai)});this.overview_close.click(function(){ac.reset_overview()});this.viewport_container.bind("draginit",function(ah,ai){if(ah.clientX>ac.viewport_container.width()-16){return false}}).bind("dragstart",function(ah,ai){ai.original_low=ac.low;ai.current_height=ah.clientY;ai.current_x=ai.offsetX}).bind("drag",function(aj,al){var ah=$(this);var am=al.offsetX-al.current_x;var ai=ah.scrollTop()-(aj.clientY-al.current_height);ah.scrollTop(ai);al.current_height=aj.clientY;al.current_x=al.offsetX;var ak=Math.round(am/ac.viewport_container.width()*(ac.high-ac.low));ac.move_delta(ak)}).bind("mousewheel",function(aj,al,ai,ah){if(ai){var ak=Math.round(-ai/ac.viewport_container.width()*(ac.high-ac.low));ac.move_delta(ak)}});this.top_labeltrack.bind("dragstart",function(ah,ai){return $("<div />").css({height:ac.content_div.height()+ac.top_labeltrack.height()+ac.nav_labeltrack.height()+1,top:"0px",position:"absolute","background-color":"#ccf",opacity:0.5,"z-index":1000}).appendTo($(this))}).bind("drag",function(al,am){$(am.proxy).css({left:Math.min(al.pageX,am.startX),width:Math.abs(al.pageX-am.startX)});var ai=Math.min(al.pageX,am.startX)-ac.container.offset().left,ah=Math.max(al.pageX,am.startX)-ac.container.offset().left,ak=(ac.high-ac.low),aj=ac.viewport_container.width();ac.update_location(Math.round(ai/aj*ak)+ac.low,Math.round(ah/aj*ak)+ac.low)}).bind("dragend",function(am,an){var ai=Math.min(am.pageX,an.startX),ah=Math.max(am.pageX,an.startX),ak=(ac.high-ac.low),aj=ac.viewport_container.width(),al=ac.low;ac.low=Math.round(ai/aj*ak)+al;ac.high=Math.round(ah/aj*ak)+al;$(an.proxy).remove();ac.request_redraw()});this.add_label_track(new Y(this,this.top_labeltrack));this.add_label_track(new Y(this,this.nav_labeltrack));$(window).bind("resize",function(){ac.resize_window()});$(document).bind("redraw",function(){ac.redraw()});this.reset();$(window).trigger("resize");this.update_intro_div()},update_intro_div:function(){if(this.num_tracks===0){this.intro_div.show()}else{this.intro_div.hide()}},update_location:function(ac,ad){this.location_span.text(commatize(ac)+" - "+commatize(ad));this.nav_input.val(this.chrom+":"+commatize(ac)+"-"+commatize(ad))},load_chroms:function(ad,ae){ad.num=t;$.extend(ad,(this.vis_id!==undefined?{vis_id:this.vis_id}:{dbkey:this.dbkey}));var ac=this;$.ajax({url:chrom_url,data:ad,dataType:"json",success:function(ag){if(ag.chrom_info.length===0){alert("Invalid chromosome: "+ad.chrom);return}if(ag.reference){ac.add_label_track(new x(ac))}ac.chrom_data=ag.chrom_info;var aj='<option value="">Select Chrom/Contig</option>';for(var ai=0,af=ac.chrom_data.length;ai<af;ai++){var ah=ac.chrom_data[ai].chrom;aj+='<option value="'+ah+'">'+ah+"</option>"}if(ag.prev_chroms){aj+='<option value="previous">Previous '+t+"</option>"}if(ag.next_chroms){aj+='<option value="next">Next '+t+"</option>"}ac.chrom_select.html(aj);if(ae){ae()}ac.chrom_start_index=ag.start_index},error:function(){alert("Could not load chroms for this dbkey:",ac.dbkey)}})},change_chrom:function(ag,ad,ai){if(!ag||ag==="None"){return}var af=this;if(ag==="previous"){af.load_chroms({low:this.chrom_start_index-t});return}if(ag==="next"){af.load_chroms({low:this.chrom_start_index+t});return}var ah=$.grep(af.chrom_data,function(ak,al){return ak.chrom===ag})[0];if(ah===undefined){af.load_chroms({chrom:ag},function(){af.change_chrom(ag,ad,ai)});return}else{if(ag!==af.chrom){af.chrom=ag;af.chrom_select.val(af.chrom);af.max_high=ah.len-1;af.reset();af.request_redraw(true);for(var aj=0,ac=af.tracks.length;aj<ac;aj++){var ae=af.tracks[aj];if(ae.init){ae.init()}}}if(ad!==undefined&&ai!==undefined){af.low=Math.max(ad,0);af.high=Math.min(ai,af.max_high)}af.reset_overview();af.request_redraw()}},go_to:function(ag){var ak=this,ac,af,ad=ag.split(":"),ai=ad[0],aj=ad[1];if(aj!==undefined){try{var ah=aj.split("-");ac=parseInt(ah[0].replace(/,/g,""),10);af=parseInt(ah[1].replace(/,/g,""),10)}catch(ae){return false}}ak.change_chrom(ai,ac,af)},move_fraction:function(ae){var ac=this;var ad=ac.high-ac.low;this.move_delta(ae*ad)},move_delta:function(ae){var ac=this;var ad=ac.high-ac.low;if(ac.low-ae<ac.max_low){ac.low=ac.max_low;ac.high=ac.max_low+ad}else{if(ac.high-ae>ac.max_high){ac.high=ac.max_high;ac.low=ac.max_high-ad}else{ac.high-=ae;ac.low-=ae}}ac.request_redraw()},add_track:function(ac){ac.view=this;ac.track_id=this.track_id_counter;this.tracks.push(ac);if(ac.init){ac.init()}ac.container_div.attr("id","track_"+ac.track_id);C(ac.container_div,".draghandle");this.track_id_counter+=1;this.num_tracks+=1;this.update_intro_div()},add_label_track:function(ac){ac.view=this;this.label_tracks.push(ac)},remove_track:function(ad){this.has_changes=true;delete this.tracks[this.tracks.indexOf(ad)];this.num_tracks-=1;var ac=this;ad.container_div.fadeOut("slow",function(){$(this).remove();ac.update_intro_div()})},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},request_redraw:function(ad){var ac=this;requestAnimationFrame(function(){ac.redraw(ad)})},redraw:function(aj){var ah=this.low,ad=this.high;if(ah<this.max_low){ah=this.max_low}if(ad>this.max_high){ad=this.max_high}var ai=this.high-this.low;if(this.high!==0&&ai<this.min_separation){ad=ah+this.min_separation}this.low=Math.floor(ah);this.high=Math.ceil(ad);this.resolution=Math.pow(z,Math.ceil(Math.log((this.high-this.low)/N)/Math.log(z)));this.zoom_res=Math.pow(s,Math.max(0,Math.ceil(Math.log(this.resolution,s)/Math.log(s))));var ac=(this.low/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ag=((this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ak=13;this.overview_box.css({left:ac,width:Math.max(ak,ag)}).show();if(ag<ak){this.overview_box.css("left",ac-(ak-ag)/2)}if(this.overview_highlight){this.overview_highlight.css({left:ac,width:ag})}this.update_location(this.low,this.high);if(!aj){for(var ae=0,af=this.tracks.length;ae<af;ae++){if(this.tracks[ae]&&this.tracks[ae].enabled){this.tracks[ae].draw()}}for(ae=0,af=this.label_tracks.length;ae<af;ae++){this.label_tracks[ae].draw()}}},zoom_in:function(ad,ae){if(this.max_high===0||this.high-this.low<this.min_separation){return}var af=this.high-this.low,ag=af/2+this.low,ac=(af/this.zoom_factor)/2;if(ad){ag=ad/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(ag-ac);this.high=Math.round(ag+ac);this.request_redraw()},zoom_out:function(){if(this.max_high===0){return}var ad=this.high-this.low,ae=ad/2+this.low,ac=(ad*this.zoom_factor)/2;this.low=Math.round(ae-ac);this.high=Math.round(ae+ac);this.request_redraw()},resize_window:function(){this.viewport_container.height(this.container.height()-this.top_container.height()-this.bottom_container.height());this.nav_container.width(this.container.width());this.request_redraw()},set_overview:function(ac){$.when(ac.get_overview_tile()).then(function(ad){view.overview_viewport.find(".track-tile").remove();view.overview_close.show();view.overview_viewport.append(ad.canvas);view.overview_highlight.show().height(ad.canvas.height());view.overview_viewport.height(ad.canvas.height()+view.overview_box.outerHeight());view.resize_window();if(view.overview_track){view.overview_track.set_is_overview(false)}view.overview_track=ac;view.has_changes=true;ac.set_is_overview(true)})},reset_overview:function(){this.overview_viewport.find(".track-tile").remove();this.overview_viewport.height(this.default_overview_height);this.overview_box.height(this.default_overview_height);this.overview_close.hide();this.overview_highlight.hide();view.resize_window();if(view.overview_track){view.overview_track.set_is_overview(false)}view.overview_track=null}});var o=function(ae,ai){this.track=ae;this.name=ai.name;this.params=[];var ap=ai.params;for(var af=0;af<ap.length;af++){var ak=ap[af],ad=ak.name,ao=ak.label,ag=unescape(ak.html),aq=ak.value,am=ak.type;if(am==="number"){this.params[this.params.length]=new g(ad,ao,ag,aq,ak.min,ak.max)}else{if(am=="select"){this.params[this.params.length]=new K(ad,ao,ag,aq)}else{console.log("WARNING: unrecognized tool parameter type:",ad,am)}}}this.parent_div=$("<div/>").addClass("dynamic-tool").hide();this.parent_div.bind("drag",function(at){at.stopPropagation()}).click(function(at){at.stopPropagation()}).bind("dblclick",function(at){at.stopPropagation()});var an=$("<div class='tool-name'>").appendTo(this.parent_div).text(this.name);var al=this.params;var aj=this;$.each(this.params,function(au,ax){var aw=$("<div>").addClass("param-row").appendTo(aj.parent_div);var at=$("<div>").addClass("param-label").text(ax.label).appendTo(aw);var av=$("<div/>").addClass("slider").html(ax.html).appendTo(aw);av.find(":input").val(ax.value);$("<div style='clear: both;'/>").appendTo(aw)});this.parent_div.find("input").click(function(){$(this).select()});var ar=$("<div>").addClass("param-row").appendTo(this.parent_div);var ah=$("<input type='submit'>").attr("value","Run on complete dataset").appendTo(ar);var ac=$("<input type='submit'>").attr("value","Run on visible region").css("margin-left","3em").appendTo(ar);var aj=this;ac.click(function(){aj.run_on_region()});ah.click(function(){aj.run_on_dataset()})};n(o.prototype,{get_param_values_dict:function(){var ac={};this.parent_div.find(":input").each(function(){var ad=$(this).attr("name"),ae=$(this).val();ac[ad]=JSON.stringify(ae)});return ac},get_param_values:function(){var ad=[];var ac={};this.parent_div.find(":input").each(function(){var ae=$(this).attr("name"),af=$(this).val();if(ae){ad[ad.length]=af}});return ad},run_on_dataset:function(){var ac=this;ac.run({dataset_id:this.track.original_dataset_id,tool_id:ac.name},null,function(ad){show_modal(ac.name+" is Running",ac.name+" is running on the complete dataset. Tool outputs are in dataset's history.",{Close:hide_modal})})},run_on_region:function(){var ac={dataset_id:this.track.original_dataset_id,chrom:this.track.view.chrom,low:this.track.view.low,high:this.track.view.high,tool_id:this.name},ae=this.track,ad=ac.tool_id+ae.tool_region_and_parameters_str(ac.chrom,ac.low,ac.high),af;if(ae instanceof e){af=new R(ad,view,ae.hda_ldda,undefined,{},{},ae);af.change_mode(ae.mode)}this.track.add_track(af);af.content_div.text("Starting job.");this.run(ac,af,function(ag){af.dataset_id=ag.dataset_id;af.content_div.text("Running job.");af.init()})},run:function(ad,ae,af){$.extend(ad,this.get_param_values_dict());var ac=function(){$.getJSON(rerun_tool_url,ad,function(ag){if(ag==="no converter"){ae.container_div.addClass("error");ae.content_div.text(G)}else{if(ag.error){ae.container_div.addClass("error");ae.content_div.text(v+ag.message)}else{if(ag==="pending"){ae.container_div.addClass("pending");ae.content_div.text("Converting input data so that it can be used quickly with tool.");setTimeout(ac,2000)}else{af(ag)}}}})};ac()}});var K=function(ad,ac,ae,af){this.name=ad;this.label=ac;this.html=ae;this.value=af};var g=function(ae,ad,ag,ah,af,ac){K.call(this,ae,ad,ag,ah);this.min=af;this.max=ac};var h=function(ad,ac,ae,af){this.name=ad;this.index=ac;this.tool_id=ae;this.tool_exp_name=af};var S=function(ad,ac,ae,af){h.call(this,ad,ac,ae,af);this.low=-Number.MAX_VALUE;this.high=Number.MAX_VALUE;this.min=Number.MAX_VALUE;this.max=-Number.MAX_VALUE;this.container=null;this.slider=null;this.slider_label=null};n(S.prototype,{applies_to:function(ac){if(ac.length>this.index){return true}return false},keep:function(ac){if(!this.applies_to(ac)){return true}var ad=parseInt(ac[this.index]);return(isNaN(ad)||(ad>=this.low&&ad<=this.high))},update_attrs:function(ad){var ac=false;if(!this.applies_to(ad)){return ac}if(ad[this.index]<this.min){this.min=Math.floor(ad[this.index]);ac=true}if(ad[this.index]>this.max){this.max=Math.ceil(ad[this.index]);ac=true}return ac},update_ui_elt:function(){if(this.min!=this.max){this.container.show()}else{this.container.hide()}var ae=function(ah,af){var ag=af-ah;return(ag<=2?0.01:1)};var ad=this.slider.slider("option","min"),ac=this.slider.slider("option","max");if(this.min<ad||this.max>ac){this.slider.slider("option","min",this.min);this.slider.slider("option","max",this.max);this.slider.slider("option","step",ae(this.min,this.max));this.slider.slider("option","values",[this.min,this.max])}}});var X=function(am,at){this.track=am;this.filters=[];for(var an=0;an<at.length;an++){var ao=at[an],au=ao.name,ac=ao.type,af=ao.index,ar=ao.tool_id,aq=ao.tool_exp_name;if(ac==="int"||ac==="float"){this.filters[an]=new S(au,af,ar,aq)}else{console.log("ERROR: unsupported filter: ",au,ac)}}var ag=function(av,aw,ax){av.click(function(){var ay=aw.text();max=parseFloat(ax.slider("option","max")),input_size=(max<=1?4:max<=1000000?max.toString().length:6),multi_value=false;if(ax.slider("option","values")){input_size=2*input_size+1;multi_value=true}aw.text("");$("<input type='text'/>").attr("size",input_size).attr("maxlength",input_size).attr("value",ay).appendTo(aw).focus().select().click(function(az){az.stopPropagation()}).blur(function(){$(this).remove();aw.text(ay)}).keyup(function(aD){if(aD.keyCode===27){$(this).trigger("blur")}else{if(aD.keyCode===13){var aB=ax.slider("option","min"),az=ax.slider("option","max"),aC=function(aE){return(isNaN(aE)||aE>az||aE<aB)},aA=$(this).val();if(!multi_value){aA=parseFloat(aA);if(aC(aA)){alert("Parameter value must be in the range ["+aB+"-"+az+"]");return $(this)}}else{aA=aA.split("-");aA=[parseFloat(aA[0]),parseFloat(aA[1])];if(aC(aA[0])||aC(aA[1])){alert("Parameter value must be in the range ["+aB+"-"+az+"]");return $(this)}}ax.slider((multi_value?"values":"value"),aA)}}})})};this.parent_div=$("<div/>").addClass("filters").hide();this.parent_div.bind("drag",function(av){av.stopPropagation()}).click(function(av){av.stopPropagation()}).bind("dblclick",function(av){av.stopPropagation()}).bind("keydown",function(av){av.stopPropagation()});var ap=$("<div/>").addClass("sliders").appendTo(this.parent_div);var ak=this;$.each(this.filters,function(ay,aA){aA.container=$("<div/>").addClass("slider-row").appendTo(ap);var az=$("<div/>").addClass("elt-label").appendTo(aA.container);var ax=$("<span/>").addClass("slider-name").text(aA.name+" ").appendTo(az);var aw=$("<span/>");var aC=$("<span/>").addClass("slider-value").appendTo(az).append("[").append(aw).append("]");var av=$("<div/>").addClass("slider").appendTo(aA.container);aA.control_element=$("<div/>").attr("id",aA.name+"-filter-control").appendTo(av);var aB=[0,0];aA.control_element.slider({range:true,min:Number.MAX_VALUE,max:-Number.MIN_VALUE,values:[0,0],slide:function(aD,aE){aB=aE.values;aw.text(aE.values[0]+"-"+aE.values[1]);setTimeout(function(){if(aE.values[0]==aB[0]&&aE.values[1]==aB[1]){var aF=aE.values;aw.text(aF[0]+"-"+aF[1]);aA.low=aF[0];aA.high=aF[1];ak.track.draw(true,true)}},50)},change:function(aD,aE){aA.control_element.slider("option","slide").call(aA.control_element,aD,aE)}});aA.slider=aA.control_element;aA.slider_label=aw;ag(aC,aw,aA.control_element);$("<div style='clear: both;'/>").appendTo(aA.container)});if(this.filters.length!==0){var ah=$("<div/>").addClass("param-row").appendTo(ap);var aj=$("<input type='submit'/>").attr("value","Run on complete dataset").appendTo(ah);var ae=this;aj.click(function(){ae.run_on_dataset()})}var al=$("<div/>").addClass("display-controls").appendTo(this.parent_div),ai=$("<span/>").addClass("elt-label").text("Transparency:").appendTo(al),ad=$("<select/>").attr("name","alpha_dropdown").appendTo(al);this.alpha_filter=null;$("<option/>").attr("value",-1).text("== None ==").appendTo(ad);for(var an=0;an<this.filters.length;an++){$("<option/>").attr("value",an).text(this.filters[an].name).appendTo(ad)}ad.change(function(){$(this).children("option:selected").each(function(){var av=parseInt($(this).val());ak.alpha_filter=(av>=0?ak.filters[av]:null);ak.track.draw(true,true)})});$("<div style='clear: both;'/>").appendTo(this.parent_div)};n(X.prototype,{reset_filters:function(){for(var ac=0;ac<this.filters.length;ac++){filter=this.filters[ac];filter.slider.slider("option","values",[filter.min,filter.max])}this.alpha_filter=null},run_on_dataset:function(){var ak=function(ao,am,an){if(!(am in ao)){ao[am]=an}return ao[am]};var ae={},ac,ad,af;for(var ag=0;ag<this.filters.length;ag++){ac=this.filters[ag];if(ac.tool_id){if(ac.min!=ac.low){ad=ak(ae,ac.tool_id,[]);ad[ad.length]=ac.tool_exp_name+" >= "+ac.low}if(ac.max!=ac.high){ad=ak(ae,ac.tool_id,[]);ad[ad.length]=ac.tool_exp_name+" <= "+ac.high}}}var ai=[];for(var al in ae){ai[ai.length]=[al,ae[al]]}var aj=ai.length;(function ah(at,ap){var an=ap[0],ao=an[0],ar=an[1],aq="("+ar.join(") and (")+")",am={cond:aq,input:at,target_dataset_id:at,tool_id:ao},ap=ap.slice(1);$.getJSON(run_tool_url,am,function(au){if(au.error){show_modal("Filter Dataset","Error running tool "+ao,{Close:hide_modal})}else{if(ap.length===0){show_modal("Filtering Dataset","Filter(s) are running on the complete dataset. Outputs are in dataset's history.",{Close:hide_modal})}else{ah(au.dataset_id,ap)}}})})(this.track.dataset_id,ai)}});var L=function(ad,ac){I.AlphaGenerator.call(this,ac);this.filter=ad};L.prototype.gen_alpha=function(ac){if(this.filter.high===Number.MAX_VALUE||this.filter.low===-Number.MAX_VALUE||this.filter.low===this.filter.high){return this.default_alpha}return((parseFloat(ac[this.filter.index])-this.filter.low)/(this.filter.high-this.filter.low))};var W=function(ac){this.track=ac.track;this.params=ac.params;this.values={};if(ac.saved_values){this.restore_values(ac.saved_values)}this.onchange=ac.onchange};n(W.prototype,{restore_values:function(ac){var ad=this;$.each(this.params,function(ae,af){if(ac[af.key]!==undefined){ad.values[af.key]=ac[af.key]}else{ad.values[af.key]=af.default_value}})},build_form:function(){var ad=this;var ac=$("<div />");$.each(this.params,function(ah,af){if(!af.hidden){var ae="param_"+ah;var am=$("<div class='form-row' />").appendTo(ac);am.append($("<label />").attr("for",ae).text(af.label+":"));if(af.type==="bool"){am.append($('<input type="checkbox" />').attr("id",ae).attr("name",ae).attr("checked",ad.values[af.key]))}else{if(af.type==="color"){var aj=ad.values[af.key];var ai=$("<input />").attr("id",ae).attr("name",ae).val(aj);var ak=$("<div class='tipsy tipsy-north' style='position: absolute;' />").hide();var ag=$("<div style='background-color: black; padding: 10px;'></div>").appendTo(ak);var al=$("<div/>").appendTo(ag).farbtastic({width:100,height:100,callback:ai,color:aj});$("<div />").append(ai).append(ak).appendTo(am).bind("click",function(an){ak.css({left:$(this).position().left+($(ai).width()/2)-60,top:$(this).position().top+$(this.height)}).show();$(document).bind("click.color-picker",function(){ak.hide();$(document).unbind("click.color-picker")});an.stopPropagation()})}else{am.append($("<input />").attr("id",ae).attr("name",ae).val(ad.values[af.key]))}}}});return ac},update_from_form:function(ac){var ae=this;var ad=false;$.each(this.params,function(af,ah){if(!ah.hidden){var ai="param_"+af;var ag=ac.find("#"+ai).val();if(ah.type==="float"){ag=parseFloat(ag)}else{if(ah.type==="int"){ag=parseInt(ag)}else{if(ah.type==="bool"){ag=ac.find("#"+ai).is(":checked")}}}if(ag!==ae.values[ah.key]){ae.values[ah.key]=ag;ad=true}}});if(ad){this.onchange()}}});var b=function(ae,ad,ac,af){this.index=ae;this.low=ae*N*ad;this.high=(ae+1)*N*ad;this.resolution=ad;this.canvas=$("<div class='track-tile'/>").append(ac);this.data=af;this.stale=false};var l=function(ae,ad,ac,af,ag){b.call(this,ae,ad,ac,af);this.max_val=ag};var M=function(ae,ad,ac,ag,af){b.call(this,ae,ad,ac,ag);this.message=af};var j=function(ad,ac,ag,ae,af){this.name=ad;this.view=ac;this.parent_element=ag;this.data_url=(ae?ae:default_data_url);this.data_url_extra_params={};this.data_query_wait=(af?af:H);this.dataset_check_url=converted_datasets_state_url;this.container_div=$("<div />").addClass("track").css("position","relative");if(!this.hidden){this.header_div=$("<div class='track-header' />").appendTo(this.container_div);if(this.view.editor){this.drag_div=$("<div class='draghandle' />").appendTo(this.header_div)}this.name_div=$("<div class='menubutton popup' />").appendTo(this.header_div);this.name_div.text(this.name);this.name_div.attr("id",this.name.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase())}this.content_div=$("<div class='track-content'>").appendTo(this.container_div);this.parent_element.append(this.container_div)};n(j.prototype,{get_type:function(){if(this instanceof Y){return"LabelTrack"}else{if(this instanceof x){return"ReferenceTrack"}else{if(this instanceof k){return"LineTrack"}else{if(this instanceof T){return"ReadTrack"}else{if(this instanceof R){return"ToolDataFeatureTrack"}else{if(this instanceof Q){return"VcfTrack"}else{if(this instanceof e){return"FeatureTrack"}}}}}}}return""},init:function(){var ac=this;ac.enabled=false;ac.tile_cache.clear();ac.data_manager.clear();ac.initial_canvas=undefined;ac.content_div.css("height","auto");ac.container_div.removeClass("nodata error pending");if(!ac.dataset_id){return}$.getJSON(converted_datasets_state_url,{hda_ldda:ac.hda_ldda,dataset_id:ac.dataset_id,chrom:ac.view.chrom},function(ad){if(!ad||ad==="error"||ad.kind==="error"){ac.container_div.addClass("error");ac.content_div.text(m);if(ad.message){var af=ac.view.tracks.indexOf(ac);var ae=$(" <a href='javascript:void(0);'></a>").text("View error").click(function(){show_modal("Trackster Error","<pre>"+ad.message+"</pre>",{Close:hide_modal})});ac.content_div.append(ae)}}else{if(ad==="no converter"){ac.container_div.addClass("error");ac.content_div.text(G)}else{if(ad==="no data"||(ad.data!==undefined&&(ad.data===null||ad.data.length===0))){ac.container_div.addClass("nodata");ac.content_div.text(B)}else{if(ad==="pending"){ac.container_div.addClass("pending");ac.content_div.text(q);setTimeout(function(){ac.init()},ac.data_query_wait)}else{if(ad.status==="data"){if(ad.valid_chroms){ac.valid_chroms=ad.valid_chroms;ac.make_name_popup_menu()}ac.content_div.text(V);if(ac.view.chrom){ac.content_div.text("");ac.content_div.css("height",ac.height_px+"px");ac.enabled=true;$.when(ac.predraw_init()).done(function(){ac.container_div.removeClass("nodata error pending");ac.draw()})}}}}}}})},predraw_init:function(){},update_name:function(ac){this.old_name=this.name;this.name=ac;this.name_div.text(this.name)},revert_name:function(){this.name=this.old_name;this.name_div.text(this.name)}});var J=function(aj,ah,ak){var ad=this,al=ad.view;this.filters_manager=(aj!==undefined?new X(this,aj):undefined);this.filters_available=false;this.filters_visible=false;this.tool=(ah!==undefined&&obj_length(ah)>0?new o(this,ah):undefined);this.is_overview=false;this.parent_track=ak;this.child_tracks=[];if(ad.hidden){return}if(this.parent_track){this.header_div.find(".draghandle").removeClass("draghandle").addClass("child-track-icon").addClass("icon-button");this.parent_element.addClass("child-track");this.tool=undefined}ad.child_tracks_container=$("<div/>").addClass("child-tracks-container").hide();ad.container_div.append(ad.child_tracks_container);if(this.filters_manager){this.filters_div=this.filters_manager.parent_div;this.header_div.after(this.filters_div)}if(this.tool){this.dynamic_tool_div=this.tool.parent_div;this.header_div.after(this.dynamic_tool_div)}if(ad.display_modes!==undefined){if(ad.mode_div===undefined){ad.mode_div=$("<div class='right-float menubutton popup' />").appendTo(ad.header_div);var ae=(ad.track_config&&ad.track_config.values.mode?ad.track_config.values.mode:ad.display_modes[0]);ad.mode=ae;ad.mode_div.text(ae);var ac={};for(var af=0,ai=ad.display_modes.length;af<ai;af++){var ag=ad.display_modes[af];ac[ag]=function(am){return function(){ad.change_mode(am)}}(ag)}make_popupmenu(ad.mode_div,ac)}else{ad.mode_div.hide()}}this.make_name_popup_menu()};n(J.prototype,j.prototype,{change_mode:function(ad){var ac=this;ac.mode_div.text(ad);ac.mode=ad;ac.track_config.values.mode=ad;ac.tile_cache.clear();ac.draw()},make_name_popup_menu:function(){var ad=this;var ac={};ac[(this.is_overview?"Hide overview":"Set as overview")]=function(){if(ad.is_overview){ad.view.reset_overview()}else{ad.view.set_overview(ad)}};ac["Edit configuration"]=function(){var aj=function(){hide_modal();$(window).unbind("keypress.check_enter_esc")},ah=function(){ad.track_config.update_from_form($(".dialog-box"));hide_modal();$(window).unbind("keypress.check_enter_esc")},ai=function(ak){if((ak.keyCode||ak.which)===27){aj()}else{if((ak.keyCode||ak.which)===13){ah()}}};$(window).bind("keypress.check_enter_esc",ai);show_modal("Configure Track",ad.track_config.build_form(),{Cancel:aj,OK:ah})};if(ad.filters_available>0){var ag=(ad.filters_div.is(":visible")?"Hide filters":"Show filters");ac[ag]=function(){ad.filters_visible=(ad.filters_div.is(":visible"));if(ad.filters_visible){ad.filters_manager.reset_filters()}ad.filters_div.toggle();ad.make_name_popup_menu()}}if(ad.tool){var ag=(ad.dynamic_tool_div.is(":visible")?"Hide tool":"Show tool");ac[ag]=function(){if(!ad.dynamic_tool_div.is(":visible")){ad.update_name(ad.name+ad.tool_region_and_parameters_str())}else{menu_option_text="Show dynamic tool";ad.revert_name()}ad.dynamic_tool_div.toggle();ad.make_name_popup_menu()}}if(ad.valid_chroms){ac["List chrom/contigs with data"]=function(){show_modal("Chrom/contigs with data","<p>"+ad.valid_chroms.join("<br/>")+"</p>",{Close:function(){hide_modal()}})}}var ae=view;var af=function(){$("#no-tracks").show()};if(this.parent_track){ae=this.parent_track;af=function(){}}ac.Remove=function(){ae.remove_track(ad);if(ae.num_tracks===0){af()}};make_popupmenu(ad.name_div,ac)},set_is_overview:function(ac){this.is_overview=ac;this.make_name_popup_menu()},get_overview_tile:function(){var ac=this;view=ac.view,resolution=Math.pow(z,Math.ceil(Math.log((view.max_high-view.max_low)/N)/Math.log(z))),view_width=view.container.width(),w_scale=view_width/(view.max_high-view.max_low),overview_tile=$.Deferred();$.when(ac.data_manager.get_data(view.max_low,view.max_high,"Auto",resolution,ac.data_url_extra_params)).then(function(ad){var af=ac._gen_tile_cache_key(view_width,w_scale,0),ah=ac.tile_cache.get(af);if(!ah){ah=ac.draw_tile(ad,resolution,0,w_scale);ac.tile_cache.set(af,ah)}var ak=$(ah.canvas.find("canvas")),ag=ak.clone(),aj=ak.get(0).getContext("2d"),ae=ag.get(0).getContext("2d"),ai=aj.getImageData(0,0,aj.canvas.width,aj.canvas.height);ae.putImageData(ai,-ac.left_offset,(ah.data.dataset_type==="summary_tree"?P:0));new_tile=new b(-1,resolution,ag);overview_tile.resolve(new_tile)});return overview_tile},_gen_tile_cache_key:function(ad,ae,ac){return ad+"_"+ae+"_"+ac},draw:function(ae,an){if(!this.dataset_id){return}var am=this.view.low,ai=this.view.high,ak=ai-am,af=this.view.container.width(),aq=af/ak,ah=this.view.resolution,ap=$("<div style='position: relative;'></div>");if(!an){this.content_div.children().remove()}this.content_div.append(ap);this.max_height=0;var ad=Math.floor(am/ah/N);var al=true;var ao=[];var ac=0;while((ad*N*ah)<ai){tile=this.draw_helper(ae,af,ad,ah,ap,aq);if(tile){ao.push(tile)}else{al=false}ad+=1;ac++}var ag=this;if(al){ag.postdraw_actions(ao,af,aq,an)}for(var aj=0;aj<this.child_tracks.length;aj++){this.child_tracks[aj].draw(ae,an)}},postdraw_actions:function(ag,ah,ai,ac){var ae=this;var af=false;for(var ad=0;ad<ag.length;ad++){if(ag[ad].message){af=true;break}}if(af){for(var ad=0;ad<ag.length;ad++){tile=ag[ad];if(!tile.message){tile.canvas.css("padding-top",A)}}}},draw_helper:function(ad,ae,af,ai,ao,at,ap,aj){var ag=this,an=this._gen_tile_cache_key(ae,at,af),ak=af*N*ai,ar=ak+N*ai;var al=(ad?undefined:ag.tile_cache.get(an));if(al){ag.show_tile(al,ao,at);return al}var am=function(au){return("isResolved" in au)};var ah=true;var ac=ag.data_manager.get_data(ak,ar,ag.mode,ai,ag.data_url_extra_params);if(am(ac)){ah=false}var aq;if(view.reference_track&&at>view.canvas_manager.char_width_px){aq=view.reference_track.data_manager.get_data(ak,ar,ag.mode,ai,view.reference_track.data_url_extra_params);if(am(aq)){ah=false}}if(ah){n(ac,aj);var al=ag.draw_tile(ac,ai,af,at,aq);ag.tile_cache.set(an,al);if(al!==undefined){ag.show_tile(al,ao,at)}return al}$.when(ac,aq).then(function(){view.request_redraw()});return null},show_tile:function(aj,al,am){var ae=this,ad=aj.canvas,ai=ad;if(aj.message){var an=$("<div/>"),ak=$("<div/>").addClass("tile-message").text(aj.message).css({height:A-1,width:aj.canvas.width}).appendTo(an),ag=$("<a href='javascript:void(0);'/>").addClass("icon more-down").appendTo(ak),ac=$("<a href='javascript:void(0);'/>").addClass("icon more-across").appendTo(ak);an.append(ad);ai=an;ag.click(function(){aj.stale=true;ae.data_manager.get_more_data(aj.low,aj.high,ae.mode,aj.resolution,{},ae.data_manager.DEEP_DATA_REQ);ae.draw()}).dblclick(function(ao){ao.stopPropagation()});ac.click(function(){aj.stale=true;ae.data_manager.get_more_data(aj.low,aj.high,ae.mode,aj.resolution,{},ae.data_manager.BROAD_DATA_REQ);ae.draw()}).dblclick(function(ao){ao.stopPropagation()})}var ah=this.view.high-this.view.low,af=(aj.low-this.view.low)*am;if(this.left_offset){af-=this.left_offset}ai.css({position:"absolute",top:0,left:af,height:""});al.append(ai);ae.max_height=Math.max(ae.max_height,ai.height());ae.content_div.css("height",ae.max_height+"px");al.children().css("height",ae.max_height+"px")},tool_region_and_parameters_str:function(ae,ac,af){var ad=this,ag=(ae!==undefined&&ac!==undefined&&af!==undefined?ae+":"+ac+"-"+af:"all");return" - region=["+ag+"], parameters=["+ad.tool.get_param_values().join(", ")+"]"},add_track:function(ac){ac.track_id=this.track_id+"_"+this.child_tracks.length;ac.container_div.attr("id","track_"+ac.track_id);this.child_tracks_container.append(ac.container_div);C(ac.container_div,".child-track-icon");if(!$(this.child_tracks_container).is(":visible")){this.child_tracks_container.show()}this.child_tracks.push(ac);this.view.has_changes=true},remove_track:function(ac){ac.container_div.fadeOut("slow",function(){$(this).remove()})}});var Y=function(ac,ad){this.hidden=true;j.call(this,null,ac,ad);this.container_div.addClass("label-track")};n(Y.prototype,j.prototype,{draw:function(){var ae=this.view,af=ae.high-ae.low,ai=Math.floor(Math.pow(10,Math.floor(Math.log(af)/Math.log(10)))),ac=Math.floor(ae.low/ai)*ai,ag=this.view.container.width(),ad=$("<div style='position: relative; height: 1.3em;'></div>");while(ac<ae.high){var ah=(ac-ae.low)/af*ag;ad.append($("<div class='label'>"+commatize(ac)+"</div>").css({position:"absolute",left:ah-1}));ac+=ai}this.content_div.children(":first").remove();this.content_div.append(ad)}});var x=function(ac){this.hidden=true;j.call(this,null,ac,ac.top_labeltrack);J.call(this);ac.reference_track=this;this.left_offset=200;this.height_px=12;this.container_div.addClass("reference-track");this.content_div.css("background","none");this.content_div.css("min-height","0px");this.content_div.css("border","none");this.data_url=reference_url;this.data_url_extra_params={dbkey:ac.dbkey};this.data_manager=new E(y,this,false);this.tile_cache=new c(r)};n(x.prototype,J.prototype,{draw_tile:function(ak,ah,ad,am){var ag=this,ae=N*ah;if(am>this.view.canvas_manager.char_width_px){if(ak===null){ag.content_div.css("height","0px");return}var af=this.view.canvas_manager.new_canvas();var al=af.getContext("2d");af.width=Math.ceil(ae*am+ag.left_offset);af.height=ag.height_px;al.font=al.canvas.manager.default_font;al.textAlign="center";for(var ai=0,aj=ak.length;ai<aj;ai++){var ac=Math.round(ai*am);al.fillText(ak[ai],ac+ag.left_offset,10)}return new b(ad,ah,af,ak)}this.content_div.css("height","0px")}});var k=function(ag,ae,ah,ac,af){var ad=this;this.display_modes=["Histogram","Line","Filled","Intensity"];this.mode="Histogram";j.call(this,ag,ae,ae.viewport_container);J.call(this);this.min_height_px=16;this.max_height_px=400;this.height_px=80;this.hda_ldda=ah;this.dataset_id=ac;this.original_dataset_id=ac;this.data_manager=new O(y,this);this.tile_cache=new c(r);this.track_config=new W({track:this,params:[{key:"color",label:"Color",type:"color",default_value:"black"},{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:this.height_px,hidden:true}],saved_values:af,onchange:function(){ad.vertical_range=ad.prefs.max_value-ad.prefs.min_value;$("#linetrack_"+ad.track_id+"_minval").text(ad.prefs.min_value);$("#linetrack_"+ad.track_id+"_maxval").text(ad.prefs.max_value);ad.tile_cache.clear();ad.draw()}});this.prefs=this.track_config.values;this.height_px=this.track_config.values.height;this.vertical_range=this.track_config.values.max_value-this.track_config.values.min_value;this.add_resize_handle()};n(k.prototype,J.prototype,{add_resize_handle:function(){var ac=this;var af=false;var ae=false;var ad=$("<div class='track-resize'>");$(ac.container_div).hover(function(){af=true;ad.show()},function(){af=false;if(!ae){ad.hide()}});ad.hide().bind("dragstart",function(ag,ah){ae=true;ah.original_height=$(ac.content_div).height()}).bind("drag",function(ah,ai){var ag=Math.min(Math.max(ai.original_height+ai.deltaY,ac.min_height_px),ac.max_height_px);$(ac.content_div).css("height",ag);ac.height_px=ag;ac.draw(true)}).bind("dragend",function(ag,ah){ac.tile_cache.clear();ae=false;if(!af){ad.hide()}ac.track_config.values.height=ac.height_px}).appendTo(ac.container_div)},predraw_init:function(){var ac=this,ad=ac.view.tracks.indexOf(ac);ac.vertical_range=undefined;return $.getJSON(ac.data_url,{stats:true,chrom:ac.view.chrom,low:null,high:null,hda_ldda:ac.hda_ldda,dataset_id:ac.dataset_id},function(ae){ac.container_div.addClass("line-track");var ag=ae.data;if(isNaN(parseFloat(ac.prefs.min_value))||isNaN(parseFloat(ac.prefs.max_value))){ac.prefs.min_value=ag.min;ac.prefs.max_value=ag.max;$("#track_"+ad+"_minval").val(ac.prefs.min_value);$("#track_"+ad+"_maxval").val(ac.prefs.max_value)}ac.vertical_range=ac.prefs.max_value-ac.prefs.min_value;ac.total_frequency=ag.total_frequency;ac.container_div.find(".yaxislabel").remove();var ah=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+ad+"_minval").text(u(ac.prefs.min_value));var af=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+ad+"_maxval").text(u(ac.prefs.max_value));af.css({position:"absolute",top:"24px",left:"10px"});af.prependTo(ac.container_div);ah.css({position:"absolute",bottom:"2px",left:"10px"});ah.prependTo(ac.container_div)})},draw_tile:function(am,ag,ad,al){if(this.vertical_range===undefined){return}var ah=ad*N*ag,af=N*ag,ac=Math.ceil(af*al),aj=this.height_px;var ae=this.view.canvas_manager.new_canvas();ae.width=ac,ae.height=aj;var ak=ae.getContext("2d");var ai=new I.LinePainter(am.data,ah,ah+af,this.prefs,this.mode);ai.draw(ak,ac,aj);return new b(ad,ag,ae,am.data)}});var e=function(ac,ah,ag,ak,aj,ae,af,ai){var ad=this;this.display_modes=["Auto","Histogram","Dense","Squish","Pack"];this.track_config=new W({track:this,params:[{key:"block_color",label:"Block color",type:"color",default_value:"#444"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:true},],saved_values:aj,onchange:function(){ad.tile_cache.clear();ad.draw()}});this.prefs=this.track_config.values;j.call(this,ac,ah,ah.viewport_container);J.call(this,ae,af,ai);this.height_px=0;this.container_div.addClass("feature-track");this.hda_ldda=ag;this.dataset_id=ak;this.original_dataset_id=ak;this.show_labels_scale=0.001;this.showing_details=false;this.summary_draw_height=30;this.inc_slots={};this.start_end_dct={};this.tile_cache=new c(d);this.data_manager=new O(20,this);this.left_offset=200;this.painter=I.LinkedFeaturePainter};n(e.prototype,J.prototype,{postdraw_actions:function(ar,ac,at,aq){J.prototype.postdraw_actions.call(this,ar,aq);var af=this;if(aq){var ah=af.content_div.children();var ai=false;for(var ag=ah.length-1,am=0;ag>=am;ag--){var ae=$(ah[ag]);if(ai){ae.remove()}else{if(ae.children().length!==0){ai=true}}}}if(af.mode=="Histogram"){var al=-1;for(var ag=0;ag<ar.length;ag++){var ap=ar[ag].max_val;if(ap>al){al=ap}}for(var ag=0;ag<ar.length;ag++){var ao=ar[ag];if(ao.max_val!==al){ao.canvas.remove();af.draw_helper(true,ac,ao.index,ao.resolution,ao.canvas.parent(),at,[],{max:al})}}}if(af.filters_manager){var ad=af.filters_manager.filters;for(var ak=0;ak<ad.length;ak++){ad[ak].update_ui_elt()}var aj=false,an;for(var ag=0;ag<ar.length;ag++){if(ar[ag].data.length){an=ar[ag].data[0];for(var ak=0;ak<ad.length;ak++){if(ad[ak].applies_to(an)){aj=true;break}}}}if(af.filters_available!==aj){af.filters_available=aj;if(!af.filters_available){af.filters_div.hide()}af.make_name_popup_menu()}}},update_auto_mode:function(ac){if(this.mode=="Auto"){if(ac=="no_detail"){ac="feature spans"}else{if(ac=="summary_tree"){ac="coverage histogram"}}this.mode_div.text("Auto ("+ac+")")}},incremental_slots:function(ag,ad,af){var ae=this.view.canvas_manager.dummy_context,ac=this.inc_slots[ag];if(!ac||(ac.mode!==af)){ac=new (p.FeatureSlotter)(ag,af==="Pack",w,function(ah){return ae.measureText(ah)});ac.mode=af;this.inc_slots[ag]=ac}return ac.slot_features(ad)},get_summary_tree_data:function(ag,aj,ae,ar){if(ar>ae-aj){ar=ae-aj}var an=Math.floor((ae-aj)/ar),aq=[],af=0;var ah=0,ai=0,am,ap=0,ak=[],ao,al;var ad=function(av,au,aw,at){av[0]=au+aw*at;av[1]=au+(aw+1)*at};while(ap<ar&&ah!==ag.length){var ac=false;for(;ap<ar&&!ac;ap++){ad(ak,aj,ap,an);for(ai=ah;ai<ag.length;ai++){am=ag[ai].slice(1,3);if(is_overlap(am,ak)){ac=true;break}}if(ac){break}}data_start_index=ai;aq[aq.length]=ao=[ak[0],0];for(;ai<ag.length;ai++){am=ag[ai].slice(1,3);if(is_overlap(am,ak)){ao[1]++}else{break}}if(ao[1]>af){af=ao[1]}ap++}return{max:af,delta:an,data:aq}},draw_tile:function(ap,ay,aC,al,af){var av=this,aE=aC*N*ay,ad=(aC+1)*N*ay,ar=ad-aE,aw=Math.ceil(ar*al),at=this.mode,aI=25,ag=this.left_offset,aq,ah;if(at==="Auto"){if(ap.dataset_type==="summary_tree"){at=ap.dataset_type}else{if(ap.extra_info==="no_detail"){at="no_detail"}else{var aH=ap.data;if(this.view.high-this.view.low>F){at="Squish"}else{at="Pack"}}}this.update_auto_mode(at)}if(at==="summary_tree"||at==="Histogram"){ah=this.summary_draw_height;this.container_div.find(".yaxislabel").remove();var ac=$("<div />").addClass("yaxislabel");ac.text(ap.max);ac.css({position:"absolute",top:"24px",left:"10px",color:this.prefs.label_color});ac.prependTo(this.container_div);var ae=this.view.canvas_manager.new_canvas();ae.width=aw+ag;ae.height=ah+P;if(ap.dataset_type!="summary_tree"){var am=this.get_summary_tree_data(ap.data,aE,ad,200);if(ap.max){am.max=ap.max}ap=am}var aF=new I.SummaryTreePainter(ap,aE,ad,this.prefs);var ax=ae.getContext("2d");ax.translate(ag,P);aF.draw(ax,aw,ah);return new l(aC,ay,ae,ap.data,ap.max)}var aq,aj=1;if(at==="no_detail"||at==="Squish"||at==="Pack"){aj=this.incremental_slots(al,ap.data,at);aq=this.inc_slots[al].slots}var ak=[];if(ap.data){var an=this.filters_manager.filters;for(var az=0,aB=ap.data.length;az<aB;az++){var ai=ap.data[az];var aA=false;var ao;for(var aD=0,aG=an.length;aD<aG;aD++){ao=an[aD];ao.update_attrs(ai);if(!ao.keep(ai)){aA=true;break}}if(!aA){ak.push(ai)}}}var au=(this.filters_manager.alpha_filter?new L(this.filters_manager.alpha_filter):null);var aF=new (this.painter)(ak,aE,ad,this.prefs,at,au,af);var ah=Math.max(aa,aF.get_required_height(aj));var ae=this.view.canvas_manager.new_canvas();ae.width=aw+ag;ae.height=ah;var ax=ae.getContext("2d");ax.fillStyle=this.prefs.block_color;ax.font=ax.canvas.manager.default_font;ax.textAlign="right";this.container_div.find(".yaxislabel").remove();if(ap.data){ax.translate(ag,0);aF.draw(ax,aw,ah,aq)}return new M(aC,ay,ae,ap.data,ap.message)}});var Q=function(af,ad,ah,ac,ae,ag){e.call(this,af,ad,ah,ac,ae,ag);this.painter=I.VariantPainter};n(Q.prototype,J.prototype,e.prototype);var T=function(af,ad,ah,ac,ae,ag){e.call(this,af,ad,ah,ac,ae,ag);this.track_config=new W({track:this,params:[{key:"block_color",label:"Block color",type:"color",default_value:"#444"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:false},{key:"show_differences",label:"Show differences only",type:"bool",default_value:true},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:true},],saved_values:ae,onchange:function(){this.track.tile_cache.clear();this.track.draw()}});this.prefs=this.track_config.values;this.painter=I.ReadPainter;this.make_name_popup_menu()};n(T.prototype,J.prototype,e.prototype);var R=function(ag,ae,ai,ac,af,ah,ad){e.call(this,ag,ae,ai,ac,af,ah,{},ad);this.data_url=raw_data_url;this.data_query_wait=1000;this.dataset_check_url=dataset_state_url};n(R.prototype,J.prototype,e.prototype,{predraw_init:function(){var ad=this;var ac=function(){if(ad.data_manager.size()===0){setTimeout(ac,300)}else{ad.data_url=default_data_url;ad.data_query_wait=H;ad.dataset_state_url=converted_datasets_state_url;$.getJSON(ad.dataset_state_url,{dataset_id:ad.dataset_id,hda_ldda:ad.hda_ldda},function(ae){})}};ac()}});U.View=Z;U.LineTrack=k;U.FeatureTrack=e;U.ReadTrack=T};var slotting_module=function(c,b){var e=c("class").extend;var d=2,a=5;b.FeatureSlotter=function(j,h,f,g){this.slots={};this.start_end_dct={};this.w_scale=j;this.include_label=h;this.max_rows=f;this.measureText=g};e(b.FeatureSlotter.prototype,{slot_features:function(m){var p=this.w_scale,s=this.slots,h=this.start_end_dct,y=[],A=[],n=0,z=this.max_rows;for(var w=0,x=m.length;w<x;w++){var l=m[w],o=l[0];if(s[o]!==undefined){n=Math.max(n,s[o]);A.push(s[o])}else{y.push(w)}}var q=function(G,H){for(var F=0;F<=z;F++){var D=false,I=h[F];if(I!==undefined){for(var C=0,E=I.length;C<E;C++){var B=I[C];if(H>B[0]&&G<B[1]){D=true;break}}}if(!D){return F}}return -1};for(var w=0,x=y.length;w<x;w++){var l=m[y[w]],o=l[0],u=l[1],f=l[2],r=l[3],g=Math.floor(u*p),k=Math.ceil(f*p),v=this.measureText(r).width,j;if(r!==undefined&&this.include_label){v+=(d+a);if(g-v>=0){g-=v;j="left"}else{k+=v;j="right"}}var t=q(g,k);if(t>=0){if(h[t]===undefined){h[t]=[]}h[t].push([g,k]);s[o]=t;n=Math.max(n,t)}else{}}return n+1}})};var painters_module=function(k,x){var u=k("class").extend;var p=function(I,A,G,z,F,D){if(D===undefined){D=4}var C=z-A;var B=F-G;var E=Math.floor(Math.sqrt(C*C+B*B)/D);var J=C/E;var H=B/E;var y;for(y=0;y<E;y++,A+=J,G+=H){if(y%2!==0){continue}I.fillRect(A,G,D,1)}};var q=function(B,A,z,E){var D=A-E/2,C=A+E/2,F=z-Math.sqrt(E*3/2);B.beginPath();B.moveTo(D,F);B.lineTo(C,F);B.lineTo(A,z);B.lineTo(D,F);B.strokeStyle=this.fillStyle;B.fill();B.stroke();B.closePath()};var g=function(y){this.default_alpha=(y?y:1)};g.prototype.gen_alpha=function(y){return this.default_alpha};var n=function(A,C,y,z,B){this.data=A;this.view_start=C;this.view_end=y;this.prefs=u({},this.default_prefs,z);this.mode=B};n.prototype.default_prefs={};var v=function(A,C,y,z,B){n.call(this,A,C,y,z,B)};v.prototype.default_prefs={show_counts:false};v.prototype.draw=function(M,z,L){var E=this.view_start,O=this.view_end-this.view_start,N=z/O;var J=this.data.data,I=this.data.delta,G=this.data.max,B=L;delta_x_px=Math.ceil(I*N);M.save();for(var C=0,D=J.length;C<D;C++){var H=Math.floor((J[C][0]-E)*N);var F=J[C][1];if(!F){continue}var K=F/G*L;if(F!==0&&K<1){K=1}M.fillStyle=this.prefs.block_color;M.fillRect(H,B-K,delta_x_px,K);var A=4;if(this.prefs.show_counts&&(M.measureText(F).width+A)<delta_x_px){M.fillStyle=this.prefs.label_color;M.textAlign="center";M.fillText(F,H+(delta_x_px/2),10)}}M.restore()};var c=function(y,C,E,F,A){n.call(this,y,C,E,F,A);if(this.prefs.min_value===undefined){var G=Infinity;for(var z=0,B=this.data.length;z<B;z++){G=Math.min(G,this.data[z][1])}this.prefs.min_value=G}if(this.prefs.max_value===undefined){var D=-Infinity;for(var z=0,B=this.data.length;z<B;z++){D=Math.max(D,this.data[z][1])}this.prefs.max_value=D}};c.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Histogram",color:"#000",overflow_color:"#F66"};c.prototype.draw=function(N,M,K){var F=false,H=this.prefs.min_value,D=this.prefs.max_value,J=D-H,z=K,A=this.view_start,L=this.view_end-this.view_start,B=M/L,I=this.mode,T=this.data;N.save();var U=Math.round(K+H/J*K);if(I!=="Intensity"){N.fillStyle="#aaa";N.fillRect(0,U,M,1)}N.beginPath();var R,E,C;if(T.length>1){C=Math.ceil((T[1][0]-T[0][0])*B)}else{C=10}for(var O=0,P=T.length;O<P;O++){N.fillStyle=this.prefs.color;R=Math.round((T[O][0]-A)*B);E=T[O][1];var Q=false,G=false;if(E===null){if(F&&I==="Filled"){N.lineTo(R,z)}F=false;continue}if(E<H){G=true;E=H}else{if(E>D){Q=true;E=D}}if(I==="Histogram"){E=Math.round(E/J*z);N.fillRect(R,U,C,-E)}else{if(I==="Intensity"){E=255-Math.floor((E-H)/J*255);N.fillStyle="rgb("+E+","+E+","+E+")";N.fillRect(R,0,C,z)}else{E=Math.round(z-(E-H)/J*z);if(F){N.lineTo(R,E)}else{F=true;if(I==="Filled"){N.moveTo(R,z);N.lineTo(R,E)}else{N.moveTo(R,E)}}}}N.fillStyle=this.prefs.overflow_color;if(Q||G){var S;if(I==="Histogram"||I==="Intensity"){S=C}else{R-=2;S=4}if(Q){N.fillRect(R,0,S,3)}if(G){N.fillRect(R,z-3,S,3)}}N.fillStyle=this.prefs.color}if(I==="Filled"){if(F){N.lineTo(R,U);N.lineTo(0,U)}N.fill()}else{N.stroke()}N.restore()};var o=function(B,D,y,A,C,z){n.call(this,B,D,y,A,C);this.alpha_generator=(z?z:new g())};o.prototype.default_prefs={block_color:"#FFF",connector_color:"#FFF"};u(o.prototype,{get_required_height:function(z){var y=y_scale=this.get_row_height(),A=this.mode;if(A==="no_detail"||A==="Squish"||A==="Pack"){y=z*y_scale}return y+Math.max(Math.round(y_scale/2),5)},draw:function(K,B,J,G){var E=this.data,H=this.view_start,L=this.view_end;K.save();K.fillStyle=this.prefs.block_color;K.textAlign="right";var O=this.view_end-this.view_start,N=B/O,A=this.get_row_height();for(var D=0,F=E.length;D<F;D++){var M=E[D],C=M[0],y=M[1],z=M[2],I=(G&&G[C]!==undefined?G[C]:null);if((y<L&&z>H)&&(this.mode=="Dense"||I!==null)){this.draw_element(K,this.mode,M,I,H,L,N,A,B)}}K.restore()},draw_element:function(E,A,G,C,B,D,F,z,y){console.log("WARNING: Unimplemented function.")}});var d=10,j=3,m=5,w=10,f=1,s=3,e=3,a=9,l=2,h="#ccc";var r=function(B,D,y,A,C,z){o.call(this,B,D,y,A,C,z)};u(r.prototype,o.prototype,{get_row_height:function(){var z=this.mode,y;if(z==="Dense"){y=d}else{if(z==="no_detail"){y=j}else{if(z==="Squish"){y=m}else{y=w}}}return y},draw_element:function(K,D,S,F,M,ac,ag,ah,y){var P=S[0],ae=S[1],W=S[2],N=S[3],X=Math.floor(Math.max(0,(ae-M)*ag)),L=Math.ceil(Math.min(y,Math.max(0,(W-M)*ag))),V=(D==="Dense"?0:(0+F))*ah,J,aa,O=null,ai=null,B=this.prefs.block_color,Z=this.prefs.label_color;K.globalAlpha=this.alpha_generator.gen_alpha(S);if(D=="Dense"){F=1}if(D==="no_detail"){K.fillStyle=B;K.fillRect(X,V+5,L-X,f)}else{var I=S[4],U=S[5],Y=S[6],C=S[7];if(U&&Y){O=Math.floor(Math.max(0,(U-M)*ag));ai=Math.ceil(Math.min(y,Math.max(0,(Y-M)*ag)))}var af,Q;if(D==="Squish"||D==="Dense"){af=1;Q=e}else{af=5;Q=a}if(!C){if(S.strand){if(S.strand==="+"){K.fillStyle=K.canvas.manager.get_pattern("right_strand_inv")}else{if(S.strand==="-"){K.fillStyle=K.canvas.manager.get_pattern("left_strand_inv")}}}else{K.fillStyle=B}K.fillRect(X,V,L-X,Q)}else{var H,R;if(D==="Squish"||D==="Dense"){K.fillStyle=h;H=V+Math.floor(e/2)+1;R=1}else{if(I){var H=V;var R=Q;if(I==="+"){K.fillStyle=K.canvas.manager.get_pattern("right_strand")}else{if(I==="-"){K.fillStyle=K.canvas.manager.get_pattern("left_strand")}}}else{K.fillStyle=h;H+=(e/2)+1;R=1}}K.fillRect(X,H,L-X,R);for(var ad=0,A=C.length;ad<A;ad++){var E=C[ad],z=Math.floor(Math.max(0,(E[0]-M)*ag)),T=Math.ceil(Math.min(y,Math.max((E[1]-M)*ag)));if(z>T){continue}K.fillStyle=B;K.fillRect(z,V+(Q-af)/2+1,T-z,af);if(O!==undefined&&Y>U&&!(z>ai||T<O)){var ab=Math.max(z,O),G=Math.min(T,ai);K.fillRect(ab,V+1,G-ab,Q);if(C.length==1&&D=="Pack"){if(I==="+"){K.fillStyle=K.canvas.manager.get_pattern("right_strand_inv")}else{if(I==="-"){K.fillStyle=K.canvas.manager.get_pattern("left_strand_inv")}}if(ab+14<G){ab+=2;G-=2}K.fillRect(ab,V+1,G-ab,Q)}}}}if(D==="Pack"&&ae>M){K.fillStyle=Z;if(M===0&&X-K.measureText(N).width<0){K.textAlign="left";K.fillText(N,L+l,V+8)}else{K.textAlign="right";K.fillText(N,X-l,V+8)}}}K.globalAlpha=1}});var b=function(B,D,y,A,C,z){o.call(this,B,D,y,A,C,z)};u(b.prototype,o.prototype,{draw_element:function(R,M,G,C,U,A,J,S,P){var G=data[i],I=G[0],Q=G[1],B=G[2],L=G[3],E=Math.floor(Math.max(0,(Q-U)*J)),H=Math.ceil(Math.min(P,Math.max(0,(B-U)*J))),D=(M==="Dense"?0:(0+C))*S,y,V,z=null,K=null;if(no_label){R.fillStyle=block_color;R.fillRect(E+left_offset,D+5,H-E,1)}else{var T=G[4],O=G[5],F=G[6];y=9;V=1;R.fillRect(E+left_offset,D,H-E,y);if(M!=="Dense"&&L!==undefined&&Q>U){R.fillStyle=label_color;if(U===0&&E-R.measureText(L).width<0){R.textAlign="left";R.fillText(L,H+2+left_offset,D+8)}else{R.textAlign="right";R.fillText(L,E-2+left_offset,D+8)}R.fillStyle=block_color}var N=T+" / "+O;if(Q>U&&R.measureText(N).width<(H-E)){R.fillStyle="white";R.textAlign="center";R.fillText(N,left_offset+E+(H-E)/2,D+8);R.fillStyle=block_color}}}});var t=function(C,E,y,B,D,z,A){o.call(this,C,E,y,B,D,z);this.ref_seq=A};t.prototype.default_prefs=u({},o.prototype.default_prefs,{show_insertions:false});u(t.prototype,o.prototype,{get_row_height:function(){var y,z=this.mode;if(z==="Dense"){y=d}else{if(z==="Squish"){y=m}else{y=w;if(this.prefs.show_insertions){y*=2}}}return y},draw_read:function(U,P,L,Z,A,T,I,F,E){U.textAlign="center";var S=this,z=[Z,A],O=0,V=0,R=0;ref_seq=this.ref_seq,char_width_px=U.canvas.manager.char_width_px;var ae=[];if((P==="Pack"||this.mode==="Auto")&&F!==undefined&&L>char_width_px){R=Math.round(L/2)}if(!I){I=[[0,F.length]]}for(var M=0,X=I.length;M<X;M++){var J=I[M],B="MIDNSHP=X"[J[0]],N=J[1];if(B==="H"||B==="S"){O-=N}var G=T+O,ad=Math.floor(Math.max(0,(G-Z)*L)),H=Math.floor(Math.max(0,(G+N-Z)*L));if(ad===H){H+=1}switch(B){case"H":break;case"S":case"M":case"=":if(is_overlap([G,G+N],z)){var Q=F.slice(V,V+N);if(R>0){U.fillStyle=this.prefs.block_color;U.fillRect(ad-R,E+1,H-ad,9);U.fillStyle=h;for(var ab=0,y=Q.length;ab<y;ab++){if(this.prefs.show_differences&&ref_seq){var K=ref_seq[G-Z+ab];if(!K||K.toLowerCase()===Q[ab].toLowerCase()){continue}}if(G+ab>=Z&&G+ab<=A){var ac=Math.floor(Math.max(0,(G+ab-Z)*L));U.fillText(Q[ab],ac,E+9)}}}else{U.fillStyle=this.prefs.block_color;U.fillRect(ad,E+4,H-ad,e)}}V+=N;O+=N;break;case"N":U.fillStyle=h;U.fillRect(ad-R,E+5,H-ad,1);O+=N;break;case"D":U.fillStyle="red";U.fillRect(ad-R,E+4,H-ad,3);O+=N;break;case"P":break;case"I":var Y=ad-R;if(is_overlap([G,G+N],z)){var Q=F.slice(V,V+N);if(this.prefs.show_insertions){var D=ad-(H-ad)/2;if((P==="Pack"||this.mode==="Auto")&&F!==undefined&&L>char_width_px){U.fillStyle="yellow";U.fillRect(D-R,E-9,H-ad,9);ae[ae.length]={type:"triangle",data:[Y,E+4,5]};U.fillStyle=h;switch(seq_tile_overlap){case (OVERLAP_START):Q=Q.slice(Z-G);break;case (OVERLAP_END):Q=Q.slice(0,G-A);break;case (CONTAINED_BY):break;case (CONTAINS):Q=Q.slice(Z-G,G-A);break}for(var ab=0,y=Q.length;ab<y;ab++){var ac=Math.floor(Math.max(0,(G+ab-Z)*L));U.fillText(Q[ab],ac-(H-ad)/2,E)}}else{U.fillStyle="yellow";U.fillRect(D,E+(this.mode!=="Dense"?2:5),H-ad,(P!=="Dense"?e:s))}}else{if((P==="Pack"||this.mode==="Auto")&&F!==undefined&&L>char_width_px){ae[ae.length]={type:"text",data:[Q.length,Y,E+9]}}else{}}}V+=N;break;case"X":V+=N;break}}U.fillStyle="yellow";var aa,C,af;for(var W=0;W<ae.length;W++){aa=ae[W];C=aa.type;af=aa.data;if(C==="text"){U.save();U.font="bold "+U.font;U.fillText(af[0],af[1],af[2]);U.restore()}else{if(C=="triangle"){q(U,af[0],af[1],af[2])}}}},draw_element:function(R,M,E,B,U,z,I,S,P){var H=E[0],Q=E[1],A=E[2],J=E[3],D=Math.floor(Math.max(0,(Q-U)*I)),F=Math.ceil(Math.min(P,Math.max(0,(A-U)*I))),C=(M==="Dense"?0:(0+B))*S,V=this.prefs.block_color,G=this.prefs.label_color,O=0;if((M==="Pack"||this.mode==="Auto")&&I>R.canvas.manager.char_width_px){var O=Math.round(I/2)}R.fillStyle=V;if(E[5] instanceof Array){var N=Math.floor(Math.max(0,(E[4][0]-U)*I)),L=Math.ceil(Math.min(P,Math.max(0,(E[4][1]-U)*I))),K=Math.floor(Math.max(0,(E[5][0]-U)*I)),y=Math.ceil(Math.min(P,Math.max(0,(E[5][1]-U)*I)));if(E[4][1]>=U&&E[4][0]<=z&&E[4][2]){this.draw_read(R,M,I,U,z,E[4][0],E[4][2],E[4][3],C)}if(E[5][1]>=U&&E[5][0]<=z&&E[5][2]){this.draw_read(R,M,I,U,z,E[5][0],E[5][2],E[5][3],C)}if(K>L){R.fillStyle=h;p(R,L-O,C+5,K-O,C+5)}}else{R.fillStyle=V;this.draw_read(R,M,I,U,z,Q,E[4],E[5],C)}if(M==="Pack"&&Q>U){R.fillStyle=this.prefs.label_color;var T=1;if(T===0&&D-R.measureText(J).width<0){R.textAlign="left";R.fillText(J,F+l-O,C+8)}else{R.textAlign="right";R.fillText(J,D-l-O,C+8)}R.fillStyle=V}}});x.AlphaGenerator=g;x.SummaryTreePainter=v;x.LinePainter=c;x.LinkedFeaturePainter=r;x.ReadPainter=t;x.VariantPainter=b};(function(d){var c={};var b=function(e){return c[e]};var a=function(f,g){var e={};g(b,e);c[f]=e};a("class",class_module);a("slotting",slotting_module);a("painters",painters_module);a("trackster",trackster_module);for(key in c.trackster){d[key]=c.trackster[key]}})(window);
\ No newline at end of file
--- a/static/scripts/trackster.js Mon Aug 22 16:31:50 2011 -0400
+++ b/static/scripts/trackster.js Tue Aug 23 17:21:37 2011 -0400
@@ -24,7 +24,7 @@
};
/**
- * Find browser's reeuestAnimationFrame method or fallback on a setTimeout
+ * Find browser's requestAnimationFrame method or fallback on a setTimeout
*/
var requestAnimationFrame = (function(){
return window.requestAnimationFrame ||
@@ -35,7 +35,7 @@
function( callback, element ) {
window.setTimeout(callback, 1000 / 60);
};
- })();
+})();
/**
@@ -1197,6 +1197,7 @@
// Name to use for filter when building expression for tool.
this.tool_exp_name = tool_exp_name;
};
+
/**
* Number filters have a min, max as well as a low, high; low and high are used
*/
@@ -1379,7 +1380,9 @@
});
};
- // Create filtering div.
+ //
+ // Create parent div.
+ //
this.parent_div = $("<div/>").addClass("filters").hide();
// Disable dragging, double clicking, keys on div so that actions on slider do not impact viz.
this.parent_div.bind("drag", function(e) {
@@ -1391,12 +1394,17 @@
}).bind("keydown", function(e) {
e.stopPropagation();
});
+
+ //
+ // Create sliders div.
+ //
+ var sliders_div = $("<div/>").addClass("sliders").appendTo(this.parent_div);
var manager = this;
$.each(this.filters, function(index, filter) {
- filter.container = $("<div/>").addClass("slider-row").appendTo(manager.parent_div);
+ filter.container = $("<div/>").addClass("slider-row").appendTo(sliders_div);
// Set up filter label (name, values).
- var filter_label = $("<div/>").addClass("slider-label").appendTo(filter.container)
+ var filter_label = $("<div/>").addClass("elt-label").appendTo(filter.container)
var name_span = $("<span/>").addClass("slider-name").text(filter.name + " ").appendTo(filter_label);
var values_span = $("<span/>");
var values_span_container = $("<span/>").addClass("slider-value").appendTo(filter_label).append("[").append(values_span).append("]");
@@ -1414,6 +1422,7 @@
//
// Always update UI values, but set timeout for doing more--especially drawing--
// so that viz is more responsive.
+ // TODO: remove this because it's no longer necessary as we have requestAnimationFrame().
//
prev_values = ui.values;
values_span.text(ui.values[0] + "-" + ui.values[1]);
@@ -1445,25 +1454,52 @@
});
// Add button to filter complete dataset.
- if (this.filters.length != 0) {
- var run_buttons_row = $("<div>").addClass("param-row").appendTo(this.parent_div);
- var run_on_dataset_button = $("<input type='submit'>").attr("value", "Run on complete dataset").appendTo(run_buttons_row);
+ if (this.filters.length !== 0) {
+ var run_buttons_row = $("<div/>").addClass("param-row").appendTo(sliders_div);
+ var run_on_dataset_button = $("<input type='submit'/>").attr("value", "Run on complete dataset").appendTo(run_buttons_row);
var filter_manager = this;
run_on_dataset_button.click( function() {
filter_manager.run_on_dataset();
});
}
+
+ //
+ // Create filtering display controls.
+ //
+ var
+ display_controls_div = $("<div/>").addClass("display-controls").appendTo(this.parent_div),
+ header_text = $("<span/>").addClass("elt-label").text("Transparency:").appendTo(display_controls_div),
+ alpha_select = $("<select/>").attr("name", "alpha_dropdown").appendTo(display_controls_div);
+
+ // Dropdown for selecting attribute to use for alpha channel manipulation.
+ this.alpha_filter = null;
+ $("<option/>").attr("value", -1).text("== None ==").appendTo(alpha_select);
+ for (var i = 0; i < this.filters.length; i++) {
+ $("<option/>").attr("value", i).text(this.filters[i].name).appendTo(alpha_select);
+ }
+ alpha_select.change(function() {
+ $(this).children("option:selected").each(function() {
+ var filterIndex = parseInt($(this).val());
+ manager.alpha_filter = (filterIndex >= 0 ? manager.filters[filterIndex] : null);
+ manager.track.draw(true, true);
+ })
+ });
+
+ // Clear floating.
+ // Add to clear floating layout.
+ $("<div style='clear: both;'/>").appendTo(this.parent_div);
};
extend(FiltersManager.prototype, {
/**
- * Reset filters to min and max.
+ * Reset filters so that they do not impact track display.
*/
reset_filters: function() {
for (var i = 0; i < this.filters.length; i++) {
filter = this.filters[i];
filter.slider.slider("option", "values", [filter.min, filter.max]);
}
+ this.alpha_filter = null;
},
run_on_dataset: function() {
// Get or create dictionary item.
@@ -1551,6 +1587,24 @@
});
/**
+ * Generates alpha values based on filter and feature's value for filter.
+ */
+var FilterAlphaGenerator = function(filter, default_alpha) {
+ painters.AlphaGenerator.call(this, default_alpha);
+ this.filter = filter;
+};
+
+FilterAlphaGenerator.prototype.gen_alpha = function(feature_data) {
+ // If filter is not initalized yet, return default alpha.
+ if (this.filter.high === Number.MAX_VALUE || this.filter.low === -Number.MAX_VALUE || this.filter.low === this.filter.high) {
+ return this.default_alpha;
+ }
+
+ // Alpha value is ratio of (filter's value compared to low) to (complete filter range).
+ return ( ( parseFloat(feature_data[this.filter.index]) - this.filter.low ) / ( this.filter.high - this.filter.low ) );
+};
+
+/**
* Container for track configuration data.
*/
var TrackConfig = function( options ) {
@@ -1562,7 +1616,7 @@
}
this.onchange = options.onchange
}
-extend( TrackConfig.prototype, {
+extend(TrackConfig.prototype, {
restore_values: function( values ) {
var track_config = this;
$.each( this.params, function( index, param ) {
@@ -2860,7 +2914,7 @@
slots = this.inc_slots[w_scale].slots;
}
- // Filter features
+ // Filter features.
var filtered = [];
if ( result.data ) {
var filters = this.filters_manager.filters;
@@ -2877,14 +2931,15 @@
}
}
if (!hide_feature) {
- filtered.push( feature );
+ filtered.push(feature);
}
}
- }
+ }
- // Create painter, and canvas of sufficient size to contain all features
+ // Create painter, and canvas of sufficient size to contain all features.
+ var filter_alpha_generator = (this.filters_manager.alpha_filter ? new FilterAlphaGenerator(this.filters_manager.alpha_filter) : null);
// HACK: ref_seq will only be defined for ReadTracks, and only the ReadPainter accepts that argument
- var painter = new (this.painter)(filtered, tile_low, tile_high, this.prefs, mode, ref_seq);
+ var painter = new (this.painter)(filtered, tile_low, tile_high, this.prefs, mode, filter_alpha_generator, ref_seq);
var required_height = Math.max(MIN_TRACK_HEIGHT, painter.get_required_height(slots_required));
var canvas = this.view.canvas_manager.new_canvas();
@@ -3213,11 +3268,25 @@
};
/**
+ * Base class for all alpha generators.
+ */
+var AlphaGenerator = function(default_alpha) {
+ this.default_alpha = (default_alpha ? default_alpha : 1);
+};
+
+/**
+ * Base method for generating an alpha channel value; returns default alpha if not implemented.
+ */
+AlphaGenerator.prototype.gen_alpha = function(data) {
+ return this.default_alpha;
+};
+
+/**
* Base class for painters
*
* -- Mode and prefs are both optional
*/
-var Painter = function( data, view_start, view_end, prefs, mode ) {
+var Painter = function(data, view_start, view_end, prefs, mode) {
// Data and data properties
this.data = data;
// View
@@ -3233,13 +3302,13 @@
/**
* SummaryTreePainter, a histogram showing number of intervals in a region
*/
-var SummaryTreePainter = function( data, view_start, view_end, prefs, mode ) {
- Painter.call( this, data, view_start, view_end, prefs, mode );
+var SummaryTreePainter = function(data, view_start, view_end, prefs, mode) {
+ Painter.call(this, data, view_start, view_end, prefs, mode);
}
SummaryTreePainter.prototype.default_prefs = { show_counts: false };
-SummaryTreePainter.prototype.draw = function( ctx, width, height ) {
+SummaryTreePainter.prototype.draw = function(ctx, width, height) {
var view_start = this.view_start,
view_range = this.view_end - this.view_start,
@@ -3276,7 +3345,7 @@
ctx.restore();
}
-var LinePainter = function( data, view_start, view_end, prefs, mode ) {
+var LinePainter = function(data, view_start, view_end, prefs, mode) {
Painter.call( this, data, view_start, view_end, prefs, mode );
if ( this.prefs.min_value === undefined ) {
var min_value = Infinity;
@@ -3296,7 +3365,7 @@
LinePainter.prototype.default_prefs = { min_value: undefined, max_value: undefined, mode: "Histogram", color: "#000", overflow_color: "#F66" };
-LinePainter.prototype.draw = function( ctx, width, height ) {
+LinePainter.prototype.draw = function(ctx, width, height) {
var
in_path = false,
min_value = this.prefs.min_value,
@@ -3406,14 +3475,14 @@
/**
* Abstract object for painting feature tracks. Subclasses must implement draw_element() for painting to work.
*/
-var FeaturePainter = function(data, view_start, view_end, prefs, mode) {
+var FeaturePainter = function(data, view_start, view_end, prefs, mode, alpha_generator) {
Painter.call(this, data, view_start, view_end, prefs, mode);
+ this.alpha_generator = (alpha_generator ? alpha_generator : new AlphaGenerator());
}
FeaturePainter.prototype.default_prefs = { block_color: "#FFF", connector_color: "#FFF" };
-extend(FeaturePainter.prototype, {
-
+extend(FeaturePainter.prototype, {
get_required_height: function(rows_required) {
// y_scale is the height per row
var required_height = y_scale = this.get_row_height(), mode = this.mode;
@@ -3479,9 +3548,9 @@
LABEL_SPACING = 2,
CONNECTOR_COLOR = "#ccc";
-var LinkedFeaturePainter = function(data, view_start, view_end, prefs, mode) {
- FeaturePainter.call(this, data, view_start, view_end, prefs, mode);
-}
+var LinkedFeaturePainter = function(data, view_start, view_end, prefs, mode, alpha_generator) {
+ FeaturePainter.call(this, data, view_start, view_end, prefs, mode, alpha_generator);
+};
extend(LinkedFeaturePainter.prototype, FeaturePainter.prototype, {
@@ -3518,18 +3587,15 @@
f_end = Math.ceil( Math.min(width, Math.max(0, (feature_end - tile_low) * w_scale)) ),
y_center = (mode === "Dense" ? 0 : (0 + slot)) * y_scale,
thickness, y_start, thick_start = null, thick_end = null,
+ // TODO: is there any reason why block, label color cannot be set at the Painter level?
block_color = this.prefs.block_color,
label_color = this.prefs.label_color;
+
+ // Set global alpha.
+ ctx.globalAlpha = this.alpha_generator.gen_alpha(feature);
- // Dense mode displays the same for all data.
- /*
- if (mode === "Dense") {
- ctx.fillStyle = block_color;
- ctx.fillRect(f_start, y_center, f_end - f_start, DENSE_FEATURE_HEIGHT);
- }
- */
-
- if ( mode == "Dense" ) {
+ // In dense mode, put all data in top slot.
+ if (mode == "Dense") {
slot = 1;
}
@@ -3626,8 +3692,7 @@
if (thick_start !== undefined && feature_te > feature_ts && !(block_start > thick_end || block_end < thick_start) ) {
var block_thick_start = Math.max(block_start, thick_start),
block_thick_end = Math.min(block_end, thick_end);
- ctx.fillRect(block_thick_start, y_center + 1,
- block_thick_end - block_thick_start, thick_height);
+ ctx.fillRect(block_thick_start, y_center + 1, block_thick_end - block_thick_start, thick_height);
if ( feature_blocks.length == 1 && mode == "Pack") {
// Exactly one block means we have no introns, but do have a distinct "thick" region,
// draw arrows over it if in pack mode
@@ -3658,15 +3723,18 @@
ctx.textAlign = "right";
ctx.fillText(feature_name, f_start - LABEL_SPACING, y_center + 8);
}
- ctx.fillStyle = block_color;
+ //ctx.fillStyle = block_color;
}
}
+
+ // Reset global alpha.
+ ctx.globalAlpha = 1;
}
});
-var VariantPainter = function(data, view_start, view_end, prefs, mode) {
- FeaturePainter.call(this, data, view_start, view_end, prefs, mode);
+var VariantPainter = function(data, view_start, view_end, prefs, mode, alpha_generator) {
+ FeaturePainter.call(this, data, view_start, view_end, prefs, mode, alpha_generator);
}
extend(VariantPainter.prototype, FeaturePainter.prototype, {
@@ -3720,8 +3788,8 @@
}
});
-var ReadPainter = function(data, view_start, view_end, prefs, mode, ref_seq) {
- FeaturePainter.call(this, data, view_start, view_end, prefs, mode);
+var ReadPainter = function(data, view_start, view_end, prefs, mode, alpha_generator, ref_seq) {
+ FeaturePainter.call(this, data, view_start, view_end, prefs, mode, alpha_generator);
this.ref_seq = ref_seq;
};
@@ -4007,6 +4075,7 @@
}
});
+exports.AlphaGenerator = AlphaGenerator;
exports.SummaryTreePainter = SummaryTreePainter;
exports.LinePainter = LinePainter;
exports.LinkedFeaturePainter = LinkedFeaturePainter;
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Add the ability to switch between tool shed repository revsions when viewing tool metadata.
by Bitbucket 22 Aug '11
by Bitbucket 22 Aug '11
22 Aug '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/b1f22f337651/
changeset: b1f22f337651
user: greg
date: 2011-08-22 22:31:50
summary: Add the ability to switch between tool shed repository revsions when viewing tool metadata.
affected #: 3 files (1.5 KB)
--- a/lib/galaxy/webapps/community/controllers/repository.py Mon Aug 22 16:19:49 2011 -0400
+++ b/lib/galaxy/webapps/community/controllers/repository.py Mon Aug 22 16:31:50 2011 -0400
@@ -1157,12 +1157,17 @@
tool = None
break
is_malicious = change_set_is_malicious( trans, repository_id, repository.tip )
+ changeset_revision_select_field = build_changeset_revision_select_field( trans,
+ repository,
+ selected_value=changeset_revision,
+ add_id_to_name=False )
return trans.fill_template( "/webapps/community/repository/view_tool_metadata.mako",
repository=repository,
tool=tool,
metadata=metadata,
changeset_revision=changeset_revision,
revision_label=revision_label,
+ changeset_revision_select_field=changeset_revision_select_field,
is_malicious=is_malicious,
message=message,
status=status )
--- a/templates/webapps/community/repository/manage_repository.mako Mon Aug 22 16:19:49 2011 -0400
+++ b/templates/webapps/community/repository/manage_repository.mako Mon Aug 22 16:31:50 2011 -0400
@@ -19,7 +19,7 @@
browse_label = 'Browse or delete repository files'
else:
browse_label = 'Browse repository files'
- can_set_malicious = metadata and can_set_metadata and is_admin
+ can_set_malicious = metadata and can_set_metadata and is_admin and changeset_revision == repository.tip
%><%!
--- a/templates/webapps/community/repository/view_tool_metadata.mako Mon Aug 22 16:19:49 2011 -0400
+++ b/templates/webapps/community/repository/view_tool_metadata.mako Mon Aug 22 16:31:50 2011 -0400
@@ -71,14 +71,31 @@
<div class="toolForm"><div class="toolFormTitle">Repository revision</div><div class="toolFormBody">
- <div class="form-row">
- <label>Revision:</label>
- %if can_view_change_log:
- <a href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">${revision_label}</a>
- %else:
- ${revision_label}
- %endif
- </div>
+ %if len( changeset_revision_select_field.options ) > 1:
+ <form name="change_revision" id="change_revision" action="${h.url_for( controller='repository', action='view_tool_metadata', repository_id=trans.security.encode_id( repository.id ), tool_id=metadata[ 'id' ] )}" method="post" >
+ <div class="form-row">
+ <%
+ if changeset_revision == repository.tip:
+ tip_str = 'repository tip'
+ else:
+ tip_str = ''
+ %>
+ ${changeset_revision_select_field.get_html()} <i>${tip_str}</i>
+ <div class="toolParamHelp" style="clear: both;">
+ Select a revision to inspect and download versions of tools from this repository.
+ </div>
+ </div>
+ </form>
+ %else:
+ <div class="form-row">
+ <label>Revision:</label>
+ %if can_view_change_log:
+ <a href="${h.url_for( controller='repository', action='view_changelog', id=trans.app.security.encode_id( repository.id ) )}">${revision_label}</a>
+ %else:
+ ${revision_label}
+ %endif
+ </div>
+ %endif
</div></div><p/>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: natefoo: Decrease user disk usage when files are removed from disk by the cleanup_datasets.py.
by Bitbucket 22 Aug '11
by Bitbucket 22 Aug '11
22 Aug '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/126c7f11415b/
changeset: 126c7f11415b
user: natefoo
date: 2011-08-22 22:19:49
summary: Decrease user disk usage when files are removed from disk by the cleanup_datasets.py.
affected #: 1 file (473 bytes)
--- a/scripts/cleanup_datasets/cleanup_datasets.py Mon Aug 22 16:07:23 2011 -0400
+++ b/scripts/cleanup_datasets/cleanup_datasets.py Mon Aug 22 16:19:49 2011 -0400
@@ -453,6 +453,13 @@
# Remove associated extra files from disk if they exist
if dataset.extra_files_path and os.path.exists( dataset.extra_files_path ):
shutil.rmtree( dataset.extra_files_path ) #we need to delete the directory and its contents; os.unlink would always fail on a directory
+ usage_users = []
+ for hda in dataset.history_associations:
+ if not hda.purged and hda.history.user is not None and hda.history.user not in usage_users:
+ usage_users.append( hda.history.user )
+ for user in usage_users:
+ user.total_disk_usage -= dataset.total_size
+ app.sa_session.add( user )
print "Purging dataset id", dataset.id
dataset.purged = True
app.sa_session.add( dataset )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
22 Aug '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/77b20b28d89c/
changeset: 77b20b28d89c
user: dan
date: 2011-08-22 22:07:23
summary: Allow FASTQ Groomer tool to work on Color Space files that contain a fake/dummy quality score for the adapter base (e.g. files obtained from the SRA). The Groomer will remove the dummy/fake quality score from the read.
affected #: 4 files (1.6 KB)
--- a/lib/galaxy_utils/sequence/fastq.py Mon Aug 22 14:58:51 2011 -0400
+++ b/lib/galaxy_utils/sequence/fastq.py Mon Aug 22 16:07:23 2011 -0400
@@ -153,6 +153,8 @@
rval.quality = reversed( rval.get_decimal_quality_scores() )
rval.quality = "%s " % " ".join( map( str, rval.quality ) )
return rval
+ def apply_galaxy_conventions( self ):
+ pass
class fastqSangerRead( fastqSequencingRead ):
format = 'sanger'
@@ -206,7 +208,7 @@
if self.has_adapter_base():
qual_len = len( self.get_ascii_quality_scores() )
seq_len = len( self.sequence )
- assert qual_len + 1 == seq_len, "Invalid FASTQ file: quality score length (%i) does not match sequence length (%i with adapter base)" % ( qual_len, seq_len )
+ assert ( qual_len + 1 == seq_len ) or ( qual_len == seq_len ), "Invalid FASTQ file: quality score length (%i) does not match sequence length (%i with adapter base)" % ( qual_len, seq_len ) #SRA adds FAKE/DUMMY quality scores to the adapter base, we'll allow the reading of the Improper score here, but remove it in the Reader when "apply_galaxy_conventions" is set to True
else:
return fastqSequencingRead.assert_sequence_quality_lengths( self )
def get_sequence( self ):
@@ -262,7 +264,12 @@
elif new_adapter:
rval.sequence = "%s%s" % ( new_adapter, rval.sequence )
return rval
-
+ def apply_galaxy_conventions( self ):
+ if self.has_adapter_base() and len( self.sequence ) == len( self.get_ascii_quality_scores() ): #SRA adds FAKE/DUMMY quality scores to the adapter base, we remove them here
+ if self.is_ascii_encoded():
+ self.quality = self.quality[1:]
+ else:
+ self.quality = " ".join( map( str, self.get_decimal_quality_scores()[1:] ) )
FASTQ_FORMATS = {}
for format in [ fastqIlluminaRead, fastqSolexaRead, fastqSangerRead, fastqCSSangerRead ]:
@@ -417,9 +424,10 @@
return column_stats
class fastqReader( object ):
- def __init__( self, fh, format = 'sanger' ):
+ def __init__( self, fh, format = 'sanger', apply_galaxy_conventions = False ):
self.file = fh
self.format = format
+ self.apply_galaxy_conventions = apply_galaxy_conventions
def close( self ):
return self.file.close()
def next(self):
@@ -450,6 +458,8 @@
break
rval.append_quality( line )
rval.assert_sequence_quality_lengths()
+ if self.apply_galaxy_conventions:
+ rval.apply_galaxy_conventions()
return rval
def __iter__( self ):
while True:
@@ -494,13 +504,14 @@
raise e
class fastqNamedReader( object ):
- def __init__( self, fh, format = 'sanger' ):
+ def __init__( self, fh, format = 'sanger', apply_galaxy_conventions = False ):
self.file = fh
self.format = format
self.reader = fastqReader( self.file, self.format )
#self.last_offset = self.file.tell()
self.offset_dict = {}
self.eof = False
+ self.apply_galaxy_conventions = apply_galaxy_conventions
def close( self ):
return self.file.close()
def get( self, sequence_id ):
@@ -531,6 +542,8 @@
if fastq_read.identifier not in self.offset_dict:
self.offset_dict[ fastq_read.identifier ] = []
self.offset_dict[ fastq_read.identifier ].append( offset )
+ if rval is not None and self.apply_galaxy_conventions:
+ rval.apply_galaxy_conventions()
return rval
def has_data( self ):
#returns a string representation of remaining data, or empty string (False) if no data remaining
--- a/tools/fastq/fastq_groomer.py Mon Aug 22 14:58:51 2011 -0400
+++ b/tools/fastq/fastq_groomer.py Mon Aug 22 16:07:23 2011 -0400
@@ -19,7 +19,7 @@
reader = fastqVerboseErrorReader
else:
reader = fastqReader
- for read_count, fastq_read in enumerate( reader( open( input_filename ), format = input_type ) ):
+ for read_count, fastq_read in enumerate( reader( open( input_filename ), format = input_type, apply_galaxy_conventions = True ) ):
if summarize_input:
aggregator.consume_read( fastq_read )
out.write( fastq_read )
--- a/tools/fastq/fastq_groomer.xml Mon Aug 22 14:58:51 2011 -0400
+++ b/tools/fastq/fastq_groomer.xml Mon Aug 22 16:07:23 2011 -0400
@@ -1,4 +1,4 @@
-<tool id="fastq_groomer" name="FASTQ Groomer" version="1.0.3">
+<tool id="fastq_groomer" name="FASTQ Groomer" version="1.0.4"><description>convert between various FASTQ quality formats</description><command interpreter="python">fastq_groomer.py '$input_file' '$input_type' '$output_file'
#if str( $options_type['options_type_selector'] ) == 'basic':
@@ -240,6 +240,15 @@
<param name="summarize_input" value="summarize_input" /><output name="output_file" file="sanger_full_range_as_solexa.fastqsolexa" /></test>
+ <test>
+ <param name="input_file" value="sanger_full_range_as_cssanger_adapter_base_with_quality_score.fastqcssanger_fake_score" ftype="fastq" />
+ <param name="input_type" value="cssanger" />
+ <param name="options_type_selector" value="advanced" />
+ <param name="output_type" value="cssanger" />
+ <param name="force_quality_encoding" value="None" />
+ <param name="summarize_input" value="summarize_input" />
+ <output name="output_file" file="sanger_full_range_as_cssanger.fastqcssanger" />
+ </test><!-- Test fastq with line wrapping --><test><param name="input_file" value="wrapping_original_sanger.fastqsanger" ftype="fastq" />
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/a82d009cb8ee/
changeset: a82d009cb8ee
user: dan
date: 2011-08-22 20:58:51
summary: Add FIMO to tool_conf.xml.sample.
affected #: 1 file (33 bytes)
--- a/tool_conf.xml.sample Mon Aug 22 14:52:11 2011 -0400
+++ b/tool_conf.xml.sample Mon Aug 22 14:58:51 2011 -0400
@@ -208,6 +208,7 @@
</section><section name="Motif Tools" id="motifs"><tool file="meme/meme.xml"/>
+ <tool file="meme/fimo.xml"/><tool file="rgenetics/rgWebLogo3.xml" /></section><section name="Multiple Alignments" id="clustal">
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/00c1fa7a0c28/
changeset: 00c1fa7a0c28
user: dan
date: 2011-08-22 20:52:11
summary: Add FIMO tool from MEME suite.
affected #: 12 files (710 bytes)
Diff too large to display.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
22 Aug '11
1 new changeset in galaxy-central:
http://bitbucket.org/galaxy/galaxy-central/changeset/94688ff06248/
changeset: 94688ff06248
user: natefoo
date: 2011-08-22 20:47:10
summary: Fix FTP upload when uploading only a single file and its name contains a comma. util.listify assumes that a string with commas should be split into a list, so don't use listify for this value. Thanks Ilya Chorny.
affected #: 1 file (84 bytes)
--- a/lib/galaxy/tools/parameters/basic.py Mon Aug 22 14:03:57 2011 -0400
+++ b/lib/galaxy/tools/parameters/basic.py Mon Aug 22 14:47:10 2011 -0400
@@ -454,7 +454,11 @@
user_ftp_dir = os.path.join( trans.app.config.ftp_upload_dir, trans.user.email )
return form_builder.FTPFileField( self.name, user_ftp_dir, trans.app.config.ftp_upload_site, value = value )
def from_html( self, value, trans=None, other_values={} ):
- return util.listify( value )
+ try:
+ assert type( value ) is list
+ except:
+ value = [ value ]
+ return value
def to_string( self, value, app ):
if value in [ None, '' ]:
return None
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0