galaxy-dev
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- 10008 discussions

11 Feb '10
details: http://www.bx.psu.edu/hg/galaxy/rev/29ece93d429c
changeset: 3371:29ece93d429c
user: Kanwei Li <kanwei(a)gmail.com>
date: Wed Feb 10 18:25:32 2010 -0500
description:
- Fix Safari crashing bug for async in-place editing
- Refactor galaxy.base.js
- Escape history name in renaming template
diffstat:
static/scripts/galaxy.base.js | 290 +++++++++++++++-----------------
static/scripts/packed/galaxy.base.js | 2 +-
static/scripts/packed/galaxy.panels.js | 2 +-
static/scripts/packed/trackster.js | 2 +-
templates/history/rename.mako | 5 +-
5 files changed, 145 insertions(+), 156 deletions(-)
diffs (452 lines):
diff -r 6dff2f938898 -r 29ece93d429c static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js Wed Feb 10 16:02:11 2010 -0500
+++ b/static/scripts/galaxy.base.js Wed Feb 10 18:25:32 2010 -0500
@@ -12,53 +12,11 @@
el.remove().appendTo("body");
}
});
-}
-
-$(document).ready( function() {
- // Links with confirmation
- $( "a[confirm]" ).click( function() {
- return confirm( $(this).attr( "confirm" ) )
- });
- // Tooltips
- if ( $.fn.tipsy ) {
- $(".tooltip").tipsy( { gravity: 's' } );
- }
- // Make popup menus.
- make_popup_menus();
-});
-
-function make_popup_menus()
-{
- jQuery( "div[popupmenu]" ).each( function() {
- var options = {};
- $(this).find( "a" ).each( function() {
- var confirmtext = $(this).attr( "confirm" ),
- href = $(this).attr( "href" ),
- target = $(this).attr( "target" );
- options[ $(this).text() ] = function() {
- if ( !confirmtext || confirm( confirmtext ) ) {
- var f = window;
- if ( target == "_parent" ) {
- f = window.parent;
- }
- else if
- ( target == "_top" ) {
- f = window.top;
- }
- f.location = href;
- }
- };
- });
- var b = $( "#" + $(this).attr( 'popupmenu' ) );
- make_popupmenu( b, options );
- $(this).remove();
- b.addClass( "popup" ).show();
- });
-}
+};
function ensure_popup_helper() {
// And the helper below the popup menus
- if ( $( "#popup-helper" ).length == 0 ) {
+ if ( $( "#popup-helper" ).length === 0 ) {
$( "<div id='popup-helper'/>" ).css( {
background: 'white', opacity: 0, zIndex: 15000,
position: 'absolute', top: 0, left: 0, width: '100%', height: '100%'
@@ -66,13 +24,41 @@
}
}
+function attach_popupmenu( button_element, wrapper ) {
+ var clean = function() {
+ wrapper.unbind().hide();
+ $("#popup-helper").unbind( "click.popupmenu" ).hide();
+ // $(document).unbind( "click.popupmenu" );
+ };
+ var click = function( e ) {
+ // var o = $(button_element).offset();
+ $("#popup-helper").bind( "click.popupmenu", clean ).show();
+ // $(document).bind( "click.popupmenu", clean );
+ // Show off screen to get size right
+ wrapper.click( clean ).css( { left: 0, top: -1000 } ).show();
+ // console.log( e.pageX, $(document).scrollLeft() + $(window).width(), $(menu_element).width() );
+ var x = e.pageX - wrapper.width() / 2 ;
+ x = Math.min( x, $(document).scrollLeft() + $(window).width() - $(wrapper).width() - 20 );
+ x = Math.max( x, $(document).scrollLeft() + 20 );
+ // console.log( e.pageX, $(document).scrollLeft() + $(window).width(), $(menu_element).width() );
+
+
+ wrapper.css( {
+ top: e.pageY - 5,
+ left: x
+ } );
+ return false;
+ };
+ $( button_element ).click( click );
+}
+
function make_popupmenu( button_element, options ) {
ensure_popup_helper();
- var container_element = $(button_element);
+ // var container_element = $(button_element);
// if ( container_element.parent().hasClass( "combo-button" ) ) {
// container_element = container_element.parent();
// }
- // ontainer_element).css( "position", "relative" );
+ // container_element).css( "position", "relative" );
var menu_element = $( "<ul id='" + button_element.attr('id') + "-menu'></ul>" );
$.each( options, function( k, v ) {
if ( v ) {
@@ -88,96 +74,90 @@
.appendTo( "body" )
.hide();
attach_popupmenu( button_element, wrapper );
-};
+}
-function attach_popupmenu( button_element, wrapper ) {
- var clean = function() {
- wrapper.unbind().hide();
- $("#popup-helper").unbind( "click.popupmenu" ).hide();
- // $(document).unbind( "click.popupmenu" );
- };
- var click = function( e ) {
- var o = $(button_element).offset();
- $("#popup-helper").bind( "click.popupmenu", clean ).show();
- // $(document).bind( "click.popupmenu", clean );
- // Show off screen to get size right
- wrapper.click( clean ).css( { left: 0, top: -1000 } ).show();
- // console.log( e.pageX, $(document).scrollLeft() + $(window).width(), $(menu_element).width() );
- var x = e.pageX - wrapper.width() / 2
- x = Math.min( x, $(document).scrollLeft() + $(window).width() - $(wrapper).width() - 20 );
- x = Math.max( x, $(document).scrollLeft() + 20 );
- // console.log( e.pageX, $(document).scrollLeft() + $(window).width(), $(menu_element).width() );
-
-
- wrapper.css( {
- top: e.pageY - 5,
- left: x
- } );
- return false;
- };
- $( button_element ).click( click );
-};
+function make_popup_menus() {
+ jQuery( "div[popupmenu]" ).each( function() {
+ var options = {};
+ $(this).find( "a" ).each( function() {
+ var confirmtext = $(this).attr( "confirm" ),
+ href = $(this).attr( "href" ),
+ target = $(this).attr( "target" );
+ options[ $(this).text() ] = function() {
+ if ( !confirmtext || confirm( confirmtext ) ) {
+ var f = window;
+ if ( target == "_parent" ) {
+ f = window.parent;
+ } else if ( target == "_top" ) {
+ f = window.top;
+ }
+ f.location = href;
+ }
+ };
+ });
+ var b = $( "#" + $(this).attr( 'popupmenu' ) );
+ make_popupmenu( b, options );
+ $(this).remove();
+ b.addClass( "popup" ).show();
+ });
+}
// Returns the number of keys (elements) in an array/dictionary.
-var array_length = function(an_array)
-{
- if (an_array.length)
+function array_length(an_array) {
+ if (an_array.length) {
return an_array.length;
+ }
var count = 0;
- for (element in an_array)
+ for (var element in an_array) {
count++;
+ }
return count;
-};
+}
-//
// Replace dbkey select box with text input box & autocomplete.
-//
-var replace_dbkey_select = function()
-{
+function replace_dbkey_select() {
var select_elt = $('select[name=dbkey]');
var start_value = select_elt.attr('value');
- if (select_elt.length != 0)
- {
- //
+ if (select_elt.length !== 0) {
// Set up text input + autocomplete element.
- //
var text_input_elt = $("<input id='dbkey-input' type='text'></input>");
text_input_elt.attr('size', 40);
text_input_elt.attr('name', select_elt.attr('name'));
- text_input_elt.click( function()
- {
- // Show all. Also provide note that load is happening since this can be slow.
- var cur_value = $(this).attr('value');
- $(this).attr('value', 'Loading...');
- $(this).showAllInCache();
- $(this).attr('value', cur_value);
- $(this).select();
+ text_input_elt.click( function() {
+ // Show all. Also provide note that load is happening since this can be slow.
+ var cur_value = $(this).attr('value');
+ $(this).attr('value', 'Loading...');
+ $(this).showAllInCache();
+ $(this).attr('value', cur_value);
+ $(this).select();
});
// Get options for dbkey for autocomplete.
- var dbkey_options = new Array();
- var dbkey_mapping = new Object();
- select_elt.children('option').each( function()
- {
+ var dbkey_options = [];
+ var dbkey_mapping = {};
+ select_elt.children('option').each( function() {
// Get text, value for option.
var text = $(this).text();
var value = $(this).attr('value');
// Ignore values that are '?'
- if (value == '?')
+ if (value == '?') {
return;
+ }
// Set options and mapping.
dbkey_options.push( text );
dbkey_mapping[ text ] = value;
// If this is the start value, set value of input element.
- if ( value == start_value )
+ if ( value == start_value ) {
text_input_elt.attr('value', text);
+ }
});
- if ( text_input_elt.attr('value') == '' )
+ if ( text_input_elt.attr('value') == '' ) {
text_input_elt.attr('value', 'Click to Search or Select Build');
+ }
// Do autocomplete.
var autocomplete_options = { selectFirst: false, autoFill: false, mustMatch: false, matchContains: true, max: 1000, minChars : 0, hideForLessThanMinChars : false };
@@ -186,70 +166,70 @@
// Replace select with text input.
select_elt.replaceWith(text_input_elt);
- //
// When form is submitted, change the text entered into the input to the corresponding value. If text doesn't correspond to value, remove it.
- //
- $('form').submit( function()
- {
+ $('form').submit( function() {
var dbkey_text_input = $('#dbkey-input');
- if (dbkey_text_input.length != 0)
- {
+ if (dbkey_text_input.length !== 0) {
// Try to convert text to value.
var cur_value = dbkey_text_input.attr('value');
var new_value = dbkey_mapping[cur_value];
- if (new_value != null && new_value != undefined)
+ if (new_value !== null && new_value !== undefined) {
dbkey_text_input.attr('value', new_value);
- else
- {
+ } else {
// If there is a non-empty start value, use that; otherwise unknown.
- if (start_value != "")
+ if (start_value != "") {
dbkey_text_input.attr('value', start_value);
- else
+ } else {
dbkey_text_input.attr('value', '?');
+ }
}
}
});
}
-} // end replace_dbkey_select()
+}
-//
// Edit and save text asynchronously.
-//
-function async_save_text(click_to_edit_elt, text_elt_id, save_url, text_parm_name, num_cols, use_textarea, num_rows, on_start, on_finish)
-{
+function async_save_text(click_to_edit_elt, text_elt_id, save_url, text_parm_name, num_cols, use_textarea, num_rows, on_start, on_finish) {
// Set defaults if necessary.
- if (num_cols == null)
+ if (num_cols === undefined) {
num_cols = 30;
- if (num_rows == null)
- num_rows = 4
+ }
+ if (num_rows === undefined) {
+ num_rows = 4;
+ }
// Set up input element.
- $("#" + click_to_edit_elt).click( function() {
- var old_text = $("#" + text_elt_id).text()
- if (use_textarea)
- var t = $("<textarea rows='" + num_rows + "' cols='" + num_cols + "'>" + old_text + "</textarea>" );
- else
- var t = $("<input type='text' value='" + old_text + "' size='" + num_cols + "'></input>" );
+ $("#" + click_to_edit_elt).live( "click", function() {
+ // Check if this is already active
+ if ( $("#renaming-active").length > 0) {
+ return;
+ }
+ var text_elt = $("#" + text_elt_id),
+ old_text = text_elt.text(),
+ t;
+
+ if (use_textarea) {
+ t = $("<textarea></textarea>").attr({ rows: num_rows, cols: num_cols }).text( old_text );
+ } else {
+ t = $("<input type='text'></input>").attr({ value: old_text, size: num_cols });
+ }
+ t.attr("id", "renaming-active");
t.blur( function() {
$(this).remove();
- $("#" + text_elt_id).show();
- if (has_tooltip)
- tooltip_elt.addClass("tooltip");
- if (on_finish != null)
+ text_elt.show();
+ if (on_finish) {
on_finish(t);
+ }
});
- var has_tooltip = $(this).hasClass("tooltip");
- var tooltip_elt = $(this);
t.keyup( function( e ) {
- if ( e.keyCode == 27 ) {
+ if ( e.keyCode === 27 ) {
// Escape key
$(this).trigger( "blur" );
- } else if ( e.keyCode == 13 ) {
- // Enter key
- new_text = this.value;
+ } else if ( e.keyCode === 13 ) {
+ // Enter key submits
+ var ajax_data = {};
+ ajax_data[text_parm_name] = $(this).val();
$(this).trigger( "blur" );
- var ajax_data = new Object();
- ajax_data[text_parm_name] = new_text;
$.ajax({
url: save_url,
data: ajax_data,
@@ -259,27 +239,37 @@
},
success: function(processed_text) {
// Set new text and call finish method.
- $("#" + text_elt_id).text( processed_text );
- if (on_finish != null)
+ text_elt.text( processed_text );
+ if (on_finish) {
on_finish(t);
+ }
}
});
}
});
- // Call onstart method if it exists.
- if (on_start != null)
+ if (on_start) {
on_start(t);
-
+ }
// Replace text with input object and focus & select.
- $("#" + text_elt_id).hide();
- t.insertAfter( $("#" + text_elt_id) );
+ text_elt.hide();
+ t.insertAfter( text_elt );
t.focus();
t.select();
- // Remove tooltip so that it doesn't show during editing.
- $(this).removeClass("tooltip");
- return false;
+ return;
});
-
}
+
+$(document).ready( function() {
+ // Links with confirmation
+ $( "a[confirm]" ).click( function() {
+ return confirm( $(this).attr("confirm") );
+ });
+ // Tooltips
+ if ( $.fn.tipsy ) {
+ $(".tooltip").tipsy( { gravity: 's' } );
+ }
+ // Make popup menus.
+ make_popup_menus();
+});
diff -r 6dff2f938898 -r 29ece93d429c static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js Wed Feb 10 16:02:11 2010 -0500
+++ b/static/scripts/packed/galaxy.base.js Wed Feb 10 18:25:32 2010 -0500
@@ -1,1 +1,1 @@
-$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function ensure_popup_helper(){if($("#popup-helper").length==0){$("<div id='popup-helper'/>").css({background:"white",opacity:0
,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function make_popupmenu(d,c){ensure_popup_helper();var a=$(d);var b=$("<ul id='"+d.attr("id")+"-menu'></ul>");$.each(c,function(g,f){if(f){$("<li/>").html(g).click(f).appendTo(b)}else{$("<li class='head'/>").html(g).appendTo(b)}});var e=$("<div class='popmenu-wrapper'>");e.append(b).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(d,e)}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){var h=$(b).offset();$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}var array_length=function(a){if(a.length){
return a.length}var b=0;for(element in a){b++}return b};var replace_dbkey_select=function(){var c=$("select[name=dbkey]");var d=c.attr("value");if(c.length!=0){var e=$("<input id='dbkey-input' type='text'></input>");e.attr("size",40);e.attr("name",c.attr("name"));e.click(function(){var g=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",g);$(this).select()});var b=new Array();var a=new Object();c.children("option").each(function(){var h=$(this).text();var g=$(this).attr("value");if(g=="?"){return}b.push(h);a[h]=g;if(g==d){e.attr("value",h)}});if(e.attr("value")==""){e.attr("value","Click to Search or Select Build")}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};e.autocomplete(b,f);c.replaceWith(e);$("form").submit(function(){var i=$("#dbkey-input");if(i.length!=0){var h=i.attr("value");var g=a[h];if(g!=null&&g!=undefined){i.attr("value",g)}else{
if(d!=""){i.attr("value",d)}else{i.attr("value","?")}}}})}};function async_save_text(d,f,e,a,c,h,i,g,b){if(c==null){c=30}if(i==null){i=4}$("#"+d).click(function(){var l=$("#"+f).text();if(h){var j=$("<textarea rows='"+i+"' cols='"+c+"'>"+l+"</textarea>")}else{var j=$("<input type='text' value='"+l+"' size='"+c+"'></input>")}j.blur(function(){$(this).remove();$("#"+f).show();if(m){k.addClass("tooltip")}if(b!=null){b(j)}});var m=$(this).hasClass("tooltip");var k=$(this);j.keyup(function(o){if(o.keyCode==27){$(this).trigger("blur")}else{if(o.keyCode==13){new_text=this.value;$(this).trigger("blur");var n=new Object();n[a]=new_text;$.ajax({url:e,data:n,error:function(){alert("Text editing for elt "+f+" failed")},success:function(p){$("#"+f).text(p);if(b!=null){b(j)}}})}}});if(g!=null){g(j)}$("#"+f).hide();j.insertAfter($("#"+f));j.focus();j.select();$(this).removeClass("tooltip");return false})};
\ No newline at end of file
+$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmenu(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")
+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function replace_dbkey_select(){var c=$("select[name=dbkey]");var d=c.attr("value");if(c.length!==0){var e=$("<input id='dbkey-input' type='text'></input>")
;e.attr("size",40);e.attr("name",c.attr("name"));e.click(function(){var g=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",g);$(this).select()});var b=[];var a={};c.children("option").each(function(){var h=$(this).text();var g=$(this).attr("value");if(g=="?"){return}b.push(h);a[h]=g;if(g==d){e.attr("value",h)}});if(e.attr("value")==""){e.attr("value","Click to Search or Select Build")}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};e.autocomplete(b,f);c.replaceWith(e);$("form").submit(function(){var i=$("#dbkey-input");if(i.length!==0){var h=i.attr("value");var g=a[h];if(g!==null&&g!==undefined){i.attr("value",g)}else{if(d!=""){i.attr("value",d)}else{i.attr("value","?")}}}})}}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$(
"#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
\ No newline at end of file
diff -r 6dff2f938898 -r 29ece93d429c static/scripts/packed/galaxy.panels.js
--- a/static/scripts/packed/galaxy.panels.js Wed Feb 10 16:02:11 2010 -0500
+++ b/static/scripts/packed/galaxy.panels.js Wed Feb 10 18:25:32 2010 -0500
@@ -1,1 +1,1 @@
-function ensure_dd_helper(){if($("#DD-helper").length==0){$("<div id='DD-helper'/>").css({background:"white",opacity:0,zIndex:9000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function make_left_panel(h,c,e){var g=false;var f=null;var d=function(i){var j=i;if(i<0){i=0}$(h).css("width",i);$(e).css("left",j);$(c).css("left",i+7);if(document.recalc){document.recalc()}};var a=function(){if(g){$(e).removeClass("hover");$(e).animate({left:f},"fast");$(h).css("left",-f).show().animate({left:0},"fast",function(){d(f);$(e).removeClass("hidden")});g=false}else{f=$(e).position().left;$(c).css("left",$(e).innerWidth());if(document.recalc){document.recalc()}$(e).removeClass("hover");$(h).animate({left:-f},"fast");$(e).animate({left:-1},"fast",function(){$(this).addClass("hidden")});g=true}};$(e).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).bind("dragstart",function(i){$("#DD-helper").show()}).bind("dragend
",function(i){$("#DD-helper").hide()}).bind("drag",function(i){x=i.offsetX;x=Math.min(400,Math.max(100,x));if(g){$(h).css("left",0);$(e).removeClass("hidden");g=false}d(x)}).bind("dragclickonly",function(i){a()}).find("div").show();var b=function(i){if((g&&i=="show")||(!g&&i=="hide")){a()}};return{force_panel:b}}function make_right_panel(a,e,h){var j=false;var g=false;var c=null;var d=function(k){$(a).css("width",k);$(e).css("right",k+9);$(h).css("right",k).css("left","");if(document.recalc){document.recalc()}};var i=function(){if(j){$(h).removeClass("hover");$(h).animate({right:c},"fast");$(a).css("right",-c).show().animate({right:0},"fast",function(){d(c);$(h).removeClass("hidden")});j=false}else{c=$(document).width()-$(h).position().left-$(h).outerWidth();$(e).css("right",$(h).innerWidth()+1);if(document.recalc){document.recalc()}$(h).removeClass("hover");$(a).animate({right:-c},"fast");$(h).animate({right:-1},"fast",function(){$(this).addClass("hidden")});j=true}g=false}
;var b=function(k){var l=$(e).width()-(j?c:0);if(l<k){if(!j){i();g=true}}else{if(g){i();g=false}}};$(h).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).bind("dragstart",function(k){$("#DD-helper").show()}).bind("dragend",function(k){$("#DD-helper").hide()}).bind("drag",function(k){x=k.offsetX;w=$(window).width();x=Math.min(w-100,x);x=Math.max(w-400,x);if(j){$(a).css("right",0);$(h).removeClass("hidden");j=false}d(w-x-$(this).outerWidth())}).bind("dragclickonly",function(k){i()}).find("div").show();var f=function(k){if((j&&k=="show")||(!j&&k=="hide")){i()}};return{handle_minwidth_hint:b,force_panel:f}}function hide_modal(){$(".dialog-box-container").fadeOut(function(){$("#overlay").hide();$(".dialog-box").find(".body").children().remove()})}function show_modal(f,c,e,d){if(f){$(".dialog-box").find(".title").html(f);$(".dialog-box").find(".unified-panel-header").show()}else{$(".dialog-box").find(".unified-panel-header").hide()}var a=$(".dia
log-box").find(".buttons").html("");if(e){$.each(e,function(b,g){a.append($("<button/>").text(b).click(g));a.append(" ")});a.show()}else{a.hide()}var a=$(".dialog-box").find(".extra_buttons").html("");if(d){$.each(d,function(b,g){a.append($("<button/>").text(b).click(g));a.append(" ")});a.show()}else{a.hide()}if(c=="progress"){c=$("<img src='../images/yui/rel_interstitial_loading.gif')' />")}$(".dialog-box").find(".body").html(c);if(!$(".dialog-box-container").is(":visible")){$("#overlay").show();$(".dialog-box-container").fadeIn()}}function show_in_overlay(c){var d=c.width||"600";var b=c.height||"400";var a=c.scroll||"auto";$("#overlay-background").bind("click.overlay",function(){hide_modal();$("#overlay-background").unbind("click.overlay")});show_modal(null,$("<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-12px;top:-12px;' src='../images/delete_icon.png'><iframe style='margin: 0; padding: 0;' src='"+c.url+"' width='"+d+"' height='"+b+"' s
crolling='"+a+"' frameborder='0'></iframe></div>"));$("#close_button").bind("click",function(){hide_modal()})}$(function(){$(".tab").each(function(){var a=$(this).children(".submenu");if(a.length>0){if($.browser.msie){a.prepend("<iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; filter:Alpha(Opacity='0');\"></iframe>")}$(this).hover(function(){a.show()},function(){a.hide()});a.click(function(){a.hide()})}})});function user_changed(a,b){if(a){$(".loggedin-only").show();$(".loggedout-only").hide();$("#user-email").text(a);if(b){$(".admin-only").show()}}else{$(".loggedin-only").hide();$(".loggedout-only").show();$(".admin-only").hide()}};
\ No newline at end of file
+function ensure_dd_helper(){if($("#DD-helper").length==0){$("<div id='DD-helper'/>").css({background:"white",opacity:0,zIndex:9000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function make_left_panel(h,c,e){var g=false;var f=null;var d=function(i){var j=i;if(i<0){i=0}$(h).css("width",i);$(e).css("left",j);$(c).css("left",i+7);if(document.recalc){document.recalc()}};var a=function(){if(g){$(e).removeClass("hover");$(e).animate({left:f},"fast");$(h).css("left",-f).show().animate({left:0},"fast",function(){d(f);$(e).removeClass("hidden")});g=false}else{f=$(e).position().left;$(c).css("left",$(e).innerWidth());if(document.recalc){document.recalc()}$(e).removeClass("hover");$(h).animate({left:-f},"fast");$(e).animate({left:-1},"fast",function(){$(this).addClass("hidden")});g=true}};$(e).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).bind("dragstart",function(i){$("#DD-helper").show()}).bind("dragend
",function(i){$("#DD-helper").hide()}).bind("drag",function(i){x=i.offsetX;x=Math.min(400,Math.max(100,x));if(g){$(h).css("left",0);$(e).removeClass("hidden");g=false}d(x)}).bind("dragclickonly",function(i){a()}).find("div").show();var b=function(i){if((g&&i=="show")||(!g&&i=="hide")){a()}};return{force_panel:b}}function make_right_panel(a,e,h){var j=false;var g=false;var c=null;var d=function(k){$(a).css("width",k);$(e).css("right",k+9);$(h).css("right",k).css("left","");if(document.recalc){document.recalc()}};var i=function(){if(j){$(h).removeClass("hover");$(h).animate({right:c},"fast");$(a).css("right",-c).show().animate({right:0},"fast",function(){d(c);$(h).removeClass("hidden")});j=false}else{c=$(document).width()-$(h).position().left-$(h).outerWidth();$(e).css("right",$(h).innerWidth()+1);if(document.recalc){document.recalc()}$(h).removeClass("hover");$(a).animate({right:-c},"fast");$(h).animate({right:-1},"fast",function(){$(this).addClass("hidden")});j=true}g=false}
;var b=function(k){var l=$(e).width()-(j?c:0);if(l<k){if(!j){i();g=true}}else{if(g){i();g=false}}};$(h).hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).bind("dragstart",function(k){$("#DD-helper").show()}).bind("dragend",function(k){$("#DD-helper").hide()}).bind("drag",function(k){x=k.offsetX;w=$(window).width();x=Math.min(w-100,x);x=Math.max(w-400,x);if(j){$(a).css("right",0);$(h).removeClass("hidden");j=false}d(w-x-$(this).outerWidth())}).bind("dragclickonly",function(k){i()}).find("div").show();var f=function(k){if((j&&k=="show")||(!j&&k=="hide")){i()}};return{handle_minwidth_hint:b,force_panel:f}}function hide_modal(){$(".dialog-box-container").fadeOut(function(){$("#overlay").hide();$(".dialog-box").find(".body").children().remove()})}function show_modal(f,c,e,d){if(f){$(".dialog-box").find(".title").html(f);$(".dialog-box").find(".unified-panel-header").show()}else{$(".dialog-box").find(".unified-panel-header").hide()}var a=$(".dia
log-box").find(".buttons").html("");if(e){$.each(e,function(b,g){a.append($("<button/>").text(b).click(g));a.append(" ")});a.show()}else{a.hide()}var a=$(".dialog-box").find(".extra_buttons").html("");if(d){$.each(d,function(b,g){a.append($("<button/>").text(b).click(g));a.append(" ")});a.show()}else{a.hide()}if(c=="progress"){c=$("<img src='../images/yui/rel_interstitial_loading.gif')' />")}$(".dialog-box").find(".body").html(c);if(!$(".dialog-box-container").is(":visible")){$("#overlay").show();$(".dialog-box-container").fadeIn()}}function show_in_overlay(c){var d=c.width||"600";var b=c.height||"400";var a=c.scroll||"auto";$("#overlay-background").bind("click.overlay",function(){hide_modal();$("#overlay-background").unbind("click.overlay")});show_modal(null,$("<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-17px;top:-15px;' src='../images/closebox.png'><iframe style='margin: 0; padding: 0;' src='"+c.url+"' width='"+d+"' height='"+b+"' scro
lling='"+a+"' frameborder='0'></iframe></div>"));$("#close_button").bind("click",function(){hide_modal()})}$(function(){$(".tab").each(function(){var a=$(this).children(".submenu");if(a.length>0){if($.browser.msie){a.prepend("<iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; filter:Alpha(Opacity='0');\"></iframe>")}$(this).hover(function(){a.show()},function(){a.hide()});a.click(function(){a.hide()})}})});function user_changed(a,b){if(a){$(".loggedin-only").show();$(".loggedout-only").hide();$("#user-email").text(a);if(b){$(".admin-only").show()}}else{$(".loggedin-only").hide();$(".loggedout-only").show();$(".admin-only").hide()}};
\ No newline at end of file
diff -r 6dff2f938898 -r 29ece93d429c static/scripts/packed/trackster.js
--- a/static/scripts/packed/trackster.js Wed Feb 10 16:02:11 2010 -0500
+++ b/static/scripts/packed/trackster.js Wed Feb 10 18:25:32 2010 -0500
@@ -1,1 +1,1 @@
-var DEBUG=false;var DENSITY=1000,FEATURE_LEVELS=10,DATA_ERROR="There was an error in indexing this dataset.",DATA_NONE="No data for this chrom/contig.",DATA_PENDING="Currently indexing... please wait",DATA_LOADING="Loading data...",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=30,CACHED_DATA=20,CONTEXT=$("<canvas></canvas>").get(0).getContext("2d"),RIGHT_STRAND,LEFT_STRAND;var right_img=new Image();right_img.src="../images/visualization/strand_right.png";right_img.onload=function(){RIGHT_STRAND=CONTEXT.createPattern(right_img,"repeat")};var left_img=new Image();left_img.src="../images/visualization/strand_left.png";left_img.onload=function(){LEFT_STRAND=CONTEXT.createPattern(left_img,"repeat")};var right_img_inv=new Image();right_img_inv.src="../images/visualization/strand_right_inv.png";right_img_inv.onload=function(){RIGHT_STRAND_INV=CONTEXT.createPattern(right_img_inv,"repeat")};var left_img_inv=new Image();left_img_inv.src="../images/visualization/strand_left_inv.png";left_i
mg_inv.onload=function(){LEFT_STRAND_INV=CONTEXT.createPattern(left_img_inv,"repeat")};function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}var Cache=function(a){this.num_elements=a;this.clear()};$.extend(Cache.prototype,{get:function(b){var a=this.key_ary.indexOf(b);if(a!=-1){this.key_ary.splice(a,1);this.key_ary.push(b)}return this.obj_cache[b]},set:function(b,c){if(!this.obj_cache[b]){if(this.key_ary.length>=this.num_elements){var a=this.key_ary.shift();delete this.obj_cache[a]}this.key_ary.push(b)}this.obj_cache[b]=c;return c},clear:function(){this.obj_cache={};this.key_ary=[]}});var View=function(b,d,c,a){this.vis_id=c;this.dbkey=a;this.title=d;this.chrom=b;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.center=(this.max_high-this.max_low)/2;this.zoom_factor=3;this.zoom_level=0};$.extend(View.prototype,{add_track:function(a){a.view=this;this.tracks.push(a);if(a.init){a.init()}},add_label_track:function
(a){a.view=this;this.label_tracks.push(a)},remove_track:function(a){delete this.tracks[a]},update_options:function(){for(var b in view.tracks){var a=view.tracks[b];if(a.update_options){a.update_options(b)}}},redraw:function(f){this.span=this.max_high-this.max_low;var d=this.span/Math.pow(this.zoom_factor,this.zoom_level),b=this.center-(d/2),e=b+d;if(b<0){b=0;e=b+d}else{if(e>this.max_high){e=this.max_high;b=e-d}}this.low=Math.floor(b);this.high=Math.ceil(e);this.center=Math.round(this.low+(this.high-this.low)/2);this.resolution=Math.pow(10,Math.ceil(Math.log((this.high-this.low)/DENSITY)/Math.LN10));this.zoom_res=Math.pow(FEATURE_LEVELS,Math.max(0,Math.ceil(Math.log(this.resolution,FEATURE_LEVELS)/Math.log(FEATURE_LEVELS))));$("#overview-box").css({left:(this.low/this.span)*$("#overview-viewport").width(),width:Math.max(12,((this.high-this.low)/this.span)*$("#overview-viewport").width())}).show();$("#low").val(commatize(this.low));$("#high").val(commatize(this.high));if(!f){f
or(var c=0,a=this.tracks.length;c<a;c++){this.tracks[c].draw()}for(var c=0,a=this.label_tracks.length;c<a;c++){this.label_tracks[c].draw()}}},zoom_in:function(a){if(this.max_high===0||this.high-this.low<30){return}if(a){this.center=a/$(document).width()*(this.high-this.low)+this.low}this.zoom_level+=1;this.redraw()},zoom_out:function(){if(this.max_high===0){return}if(this.zoom_level<=0){this.zoom_level=0;return}this.zoom_level-=1;this.redraw()}});var Track=function(a,b){this.name=a;this.parent_element=b;this.make_container()};$.extend(Track.prototype,{make_container:function(){this.header_div=$("<div class='track-header'>").text(this.name);this.content_div=$("<div class='track-content'>");this.container_div=$("<div class='track'></div>").append(this.header_div).append(this.content_div);this.parent_element.append(this.container_div)}});var TiledTrack=function(){};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var i=this.view.low,e=this.view.high,f=e-i,d=this.v
iew.resolution;if(DEBUG){$("#debug").text(d+" "+this.view.zoom_res)}var k=$("<div style='position: relative;'></div>");this.content_div.children(":first").remove();this.content_div.append(k);var l=this.content_div.width()/f;var h;var a=Math.floor(i/d/DENSITY);while((a*DENSITY*d)<e){var j=this.content_div.width()+"_"+this.view.zoom_level+"_"+a;var c=this.tile_cache.get(j);if(c){var g=a*DENSITY*d;var b=(g-i)*l;if(this.left_offset){b-=this.left_offset}c.css({left:b});k.append(c);this.max_height=Math.max(this.max_height,c.height())}else{this.delayed_draw(this,j,i,e,a,d,k,l)}a+=1}},delayed_draw:function(c,e,a,f,b,d,g,h){setTimeout(function(){if(!(a>c.view.high||f<c.view.low)){tile_element=c.draw_tile(d,b,g,h);if(tile_element){c.tile_cache.set(e,tile_element);c.max_height=Math.max(c.max_height,tile_element.height());c.content_div.css("height",c.max_height)}}},50)}});var LabelTrack=function(a){Track.call(this,null,a);this.track_type="LabelTrack";this.hidden=true;this.container_div.
addClass("label-track")};$.extend(LabelTrack.prototype,Track.prototype,{draw:function(){var c=this.view,d=c.high-c.low,g=Math.floor(Math.pow(10,Math.floor(Math.log(d)/Math.log(10)))),a=Math.floor(c.low/g)*g,e=this.content_div.width(),b=$("<div style='position: relative; height: 1.3em;'></div>");while(a<c.high){var f=(a-c.low)/d*e;b.append($("<div class='label'>"+commatize(a)+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var LineTrack=function(c,a,d,b){this.track_type="LineTrack";this.tile_cache=new Cache(CACHED_TILES_LINE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.indexer=d;this.height_px=100;this.container_div.addClass("line-track");this.dataset_id=a;this.prefs={min_value:undefined,max_value:undefined};if(b.min_value!==undefined){this.prefs.min_value=b.min_value}if(b.max_value!==undefined){this.prefs.max_value=b.max_value}};$.extend(LineTrack.prototype,TiledTrack.prototype,{i
nit:function(){this.data_queue={};this.data_cache=new Cache(CACHED_DATA);var a=this,b=a.view.tracks.indexOf(a);a.content_div.text(DATA_LOADING);a.container_div.removeClass("nodata error pending");$.getJSON(data_url,{stats:true,indexer:a.indexer,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(d){if(!d||d=="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR)}else{if(d.length===0||d=="no data"){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(d=="pending"){a.container_div.addClass("pending");a.content_div.text(DATA_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("height",a.height_px+"px");if(a.prefs.min_value===undefined||a.prefs.max_value===undefined){a.prefs.min_value=d.min;a.prefs.max_value=d.max;$("#track_"+b+"_minval").val(a.prefs.min_value);$("#track_"+b+"_maxval").val(a.prefs.max_value)}a.vertical_range=a.prefs.max_value-a.prefs.min_value;if($("#linetrack_"+b
+"_minval").length===0){var e=$("<div></div>").addClass("yaxislabel").attr("id","linetrack_"+b+"_minval").text(a.prefs.min_value);var c=$("<div></div>").addClass("yaxislabel").attr("id","linetrack_"+b+"_maxval").text(a.prefs.max_value);c.css({position:"relative",top:"25px"});c.prependTo(a.container_div);e.css({position:"relative",top:a.height_px+55+"px"});e.prependTo(a.container_div)}a.draw()}}}})},get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.getJSON(data_url,{indexer:this.indexer,chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution},function(g){c.data_cache.set(e,g);delete c.data_queue[e];c.draw()})}},draw_tile:function(n,p,c,e){if(this.vertical_range===undefined){return}var q=p*DENSITY*n,a=DENSITY*n,b=$("<canvas class='tile'></canvas>"),s=n+"_"+p;if(!this.data_cache.get(s)){this.get_data(n,p);return}var r=this.data_cache.get(s);b.css({position:"absolute",top:
0,left:(q-this.view.low)*e});b.get(0).width=Math.ceil(a*e);b.get(0).height=this.height_px;var m=b.get(0).getContext("2d"),j=false,k=this.prefs.min_value,f=this.prefs.max_value,l=this.vertical_range,d=this.height_px;m.beginPath();for(var o=0;o<r.length-1;o++){var h=r[o][0]-q;var g=r[o][1];if(isNaN(g)){j=false}else{h=h*e;if(g<=k){g=k}else{if(g>=f){g=f}}g=Math.round(d-(g-k)/l*d);if(j){m.lineTo(h,g)}else{m.moveTo(h,g);j=true}}}m.stroke();c.append(b);return b},gen_options:function(j){var a=$("<div></div>").addClass("form-row");var e="track_"+j+"_minval",g="track_"+j+"_maxval",h=$("<label></label>").attr("for",e).text("Min value:"),b=(this.prefs.min_value===undefined?"":this.prefs.min_value),i=$("<input></input>").attr("id",e).val(b),d=$("<label></label>").attr("for",g).text("Max value:"),f=(this.prefs.max_value===undefined?"":this.prefs.max_value),c=$("<input></input>").attr("id",g).val(f);return a.append(h).append(i).append(d).append(c)},update_options:function(c){var a=$("#trac
k_"+c+"_minval").val(),b=$("#track_"+c+"_maxval").val();if(a!==this.prefs.min_value||b!==this.prefs.max_value){this.prefs.min_value=parseFloat(a);this.prefs.max_value=parseFloat(b);this.vertical_range=this.prefs.max_value-this.prefs.min_value;$("#linetrack_"+c+"_minval").text(this.prefs.min_value);$("#linetrack_"+c+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.draw()}}});var FeatureTrack=function(c,a,d,b){this.track_type="FeatureTrack";this.tile_cache=new Cache(CACHED_TILES_FEATURE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.indexer=d;this.height_px=100;this.container_div.addClass("feature-track");this.dataset_id=a;this.zo_slots={};this.show_labels_scale=0.001;this.showing_details=false;this.vertical_detail_px=10;this.vertical_nodetail_px=3;this.default_font="9px Monaco, Lucida Console, monospace";this.left_offset=200;this.inc_slots={};this.data_queue={};this.s_e_by_tile={};this.data_cache=new Cache(20);this.prefs={block_color:"black",l
abel_color:"black"};if(b.block_color!==undefined){this.prefs.block_color=b.block_color}if(b.label_color!==undefined){this.prefs.label_color=b.label_color}};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this;a.content_div.text(DATA_LOADING);a.container_div.removeClass("nodata error pending");$.getJSON(data_url,{indexer:a.indexer,low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom},function(b){if(b=="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR)}else{if(b.length===0||b=="no data"){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(b=="pending"){a.container_div.adClass("pending");a.content_div.text(DATA_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("height",a.height_px+"px");a.values=b;a.calc_slots();a.slots=a.zo_slots;a.draw()}}}})},get_data:function(a,d){var b=this,c=a+"_"+d;if(!b.data_queue[c]){b.data_queue[c]=true;$.get
JSON(data_url,{indexer:b.indexer,chrom:b.view.chrom,low:a,high:d,dataset_id:b.dataset_id,include_blocks:true},function(e){b.data_cache.set(c,e);delete b.data_queue[c];b.draw()})}},calc_slots:function(){var b=[],a=this.content_div.width()/(this.view.high-this.view.low),d=this.view.max_low;for(var e=0,f=this.values.length;e<f;e++){var g,h,k=this.values[e];g=Math.floor((k.start-d)*a);h=Math.ceil((k.end-d)*a);var c=0;while(true){if(b[c]===undefined||b[c]<g){b[c]=h;this.zo_slots[k.uid]=c;break}c++}}this.height_px=b.length*this.vertical_nodetail_px+15;this.content_div.css("height",this.height_px+"px")},incremental_slots:function(a,f){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=1/a;this.s_e_by_tile[a]={}}var h=this.inc_slots[a].w_scale,s=[],g=0,b=$("<canvas></canvas>").get(0).getContext("2d"),l=this.view.max_low;var c,e,u=[];for(var p=0,q=f.length;p<q;p++){var d=f[p];if(this.inc_slots[a][d.uid]!==undefined){g=Math.max(g,this.inc_slots[a][d.uid]);u.push(thi
s.inc_slots[a][d.uid])}else{s.push(p)}}for(var p=0,q=s.length;p<q;p++){var d=f[s[p]];c=Math.floor((d.start-l)*h);c-=b.measureText(d.name).width;e=Math.ceil((d.end-l)*h);var o=0;while(true){var m=true;if(this.s_e_by_tile[a][o]!==undefined){for(var n=0,t=this.s_e_by_tile[a][o].length;n<t;n++){var r=this.s_e_by_tile[a][o][n];if(e>r[0]&&c<r[1]){m=false;break}}}if(m){if(this.s_e_by_tile[a][o]===undefined){this.s_e_by_tile[a][o]=[]}this.s_e_by_tile[a][o].push([c,e]);this.inc_slots[a][d.uid]=o;g=Math.max(g,o);break}o++}}return g},draw_tile:function(B,f,g,M){if(!this.values){return}var s=f*DENSITY*B,G=(f+1)*DENSITY*B,r=DENSITY*B;var K,L,m;if(M>this.show_labels_scale){if(!this.showing_details){this.showing_details=true}for(var H in this.data_cache.obj_cache){var C=H.split("_"),z=C[0],c=C[1];if(z<=s&&c>=G){K=this.data_cache.get(H);break}}if(!K){this.data_queue[[s,G]]=true;this.get_data(s,G);return}m=this.incremental_slots(this.view.zoom_res,K)*this.vertical_detail_px+15;L=this.inc_slo
ts[this.view.zoom_res]}else{if(this.showing_details){this.showing_details=false}m=this.height_px;L=this.zo_slots;K=this.values}var a=Math.ceil(r*M),u=$("<canvas class='tile'></canvas>"),D=this.prefs.label_color,e=this.prefs.block_color,x=this.left_offset,N=this.showing_details,O=(this.showing_details?this.vertical_detail_px:this.vertical_nodetail_px);u.css({position:"absolute",top:0,left:(s-this.view.low)*M-x});u.get(0).width=a+x;u.get(0).height=m;var p=u.get(0).getContext("2d");p.fillStyle=this.prefs.block_color;p.font=this.default_font;p.textAlign="right";var I=0;for(var J=0,o=K.length;J<o;J++){var v=K[J];if(v.start<=G&&v.end>=s){var A=Math.floor(Math.max(0,(v.start-s)*M)),q=Math.ceil(Math.min(a,(v.end-s)*M)),y=L[v.uid]*O;var n,E,t=null,P=null;if(v.thick_start&&v.thick_end){t=Math.floor(Math.max(0,(v.thick_start-s)*M));P=Math.ceil(Math.min(a,(v.thick_end-s)*M))}if(!N){p.fillRect(A+x,y+5,q-A,1)}else{if(v.start>s){p.fillStyle=D;p.fillText(v.name,A-1+x,y+8);p.fillStyle=e}var
Q=v.blocks;if(Q){if(v.strand){if(v.strand=="+"){p.fillStyle=RIGHT_STRAND}else{if(v.strand=="-"){p.fillStyle=LEFT_STRAND}}p.fillRect(A+x,y,q-A,10);p.fillStyle=e}for(var H=0,d=Q.length;H<d;H++){var h=Q[H],b=Math.floor(Math.max(0,(h[0]-s)*M)),w=Math.ceil(Math.min(a,(h[1]-s)*M));if(b>w){continue}n=5;E=3;p.fillRect(b+x,y+E,w-b,n);if(t!==undefined&&!(b>P||w<t)){n=9;E=1;var F=Math.max(b,t),l=Math.min(w,P);p.fillRect(F+x,y+E,l-F,n)}}}else{n=9;E=1;p.fillRect(A+x,y+E,q-A,n);if(v.strand){if(v.strand=="+"){p.fillStyle=RIGHT_STRAND_INV}else{if(v.strand=="-"){p.fillStyle=LEFT_STRAND_INV}}p.fillRect(A+x,y,q-A,10);p.fillStyle=prefs.block_color}}}I++}}g.append(u);return u},gen_options:function(g){var a=$("<div></div>").addClass("form-row");var d="track_"+g+"_block_color",c=$("<label></label>").attr("for",d).text("Block color:"),b=$("<input></input>").attr("id",d).attr("name",d).val(this.prefs.block_color),f="track_"+g+"_label_color",h=$("<label></label>").attr("for",f).text("Label color:"),e
=$("<input></input>").attr("id",f).attr("name",f).val(this.prefs.label_color);return a.append(c).append(b).append(h).append(e)},update_options:function(c){var a=$("#track_"+c+"_block_color").val(),b=$("#track_"+c+"_label_color").val();if(a!==this.prefs.block_color||b!==this.prefs.label_color){this.prefs.block_color=a;this.prefs.label_color=b;this.tile_cache.clear();this.draw()}}});var ReadTrack=function(c,a,d,b){this.track_type="ReadTrack";this.tile_cache=new Cache(CACHED_TILES_FEATURE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);FeatureTrack.call(this,c,a,d,b)};$.extend(ReadTrack.prototype,TiledTrack.prototype,FeatureTrack.prototype,{draw_tile:function(v,z,m,n){if(!this.values){return}var A=z*DENSITY*v,e=(z+1)*DENSITY*v,q=DENSITY*v;var D,p,h;h=this.height_px;p=this.zo_slots;D=this.values;var t=Math.ceil(q*n),r=$("<canvas class='tile'></canvas>");r.css({position:"absolute",top:0,left:(A-this.view.low)*n-this.left_offset});r.get(0).width=t+this.left_offset;r.get(0
).height=h;var u=r.get(0).getContext("2d");u.fillStyle=this.prefs.block_color;u.font=this.default_font;u.textAlign="right";var s=u.measureText("A").width;var w=0;for(var x=0,y=D.length;x<y;x++){var l=D[x];if(l.start<=e&&l.end>=A){var g=Math.floor(Math.max(0,(l.start-A)*n)),k=Math.ceil(Math.min(t,(l.end-A)*n)),f=p[l.uid]*this.vertical_detail_px;var a,E,d=null,o=null;if(n>s){for(var B=0,b=l.name.length;B<b;B++){var C=Math.floor(Math.max(0,(l.start+B-A)*n));u.fillText(l.name[B],C+this.left_offset,f+8)}}else{u.fillRect(g+this.left_offset,f+4,k-g,3)}}}m.append(r);return r}});
\ No newline at end of file
+var DEBUG=false;var DENSITY=1000,FEATURE_LEVELS=10,DATA_ERROR="There was an error in indexing this dataset.",DATA_NONE="No data for this chrom/contig.",DATA_PENDING="Currently indexing... please wait",DATA_LOADING="Loading data...",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=30,CACHED_DATA=20,CONTEXT=$("<canvas></canvas>").get(0).getContext("2d"),RIGHT_STRAND,LEFT_STRAND;var right_img=new Image();right_img.src="../images/visualization/strand_right.png";right_img.onload=function(){RIGHT_STRAND=CONTEXT.createPattern(right_img,"repeat")};var left_img=new Image();left_img.src="../images/visualization/strand_left.png";left_img.onload=function(){LEFT_STRAND=CONTEXT.createPattern(left_img,"repeat")};var right_img_inv=new Image();right_img_inv.src="../images/visualization/strand_right_inv.png";right_img_inv.onload=function(){RIGHT_STRAND_INV=CONTEXT.createPattern(right_img_inv,"repeat")};var left_img_inv=new Image();left_img_inv.src="../images/visualization/strand_left_inv.png";left_i
mg_inv.onload=function(){LEFT_STRAND_INV=CONTEXT.createPattern(left_img_inv,"repeat")};function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}var Cache=function(a){this.num_elements=a;this.clear()};$.extend(Cache.prototype,{get:function(b){var a=this.key_ary.indexOf(b);if(a!=-1){this.key_ary.splice(a,1);this.key_ary.push(b)}return this.obj_cache[b]},set:function(b,c){if(!this.obj_cache[b]){if(this.key_ary.length>=this.num_elements){var a=this.key_ary.shift();delete this.obj_cache[a]}this.key_ary.push(b)}this.obj_cache[b]=c;return c},clear:function(){this.obj_cache={};this.key_ary=[]}});var View=function(b,d,c,a){this.vis_id=c;this.dbkey=a;this.title=d;this.chrom=b;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.center=(this.max_high-this.max_low)/2;this.zoom_factor=3;this.zoom_level=0;this.track_id_counter=0};$.extend(View.prototype,{add_track:function(a){a.view=this;a.track_id=this.track_id_counter;this.trac
ks.push(a);if(a.init){a.init()}a.container_div.attr("id","track_"+a.track_id);this.track_id_counter+=1},add_label_track:function(a){a.view=this;this.label_tracks.push(a)},remove_track:function(a){a.container_div.fadeOut("slow",function(){$(this).remove()});delete this.tracks[a]},update_options:function(){var b=$("ul#sortable-ul").sortable("toArray");var d=[];var c=$("#viewport > div").sort(function(g,f){return b.indexOf($(g).attr("id"))>b.indexOf($(f).attr("id"))});$("#viewport > div").remove();$("#viewport").html(c);for(var e in view.tracks){var a=view.tracks[e];if(a.update_options){a.update_options(e)}}},redraw:function(f){this.span=this.max_high-this.max_low;var d=this.span/Math.pow(this.zoom_factor,this.zoom_level),b=this.center-(d/2),e=b+d;if(b<0){b=0;e=b+d}else{if(e>this.max_high){e=this.max_high;b=e-d}}this.low=Math.floor(b);this.high=Math.ceil(e);this.center=Math.round(this.low+(this.high-this.low)/2);this.resolution=Math.pow(10,Math.ceil(Math.log((this.high-this.low
)/DENSITY)/Math.LN10));this.zoom_res=Math.pow(FEATURE_LEVELS,Math.max(0,Math.ceil(Math.log(this.resolution,FEATURE_LEVELS)/Math.log(FEATURE_LEVELS))));$("#overview-box").css({left:(this.low/this.span)*$("#overview-viewport").width(),width:Math.max(12,((this.high-this.low)/this.span)*$("#overview-viewport").width())}).show();$("#low").val(commatize(this.low));$("#high").val(commatize(this.high));if(!f){for(var c=0,a=this.tracks.length;c<a;c++){this.tracks[c].draw()}for(var c=0,a=this.label_tracks.length;c<a;c++){this.label_tracks[c].draw()}}},zoom_in:function(a){if(this.max_high===0||this.high-this.low<30){return}if(a){this.center=a/$(document).width()*(this.high-this.low)+this.low}this.zoom_level+=1;this.redraw()},zoom_out:function(){if(this.max_high===0){return}if(this.zoom_level<=0){this.zoom_level=0;return}this.zoom_level-=1;this.redraw()}});var Track=function(a,b){this.name=a;this.parent_element=b;this.init_global()};$.extend(Track.prototype,{init_global:function(){this.
header_div=$("<div class='track-header'>").text(this.name);this.content_div=$("<div class='track-content'>");this.container_div=$("<div></div>").addClass("track").append(this.header_div).append(this.content_div);this.parent_element.append(this.container_div)}});var TiledTrack=function(){};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var i=this.view.low,e=this.view.high,f=e-i,d=this.view.resolution;if(DEBUG){$("#debug").text(d+" "+this.view.zoom_res)}var k=$("<div style='position: relative;'></div>");this.content_div.children(":first").remove();this.content_div.append(k);var l=this.content_div.width()/f;var h;var a=Math.floor(i/d/DENSITY);while((a*DENSITY*d)<e){var j=this.content_div.width()+"_"+this.view.zoom_level+"_"+a;var c=this.tile_cache.get(j);if(c){var g=a*DENSITY*d;var b=(g-i)*l;if(this.left_offset){b-=this.left_offset}c.css({left:b});k.append(c);this.max_height=Math.max(this.max_height,c.height())}else{this.delayed_draw(this,j,i,e,a,d,k,l)}a+=1}},d
elayed_draw:function(c,e,a,f,b,d,g,h){setTimeout(function(){if(!(a>c.view.high||f<c.view.low)){tile_element=c.draw_tile(d,b,g,h);if(tile_element){c.tile_cache.set(e,tile_element);c.max_height=Math.max(c.max_height,tile_element.height());c.content_div.css("height",c.max_height)}}},50)}});var LabelTrack=function(a){Track.call(this,null,a);this.track_type="LabelTrack";this.hidden=true;this.container_div.addClass("label-track")};$.extend(LabelTrack.prototype,Track.prototype,{draw:function(){var c=this.view,d=c.high-c.low,g=Math.floor(Math.pow(10,Math.floor(Math.log(d)/Math.log(10)))),a=Math.floor(c.low/g)*g,e=this.content_div.width(),b=$("<div style='position: relative; height: 1.3em;'></div>");while(a<c.high){var f=(a-c.low)/d*e;b.append($("<div class='label'>"+commatize(a)+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var LineTrack=function(c,a,d,b){this.track_type="LineTrack";this.tile_cache=new
Cache(CACHED_TILES_LINE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.indexer=d;this.height_px=100;this.container_div.addClass("line-track");this.dataset_id=a;this.prefs={min_value:undefined,max_value:undefined};if(b.min_value!==undefined){this.prefs.min_value=b.min_value}if(b.max_value!==undefined){this.prefs.max_value=b.max_value}};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){this.data_queue={};this.data_cache=new Cache(CACHED_DATA);var a=this,b=a.view.tracks.indexOf(a);a.content_div.text(DATA_LOADING);a.container_div.removeClass("nodata error pending");$.getJSON(data_url,{stats:true,indexer:a.indexer,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(d){if(!d||d=="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR)}else{if(d.length===0||d=="no data"){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(d=="pending"){a.container_div.addClass("pending");a.content_div.text(DAT
A_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("height",a.height_px+"px");if(a.prefs.min_value===undefined||a.prefs.max_value===undefined){a.prefs.min_value=d.min;a.prefs.max_value=d.max;$("#track_"+b+"_minval").val(a.prefs.min_value);$("#track_"+b+"_maxval").val(a.prefs.max_value)}a.vertical_range=a.prefs.max_value-a.prefs.min_value;if($("#linetrack_"+b+"_minval").length===0){var e=$("<div></div>").addClass("yaxislabel").attr("id","linetrack_"+b+"_minval").text(a.prefs.min_value);var c=$("<div></div>").addClass("yaxislabel").attr("id","linetrack_"+b+"_maxval").text(a.prefs.max_value);c.css({position:"relative",top:"25px"});c.prependTo(a.container_div);e.css({position:"relative",top:a.height_px+55+"px"});e.prependTo(a.container_div)}a.draw()}}}})},get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.getJSON(data_url,{indexer:this.indexer,chrom:this.view.chrom,lo
w:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution},function(g){c.data_cache.set(e,g);delete c.data_queue[e];c.draw()})}},draw_tile:function(n,p,c,e){if(this.vertical_range===undefined){return}var q=p*DENSITY*n,a=DENSITY*n,b=$("<canvas class='tile'></canvas>"),s=n+"_"+p;if(!this.data_cache.get(s)){this.get_data(n,p);return}var r=this.data_cache.get(s);b.css({position:"absolute",top:0,left:(q-this.view.low)*e});b.get(0).width=Math.ceil(a*e);b.get(0).height=this.height_px;var m=b.get(0).getContext("2d"),j=false,k=this.prefs.min_value,f=this.prefs.max_value,l=this.vertical_range,d=this.height_px;m.beginPath();for(var o=0;o<r.length-1;o++){var h=r[o][0]-q;var g=r[o][1];if(isNaN(g)){j=false}else{h=h*e;if(g<=k){g=k}else{if(g>=f){g=f}}g=Math.round(d-(g-k)/l*d);if(j){m.lineTo(h,g)}else{m.moveTo(h,g);j=true}}}m.stroke();c.append(b);return b},gen_options:function(j){var a=$("<div></div>").addClass("form-row");var e="track_"+j+"_minval",g="track_"+j+"_maxval",h=$("<l
abel></label>").attr("for",e).text("Min value:"),b=(this.prefs.min_value===undefined?"":this.prefs.min_value),i=$("<input></input>").attr("id",e).val(b),d=$("<label></label>").attr("for",g).text("Max value:"),f=(this.prefs.max_value===undefined?"":this.prefs.max_value),c=$("<input></input>").attr("id",g).val(f);return a.append(h).append(i).append(d).append(c)},update_options:function(c){var a=$("#track_"+c+"_minval").val(),b=$("#track_"+c+"_maxval").val();if(a!==this.prefs.min_value||b!==this.prefs.max_value){this.prefs.min_value=parseFloat(a);this.prefs.max_value=parseFloat(b);this.vertical_range=this.prefs.max_value-this.prefs.min_value;$("#linetrack_"+c+"_minval").text(this.prefs.min_value);$("#linetrack_"+c+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.draw()}}});var FeatureTrack=function(c,a,d,b){this.track_type="FeatureTrack";this.tile_cache=new Cache(CACHED_TILES_FEATURE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.indexer=d;this.
height_px=100;this.container_div.addClass("feature-track");this.dataset_id=a;this.zo_slots={};this.show_labels_scale=0.001;this.showing_details=false;this.vertical_detail_px=10;this.vertical_nodetail_px=3;this.default_font="9px Monaco, Lucida Console, monospace";this.left_offset=200;this.inc_slots={};this.data_queue={};this.s_e_by_tile={};this.data_cache=new Cache(20);this.prefs={block_color:"black",label_color:"black"};if(b.block_color!==undefined){this.prefs.block_color=b.block_color}if(b.label_color!==undefined){this.prefs.label_color=b.label_color}};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this;a.content_div.text(DATA_LOADING);a.container_div.removeClass("nodata error pending");$.getJSON(data_url,{indexer:a.indexer,low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom},function(b){if(b=="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR)}else{if(b.length===0||b=="no data"){a.container_d
iv.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(b=="pending"){a.container_div.adClass("pending");a.content_div.text(DATA_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("height",a.height_px+"px");a.values=b;a.calc_slots();a.slots=a.zo_slots;a.draw()}}}})},get_data:function(a,d){var b=this,c=a+"_"+d;if(!b.data_queue[c]){b.data_queue[c]=true;$.getJSON(data_url,{indexer:b.indexer,chrom:b.view.chrom,low:a,high:d,dataset_id:b.dataset_id,include_blocks:true},function(e){b.data_cache.set(c,e);delete b.data_queue[c];b.draw()})}},calc_slots:function(){var b=[],a=this.content_div.width()/(this.view.high-this.view.low),d=this.view.max_low;for(var e=0,f=this.values.length;e<f;e++){var g,h,k=this.values[e];g=Math.floor((k.start-d)*a);h=Math.ceil((k.end-d)*a);var c=0;while(true){if(b[c]===undefined||b[c]<g){b[c]=h;this.zo_slots[k.uid]=c;break}c++}}this.height_px=b.length*this.vertical_nodetail_px+15;this.content_div.css("height",thi
s.height_px+"px")},incremental_slots:function(a,f){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=1/a;this.s_e_by_tile[a]={}}var h=this.inc_slots[a].w_scale,s=[],g=0,b=$("<canvas></canvas>").get(0).getContext("2d"),l=this.view.max_low;var c,e,u=[];for(var p=0,q=f.length;p<q;p++){var d=f[p];if(this.inc_slots[a][d.uid]!==undefined){g=Math.max(g,this.inc_slots[a][d.uid]);u.push(this.inc_slots[a][d.uid])}else{s.push(p)}}for(var p=0,q=s.length;p<q;p++){var d=f[s[p]];c=Math.floor((d.start-l)*h);c-=b.measureText(d.name).width;e=Math.ceil((d.end-l)*h);var o=0;while(true){var m=true;if(this.s_e_by_tile[a][o]!==undefined){for(var n=0,t=this.s_e_by_tile[a][o].length;n<t;n++){var r=this.s_e_by_tile[a][o][n];if(e>r[0]&&c<r[1]){m=false;break}}}if(m){if(this.s_e_by_tile[a][o]===undefined){this.s_e_by_tile[a][o]=[]}this.s_e_by_tile[a][o].push([c,e]);this.inc_slots[a][d.uid]=o;g=Math.max(g,o);break}o++}}return g},draw_tile:function(B,f,g,M){if(!this.values){return}var
s=f*DENSITY*B,G=(f+1)*DENSITY*B,r=DENSITY*B;var K,L,m;if(M>this.show_labels_scale){if(!this.showing_details){this.showing_details=true}for(var H in this.data_cache.obj_cache){var C=H.split("_"),z=C[0],c=C[1];if(z<=s&&c>=G){K=this.data_cache.get(H);break}}if(!K){this.data_queue[[s,G]]=true;this.get_data(s,G);return}m=this.incremental_slots(this.view.zoom_res,K)*this.vertical_detail_px+15;L=this.inc_slots[this.view.zoom_res]}else{if(this.showing_details){this.showing_details=false}m=this.height_px;L=this.zo_slots;K=this.values}var a=Math.ceil(r*M),u=$("<canvas class='tile'></canvas>"),D=this.prefs.label_color,e=this.prefs.block_color,x=this.left_offset,N=this.showing_details,O=(this.showing_details?this.vertical_detail_px:this.vertical_nodetail_px);u.css({position:"absolute",top:0,left:(s-this.view.low)*M-x});u.get(0).width=a+x;u.get(0).height=m;var p=u.get(0).getContext("2d");p.fillStyle=this.prefs.block_color;p.font=this.default_font;p.textAlign="right";var I=0;for(var J=0,o
=K.length;J<o;J++){var v=K[J];if(v.start<=G&&v.end>=s){var A=Math.floor(Math.max(0,(v.start-s)*M)),q=Math.ceil(Math.min(a,(v.end-s)*M)),y=L[v.uid]*O;var n,E,t=null,P=null;if(v.thick_start&&v.thick_end){t=Math.floor(Math.max(0,(v.thick_start-s)*M));P=Math.ceil(Math.min(a,(v.thick_end-s)*M))}if(!N){p.fillRect(A+x,y+5,q-A,1)}else{if(v.start>s){p.fillStyle=D;p.fillText(v.name,A-1+x,y+8);p.fillStyle=e}var Q=v.blocks;if(Q){if(v.strand){if(v.strand=="+"){p.fillStyle=RIGHT_STRAND}else{if(v.strand=="-"){p.fillStyle=LEFT_STRAND}}p.fillRect(A+x,y,q-A,10);p.fillStyle=e}for(var H=0,d=Q.length;H<d;H++){var h=Q[H],b=Math.floor(Math.max(0,(h[0]-s)*M)),w=Math.ceil(Math.min(a,(h[1]-s)*M));if(b>w){continue}n=5;E=3;p.fillRect(b+x,y+E,w-b,n);if(t!==undefined&&!(b>P||w<t)){n=9;E=1;var F=Math.max(b,t),l=Math.min(w,P);p.fillRect(F+x,y+E,l-F,n)}}}else{n=9;E=1;p.fillRect(A+x,y+E,q-A,n);if(v.strand){if(v.strand=="+"){p.fillStyle=RIGHT_STRAND_INV}else{if(v.strand=="-"){p.fillStyle=LEFT_STRAND_INV}}p.fi
llRect(A+x,y,q-A,10);p.fillStyle=prefs.block_color}}}I++}}g.append(u);return u},gen_options:function(g){var a=$("<div></div>").addClass("form-row");var d="track_"+g+"_block_color",c=$("<label></label>").attr("for",d).text("Block color:"),b=$("<input></input>").attr("id",d).attr("name",d).val(this.prefs.block_color),f="track_"+g+"_label_color",h=$("<label></label>").attr("for",f).text("Label color:"),e=$("<input></input>").attr("id",f).attr("name",f).val(this.prefs.label_color);return a.append(c).append(b).append(h).append(e)},update_options:function(c){var a=$("#track_"+c+"_block_color").val(),b=$("#track_"+c+"_label_color").val();if(a!==this.prefs.block_color||b!==this.prefs.label_color){this.prefs.block_color=a;this.prefs.label_color=b;this.tile_cache.clear();this.draw()}}});var ReadTrack=function(c,a,d,b){this.track_type="ReadTrack";this.tile_cache=new Cache(CACHED_TILES_FEATURE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);FeatureTrack.call(this,c,a,d,b)};$.ex
tend(ReadTrack.prototype,TiledTrack.prototype,FeatureTrack.prototype,{draw_tile:function(v,z,m,n){if(!this.values){return}var A=z*DENSITY*v,e=(z+1)*DENSITY*v,q=DENSITY*v;var D,p,h;h=this.height_px;p=this.zo_slots;D=this.values;var t=Math.ceil(q*n),r=$("<canvas class='tile'></canvas>");r.css({position:"absolute",top:0,left:(A-this.view.low)*n-this.left_offset});r.get(0).width=t+this.left_offset;r.get(0).height=h;var u=r.get(0).getContext("2d");u.fillStyle=this.prefs.block_color;u.font=this.default_font;u.textAlign="right";var s=u.measureText("A").width;var w=0;for(var x=0,y=D.length;x<y;x++){var l=D[x];if(l.start<=e&&l.end>=A){var g=Math.floor(Math.max(0,(l.start-A)*n)),k=Math.ceil(Math.min(t,(l.end-A)*n)),f=p[l.uid]*this.vertical_detail_px;var a,E,d=null,o=null;if(n>s){for(var B=0,b=l.name.length;B<b;B++){var C=Math.floor(Math.max(0,(l.start+B-A)*n));u.fillText(l.name[B],C+this.left_offset,f+8)}}else{u.fillRect(g+this.left_offset,f+4,k-g,3)}}}m.append(r);return r}});
\ No newline at end of file
diff -r 6dff2f938898 -r 29ece93d429c templates/history/rename.mako
--- a/templates/history/rename.mako Wed Feb 10 16:02:11 2010 -0500
+++ b/templates/history/rename.mako Wed Feb 10 18:25:32 2010 -0500
@@ -1,4 +1,3 @@
-<% _=n_ %>
<%inherit file="/base.mako"/>
<%def name="title()">${_('Rename History')}</%def>
@@ -19,10 +18,10 @@
<tr>
<td>
<input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
- ${history.get_display_name()}
+ ${history.get_display_name() | h}
</td>
<td>
- <input type="text" name="name" value="${history.get_display_name()}" size="40">
+ <input type="text" name="name" value="${history.get_display_name() | h}" size="40">
</td>
</tr>
%endfor
1
0

11 Feb '10
details: http://www.bx.psu.edu/hg/galaxy/rev/6dff2f938898
changeset: 3370:6dff2f938898
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Wed Feb 10 16:02:11 2010 -0500
description:
Typo bug fix in tool_runner, should once again be able to upload a new version of a library_dataset.
diffstat:
lib/galaxy/web/controllers/tool_runner.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r 44cada534e33 -r 6dff2f938898 lib/galaxy/web/controllers/tool_runner.py
--- a/lib/galaxy/web/controllers/tool_runner.py Wed Feb 10 15:27:58 2010 -0500
+++ b/lib/galaxy/web/controllers/tool_runner.py Wed Feb 10 16:02:11 2010 -0500
@@ -160,7 +160,7 @@
if nonfile_params.get( 'folder_id', False ):
replace_id = nonfile_params.get( 'replace_id', None )
if replace_id not in [ None, 'None' ]:
- replace_dataset = trans.sa_session.query( l.LibraryDataset ).get( trans.security.decode_id( replace_id ) )
+ replace_dataset = trans.sa_session.query( trans.app.model.LibraryDataset ).get( trans.security.decode_id( replace_id ) )
else:
replace_dataset = None
library_bunch = upload_common.handle_library_params( trans, nonfile_params, nonfile_params.folder_id, replace_dataset )
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/44cada534e33
changeset: 3369:44cada534e33
user: Kanwei Li <kanwei(a)gmail.com>
date: Wed Feb 10 15:27:58 2010 -0500
description:
unpublish typo
diffstat:
lib/galaxy/web/controllers/history.py | 2 +-
lib/galaxy/web/controllers/page.py | 2 +-
lib/galaxy/web/controllers/workflow.py | 4 ++--
templates/sharing_base.mako | 2 +-
templates/workflow/sharing.mako | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diffs (69 lines):
diff -r 773273b96ff4 -r 44cada534e33 lib/galaxy/web/controllers/history.py
--- a/lib/galaxy/web/controllers/history.py Wed Feb 10 15:13:46 2010 -0500
+++ b/lib/galaxy/web/controllers/history.py Wed Feb 10 15:27:58 2010 -0500
@@ -563,7 +563,7 @@
history.importable = False
elif 'unpublish' in kwargs:
history.published = False
- elif 'disable_link_access_and_unpubish' in kwargs:
+ elif 'disable_link_access_and_unpublish' in kwargs:
history.importable = history.published = False
elif 'unshare_user' in kwargs:
user = trans.sa_session.query( trans.app.model.User ).get( trans.security.decode_id( kwargs[ 'unshare_user' ] ) )
diff -r 773273b96ff4 -r 44cada534e33 lib/galaxy/web/controllers/page.py
--- a/lib/galaxy/web/controllers/page.py Wed Feb 10 15:13:46 2010 -0500
+++ b/lib/galaxy/web/controllers/page.py Wed Feb 10 15:27:58 2010 -0500
@@ -394,7 +394,7 @@
page.importable = False
elif 'unpublish' in kwargs:
page.published = False
- elif 'disable_link_access_and_unpubish' in kwargs:
+ elif 'disable_link_access_and_unpublish' in kwargs:
page.importable = page.published = False
elif 'unshare_user' in kwargs:
user = session.query( model.User ).get( trans.security.decode_id( kwargs['unshare_user' ] ) )
diff -r 773273b96ff4 -r 44cada534e33 lib/galaxy/web/controllers/workflow.py
--- a/lib/galaxy/web/controllers/workflow.py Wed Feb 10 15:13:46 2010 -0500
+++ b/lib/galaxy/web/controllers/workflow.py Wed Feb 10 15:27:58 2010 -0500
@@ -262,7 +262,7 @@
stored.importable = False
elif 'unpublish' in kwargs:
stored.published = False
- elif 'disable_link_access_and_unpubish' in kwargs:
+ elif 'disable_link_access_and_unpublish' in kwargs:
stored.importable = stored.published = False
elif 'unshare_user' in kwargs:
user = session.query( model.User ).get( trans.security.decode_id( kwargs['unshare_user' ] ) )
@@ -477,7 +477,7 @@
def editor( self, trans, id=None ):
"""
Render the main workflow editor interface. The canvas is embedded as
- an iframe (neccesary for scrolling to work properly), which is
+ an iframe (necessary for scrolling to work properly), which is
rendered by `editor_canvas`.
"""
if not id:
diff -r 773273b96ff4 -r 44cada534e33 templates/sharing_base.mako
--- a/templates/sharing_base.mako Wed Feb 10 15:13:46 2010 -0500
+++ b/templates/sharing_base.mako Wed Feb 10 15:27:58 2010 -0500
@@ -153,7 +153,7 @@
<input class="action-button" type="submit" name="unpublish" value="Unpublish ${item_class_name}">
<div class="toolParamHelp">Removes ${item_class_name_lc} from Galaxy's <a href='${h.url_for( action='list_published' )}' target="_top">Published ${item_class_plural_name}</a> section so that it is not publicly listed or searchable.</div>
<br>
- <input class="action-button" type="submit" name="disable_link_access_and_unpubish" value="Disable Access to ${item_class_name} via Link and Unpublish">
+ <input class="action-button" type="submit" name="disable_link_access_and_unpublish" value="Disable Access to ${item_class_name} via Link and Unpublish">
<div class="toolParamHelp">Disables ${item_class_name_lc}'s link so that it is not accessible and removes ${item_class_name_lc} from Galaxy's <a href='${h.url_for( action='list_published' )}' target='_top'>Published ${item_class_plural_name}</a> section so that it is not publicly listed or searchable.</div>
%endif
diff -r 773273b96ff4 -r 44cada534e33 templates/workflow/sharing.mako
--- a/templates/workflow/sharing.mako Wed Feb 10 15:13:46 2010 -0500
+++ b/templates/workflow/sharing.mako Wed Feb 10 15:27:58 2010 -0500
@@ -82,7 +82,7 @@
<input class="action-button" type="submit" name="unpublish" value="Unpublish Workflow">
<div class="toolParamHelp">Removes workflow from Galaxy's <a href='${h.url_for( action='list_published' )}'>Published Workflows</a> section so that it is not publicly listed or searchable.</div>
<br>
- <input class="action-button" type="submit" name="disable_link_access_and_unpubish" value="Disable Access to Workflow via Link and Unpublish">
+ <input class="action-button" type="submit" name="disable_link_access_and_unpublish" value="Disable Access to Workflow via Link and Unpublish">
<div class="toolParamHelp">Disables workflow's link so that it is not accessible and removes workflow from Galaxy's <a href='${h.url_for( action='list_published' )}' target='_top'>Published Workflows</a> section so that it is not publicly listed or searchable.</div>
%endif
1
0

11 Feb '10
details: http://www.bx.psu.edu/hg/galaxy/rev/773273b96ff4
changeset: 3368:773273b96ff4
user: Anton Nekrutenko <anton(a)bx.psu.edu>
date: Wed Feb 10 15:13:46 2010 -0500
description:
A slightly better closing icon for screencast overlays
diffstat:
static/images/closebox.png | 0
static/scripts/galaxy.panels.js | 2 +-
2 files changed, 1 insertions(+), 1 deletions(-)
diffs (14 lines):
diff -r 485d9f2c7627 -r 773273b96ff4 static/images/closebox.png
Binary file static/images/closebox.png has changed
diff -r 485d9f2c7627 -r 773273b96ff4 static/scripts/galaxy.panels.js
--- a/static/scripts/galaxy.panels.js Wed Feb 10 14:59:46 2010 -0500
+++ b/static/scripts/galaxy.panels.js Wed Feb 10 15:13:46 2010 -0500
@@ -210,7 +210,7 @@
hide_modal();
$("#overlay-background").unbind( "click.overlay" );
});
- show_modal( null, $("<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-12px;top:-12px;' src='../images/delete_icon.png'><iframe style='margin: 0; padding: 0;' src='" + options.url + "' width='" + width + "' height='" + height + "' scrolling='" + scroll + "' frameborder='0'></iframe></div>" ) );
+ show_modal( null, $("<div style='margin: -5px;'><img id='close_button' style='position:absolute;right:-17px;top:-15px;' src='../images/closebox.png'><iframe style='margin: 0; padding: 0;' src='" + options.url + "' width='" + width + "' height='" + height + "' scrolling='" + scroll + "' frameborder='0'></iframe></div>" ) );
$("#close_button").bind( "click", function() { hide_modal() } );
}
1
0

11 Feb '10
details: http://www.bx.psu.edu/hg/galaxy/rev/485d9f2c7627
changeset: 3367:485d9f2c7627
user: Kelly Vincent <kpvincent(a)bx.psu.edu>
date: Wed Feb 10 14:59:46 2010 -0500
description:
Corrected some typos in DNA filtering tool
diffstat:
test-data/dna_filter_in1.bed | 49 -------------------------------------------
test-data/dna_filter_out1.bed | 4 ---
test-data/dna_filter_out2.bed | 39 ----------------------------------
test-data/dna_filter_out3.bed | 41 -----------------------------------
test-data/dna_filter_out4.bed | 24 ---------------------
tools/stats/dna_filtering.xml | 15 ++++++-------
6 files changed, 7 insertions(+), 165 deletions(-)
diffs (230 lines):
diff -r 1487502e7996 -r 485d9f2c7627 test-data/dna_filter_in1.bed
--- a/test-data/dna_filter_in1.bed Wed Feb 10 14:42:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-chr1 256 257 A N M N - M N U N N A N D N G N N K N N N
-chr1 468 469 C C C N M N N K . N C U N H N G N N M N S
-chr1 582 583 G G G N G R N R N - N M N V K N N N G C R
-chr1 602 603 G G G N G N Y N R G G N N U N T N A K N R
-chr1 4792 4793 A A M K N W S S N N Y N N N N N M R N R N
-chr1 6119 6120 G G M N S N N W B N S D N N H V N B W N N
-chr1 6357 6358 G G N M K N G - N N G U N N N B N N K N S
-chr1 6433 6434 G G N R N N C N N N . N N . N N N N N R N
-chr1 39160 39161 T T T N N Y N - N N N N N N N V N N N N Y
-chr1 41920 41921 G C G N M C G N A N G N K N W S N N N V N
-chr1 42100 42101 T T T Y R W N N N V N M R N N G N M Y N K
-chr1 45026 45027 C A C N N Y N S Y N N X N A D N N K N N A
-chr1 45161 45162 C T C . N X H V N N C R N Y N N N N R N Y
-chr2 45407 45408 C N C S B N N N N N C N Y N N T K G N C N
-chr2 45788 45789 T T T N W S N Y N R Y N S N W M N C T N C
-chr2 46243 46244 T T T N W N N B V N U N T N N Y C N U N N
-chr2 47814 47815 A C A S N X D N N H W N G N Y C N N M R N
-chr2 48073 48074 A G A Y W . N K N N N G N N N G N N N Y N
-chr2 48633 48634 T T T N G N N N . N N N N S N Y N . N N N
-chr2 51304 51305 A G N N C N W - N S Y N . N N G N N N W R
-chr2 51324 51325 T T N R N N N N N - N U N W A N N N N N N
-chr2 52065 52066 T C T N N N S N . N T N M N S W N T Y C N
-chr2 53130 53131 T C T K R . N B N N T N N M N Y N N Y N N
-chr2 53505 53506 A A A M N N Y N N N N - K N W N N N S N R
-chr2 53559 53560 T T T N N V R V N N T N U N N B N M N V Y
-chr2 55607 55608 A N A U S N N H R K N N N Y N N G N N N N
-chr10 55659 55660 T N T C N K N N N U N S N N N V C R S N N
-chr10 55734 55735 T N T G N C N M M G C N B N . N G N N N N
-chr10 55870 55871 C G C N H G - N N N C N H K N M G N N N N
-chr10 56024 56025 A T A N D U N Y B N N X N N Y N T N - N N
-chr10 56100 56101 T T A W N N W N S N K M N R N R N R N G N
-chr10 56120 56121 A - A N A N N Y N N N W V N N Y G N N W N
-chr10 56137 56138 A A A N A Y H . Y N G N . D N N T N N N N
-chr10 56174 56175 A T A Y A N N N N N N N N N . S T Y N B N
-chr10 59373 59374 A G A N N N N N N T N S N N N G N N N V N
-chr10 68912 68913 G T G R N B R N H N U W Y N N N N N N N T
-chr10 72946 72947 T A N N N N N N B N N . B D W U N U N D A
-chr10 77052 77053 G A R N G N N Y N N N N N N B R N W N N R
-chr18 78200 78201 G G G N N H N N V N G N N N N A A N K X N
-chr18 81076 81077 T A T B N N G N N X W N X N V N N D N N N
-chr18 81198 81199 A T A N N N N - N N X N K T N M N K X N W
-chr18 81216 81217 G A G Y N N D N X N N N N A N S N N N D N
-chr18 81398 81399 G T G N - W N N M N G C N K N S N N N N K
-chr18 91548 91549 A A A S N X H S R N A K N N N N U A R N N
-chr18 93895 93896 T T T H N N V W Y N N N - N N N N N N Y N
-chr18 98172 98173 T T T N . N N N S N T N Y N N Y X D V N Y
-chr18 110904 110905 T - A A N A N A W A N N A X N W N N N N N
-chr18 140324 140325 A A A N M N N Y N S N V N N X N C N N . M
-chr18 160592 160593 C G G G N G N G N G N N G N N M T N Y N N
\ No newline at end of file
diff -r 1487502e7996 -r 485d9f2c7627 test-data/dna_filter_out1.bed
--- a/test-data/dna_filter_out1.bed Wed Feb 10 14:42:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-chr1 582 583 G G G N G R N R N - N M N V K N N N G C R
-chr1 602 603 G G G N G N Y N R G G N N U N T N A K N R
-chr2 48633 48634 T T T N G N N N . N N N N S N Y N . N N N
-chr10 77052 77053 G A R N G N N Y N N N N N N B R N W N N R
diff -r 1487502e7996 -r 485d9f2c7627 test-data/dna_filter_out2.bed
--- a/test-data/dna_filter_out2.bed Wed Feb 10 14:42:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-chr1 256 257 A N M N - M N U N N A N D N G N N K N N N
-chr1 602 603 G G G N G N Y N R G G N N U N T N A K N R
-chr1 4792 4793 A A M K N W S S N N Y N N N N N M R N R N
-chr1 6119 6120 G G M N S N N W B N S D N N H V N B W N N
-chr1 6357 6358 G G N M K N G - N N G U N N N B N N K N S
-chr1 6433 6434 G G N R N N C N N N . N N . N N N N N R N
-chr1 39160 39161 T T T N N Y N - N N N N N N N V N N N N Y
-chr1 41920 41921 G C G N M C G N A N G N K N W S N N N V N
-chr1 42100 42101 T T T Y R W N N N V N M R N N G N M Y N K
-chr2 45788 45789 T T T N W S N Y N R Y N S N W M N C T N C
-chr2 46243 46244 T T T N W N N B V N U N T N N Y C N U N N
-chr2 47814 47815 A C A S N X D N N H W N G N Y C N N M R N
-chr2 48633 48634 T T T N G N N N . N N N N S N Y N . N N N
-chr2 51304 51305 A G N N C N W - N S Y N . N N G N N N W R
-chr2 51324 51325 T T N R N N N N N - N U N W A N N N N N N
-chr2 53130 53131 T C T K R . N B N N T N N M N Y N N Y N N
-chr2 53505 53506 A A A M N N Y N N N N - K N W N N N S N R
-chr2 53559 53560 T T T N N V R V N N T N U N N B N M N V Y
-chr2 55607 55608 A N A U S N N H R K N N N Y N N G N N N N
-chr10 55659 55660 T N T C N K N N N U N S N N N V C R S N N
-chr10 55734 55735 T N T G N C N M M G C N B N . N G N N N N
-chr10 56024 56025 A T A N D U N Y B N N X N N Y N T N - N N
-chr10 56100 56101 T T A W N N W N S N K M N R N R N R N G N
-chr10 56120 56121 A - A N A N N Y N N N W V N N Y G N N W N
-chr10 56137 56138 A A A N A Y H . Y N G N . D N N T N N N N
-chr10 56174 56175 A T A Y A N N N N N N N N N . S T Y N B N
-chr10 59373 59374 A G A N N N N N N T N S N N N G N N N V N
-chr10 68912 68913 G T G R N B R N H N U W Y N N N N N N N T
-chr10 72946 72947 T A N N N N N N B N N . B D W U N U N D A
-chr10 77052 77053 G A R N G N N Y N N N N N N B R N W N N R
-chr18 78200 78201 G G G N N H N N V N G N N N N A A N K X N
-chr18 81076 81077 T A T B N N G N N X W N X N V N N D N N N
-chr18 81198 81199 A T A N N N N - N N X N K T N M N K X N W
-chr18 81216 81217 G A G Y N N D N X N N N N A N S N N N D N
-chr18 81398 81399 G T G N - W N N M N G C N K N S N N N N K
-chr18 91548 91549 A A A S N X H S R N A K N N N N U A R N N
-chr18 98172 98173 T T T N . N N N S N T N Y N N Y X D V N Y
-chr18 110904 110905 T - A A N A N A W A N N A X N W N N N N N
-chr18 160592 160593 C G G G N G N G N G N N G N N M T N Y N N
diff -r 1487502e7996 -r 485d9f2c7627 test-data/dna_filter_out3.bed
--- a/test-data/dna_filter_out3.bed Wed Feb 10 14:42:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-chr1 468 469 C C C N M N N K . N C U N H N G N N M N S
-chr1 582 583 G G G N G R N R N - N M N V K N N N G C R
-chr1 602 603 G G G N G N Y N R G G N N U N T N A K N R
-chr1 6119 6120 G G M N S N N W B N S D N N H V N B W N N
-chr1 6357 6358 G G N M K N G - N N G U N N N B N N K N S
-chr1 6433 6434 G G N R N N C N N N . N N . N N N N N R N
-chr1 39160 39161 T T T N N Y N - N N N N N N N V N N N N Y
-chr1 41920 41921 G C G N M C G N A N G N K N W S N N N V N
-chr1 42100 42101 T T T Y R W N N N V N M R N N G N M Y N K
-chr1 45026 45027 C A C N N Y N S Y N N X N A D N N K N N A
-chr1 45161 45162 C T C . N X H V N N C R N Y N N N N R N Y
-chr2 45407 45408 C N C S B N N N N N C N Y N N T K G N C N
-chr2 45788 45789 T T T N W S N Y N R Y N S N W M N C T N C
-chr2 46243 46244 T T T N W N N B V N U N T N N Y C N U N N
-chr2 48073 48074 A G A Y W . N K N N N G N N N G N N N Y N
-chr2 48633 48634 T T T N G N N N . N N N N S N Y N . N N N
-chr2 51324 51325 T T N R N N N N N - N U N W A N N N N N N
-chr2 52065 52066 T C T N N N S N . N T N M N S W N T Y C N
-chr2 53130 53131 T C T K R . N B N N T N N M N Y N N Y N N
-chr2 53559 53560 T T T N N V R V N N T N U N N B N M N V Y
-chr2 55607 55608 A N A U S N N H R K N N N Y N N G N N N N
-chr10 55659 55660 T N T C N K N N N U N S N N N V C R S N N
-chr10 55734 55735 T N T G N C N M M G C N B N . N G N N N N
-chr10 55870 55871 C G C N H G - N N N C N H K N M G N N N N
-chr10 56100 56101 T T A W N N W N S N K M N R N R N R N G N
-chr10 56120 56121 A - A N A N N Y N N N W V N N Y G N N W N
-chr10 56174 56175 A T A Y A N N N N N N N N N . S T Y N B N
-chr10 59373 59374 A G A N N N N N N T N S N N N G N N N V N
-chr10 68912 68913 G T G R N B R N H N U W Y N N N N N N N T
-chr10 72946 72947 T A N N N N N N B N N . B D W U N U N D A
-chr10 77052 77053 G A R N G N N Y N N N N N N B R N W N N R
-chr18 78200 78201 G G G N N H N N V N G N N N N A A N K X N
-chr18 81076 81077 T A T B N N G N N X W N X N V N N D N N N
-chr18 81198 81199 A T A N N N N - N N X N K T N M N K X N W
-chr18 81216 81217 G A G Y N N D N X N N N N A N S N N N D N
-chr18 81398 81399 G T G N - W N N M N G C N K N S N N N N K
-chr18 93895 93896 T T T H N N V W Y N N N - N N N N N N Y N
-chr18 98172 98173 T T T N . N N N S N T N Y N N Y X D V N Y
-chr18 110904 110905 T - A A N A N A W A N N A X N W N N N N N
-chr18 140324 140325 A A A N M N N Y N S N V N N X N C N N . M
-chr18 160592 160593 C G G G N G N G N G N N G N N M T N Y N N
diff -r 1487502e7996 -r 485d9f2c7627 test-data/dna_filter_out4.bed
--- a/test-data/dna_filter_out4.bed Wed Feb 10 14:42:42 2010 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-chr1 582 583 G G G N G R N R N - N M N V K N N N G C R
-chr1 602 603 G G G N G N Y N R G G N N U N T N A K N R
-chr1 6119 6120 G G M N S N N W B N S D N N H V N B W N N
-chr1 6433 6434 G G N R N N C N N N . N N . N N N N N R N
-chr1 41920 41921 G C G N M C G N A N G N K N W S N N N V N
-chr1 45161 45162 C T C . N X H V N N C R N Y N N N N R N Y
-chr2 45788 45789 T T T N W S N Y N R Y N S N W M N C T N C
-chr2 46243 46244 T T T N W N N B V N U N T N N Y C N U N N
-chr2 48633 48634 T T T N G N N N . N N N N S N Y N . N N N
-chr2 51304 51305 A G N N C N W - N S Y N . N N G N N N W R
-chr2 51324 51325 T T N R N N N N N - N U N W A N N N N N N
-chr2 52065 52066 T C T N N N S N . N T N M N S W N T Y C N
-chr2 53559 53560 T T T N N V R V N N T N U N N B N M N V Y
-chr10 55734 55735 T N T G N C N M M G C N B N . N G N N N N
-chr10 55870 55871 C G C N H G - N N N C N H K N M G N N N N
-chr10 56120 56121 A - A N A N N Y N N N W V N N Y G N N W N
-chr10 59373 59374 A G A N N N N N N T N S N N N G N N N V N
-chr10 72946 72947 T A N N N N N N B N N . B D W U N U N D A
-chr10 77052 77053 G A R N G N N Y N N N N N N B R N W N N R
-chr18 81198 81199 A T A N N N N - N N X N K T N M N K X N W
-chr18 98172 98173 T T T N . N N N S N T N Y N N Y X D V N Y
-chr18 110904 110905 T - A A N A N A W A N N A X N W N N N N N
-chr18 140324 140325 A A A N M N N Y N S N V N N X N C N N . M
-chr18 160592 160593 C G G G N G N G N G N N G N N M T N Y N N
diff -r 1487502e7996 -r 485d9f2c7627 tools/stats/dna_filtering.xml
--- a/tools/stats/dna_filtering.xml Wed Feb 10 14:42:42 2010 -0500
+++ b/tools/stats/dna_filtering.xml Wed Feb 10 14:59:46 2010 -0500
@@ -56,7 +56,7 @@
.. class:: warningmark
-**TIP:** This tool is intended primarily for comparing column values (such as "c5==c12"), although it is also possible to filter on specific values (like "c6!='G'"). Be aware that when searching for specific values, any possible match is considered. So if you search on "c6!='G'", rows will be excluded when c6 is G, K, R, S, B, V, or D (plus N or X if you set that to equal "Everything"), because it is possible those values could be G.
+**TIP:** This tool is intended primarily for comparing column values (such as "c5==c12"), although it is also possible to filter on specific values (like "c6!='G'"). Be aware that when searching for specific values, any possible match is considered. So if you search on "c6!='G'", rows will be excluded when c6 is G, K, R, S, B, V, or D (plus N or X if you set that to equal "Everything"), because it is possible those values could indicate G.
-----
@@ -69,7 +69,7 @@
chr1 100 101 A M C R
chr1 200 201 T K C C
-and your want to select all rows where patient1 has the same base as patient2. Unfortunately you cannot do this with the *Filter and Sort -> Filter* tool because it does not understant DNA ambiguity codes (see below). For example, at postion 100 patient1 is the same as patient2 because M is a mix of As and Cs. This tool is designed to make filtering on ambiguities possible.
+and your want to select all rows where patient1 has the same base as patient2. Unfortunately you cannot do this with the *Filter and Sort -> Filter* tool because it does not understand DNA ambiguity codes (see below). For example, at position 100 patient1 is the same as patient2 because M is a mix of As and Cs. This tool is designed to make filtering on ambiguities possible.
-----
@@ -88,14 +88,13 @@
The following types of filtering are allowed:
-- Testing colums for eqality (e.g., c2 == c4 or c2 != c4)
+- Testing columns for equality (e.g., c2 == c4 or c2 != c4)
- Testing that a column contains a particular base (e.g., c4 == 'C'). Only bases listed in *DNA Codes* below are allowed.
- Testing that a column represents a plus or a minus strand (e.g., c3 == '+' or c3 != '-')
-- Testing that a column is a chromsomes (c1 == 'chrX') or a scaffold (c1 == 'scafford87976')
+- Testing that a column is a chromosomes (c1 == 'chrX') or a scaffold (c1 == 'scaffold87976')
All other types of filtering should be done with *Filter and Sort -> Filter* tool.
-
-----
**DNA Codes**
@@ -128,10 +127,10 @@
**Example**
-- **c8=='A'** selects lines in which the eighth column is A, M, R, W, V, H, D and N or X if appropriate
+- **c8=='A'** selects lines in which the eighth column is A, M, R, W, V, H, or D, or N or X if appropriate
- **c12==c15** selects lines where the value in the twelfth column could be the same as the fifteenth and the fifteenth column could be the same as the twelfth column (based on appropriate codes)
-- **c9!=c19** selects lines where column nine could not be the same as column nineteen and column nineteen could not be the same as column nine (using appropriate codes)
-- **c4 == 'A' and c4 == c5** selects lines where column 4 and 5 are both A, M, R, W, V, H, D and N or X if appropriate
+- **c9!=c19** selects lines where column nine could not be the same as column nineteen or column nineteen could not be the same as column nine (using appropriate codes)
+- **c4 == 'A' and c4 == c5** selects lines where column 4 and 5 are both A, M, R, W, V, H, D or N, or X if appropriate
</help>
</tool>
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/1487502e7996
changeset: 3366:1487502e7996
user: Anton Nekrutenko <anton(a)bx.psu.edu>
date: Wed Feb 10 14:42:42 2010 -0500
description:
Edites to DNA ambig filter interface
diffstat:
tools/stats/dna_filtering.xml | 89 ++++++++++++++++++++++++++----------------
1 files changed, 55 insertions(+), 34 deletions(-)
diffs (131 lines):
diff -r e85a213a347d -r 1487502e7996 tools/stats/dna_filtering.xml
--- a/tools/stats/dna_filtering.xml Wed Feb 10 14:14:55 2010 -0500
+++ b/tools/stats/dna_filtering.xml Wed Feb 10 14:42:42 2010 -0500
@@ -1,5 +1,5 @@
-<tool id="dna_filter" name="DNA Filter" version="1.0.0">
- <description>filter column data on DNA ambiguity codes using simple expressions</description>
+<tool id="dna_filter" name="Filter on ambiguities" version="1.0.0">
+ <description>in polymorphism datasets</description>
<command interpreter="python">
dna_filtering.py
--input=$input
@@ -14,9 +14,9 @@
<param name="cond" size="40" type="text" value="c4 == 'G'" label="With following condition" help="Double equal signs, ==, must be used as shown above. To filter for an arbitrary string, use the Select tool.">
<validator type="empty_field" message="Enter a valid filtering condition, see syntax and examples below."/>
</param>
- <param name="n_handling" type="select" label="Do you want N (and X) to match A or C or G or T OR nothing?">
- <option value="all">N = A or C or G or T</option>
- <option value="none">N = nothing</option>
+ <param name="n_handling" type="select" label="What is the meaning of N" help="Everything matches everything, Unknown matches nothing">
+ <option value="all">Everything (A, T, C, G)</option>
+ <option value="none">Unknown</option>
</param>
</inputs>
<outputs>
@@ -50,30 +50,51 @@
</tests>
<help>
-.. class:: warningmark
-
-Double equal signs, ==, must be used as *"equal to"* (e.g., **c1 == 'G'**)
-
.. class:: infomark
**TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert*
-.. class:: infomark
+.. class:: warningmark
-**TIP:** This tool is intended primarily for comparing column values (such as "c5==c12"), although it is also possible to filter on specific values (like "c6!='G'"). Be aware that when searching for specific values, any possible match is considered. So if you search on "c6!='G'", rows will be excluded when c6 is G, K, R, S, B, V, or D (plus N or X if you set that to equal "all"), because it is possible those values could be G.
+**TIP:** This tool is intended primarily for comparing column values (such as "c5==c12"), although it is also possible to filter on specific values (like "c6!='G'"). Be aware that when searching for specific values, any possible match is considered. So if you search on "c6!='G'", rows will be excluded when c6 is G, K, R, S, B, V, or D (plus N or X if you set that to equal "Everything"), because it is possible those values could be G.
+
+-----
+
+**What it does**
+
+This tool is written for a very specific case related to an analysis of polymorphism data. Suppose you have a table of SNP data that looks like this::
+
+ chromosome start end patient1 parient2 patient3 patient4
+ --------------------------------------------------------
+ chr1 100 101 A M C R
+ chr1 200 201 T K C C
+
+and your want to select all rows where patient1 has the same base as patient2. Unfortunately you cannot do this with the *Filter and Sort -> Filter* tool because it does not understant DNA ambiguity codes (see below). For example, at postion 100 patient1 is the same as patient2 because M is a mix of As and Cs. This tool is designed to make filtering on ambiguities possible.
-----
**Syntax**
-The filter tool allows you to restrict the dataset using simple conditional statements.
+The filter tool allows you to restrict the dataset using simple conditional statements:
-- Columns are referenced with **c** and a **number**. For example, **c1** refers to the first column of a tab-delimited file
-- Make sure that multi-character operators contain no white space ( e.g., **!=** is valid while **! =** is not valid )
+- Columns are referenced with **c** and a **number**. For example, **c1** refers to the first column of a tab-delimited file (e.g., **c4 == c5**)
- When using 'equal-to' operator **double equal sign '==' must be used** ( e.g., **c1=='chr1'** )
- Non-numerical values must be included in single or double quotes ( e.g., **c6=='C'** )
- Filtering condition can include logical operators, but **make sure operators are all lower case** ( e.g., **(c1!='chrX' and c1!='chrY') or c6=='+'** )
-- You can use spaces between the arguments and equality sign or not (e.g. both **c9 == c10** and **c9==c10** are valid)
+
+------
+
+**Allowed types of filtering**
+
+The following types of filtering are allowed:
+
+- Testing colums for eqality (e.g., c2 == c4 or c2 != c4)
+- Testing that a column contains a particular base (e.g., c4 == 'C'). Only bases listed in *DNA Codes* below are allowed.
+- Testing that a column represents a plus or a minus strand (e.g., c3 == '+' or c3 != '-')
+- Testing that a column is a chromsomes (c1 == 'chrX') or a scaffold (c1 == 'scafford87976')
+
+All other types of filtering should be done with *Filter and Sort -> Filter* tool.
+
-----
@@ -81,25 +102,25 @@
The following are the DNA codes used for filtering::
- Code Meaning
- ---- ---------------------------
- A A
- T T
- U T
- G G
- C C
- K G or T
- M A or C
- R A or G
- Y C or T
- S C or G
- W A or T
- B C, G or T
- V A, C or G
- H A, C or T
- D A, G or T
- X A, C, G or T
- N A, C, G or T
+ Code Meaning
+ ---- --------------------------
+ A A
+ T T
+ U T
+ G G
+ C C
+ K G or T
+ M A or C
+ R A or G
+ Y C or T
+ S C or G
+ W A or T
+ B C, G or T
+ V A, C or G
+ H A, C or T
+ D A, G or T
+ X A, C, G or T
+ N A, C, G or T
. not (A, C, G or T)
- gap of indeterminate length
1
0

11 Feb '10
details: http://www.bx.psu.edu/hg/galaxy/rev/e85a213a347d
changeset: 3365:e85a213a347d
user: gua110
date: Wed Feb 10 14:14:55 2010 -0500
description:
Modified strand column assignment to the NiceReaderWrapper object in basecoverage tool. Previously, if the input had no strand column declared, the object would have a default strand col of 5, and return a coverage of 0 as c5 might not have been a valid strand col.
diffstat:
tools/new_operations/gops_basecoverage.py | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diffs (30 lines):
diff -r 33b475ccc316 -r e85a213a347d tools/new_operations/gops_basecoverage.py
--- a/tools/new_operations/gops_basecoverage.py Wed Feb 10 13:18:45 2010 -0500
+++ b/tools/new_operations/gops_basecoverage.py Wed Feb 10 14:14:55 2010 -0500
@@ -8,7 +8,6 @@
from galaxy import eggs
import pkg_resources
pkg_resources.require( "bx-python" )
-
import sys, traceback, fileinput
from warnings import warn
from bx.intervals import *
@@ -29,15 +28,14 @@
in_fname, out_fname = args
except:
doc_optparse.exception()
-
+
g1 = NiceReaderWrapper( fileinput.FileInput( in_fname ),
chrom_col=chr_col_1,
start_col=start_col_1,
end_col=end_col_1,
+ strand_col = strand_col_1,
fix_strand=True )
-
- if strand_col_1 >= 0:
- g1.strand_col=strand_col_1
+
try:
bases = base_coverage(g1)
except ParseError, exc:
1
0

11 Feb '10
details: http://www.bx.psu.edu/hg/galaxy/rev/33b475ccc316
changeset: 3364:33b475ccc316
user: Kelly Vincent <kpvincent(a)bx.psu.edu>
date: Wed Feb 10 13:18:45 2010 -0500
description:
Changed some of the filtering logic for DNA code filter tool, and got tests working
diffstat:
test-data/dna_filter_in1.tabular | 49 +++++++++++++++++++++
test-data/dna_filter_out1.tabular | 35 +++++++++++++++
test-data/dna_filter_out2.tabular | 31 +++++++++++++
test-data/dna_filter_out3.tabular | 42 ++++++++++++++++++
test-data/dna_filter_out4.tabular | 6 ++
tools/stats/dna_filtering.py | 87 ++++++++++++++++++++++++--------------
tools/stats/dna_filtering.xml | 24 +++++----
7 files changed, 230 insertions(+), 44 deletions(-)
diffs (389 lines):
diff -r 1fc06b260097 -r 33b475ccc316 test-data/dna_filter_in1.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/dna_filter_in1.tabular Wed Feb 10 13:18:45 2010 -0500
@@ -0,0 +1,49 @@
+chr1 256 257 A N M N - M N U N N A N D N G N N K N N N +
+chr1 468 469 C C C N M N N K . N C U N H N G N N M N S -
+chr1 582 583 G G G N G R N R N - N M N V K N N N G C R +
+chr1 602 603 G G G N G N Y N R G G N N U N T N A K N R +
+chr1 4792 4793 A A M K N W S S N N Y N N N N N M R N R N +
+chr1 6119 6120 G G M N S N N W B N S D N N H V N B W N N +
+chr1 6357 6358 G G N M K N G - N N G U N N N B N N K N S -
+chr1 6433 6434 G G N R N N C N N N . N N . N N N N N R N +
+chr1 39160 39161 T T T N N Y N - N N N N N N N V N N N N Y +
+chr1 41920 41921 G C G N M C G N A N G N K N W S N N N V N +
+chr1 42100 42101 T T T Y R W N N N V N M R N N G N M Y N K -
+chr1 45026 45027 C A C N N Y N S Y N N X N A D N N K N N A +
+chr1 45161 45162 C T C . N X H V N N C R N Y N N N N R N Y +
+chr2 45407 45408 C N C S B N N N N N C N Y N N T K G N C N +
+chr2 45788 45789 T T T N W S N Y N R Y N S N W M N C T N C -
+chr2 46243 46244 T T T N W N N B V N U N T N N Y C N U N N +
+chr2 47814 47815 A C A S N X D N N H W N G N Y C N N M R N +
+chr2 48073 48074 A G A Y W . N K N N N G N N N G N N N Y N +
+chr2 48633 48634 T T T N G N N N . N N N N S N Y N . N N N +
+chr2 51304 51305 A G N N C N W - N S Y N . N N G N N N W R +
+chr2 51324 51325 T T N R N N N N N - N U N W A N N N N N N -
+chr2 52065 52066 T C T N N N S N . N T N M N S W N T Y C N -
+chr2 53130 53131 T C T K R . N B N N T N N M N Y N N Y N N +
+chr2 53505 53506 A A A M N N Y N N N N - K N W N N N S N R +
+chr2 53559 53560 T T T N N V R V N N T N U N N B N M N V Y +
+chr2 55607 55608 A N A U S N N H R K N N N Y N N G N N N N +
+chr10 55659 55660 T N T C N K N N N U N S N N N V C R S N N +
+chr10 55734 55735 T N T G N C N M M G C N B N . N G N N N N +
+chr10 55870 55871 C G C N H G - N N N C N H K N M G N N N N +
+chr10 56024 56025 A T A N D U N Y B N N X N N Y N T N - N N +
+chr10 56100 56101 T T A W N N W N S N K M N R N R N R N G N +
+chr10 56120 56121 A - A N A N N Y N N N W V N N Y G N N W N -
+chr10 56137 56138 A A A N A Y H . Y N G N . D N N T N N N N +
+chr10 56174 56175 A T A Y A N N N N N N N N N . S T Y N B N +
+chr10 59373 59374 A G A N N N N N N T N S N N N G N N N V N +
+chr10 68912 68913 G T G R N B R N H N U W Y N N N N N N N T +
+chr10 72946 72947 T A N N N N N N B N N . B D W U N U N D A -
+chr10 77052 77053 G A R N G N N Y N N N N N N B R N W N N R +
+chr18 78200 78201 G G G N N H N N V N G N N N N A A N K X N +
+chr18 81076 81077 T A T B N N G N N X W N X N V N N D N N N +
+chr18 81198 81199 A T A N N N N - N N X N K T N M N K X N W +
+chr18 81216 81217 G A G Y N N D N X N N N N A N S N N N D N -
+chr18 81398 81399 G T G N - W N N M N G C N K N S N N N N K +
+chr18 91548 91549 A A A S N X H S R N A K N N N N U A R N N +
+chr18 93895 93896 T T T H N N V W Y N N N - N N N N N N Y N +
+chr18 98172 98173 T T T N . N N N S N T N Y N N Y X D V N Y +
+chr18 110904 110905 T - A A N A N A W A N N A X N W N N N N N +
+chr18 140324 140325 A A A N M N N Y N S N V N N X N C N N . M +
+chr18 160592 160593 C G G G N G N G N G N N G N N M T N Y N N -
\ No newline at end of file
diff -r 1fc06b260097 -r 33b475ccc316 test-data/dna_filter_out1.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/dna_filter_out1.tabular Wed Feb 10 13:18:45 2010 -0500
@@ -0,0 +1,35 @@
+chr1 582 583 G G G N G R N R N - N M N V K N N N G C R +
+chr1 602 603 G G G N G N Y N R G G N N U N T N A K N R +
+chr1 4792 4793 A A M K N W S S N N Y N N N N N M R N R N +
+chr1 6119 6120 G G M N S N N W B N S D N N H V N B W N N +
+chr1 6357 6358 G G N M K N G - N N G U N N N B N N K N S -
+chr1 6433 6434 G G N R N N C N N N . N N . N N N N N R N +
+chr1 39160 39161 T T T N N Y N - N N N N N N N V N N N N Y +
+chr1 42100 42101 T T T Y R W N N N V N M R N N G N M Y N K -
+chr1 45026 45027 C A C N N Y N S Y N N X N A D N N K N N A +
+chr1 45161 45162 C T C . N X H V N N C R N Y N N N N R N Y +
+chr2 45407 45408 C N C S B N N N N N C N Y N N T K G N C N +
+chr2 47814 47815 A C A S N X D N N H W N G N Y C N N M R N +
+chr2 48633 48634 T T T N G N N N . N N N N S N Y N . N N N +
+chr2 51324 51325 T T N R N N N N N - N U N W A N N N N N N -
+chr2 52065 52066 T C T N N N S N . N T N M N S W N T Y C N -
+chr2 53130 53131 T C T K R . N B N N T N N M N Y N N Y N N +
+chr2 53505 53506 A A A M N N Y N N N N - K N W N N N S N R +
+chr2 53559 53560 T T T N N V R V N N T N U N N B N M N V Y +
+chr2 55607 55608 A N A U S N N H R K N N N Y N N G N N N N +
+chr10 55659 55660 T N T C N K N N N U N S N N N V C R S N N +
+chr10 55734 55735 T N T G N C N M M G C N B N . N G N N N N +
+chr10 56024 56025 A T A N D U N Y B N N X N N Y N T N - N N +
+chr10 56100 56101 T T A W N N W N S N K M N R N R N R N G N +
+chr10 59373 59374 A G A N N N N N N T N S N N N G N N N V N +
+chr10 68912 68913 G T G R N B R N H N U W Y N N N N N N N T +
+chr10 72946 72947 T A N N N N N N B N N . B D W U N U N D A -
+chr10 77052 77053 G A R N G N N Y N N N N N N B R N W N N R +
+chr18 78200 78201 G G G N N H N N V N G N N N N A A N K X N +
+chr18 81076 81077 T A T B N N G N N X W N X N V N N D N N N +
+chr18 81198 81199 A T A N N N N - N N X N K T N M N K X N W +
+chr18 81216 81217 G A G Y N N D N X N N N N A N S N N N D N -
+chr18 91548 91549 A A A S N X H S R N A K N N N N U A R N N +
+chr18 93895 93896 T T T H N N V W Y N N N - N N N N N N Y N +
+chr18 110904 110905 T - A A N A N A W A N N A X N W N N N N N +
+chr18 160592 160593 C G G G N G N G N G N N G N N M T N Y N N -
\ No newline at end of file
diff -r 1fc06b260097 -r 33b475ccc316 test-data/dna_filter_out2.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/dna_filter_out2.tabular Wed Feb 10 13:18:45 2010 -0500
@@ -0,0 +1,31 @@
+chr1 602 603 G G G N G N Y N R G G N N U N T N A K N R +
+chr1 39160 39161 T T T N N Y N - N N N N N N N V N N N N Y +
+chr1 41920 41921 G C G N M C G N A N G N K N W S N N N V N +
+chr1 42100 42101 T T T Y R W N N N V N M R N N G N M Y N K -
+chr2 45788 45789 T T T N W S N Y N R Y N S N W M N C T N C -
+chr2 46243 46244 T T T N W N N B V N U N T N N Y C N U N N +
+chr2 47814 47815 A C A S N X D N N H W N G N Y C N N M R N +
+chr2 48633 48634 T T T N G N N N . N N N N S N Y N . N N N +
+chr2 53130 53131 T C T K R . N B N N T N N M N Y N N Y N N +
+chr2 53505 53506 A A A M N N Y N N N N - K N W N N N S N R +
+chr2 53559 53560 T T T N N V R V N N T N U N N B N M N V Y +
+chr2 55607 55608 A N A U S N N H R K N N N Y N N G N N N N +
+chr10 55659 55660 T N T C N K N N N U N S N N N V C R S N N +
+chr10 55734 55735 T N T G N C N M M G C N B N . N G N N N N +
+chr10 56024 56025 A T A N D U N Y B N N X N N Y N T N - N N +
+chr10 56100 56101 T T A W N N W N S N K M N R N R N R N G N +
+chr10 56120 56121 A - A N A N N Y N N N W V N N Y G N N W N -
+chr10 56137 56138 A A A N A Y H . Y N G N . D N N T N N N N +
+chr10 56174 56175 A T A Y A N N N N N N N N N . S T Y N B N +
+chr10 59373 59374 A G A N N N N N N T N S N N N G N N N V N +
+chr10 68912 68913 G T G R N B R N H N U W Y N N N N N N N T +
+chr10 77052 77053 G A R N G N N Y N N N N N N B R N W N N R +
+chr18 78200 78201 G G G N N H N N V N G N N N N A A N K X N +
+chr18 81076 81077 T A T B N N G N N X W N X N V N N D N N N +
+chr18 81198 81199 A T A N N N N - N N X N K T N M N K X N W +
+chr18 81216 81217 G A G Y N N D N X N N N N A N S N N N D N -
+chr18 81398 81399 G T G N - W N N M N G C N K N S N N N N K +
+chr18 91548 91549 A A A S N X H S R N A K N N N N U A R N N +
+chr18 98172 98173 T T T N . N N N S N T N Y N N Y X D V N Y +
+chr18 110904 110905 T - A A N A N A W A N N A X N W N N N N N +
+chr18 160592 160593 C G G G N G N G N G N N G N N M T N Y N N -
\ No newline at end of file
diff -r 1fc06b260097 -r 33b475ccc316 test-data/dna_filter_out3.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/dna_filter_out3.tabular Wed Feb 10 13:18:45 2010 -0500
@@ -0,0 +1,42 @@
+chr1 468 469 C C C N M N N K . N C U N H N G N N M N S -
+chr1 582 583 G G G N G R N R N - N M N V K N N N G C R +
+chr1 602 603 G G G N G N Y N R G G N N U N T N A K N R +
+chr1 6119 6120 G G M N S N N W B N S D N N H V N B W N N +
+chr1 6357 6358 G G N M K N G - N N G U N N N B N N K N S -
+chr1 6433 6434 G G N R N N C N N N . N N . N N N N N R N +
+chr1 39160 39161 T T T N N Y N - N N N N N N N V N N N N Y +
+chr1 41920 41921 G C G N M C G N A N G N K N W S N N N V N +
+chr1 42100 42101 T T T Y R W N N N V N M R N N G N M Y N K -
+chr1 45026 45027 C A C N N Y N S Y N N X N A D N N K N N A +
+chr1 45161 45162 C T C . N X H V N N C R N Y N N N N R N Y +
+chr2 45407 45408 C N C S B N N N N N C N Y N N T K G N C N +
+chr2 45788 45789 T T T N W S N Y N R Y N S N W M N C T N C -
+chr2 46243 46244 T T T N W N N B V N U N T N N Y C N U N N +
+chr2 48073 48074 A G A Y W . N K N N N G N N N G N N N Y N +
+chr2 48633 48634 T T T N G N N N . N N N N S N Y N . N N N +
+chr2 51324 51325 T T N R N N N N N - N U N W A N N N N N N -
+chr2 52065 52066 T C T N N N S N . N T N M N S W N T Y C N -
+chr2 53130 53131 T C T K R . N B N N T N N M N Y N N Y N N +
+chr2 53559 53560 T T T N N V R V N N T N U N N B N M N V Y +
+chr2 55607 55608 A N A U S N N H R K N N N Y N N G N N N N +
+chr10 55659 55660 T N T C N K N N N U N S N N N V C R S N N +
+chr10 55734 55735 T N T G N C N M M G C N B N . N G N N N N +
+chr10 55870 55871 C G C N H G - N N N C N H K N M G N N N N +
+chr10 56100 56101 T T A W N N W N S N K M N R N R N R N G N +
+chr10 56120 56121 A - A N A N N Y N N N W V N N Y G N N W N -
+chr10 56137 56138 A A A N A Y H . Y N G N . D N N T N N N N +
+chr10 56174 56175 A T A Y A N N N N N N N N N . S T Y N B N +
+chr10 59373 59374 A G A N N N N N N T N S N N N G N N N V N +
+chr10 68912 68913 G T G R N B R N H N U W Y N N N N N N N T +
+chr10 72946 72947 T A N N N N N N B N N . B D W U N U N D A -
+chr10 77052 77053 G A R N G N N Y N N N N N N B R N W N N R +
+chr18 78200 78201 G G G N N H N N V N G N N N N A A N K X N +
+chr18 81076 81077 T A T B N N G N N X W N X N V N N D N N N +
+chr18 81198 81199 A T A N N N N - N N X N K T N M N K X N W +
+chr18 81216 81217 G A G Y N N D N X N N N N A N S N N N D N -
+chr18 81398 81399 G T G N - W N N M N G C N K N S N N N N K +
+chr18 93895 93896 T T T H N N V W Y N N N - N N N N N N Y N +
+chr18 98172 98173 T T T N . N N N S N T N Y N N Y X D V N Y +
+chr18 110904 110905 T - A A N A N A W A N N A X N W N N N N N +
+chr18 140324 140325 A A A N M N N Y N S N V N N X N C N N . M +
+chr18 160592 160593 C G G G N G N G N G N N G N N M T N Y N N -
\ No newline at end of file
diff -r 1fc06b260097 -r 33b475ccc316 test-data/dna_filter_out4.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/dna_filter_out4.tabular Wed Feb 10 13:18:45 2010 -0500
@@ -0,0 +1,6 @@
+chr2 45788 45789 T T T N W S N Y N R Y N S N W M N C T N C -
+chr2 51324 51325 T T N R N N N N N - N U N W A N N N N N N -
+chr2 52065 52066 T C T N N N S N . N T N M N S W N T Y C N -
+chr10 56120 56121 A - A N A N N Y N N N W V N N Y G N N W N -
+chr10 72946 72947 T A N N N N N N B N N . B D W U N U N D A -
+chr18 160592 160593 C G G G N G N G N G N N G N N M T N Y N N -
\ No newline at end of file
diff -r 1fc06b260097 -r 33b475ccc316 tools/stats/dna_filtering.py
--- a/tools/stats/dna_filtering.py Wed Feb 10 12:17:38 2010 -0500
+++ b/tools/stats/dna_filtering.py Wed Feb 10 13:18:45 2010 -0500
@@ -14,7 +14,7 @@
"""
#from __future__ import division
-import os.path, re, string, sys
+import os.path, re, string, string, sys
from galaxy import eggs
import pkg_resources; pkg_resources.require( "bx-python" )
from bx.cookbook import doc_optparse
@@ -62,28 +62,29 @@
orig_cond_text = cond_text
# Expand to allow for DNA codes
dot_letters = [ letter for letter in string.uppercase if letter not in \
- [ 'A', 'T', 'U', 'G', 'C', 'K', 'M', 'R', 'Y', 'S', 'W', 'B', 'V', 'H', 'D', 'N', 'X' ] ]
- codes = {'A': [ 'A', 'M', 'R', 'W', 'V', 'H', 'D' ],
- 'T': [ 'T', 'U', 'K', 'Y', 'W', 'B', 'H', 'D' ],
- 'G': [ 'G', 'K', 'R', 'S', 'B', 'V', 'D' ],
- 'C': [ 'C', 'M', 'Y', 'S', 'B', 'V', 'H' ],
- 'U': [ 'T', 'U', 'K', 'Y', 'W', 'B', 'H', 'D' ],
- 'K': [ 'K', 'G', 'T' ],
- 'M': [ 'M', 'A', 'C' ],
- 'R': [ 'R', 'A', 'G' ],
- 'Y': [ 'Y', 'C', 'T' ],
- 'S': [ 'S', 'C', 'G' ],
- 'W': [ 'W', 'A', 'T' ],
- 'B': [ 'B', 'C', 'G', 'T' ],
- 'V': [ 'V', 'A', 'C', 'G' ],
- 'H': [ 'H', 'A', 'C', 'T' ],
- 'D': [ 'D', 'A', 'G', 'T' ],
+ [ 'A', 'C', 'G', 'T', 'U', 'B', 'D', 'H', 'K', 'M', 'N', 'R', 'S', 'V', 'W', 'X', 'Y' ] ]
+ dot_letters.append( '.' )
+ codes = {'A': [ 'A', 'D', 'H', 'M', 'R', 'V', 'W' ],
+ 'C': [ 'C', 'B', 'H', 'M', 'S', 'V', 'Y' ],
+ 'G': [ 'G', 'B', 'D', 'K', 'R', 'S', 'V' ],
+ 'T': [ 'T', 'U', 'B', 'D', 'H', 'K', 'W', 'Y' ],
+ 'U': [ 'T', 'U', 'B', 'D', 'H', 'K', 'W', 'Y' ],
+ 'K': [ 'G', 'T', 'U', 'B', 'D', 'H', 'K', 'R', 'S', 'V', 'W', 'Y' ],
+ 'M': [ 'A', 'C', 'B', 'D', 'H', 'M', 'R', 'S', 'V', 'W', 'Y' ],
+ 'R': [ 'A', 'G', 'B', 'D', 'H', 'K', 'M', 'R', 'S', 'V', 'W' ],
+ 'Y': [ 'C', 'T', 'U', 'B', 'D', 'H', 'K', 'M', 'S', 'V', 'W', 'Y' ],
+ 'S': [ 'C', 'G', 'B', 'D', 'H', 'K', 'M', 'R', 'S', 'V', 'Y' ],
+ 'W': [ 'A', 'T', 'U', 'B', 'D', 'H', 'K', 'M', 'R', 'V', 'W', 'Y' ],
+ 'B': [ 'C', 'G', 'T', 'U', 'B', 'D', 'H', 'K', 'M', 'R', 'S', 'V', 'W', 'Y' ],
+ 'V': [ 'A', 'C', 'G', 'B', 'D', 'H', 'K', 'M', 'R', 'S', 'V', 'W' ],
+ 'H': [ 'A', 'C', 'T', 'U', 'B', 'D', 'H', 'K', 'M', 'R', 'S', 'V', 'W', 'Y' ],
+ 'D': [ 'A', 'G', 'T', 'U', 'B', 'D', 'H', 'K', 'M', 'R', 'S', 'V', 'W', 'Y' ],
'.': dot_letters,
'-': [ '-' ]}
# Add handling for N and X
if n_handling == "all":
- codes[ 'N' ] = [ 'G', 'A', 'T', 'C', 'U', 'K', 'M', 'R', 'Y', 'S', 'W', 'B', 'V', 'H', 'D', 'N', 'X' ]
- codes[ 'X' ] = [ 'G', 'A', 'T', 'C', 'U', 'K', 'M', 'R', 'Y', 'S', 'W', 'B', 'V', 'H', 'D', 'N', 'X' ]
+ codes[ 'N' ] = [ 'A', 'C', 'G', 'T', 'U', 'B', 'D', 'H', 'K', 'M', 'N', 'R', 'S', 'V', 'W', 'X', 'Y' ]
+ codes[ 'X' ] = [ 'A', 'C', 'G', 'T', 'U', 'B', 'D', 'H', 'K', 'M', 'N', 'R', 'S', 'V', 'W', 'X', 'Y' ]
for code in codes.keys():
if code != '.' and code != '-':
codes[code].append( 'N' )
@@ -91,31 +92,51 @@
else:
codes[ 'N' ] = dot_letters
codes[ 'X' ] = dot_letters
+ codes[ '.' ].extend( [ 'N', 'X' ] )
# Expand conditions to allow for DNA codes
try:
match_replace = {}
- pat = re.compile( "c\d+\s*[!=]=\s*[\w']+" )
+ pat = re.compile( 'c\d+\s*[!=]=\s*[\w\d"\'+-.]+' )
matches = pat.findall( cond_text )
for match in matches:
- if match.find( '==' ) > 0:
+ if match.find( 'chr' ) >= 0 or match.find( 'scaffold' ) >= 0 or match.find( '+' ) >= 0:
+ if match.find( '==' ) >= 0:
+ match_parts = match.split( '==' )
+ elif match.find( '!=' ) >= 0:
+ match_parts = match.split( '!=' )
+ else:
+ raise Exception, "The operators '==' and '!=' were not found."
+ left = match_parts[0].strip()
+ right = match_parts[1].strip()
+ new_match = "(%s)" % ( match )
+ elif match.find( '==' ) > 0:
match_parts = match.split( '==' )
- new_match = '(%s in codes[%s] and %s in codes[%s])' % ( match_parts[0], match_parts[1], match_parts[1], match_parts[0] )
+ left = match_parts[0].strip()
+ right = match_parts[1].strip()
+ new_match = '(%s in codes[%s] and %s in codes[%s])' % ( left, right, right, left )
elif match.find( '!=' ) > 0 :
match_parts = match.split( '!=' )
- new_match = '(%s not in codes[%s] or %s not in codes[%s])' % ( match_parts[0], match_parts[1], match_parts[1], match_parts[0] )
+ left = match_parts[0].strip()
+ right = match_parts[1].strip()
+ new_match = '(%s not in codes[%s] or %s not in codes[%s])' % ( left, right, right, left )
else:
- raise Exception
- if match_parts[1].find( "'" ) >= 0:
- assert match_parts[1].replace( "'", '' ) in [ 'G', 'A', 'T', 'C', 'U', 'K', 'M', 'R', 'Y', 'S', 'W', 'B', 'V', 'H', 'D', 'N', 'X', '-', '.' ]
+ raise Exception, "The operators '==' and '!=' were not found."
+ assert left.startswith( 'c' ), 'The column names should start with c (lowercase)'
+ if right.find( "'" ) >= 0 or right.find( '"' ) >= 0:
+ test = right.replace( "'", '' ).replace( '"', '' )
+ assert test in string.uppercase or test.find( '+' ) >= 0 or test.find( '.' ) >= 0 or test.find( '-' ) >= 0\
+ or test.startswith( 'chr' ) or test.startswith( 'scaffold' ), \
+ 'The value to search for should be a valid base, code, plus sign, chromosome (like "chr1") or scaffold (like "scaffold5"). ' \
+ 'Use the general filter tool to filter on anything else first'
else:
- assert match_parts[1].startswith( 'c' )
+ assert right.startswith( 'c' ), 'The column names should start with c (lowercase)'
match_replace[match] = new_match
+ if len( match_replace.keys() ) == 0:
+ raise Exception, 'There do not appear to be any valid conditions'
for match in match_replace.keys():
- cond_text = cond_text.replace(match, match_replace[match])
- if len( match_replace ) == 0:
- raise Exception
- except:
- stop_err( "One of your conditions is invalid. Make sure to use only '!=' or '==', valid column numbers, and valid base values." )
+ cond_text = cond_text.replace( match, match_replace[match] )
+ except Exception, e:
+ stop_err( "At least one of your conditions is invalid. Make sure to use only '!=' or '==', valid column numbers, and valid base values.\n" + str(e) )
# Attempt to determine if the condition includes executable stuff and, if so, exit
secured = dir()
@@ -177,7 +198,7 @@
out.close()
if str( e ).startswith( 'invalid syntax' ):
valid_filter = False
- stop_err( 'Filter condition "%s" likely invalid. See tool tips, syntax and examples.' % orig_cond_text )
+ stop_err( 'Filter condition "%s" likely invalid. See tool tips, syntax and examples.' % orig_cond_text + ' '+str(e))
else:
stop_err( str( e ) )
diff -r 1fc06b260097 -r 33b475ccc316 tools/stats/dna_filtering.xml
--- a/tools/stats/dna_filtering.xml Wed Feb 10 12:17:38 2010 -0500
+++ b/tools/stats/dna_filtering.xml Wed Feb 10 13:18:45 2010 -0500
@@ -11,7 +11,7 @@
</command>
<inputs>
<param format="tabular" name="input" type="data" label="Filter" help="Query missing? See TIP below."/>
- <param name="cond" size="40" type="text" value="c8=='G'" label="With following condition" help="Double equal signs, ==, must be used as shown above. To filter for an arbitrary string, use the Select tool.">
+ <param name="cond" size="40" type="text" value="c4 == 'G'" label="With following condition" help="Double equal signs, ==, must be used as shown above. To filter for an arbitrary string, use the Select tool.">
<validator type="empty_field" message="Enter a valid filtering condition, see syntax and examples below."/>
</param>
<param name="n_handling" type="select" label="Do you want N (and X) to match A or C or G or T OR nothing?">
@@ -24,28 +24,28 @@
</outputs>
<tests>
<test>
- <param name="input" value="dna_filter_in1.bed" />
+ <param name="input" ftype="tabular" value="dna_filter_in1.tabular" />
<param name="cond" value="c8=='G'" />
<param name="n_handling" value="all" />
- <output name="out_file1" file="dna_filter_out1.bed" />
+ <output name="out_file1" ftype="tabular" file="dna_filter_out1.tabular" />
</test>
<test>
- <param name="input" value="dna_filter_in1.bed" />
- <param name="cond" value="(c10==c11 or c17==c18) and c6!='C' and c23=='R'" />
+ <param name="input" value="dna_filter_in1.tabular" />
+ <param name="cond" value="(c10 == c11 or c17 == c18) and c6 != 'C' and c23 == 'R'" />
<param name="n_handling" value="all" />
- <output name="out_file1" file="dna_filter_out2.bed" />
+ <output name="out_file1" file="dna_filter_out2.tabular" />
</test>
<test>
- <param name="input" value="dna_filter_in1.bed" />
+ <param name="input" value="dna_filter_in1.tabular" />
<param name="cond" value="c4=='B' or c9==c10" />
<param name="n_handling" value="none" />
- <output name="out_file1" file="dna_filter_out3.bed" />
+ <output name="out_file1" file="dna_filter_out3.tabular" />
</test>
<test>
- <param name="input" value="dna_filter_in1.bed" />
- <param name="cond" value="c7!='Y' and c9!='U'" />
+ <param name="input" value="dna_filter_in1.tabular" />
+ <param name="cond" value="c1!='chr1' and c7!='Y' and c25!='+'" />
<param name="n_handling" value="none" />
- <output name="out_file1" file="dna_filter_out4.bed" />
+ <output name="out_file1" file="dna_filter_out4.tabular" />
</test>
</tests>
<help>
@@ -73,6 +73,7 @@
- When using 'equal-to' operator **double equal sign '==' must be used** ( e.g., **c1=='chr1'** )
- Non-numerical values must be included in single or double quotes ( e.g., **c6=='C'** )
- Filtering condition can include logical operators, but **make sure operators are all lower case** ( e.g., **(c1!='chrX' and c1!='chrY') or c6=='+'** )
+- You can use spaces between the arguments and equality sign or not (e.g. both **c9 == c10** and **c9==c10** are valid)
-----
@@ -109,6 +110,7 @@
- **c8=='A'** selects lines in which the eighth column is A, M, R, W, V, H, D and N or X if appropriate
- **c12==c15** selects lines where the value in the twelfth column could be the same as the fifteenth and the fifteenth column could be the same as the twelfth column (based on appropriate codes)
- **c9!=c19** selects lines where column nine could not be the same as column nineteen and column nineteen could not be the same as column nine (using appropriate codes)
+- **c4 == 'A' and c4 == c5** selects lines where column 4 and 5 are both A, M, R, W, V, H, D and N or X if appropriate
</help>
</tool>
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/1fc06b260097
changeset: 3363:1fc06b260097
user: Kanwei Li <kanwei(a)gmail.com>
date: Wed Feb 10 12:17:38 2010 -0500
description:
trackster:
- Refactor element creation code
- Can delete tracks
- Can reorder tracks
diffstat:
static/june_2007_style/history.css.tmpl | 2 +-
static/scripts/trackster.js | 19 ++++++++++--
templates/tracks/browser.mako | 49 ++++++++++++++++----------------
3 files changed, 41 insertions(+), 29 deletions(-)
diffs (142 lines):
diff -r 445986a09dbb -r 1fc06b260097 static/june_2007_style/history.css.tmpl
--- a/static/june_2007_style/history.css.tmpl Tue Feb 09 15:05:39 2010 -0500
+++ b/static/june_2007_style/history.css.tmpl Wed Feb 10 12:17:38 2010 -0500
@@ -19,7 +19,7 @@
margin: 5px 0 5px 0;
}
-## Default history item appearend
+## Default history item appearance
div.historyItem {
margin: 5px -5px 5px 0px;
padding: 5px 11px 5px 5px;
diff -r 445986a09dbb -r 1fc06b260097 static/scripts/trackster.js
--- a/static/scripts/trackster.js Tue Feb 09 15:05:39 2010 -0500
+++ b/static/scripts/trackster.js Wed Feb 10 12:17:38 2010 -0500
@@ -89,21 +89,34 @@
this.center = (this.max_high - this.max_low) / 2;
this.zoom_factor = 3;
this.zoom_level = 0;
+ this.track_id_counter = 0;
};
$.extend( View.prototype, {
add_track: function ( track ) {
track.view = this;
+ track.track_id = this.track_id_counter;
this.tracks.push( track );
if (track.init) { track.init(); }
+ track.container_div.attr('id', 'track_' + track.track_id);
+ this.track_id_counter += 1;
},
add_label_track: function ( label_track ) {
label_track.view = this;
this.label_tracks.push( label_track );
},
remove_track: function( track ) {
+ track.container_div.fadeOut('slow', function() { $(this).remove(); });
delete this.tracks[track];
},
update_options: function() {
+ var sorted = $("ul#sortable-ul").sortable('toArray');
+ var payload = [];
+
+ var divs = $("#viewport > div").sort(function (a, b) {
+ return sorted.indexOf( $(a).attr('id') ) > sorted.indexOf( $(b).attr('id') );
+ });
+ $("#viewport > div").remove();
+ $("#viewport").html(divs);
for (var track_id in view.tracks) {
var track = view.tracks[track_id];
if (track.update_options) {
@@ -177,13 +190,13 @@
var Track = function ( name, parent_element ) {
this.name = name;
this.parent_element = parent_element;
- this.make_container();
+ this.init_global();
};
$.extend( Track.prototype, {
- make_container: function () {
+ init_global: function () {
this.header_div = $("<div class='track-header'>").text( this.name );
this.content_div = $("<div class='track-content'>");
- this.container_div = $("<div class='track'></div>").append( this.header_div ).append( this.content_div );
+ this.container_div = $("<div></div>").addClass('track').append( this.header_div ).append( this.content_div );
this.parent_element.append( this.container_div );
}
});
diff -r 445986a09dbb -r 1fc06b260097 templates/tracks/browser.mako
--- a/templates/tracks/browser.mako Tue Feb 09 15:05:39 2010 -0500
+++ b/templates/tracks/browser.mako Wed Feb 10 12:17:38 2010 -0500
@@ -25,15 +25,6 @@
margin: 5px 0;
background: #eee;
}
- .delete-button {
- background: transparent url(history-buttons.png) no-repeat scroll 0 -104px;
- height: 20px;
- width: 20px;
- }
- .delete-button:hover {
- background-position: 0 -130px;
- }
-
</style>
</%def>
@@ -231,7 +222,6 @@
});
});
-
hide_modal();
},
"Cancel": function() {
@@ -307,23 +297,32 @@
function sidebar_box(track) {
if (!track.hidden) {
- var track_id = view.tracks.length -1; // Track was just added to view, so index is current length -1
- var label = $('<label for="track_' + track_id + 'title">' + track.name + '</label>');
- var title = $('<div class="historyItemTitle"></div>');
- var del_icon = $('<a style="display:block; float:right" href="#" class="icon-button delete" />');
- var body = $('<div class="historyItemBody"></div>');
- // var checkbox = $('<input type="checkbox" checked="checked"></input>').attr("id", "track_" + track_id + "title");
- var li = $('<li class="sortable"></li>').attr("id", "track_" + track_id);
- var div = $('<div class="historyItemContainer historyItem"></div>');
- del_icon.prependTo(title);
- label.appendTo(title);
- // checkbox.prependTo(title);
+ var track_id = track.track_id,
+ label = $('<label for="track_' + track_id + 'title">' + track.name + '</label>'),
+ title = $('<div class="historyItemTitle"></div>'),
+ del_icon = $('<a style="display:block; float:right" href="#" class="icon-button delete" />'),
+ edit_icon = $('<a style="display:block; float:right" href="#" class="icon-button edit" />'),
+ body = $('<div class="historyItemBody"></div>'),
+ checkbox = $('<input type="checkbox" checked="checked"></input>').attr("id", "track_" + track_id + "title"),
+ li = $('<li class="sortable"></li>').attr("id", "track_" + track_id),
+ div = $('<div class="historyItemContainer historyItem"></div>'),
+ editable = $('<div style="display:none"></div>');
+
+ edit_icon.bind("click", function() {
+ editable.toggle();
+ });
+
+ del_icon.bind("click", function() {
+ li.fadeOut('slow', function() { $(this).remove(); });
+ view.remove_track(track);
+ view.update_options();
+ });
+
+ title.append(label).append(del_icon).append(edit_icon);
if (track.gen_options) {
- body.append(track.gen_options(track_id));
+ editable.append(track.gen_options(track_id)).appendTo(body);
}
- title.prependTo(div);
- body.appendTo(div);
- li.append(div);
+ div.append(title).append(body).appendTo(li)
$("ul#sortable-ul").append(li);
}
};
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/445986a09dbb
changeset: 3362:445986a09dbb
user: rc
date: Tue Feb 09 15:05:39 2010 -0500
description:
Removed NumberField from form_builder
diffstat:
lib/galaxy/model/__init__.py | 3 ---
lib/galaxy/web/form_builder.py | 21 +--------------------
templates/admin/requests/show_request.mako | 2 --
templates/requests/show_request.mako | 2 --
4 files changed, 1 insertions(+), 27 deletions(-)
diffs (75 lines):
diff -r 606686b073f3 -r 445986a09dbb lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py Tue Feb 09 13:40:01 2010 -0500
+++ b/lib/galaxy/model/__init__.py Tue Feb 09 15:05:39 2010 -0500
@@ -1267,9 +1267,6 @@
if field[ 'type' ] == 'TextField':
field_widget.set_size( 40 )
field_widget.value = value
- if field[ 'type' ] == 'NumberField':
- field_widget.set_size( 40 )
- field_widget.value = value
elif field[ 'type' ] == 'TextArea':
field_widget.set_size( 3, 40 )
field_widget.value = value
diff -r 606686b073f3 -r 445986a09dbb lib/galaxy/web/form_builder.py
--- a/lib/galaxy/web/form_builder.py Tue Feb 09 13:40:01 2010 -0500
+++ b/lib/galaxy/web/form_builder.py Tue Feb 09 15:05:39 2010 -0500
@@ -12,7 +12,7 @@
raise TypeError( "Abstract Method" )
@staticmethod
def form_field_types():
- return ['TextField', 'NumberField', 'TextArea', 'SelectField', 'CheckboxField', 'AddressField']
+ return ['TextField', 'TextArea', 'SelectField', 'CheckboxField', 'AddressField']
class TextField(BaseField):
"""
@@ -51,25 +51,6 @@
% ( prefix, self.name, self.size, escape(str(self.value), quote=True) )
def set_size(self, size):
self.size = int( size )
-
-class NumberField(BaseField):
- """
- A number input box.
-
- >>> print NumberField( "foo" ).get_html()
- <input type="int" name="foo" size="10" value="">
- >>> print NumberField( "bins", size=4, value="12345" ).get_html()
- <input type="int" name="bins" size="4" value="12345">
- """
- def __init__( self, name, size=None, value=None ):
- self.name = name
- self.size = int( size or 10 )
- self.value = value or ""
- def get_html( self, prefix="" ):
- return '<input type="int" name="%s%s" size="%d" value="%s">' \
- % ( prefix, self.name, self.size, escape(str(self.value), quote=True) )
- def set_size(self, size):
- self.size = int( size )
class TextArea(BaseField):
"""
diff -r 606686b073f3 -r 445986a09dbb templates/admin/requests/show_request.mako
--- a/templates/admin/requests/show_request.mako Tue Feb 09 13:40:01 2010 -0500
+++ b/templates/admin/requests/show_request.mako Tue Feb 09 15:05:39 2010 -0500
@@ -226,8 +226,6 @@
</select>
%elif field['type'] == 'CheckboxField':
<input type="checkbox" name="sample_${index}_field_${field_index}" value="Yes"/>
- %elif field['type'] == 'NumberField':
- <input type="int" name="sample_${index}_field_${field_index}" value="${sample_values[field_index]}" size="7"/>
%endif
<div class="toolParamHelp" style="clear: both;">
<i>${'('+field['required']+')' }</i>
diff -r 606686b073f3 -r 445986a09dbb templates/requests/show_request.mako
--- a/templates/requests/show_request.mako Tue Feb 09 13:40:01 2010 -0500
+++ b/templates/requests/show_request.mako Tue Feb 09 15:05:39 2010 -0500
@@ -214,8 +214,6 @@
</select>
%elif field['type'] == 'CheckboxField':
<input type="checkbox" name="sample_${index}_field_${field_index}" value="Yes"/>
- %elif field['type'] == 'NumberField':
- <input type="int" name="sample_${index}_field_${field_index}" value="${sample_values[field_index]}" size="7"/>
%endif
<div class="toolParamHelp" style="clear: both;">
<i>${'('+field['required']+')' }</i>
1
0