galaxy-dev
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
December 2009
- 30 participants
- 108 discussions
Hello,
I am trying to set up the apache proxy setting for a local galaxy install.
I have this section set but the REMOTE_USER is not getting set properly:
<Location />
AuthType Basic
AuthBasicProvider ldap
AuthLDAPURL
"ldap://server:389/ou=People,dc=domain,dc=edu?uid?sub?(objectClass=person)"
AuthzLDAPAuthoritative off
Require valid-user
</Location>
RequestHeader set REMOTE_USER %{AUTHENTICATE_uid}e
I have a feeling I'm missing something.
The authentication for the server is working but the galaxy interface gives
the error message that the remote user is not being sent.
Any additional settings that I'm missing here?
Kind Regards,
Kimberly
2
4
Hi,
I'm a PhD student in Tsinghua University, Beijing.
I set up a local Galaxy, and import a bed file. I want to sort all the rows by the the second column' value, "start position" ,in ascending order. It failed when executed in my local version, however, it's OK to run on the Galaxy's public site. The system is Ubuntu 9.10,and the python version is 2.6.4. The bed file is about 150,000 lines.
Is it the problem of database or other? I am not using any external database for the local galaxy.
Best,
Weilong Guo
The error message is as follow.
----------------------------------
Traceback (most recent call last):
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/lib/galaxy/jobs/runners/local.py", line 122, in run_job
job_wrapper.finish( stdout, stderr )
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/lib/galaxy/jobs/__init__.py", line 569, in finish
self.sa_session.flush()
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/scoping.py", line 127, in do
return getattr(self.registry(), name)(*args, **kwargs)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/session.py", line 1356, in flush
self._flush(objects)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/session.py", line 1434, in _flush
flush_context.execute()
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 261, in execute
UOWExecutor().execute(self, tasks)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 753, in execute
self.execute_save_steps(trans, task)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 773, in execute_save_steps
self.execute_cyclical_dependencies(trans, task, False)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 789, in execute_cyclical_dependencies
self.execute(trans, [t], isdelete)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 753, in execute
self.execute_save_steps(trans, task)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 768, in execute_save_steps
self.save_objects(trans, task)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/unitofwork.py", line 759, in save_objects
task.mapper._save_obj(task.polymorphic_tosave_objects, trans)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/orm/mapper.py", line 1413, in _save_obj
c = connection.execute(statement.values(value_params), params)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/engine/base.py", line 824, in execute
return Connection.executors[c](self, object, multiparams, params)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/engine/base.py", line 874, in _execute_clauseelement
return self.__execute_context(context)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/engine/base.py", line 896, in __execute_context
self._cursor_execute(context.cursor, context.statement, context.parameters[0], context=context)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/engine/base.py", line 950, in _cursor_execute
self._handle_dbapi_exception(e, statement, parameters, cursor, context)
File "/home/guoweilong/GWL-galaxy/galaxy_gwl/eggs/py2.6-noplatform/SQLAlchemy-0.5.6_dev_r6498-py2.6.egg/sqlalchemy/engine/base.py", line 931, in _handle_dbapi_exception
raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
ProgrammingError: (ProgrammingError) You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings. u'UPDATE history_dataset_association SET update_time=?, info=?, blurb=?, peek=? WHERE history_dataset_association.id = ?' ['2009-12-21 02:41:54.450928', 'sort: \xe5\xa4\x9a\xe5\xad\x97\xe7\xac\xa6\xe6\xa0\x87\xe7\xad\xbe\xe2\x80\x9c$\\t\xe2\x80\x9d\n', 'error', 'no peek', 7]
2
1
details: http://www.bx.psu.edu/hg/galaxy/rev/2b632af1f56d
changeset: 3184:2b632af1f56d
user: James Taylor <james(a)jamestaylor.org>
date: Thu Dec 17 14:32:44 2009 -0500
description:
Packed scripts
diffstat:
static/scripts/packed/autocomplete_tagging.js | 2 +-
static/scripts/packed/galaxy.base.js | 2 +-
static/scripts/packed/trackster.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diffs (24 lines):
diff -r 256889bc552f -r 2b632af1f56d static/scripts/packed/autocomplete_tagging.js
--- a/static/scripts/packed/autocomplete_tagging.js Thu Dec 17 08:25:31 2009 -0500
+++ b/static/scripts/packed/autocomplete_tagging.js Thu Dec 17 14:32:44 2009 -0500
@@ -1,1 +1,1 @@
-jQuery.fn.autocomplete_tagging=function(f,d){var g={get_toggle_link_text_fn:function(u){var w="";var v=o(u);if(v!=0){w=v+(v!=0?" Tags":" Tag")}else{w="Add tags"}return w},tag_click_fn:function(u,v){},editable:true,input_size:20,in_form:false,tags:{},use_toggle_link:true,item_id:"",add_tag_img:"",add_tag_img_rollover:"",delete_tag_img:"",ajax_autocomplete_tag_url:"",ajax_retag_url:"",ajax_delete_tag_url:"",ajax_add_tag_url:""};var q=jQuery.extend(g,d);var o=function(u){if(u.length){return u.length}var v=0;for(element in u){v++}return v};var e=$("#"+f);var m=$(this).attr("id").split("-");var a=m[m.length-1];var l=e.find("#tag-area-"+a);var s=e.find("#toggle-link-"+a);var n=e.find("#tag-input");var h=e.find(".add-tag-button");s.click(function(){var x=$(this).attr("id").split("-")[2];var v=$("#tag-area-"+x);var u=(v.css("display")=="none");var w;if(u){w=function(){var y=$(this).find(".tag-button").length;if(y==0){v.click()}}}else{w=function(){v.blur()}}v.slideToggle("fast",w);re
turn $(this)});if(q.editable){n.hide()}n.keyup(function(z){if(z.keyCode==27){$(this).trigger("blur")}else{if((z.keyCode==13)||(z.keyCode==188)||(z.keyCode==32)){new_value=this.value;if(return_key_pressed_for_autocomplete==true){return_key_pressed_for_autocomplete=false;return false}if(new_value.indexOf(": ",new_value.length-2)!=-1){this.value=new_value.substring(0,new_value.length-1);return false}if((z.keyCode==188)||(z.keyCode==32)){new_value=new_value.substring(0,new_value.length-1)}new_value=new_value.replace(/^\s+|\s+$/g,"");if(new_value.length<2){return false}this.value="";var w=j(new_value);var v=l.children(".tag-button");if(v.length!=0){var A=v.slice(v.length-1);A.after(w)}else{l.prepend(w)}var u=new_value.split(":");q.tags[u[0]]=u[1];var x=q.get_toggle_link_text_fn(q.tags);s.text(x);var y=$(this);$.ajax({url:q.ajax_add_tag_url,data:{new_tag:new_value},error:function(){w.remove();delete q.tags[u[0]];var B=q.get_toggle_link_text_fn(q.tags);s.text(B);alert("Add tag fail
ed")},success:function(){y.flushCache()}});return false}}});var c=function(w,v,u,y,x){tag_name_and_value=y.split(":");return(tag_name_and_value.length==1?tag_name_and_value[0]:tag_name_and_value[1])};var k={selectFirst:false,formatItem:c,autoFill:false,highlight:false};n.autocomplete(q.ajax_autocomplete_tag_url,k);e.find(".delete-tag-img").each(function(){p($(this))});e.find(".tag-name").each(function(){$(this).click(function(){var v=$(this).text();var u=v.split(":");q.tag_click_fn(u[0],u[1]);return true})});h.click(function(){$(this).hide();l.click();return false});if(q.editable){l.blur(function(u){r=o(q.tags);if(r!=0){h.show();n.hide();l.removeClass("active-tag-area")}else{}});l.click(function(w){var v=$(this).hasClass("active-tag-area");if($(w.target).hasClass("delete-tag-img")&&!v){return false}if($(w.target).hasClass("tag-name")&&!v){return false}$(this).addClass("active-tag-area");h.hide();n.show();n.focus();var u=function(y){var x=l.attr("id");if(($(y.target).attr("id
")!=x)&&($(y.target).parents().filter(x).length==0)){l.blur();$(document).unbind("click",u)}};$(window).click(u);return false})}if(q.use_toggle_link){l.hide()}else{var r=o(q.tags);if(r==0){h.hide();n.show()}}function b(v,u){return v+((u!=""&&u)?":"+u:"")}function p(u){$(u).mouseenter(function(){$(this).attr("src",q.delete_tag_img_rollover)});$(u).mouseleave(function(){$(this).attr("src",q.delete_tag_img)});$(u).click(function(){var A=$(this).parent();var z=A.find(".tag-name").eq(0);var y=z.text();var w=i(y);var C=w[0];var v=w[1];var B=A.prev();A.remove();delete q.tags[C];var x=q.get_toggle_link_text_fn(q.tags);s.text(x);$.ajax({url:q.ajax_delete_tag_url,data:{tag_name:C},error:function(){q.tags[C]=v;if(B.hasClass("tag-button")){B.after(A)}else{l.prepend(A)}var D=q.get_toggle_link_text_fn(q.tags);alert("Remove tag failed");s.text(D);u.mouseenter(function(){$(this).attr("src",q.delete_tag_img_rollover)});u.mouseleave(function(){$(this).attr("src",q.delete_tag_img)})},success:f
unction(){}});return true})}function t(u){var v=new Array();for(key in u){v[v.length]=key+"-->"+u[key]}return"{"+v.join(",")+"}"}function i(u){return u.split(":")}function j(u){var v=$("<img src='"+q.delete_tag_img+"'/>").addClass("delete-tag-img");p(v);var w=$("<span>").text(u).addClass("tag-name");w.click(function(){tag_name_and_value=u.split(":");q.tag_click_fn(tag_name_and_value[0],tag_name_and_value[1]);return true});var x=$("<span></span>").addClass("tag-button");x.append(w);if(q.editable){x.append(v)}return x}};
\ No newline at end of file
+function init_tag_click_function(b,a){$(b).find(".tag-name").each(function(){$(this).click(function(){var d=$(this).text();var c=d.split(":");a(c[0],c[1]);return true})})}jQuery.fn.autocomplete_tagging=function(q){var g={get_toggle_link_text_fn:function(r){var t="";var s=o(r);if(s!=0){t=s+(s!=0?" Tags":" Tag")}else{t="Add tags"}return t},tag_click_fn:function(r,s){},editable:true,input_size:20,in_form:false,tags:{},use_toggle_link:true,item_id:"",add_tag_img:"",add_tag_img_rollover:"",delete_tag_img:"",ajax_autocomplete_tag_url:"",ajax_retag_url:"",ajax_delete_tag_url:"",ajax_add_tag_url:""};var e=jQuery.extend(g,q);var o=function(r){if(r.length){return r.length}var s=0;for(element in r){s++}return s};var h=$(this);var c=h.find(".tag-area");var f=h.find(".toggle-link");var b=h.find(".tag-input");var n=h.find(".add-tag-button");f.click(function(){var r=(c.css("display")=="none");var s;if(r){s=function(){var t=$(this).find(".tag-button").length;if(t==0){c.click()}}}else{s=func
tion(){c.blur()}}c.slideToggle("fast",s);return $(this)});if(e.editable){b.hide()}b.keyup(function(w){if(w.keyCode==27){$(this).trigger("blur")}else{if((w.keyCode==13)||(w.keyCode==188)||(w.keyCode==32)){new_value=this.value;if(return_key_pressed_for_autocomplete==true){return_key_pressed_for_autocomplete=false;return false}if(new_value.indexOf(": ",new_value.length-2)!=-1){this.value=new_value.substring(0,new_value.length-1);return false}if((w.keyCode==188)||(w.keyCode==32)){new_value=new_value.substring(0,new_value.length-1)}new_value=new_value.replace(/^\s+|\s+$/g,"");if(new_value.length<2){return false}this.value="";var t=k(new_value);var s=c.children(".tag-button");if(s.length!=0){var x=s.slice(s.length-1);x.after(t)}else{c.prepend(t)}var r=new_value.split(":");e.tags[r[0]]=r[1];var u=e.get_toggle_link_text_fn(e.tags);f.text(u);var v=$(this);$.ajax({url:e.ajax_add_tag_url,data:{new_tag:new_value},error:function(){t.remove();delete e.tags[r[0]];var y=e.get_toggle_link_te
xt_fn(e.tags);f.text(y);alert("Add tag failed")},success:function(){v.flushCache()}});return false}}});var j=function(t,s,r,v,u){tag_name_and_value=v.split(":");return(tag_name_and_value.length==1?tag_name_and_value[0]:tag_name_and_value[1])};var i={selectFirst:false,formatItem:j,autoFill:false,highlight:false};b.autocomplete(e.ajax_autocomplete_tag_url,i);h.find(".delete-tag-img").each(function(){d($(this))});init_tag_click_function($(this),e.tag_click_fn);n.click(function(){$(this).hide();c.click();return false});if(e.editable){c.blur(function(r){p=o(e.tags);if(p!=0){n.show();b.hide();c.removeClass("active-tag-area")}else{}});c.click(function(t){var s=$(this).hasClass("active-tag-area");if($(t.target).hasClass("delete-tag-img")&&!s){return false}if($(t.target).hasClass("tag-name")&&!s){return false}$(this).addClass("active-tag-area");n.hide();b.show();b.focus();var r=function(v){var u=c.attr("id");if(($(v.target).attr("id")!=u)&&($(v.target).parents().filter(u).length==0))
{c.blur();$(document).unbind("click",r)}};$(window).click(r);return false})}if(e.use_toggle_link){c.hide()}else{var p=o(e.tags);if(p==0){n.hide();b.show()}}function l(s,r){return s+((r!=""&&r)?":"+r:"")}function d(r){$(r).mouseenter(function(){$(this).attr("src",e.delete_tag_img_rollover)});$(r).mouseleave(function(){$(this).attr("src",e.delete_tag_img)});$(r).click(function(){var x=$(this).parent();var w=x.find(".tag-name").eq(0);var v=w.text();var t=m(v);var z=t[0];var s=t[1];var y=x.prev();x.remove();delete e.tags[z];var u=e.get_toggle_link_text_fn(e.tags);f.text(u);$.ajax({url:e.ajax_delete_tag_url,data:{tag_name:z},error:function(){e.tags[z]=s;if(y.hasClass("tag-button")){y.after(x)}else{c.prepend(x)}var A=e.get_toggle_link_text_fn(e.tags);alert("Remove tag failed");f.text(A);r.mouseenter(function(){$(this).attr("src",e.delete_tag_img_rollover)});r.mouseleave(function(){$(this).attr("src",e.delete_tag_img)})},success:function(){}});return true})}function a(r){var s=new
Array();for(key in r){s[s.length]=key+"-->"+r[key]}return"{"+s.join(",")+"}"}function m(r){return r.split(":")}function k(r){var s=$("<img src='"+e.delete_tag_img+"'/>").addClass("delete-tag-img");d(s);var t=$("<span>").text(r).addClass("tag-name");t.click(function(){tag_name_and_value=r.split(":");e.tag_click_fn(tag_name_and_value[0],tag_name_and_value[1]);return true});var u=$("<span></span>").addClass("tag-button");u.append(t);if(e.editable){u.append(s)}return u}};
\ No newline at end of file
diff -r 256889bc552f -r 2b632af1f56d static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js Thu Dec 17 08:25:31 2009 -0500
+++ b/static/scripts/packed/galaxy.base.js Thu Dec 17 14:32:44 2009 -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")}})};jQuery(document).ready(function(){jQuery("a[confirm]").click(function(){return confirm(jQuery(this).attr("confirm"))});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}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.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=funct
ion(){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","?")}}}})}};
\ 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")}})};jQuery(document).ready(function(){jQuery("a[confirm]").click(function(){return confirm(jQuery(this).attr("confirm"))});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}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","?")}}}})}};
\ No newline at end of file
diff -r 256889bc552f -r 2b632af1f56d static/scripts/packed/trackster.js
--- a/static/scripts/packed/trackster.js Thu Dec 17 08:25:31 2009 -0500
+++ b/static/scripts/packed/trackster.js Thu Dec 17 14:32:44 2009 -0500
@@ -1,1 +1,1 @@
-var DEBUG=false;var DENSITY=1000,FEATURE_LEVELS=100,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_
img_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.obj_cache={};this.key_ary=[]};$.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}});var View=function(b,a){this.chrom=b;this.tracks=[];this.max_low=0;this.max_high=a;this.center=(this.max_high-this.max_low)/2;this.span=this.max_high-this.max_low;this.zoom_factor=2;this.zoom_level=0};$.extend(View.prototype,{add_track:function(a){a.view=this;this.tracks.push(a);if(a.init){a.init()}},redraw:function(){var d=this.span/Math.pow(this.zoom_factor,this.zoom_level),b=thi
s.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.max(1,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));for(var c=0,a=this.tracks.length;c<a;c++){this.tracks[c].draw()}$("#bottom-spacer").remove();$("#viewport").append('<div id="bottom-spacer" style="height: 200px;"></div>')},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:fun
ction(){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.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.zo
om_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)}else{h=this.draw_tile(d,a,k,l);if(h){this.tile_cache.set(j,h)}}a+=1}}});var LabelTrack=function(a){Track.call(this,null,a);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,b,a){this.tile_cache=new Cache(CACHED_TILES_LINE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.track_type="line";this.height_px=(a?a:100);this.contain
er_div.addClass("line-track");this.dataset_id=b;this.data_queue={};this.cache=new Cache(CACHED_DATA)};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this;a.content_div.text(DATA_LOADING);$.getJSON(data_url,{stats:true,track_type:a.track_type,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(c){if(!c||c=="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR)}else{if(c=="no data"){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(c=="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");a.min_value=c.min;a.max_value=c.max;a.vertical_range=a.max_value-a.min_value;var d=$("<div class='yaxislabel'>"+a.min_value+"</div>");var b=$("<div class='yaxislabel'>"+a.max_value+"</div>");b.css({position:"relative",top:"35px"});b.prependTo(a.container_div);d.css({positi
on:"relative",top:a.height_px+32+"px"});d.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,{track_type:this.track_type,chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution},function(g){c.cache.set(e,g);delete c.data_queue[e];c.draw()})}},draw_tile:function(d,a,m,o){if(!this.vertical_range){return}var h=a*DENSITY*d,b=DENSITY*d,c=$("<canvas class='tile'></canvas>"),l=d+"_"+a;if(!this.cache.get(l)){this.get_data(d,a);return}var g=this.cache.get(l);c.css({position:"absolute",top:0,left:(h-this.view.low)*o});c.get(0).width=Math.ceil(b*o);c.get(0).height=this.height_px;var n=c.get(0).getContext("2d");var e=false;n.beginPath();for(var f=0;f<g.length-1;f++){var k=g[f][0]-h;var j=g[f][1];if(isNaN(j)){e=false}else{k=k*o;j=(j-this.min_value)/this.vertical_range*this.height_px;if(e){n.lineTo(k,j)}else{n.moveTo(k,j);e=t
rue}}}n.stroke();m.append(c);return c}});var FeatureTrack=function(c,b,a){this.tile_cache=new Cache(CACHED_TILES_FEATURE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.track_type="feature";this.height_px=(a?a:100);this.container_div.addClass("feature-track");this.dataset_id=b;this.zo_slots={};this.show_labels_scale=0.001;this.showing_labels=false;this.vertical_gap=10;this.base_color="#2C3143";this.default_font="9px Monaco, Lucida Console, monospace";this.left_offset=200;this.inc_slots={};this.data_queue={};this.data_cache=new Cache(20)};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this;a.content_div.text(DATA_LOADING);$.getJSON(data_url,{track_type:a.track_type,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_NO
NE)}else{if(b=="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");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,{track_type:b.track_type,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 c=[],b=this.content_div.width()/(this.view.high-this.view.low),a=this.view.max_high,e=this.view.max_low;for(var f=0,g=this.values.length;f<g;f++){var h,k,l=this.values[f];h=Math.floor((l.start-e)*b);k=Math.ceil((l.end-e)*b);var d=0;while(true){if(c[d]===undefined||c[d]<h){c[d]=k;this.zo_slots[l.uid]=d;break}d++}}this.height_px=c.length*this.vertical_gap+15;this.content_div.css("height",this.height_px+"px")},increment
al_slots:function(a,b){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=DENSITY/Math.pow(FEATURE_LEVELS,a+1)}var k=this.inc_slots[a];var d=[],l=[],c=0,m=$("<canvas></canvas>").get(0).getContext("2d"),f=this.view.max_low;for(var g=0,h=b.length;g<h;g++){var n=b[g];if(k[n.uid]){c=Math.max(c,k[n.uid]);d[k[n.uid]]=Math.ceil((n.end-f)*k.w_scale)}else{l.push(n)}}for(var g=0,h=l.length;g<h;g++){var n=l[g];f_start=Math.floor((n.start-f)*k.w_scale);f_start-=m.measureText(n.name).width;f_end=Math.ceil((n.end-f)*k.w_scale);var e=0;while(true){if(d[e]===undefined||d[e]<f_start){d[e]=f_end;k[n.uid]=e;c=Math.max(c,e);break}e++}}return c},draw_tile:function(A,F,n,r){if(!this.values){return}var G=F*DENSITY*A,c=(F+1)*DENSITY*A,v=DENSITY*A;var K,u,h;if(r>this.show_labels_scale){if(!this.showing_labels){this.showing_labels=true}for(var B in this.data_cache.obj_cache){var p=B.split("_"),e=p[0],d=p[1];if(e<=G&&d>=c){K=this.data_cache.get(B);break}}if(!K){this.data_queue[[G,c]
]=true;this.get_data(G,c);return}h=this.incremental_slots(this.view.zoom_res,K)*this.vertical_gap+15;u=this.inc_slots[this.view.zoom_res]}else{if(this.showing_labels){this.showing_labels=false}h=this.height_px;u=this.zo_slots;K=this.values}var y=Math.ceil(v*r),x=$("<canvas class='tile'></canvas>");x.css({position:"absolute",top:0,left:(G-this.view.low)*r-this.left_offset});x.get(0).width=y+this.left_offset;x.get(0).height=h;var z=x.get(0).getContext("2d");z.fillStyle=this.base_color;z.font=this.default_font;z.textAlign="right";var C=0;for(var D=0,E=K.length;D<E;D++){var m=K[D];if(m.start<=c&&m.end>=G){var g=Math.floor(Math.max(0,(m.start-G)*r)),l=Math.ceil(Math.min(y,(m.end-G)*r)),f=u[m.uid]*this.vertical_gap;var a,L,b=null,s=null;if(m.thick_start&&m.thick_end){b=Math.floor(Math.max(0,(m.thick_start-G)*r));s=Math.ceil(Math.min(y,(m.thick_end-G)*r))}if(!this.showing_labels){z.fillRect(g+this.left_offset,f+5,l-g,1)}else{if(z.fillText&&m.start>G){z.fillText(m.name,g-1+this.left
_offset,f+8)}var I=m.blocks;if(I){if(m.strand){if(m.strand=="+"){z.fillStyle=RIGHT_STRAND}else{if(m.strand=="-"){z.fillStyle=LEFT_STRAND}}z.fillRect(g+this.left_offset,f,l-g,10);z.fillStyle=this.base_color}for(var B=0,J=I.length;B<J;B++){var q=I[B],o=Math.floor(Math.max(0,(q[0]-G)*r)),H=Math.ceil(Math.min(y,(q[1]-G)*r));if(o>H){continue}a=5;L=3;z.fillRect(o+this.left_offset,f+L,H-o,a);if(b&&(o<s||H>b)){a=9;L=1;var w=Math.max(o,b),t=Math.min(H,s);z.fillRect(w+this.left_offset,f+L,t-w,a)}}}else{a=9;L=1;z.fillRect(g+this.left_offset,f+L,l-g,a);if(m.strand){if(m.strand=="+"){z.fillStyle=RIGHT_STRAND_INV}else{if(m.strand=="-"){z.fillStyle=LEFT_STRAND_INV}}z.fillRect(g+this.left_offset,f,l-g,10);z.fillStyle=this.base_color}}}C++}}n.append(x);return x}});
\ No newline at end of file
+var DEBUG=false;var DENSITY=1000,FEATURE_LEVELS=100,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_
img_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.obj_cache={};this.key_ary=[]};$.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}});var View=function(b,a){this.chrom=b;this.tracks=[];this.max_low=0;this.max_high=a;this.center=(this.max_high-this.max_low)/2;this.span=this.max_high-this.max_low;this.zoom_factor=2;this.zoom_level=0};$.extend(View.prototype,{add_track:function(a){a.view=this;this.tracks.push(a);if(a.init){a.init()}},redraw:function(){var d=this.span/Math.pow(this.zoom_factor,this.zoom_level),b=thi
s.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.max(1,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));for(var c=0,a=this.tracks.length;c<a;c++){this.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;thi
s.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 j=this.view.low,e=this.view.high,f=e-j,d=this.view.resolution;if(DEBUG){$("#debug").text(d+" "+this.view.zoom_res)}var l=$("<div style='position: relative;'></div>");this.content_div.children(":first").remove();this.content_div.append(l);var m=this.content_div.width()/f;var i=20;var h;var a=Math.floor(j/d/DENSITY);while((a*DENSITY*d)<e){var k=this.content_div.width()+"_"+this.view.zoom_level+"_"+a;var c=this.tile_cache.get(k);if(c){var g=a*DENSITY*d;var b=(g-j)*m;if(this.left_off
set){b-=this.left_offset}c.css({left:b});l.append(c);i=Math.max(i,c.height())}else{h=this.draw_tile(d,a,l,m);if(h){this.tile_cache.set(k,h);i=Math.max(i,h.height())}}this.content_div.css("height",i);a+=1}}});var LabelTrack=function(a){Track.call(this,null,a);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,b,a){this.tile_cache=new Cache(CACHED_TILES_LINE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.track_type="line";this.height_px=(a?a:100);this.container_div.addClass
("line-track");this.dataset_id=b;this.data_queue={};this.cache=new Cache(CACHED_DATA)};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this;a.content_div.text(DATA_LOADING);$.getJSON(data_url,{stats:true,track_type:a.track_type,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(c){if(!c||c=="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR)}else{if(c=="no data"){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(c=="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");a.min_value=c.min;a.max_value=c.max;a.vertical_range=a.max_value-a.min_value;var d=$("<div class='yaxislabel'>"+a.min_value+"</div>");var b=$("<div class='yaxislabel'>"+a.max_value+"</div>");b.css({position:"relative",top:"35px"});b.prependTo(a.container_div);d.css({position:"relative",t
op:a.height_px+32+"px"});d.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,{track_type:this.track_type,chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution},function(g){c.cache.set(e,g);delete c.data_queue[e];c.draw()})}},draw_tile:function(d,a,m,o){if(!this.vertical_range){return}var h=a*DENSITY*d,b=DENSITY*d,c=$("<canvas class='tile'></canvas>"),l=d+"_"+a;if(!this.cache.get(l)){this.get_data(d,a);return}var g=this.cache.get(l);c.css({position:"absolute",top:0,left:(h-this.view.low)*o});c.get(0).width=Math.ceil(b*o);c.get(0).height=this.height_px;var n=c.get(0).getContext("2d");var e=false;n.beginPath();for(var f=0;f<g.length-1;f++){var k=g[f][0]-h;var j=g[f][1];if(isNaN(j)){e=false}else{k=k*o;j=(j-this.min_value)/this.vertical_range*this.height_px;if(e){n.lineTo(k,j)}else{n.moveTo(k,j);e=true}}}n.stroke(
);m.append(c);return c}});var FeatureTrack=function(c,b,a){this.tile_cache=new Cache(CACHED_TILES_FEATURE);Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.track_type="feature";this.height_px=(a?a:100);this.container_div.addClass("feature-track");this.dataset_id=b;this.zo_slots={};this.show_labels_scale=0.001;this.showing_labels=false;this.vertical_gap=10;this.base_color="#2C3143";this.default_font="9px Monaco, Lucida Console, monospace";this.left_offset=200;this.inc_slots={};this.data_queue={};this.data_cache=new Cache(20)};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this;a.content_div.text(DATA_LOADING);$.getJSON(data_url,{track_type:a.track_type,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.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");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,{track_type:b.track_type,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 c=[],b=this.content_div.width()/(this.view.high-this.view.low),a=this.view.max_high,e=this.view.max_low;for(var f=0,g=this.values.length;f<g;f++){var h,k,l=this.values[f];h=Math.floor((l.start-e)*b);k=Math.ceil((l.end-e)*b);var d=0;while(true){if(c[d]===undefined||c[d]<h){c[d]=k;this.zo_slots[l.uid]=d;break}d++}}this.height_px=c.length*this.vertical_gap+15;this.content_div.css("height",this.height_px+"px")},incremental_slots:functi
on(a,b){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=DENSITY/Math.pow(FEATURE_LEVELS,a+1)}var k=this.inc_slots[a];var d=[],l=[],c=0,m=$("<canvas></canvas>").get(0).getContext("2d"),f=this.view.max_low;for(var g=0,h=b.length;g<h;g++){var n=b[g];if(k[n.uid]){c=Math.max(c,k[n.uid]);d[k[n.uid]]=Math.ceil((n.end-f)*k.w_scale)}else{l.push(n)}}for(var g=0,h=l.length;g<h;g++){var n=l[g];f_start=Math.floor((n.start-f)*k.w_scale);f_start-=m.measureText(n.name).width;f_end=Math.ceil((n.end-f)*k.w_scale);var e=0;while(true){if(d[e]===undefined||d[e]<f_start){d[e]=f_end;k[n.uid]=e;c=Math.max(c,e);break}e++}}return c},draw_tile:function(A,F,n,r){if(!this.values){return}var G=F*DENSITY*A,c=(F+1)*DENSITY*A,v=DENSITY*A;var K,u,h;if(r>this.show_labels_scale){if(!this.showing_labels){this.showing_labels=true}for(var B in this.data_cache.obj_cache){var p=B.split("_"),e=p[0],d=p[1];if(e<=G&&d>=c){K=this.data_cache.get(B);break}}if(!K){this.data_queue[[G,c]]=true;this.get
_data(G,c);return}h=this.incremental_slots(this.view.zoom_res,K)*this.vertical_gap+15;u=this.inc_slots[this.view.zoom_res]}else{if(this.showing_labels){this.showing_labels=false}h=this.height_px;u=this.zo_slots;K=this.values}var y=Math.ceil(v*r),x=$("<canvas class='tile'></canvas>");x.css({position:"absolute",top:0,left:(G-this.view.low)*r-this.left_offset});x.get(0).width=y+this.left_offset;x.get(0).height=h;var z=x.get(0).getContext("2d");z.fillStyle=this.base_color;z.font=this.default_font;z.textAlign="right";var C=0;for(var D=0,E=K.length;D<E;D++){var m=K[D];if(m.start<=c&&m.end>=G){var g=Math.floor(Math.max(0,(m.start-G)*r)),l=Math.ceil(Math.min(y,(m.end-G)*r)),f=u[m.uid]*this.vertical_gap;var a,L,b=null,s=null;if(m.thick_start&&m.thick_end){b=Math.floor(Math.max(0,(m.thick_start-G)*r));s=Math.ceil(Math.min(y,(m.thick_end-G)*r))}if(!this.showing_labels){z.fillRect(g+this.left_offset,f+5,l-g,1)}else{if(z.fillText&&m.start>G){z.fillText(m.name,g-1+this.left_offset,f+8)}va
r I=m.blocks;if(I){if(m.strand){if(m.strand=="+"){z.fillStyle=RIGHT_STRAND}else{if(m.strand=="-"){z.fillStyle=LEFT_STRAND}}z.fillRect(g+this.left_offset,f,l-g,10);z.fillStyle=this.base_color}for(var B=0,J=I.length;B<J;B++){var q=I[B],o=Math.floor(Math.max(0,(q[0]-G)*r)),H=Math.ceil(Math.min(y,(q[1]-G)*r));if(o>H){continue}a=5;L=3;z.fillRect(o+this.left_offset,f+L,H-o,a);if(b&&(o<s||H>b)){a=9;L=1;var w=Math.max(o,b),t=Math.min(H,s);z.fillRect(w+this.left_offset,f+L,t-w,a)}}}else{a=9;L=1;z.fillRect(g+this.left_offset,f+L,l-g,a);if(m.strand){if(m.strand=="+"){z.fillStyle=RIGHT_STRAND_INV}else{if(m.strand=="-"){z.fillStyle=LEFT_STRAND_INV}}z.fillRect(g+this.left_offset,f,l-g,10);z.fillStyle=this.base_color}}}C++}}n.append(x);return x}});
\ No newline at end of file
1
0
21 Dec '09
details: http://www.bx.psu.edu/hg/galaxy/rev/1528580cc311
changeset: 3186:1528580cc311
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Fri Dec 18 10:27:00 2009 -0500
description:
Make buildbots's tool-data dir include a soft link to /galaxy/home/universe/encode_feature_partitions
diffstat:
buildbot_setup.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diffs (11 lines):
diff -r eee2356f187b -r 1528580cc311 buildbot_setup.sh
--- a/buildbot_setup.sh Thu Dec 17 15:36:51 2009 -0500
+++ b/buildbot_setup.sh Fri Dec 18 10:27:00 2009 -0500
@@ -18,6 +18,7 @@
/depot/data2/galaxy/blastdb.loc
/depot/data2/galaxy/bowtie_indices.loc
/depot/data2/galaxy/encode_datasets.loc
+/galaxy/home/universe/encode_feature_partitions
/depot/data2/galaxy/lastz_seqs.loc
/depot/data2/galaxy/liftOver.loc
/depot/data2/galaxy/maf_index.loc
1
0
21 Dec '09
details: http://www.bx.psu.edu/hg/galaxy/rev/eee2356f187b
changeset: 3185:eee2356f187b
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Thu Dec 17 15:36:51 2009 -0500
description:
Style updates for history annotation feature in pages and a minor bug fix for grid_base.
diffstat:
static/wymeditor/skins/galaxy/icons.png |
static/wymeditor/skins/galaxy/skin.css | 3 ++-
templates/grid_base.mako | 8 +++++++-
templates/page/history_annotation_table.mako | 10 +++++-----
4 files changed, 14 insertions(+), 7 deletions(-)
diffs (75 lines):
diff -r 2b632af1f56d -r eee2356f187b static/wymeditor/skins/galaxy/icons.png
Binary file static/wymeditor/skins/galaxy/icons.png has changed
diff -r 2b632af1f56d -r eee2356f187b static/wymeditor/skins/galaxy/skin.css
--- a/static/wymeditor/skins/galaxy/skin.css Thu Dec 17 14:32:44 2009 -0500
+++ b/static/wymeditor/skins/galaxy/skin.css Thu Dec 17 15:36:51 2009 -0500
@@ -109,7 +109,8 @@
.wym_skin_galaxy .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;}
.wym_skin_galaxy .wym_buttons li.wym_tools_html a { background-position: 0 -193px;}
.wym_skin_galaxy .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;}
- .wym_skin_galaxy .wym_buttons li.galaxy_tools_insert_history_link a { background-position: 0 -622px;}
+ .wym_skin_galaxy .wym_buttons li.galaxy_tools_insert_history_link a { background-position: 0 -646px;}
+ .wym_skin_galaxy .wym_buttons li.galaxy_tools_annotate_history a { background-position: 0 -622px;}
/*DECORATION*/
.wym_skin_galaxy .wym_section h2 { background: #f0f0f0; border: solid gray; border-width: 0 0 1px;}
diff -r 2b632af1f56d -r eee2356f187b templates/grid_base.mako
--- a/templates/grid_base.mako Thu Dec 17 14:32:44 2009 -0500
+++ b/templates/grid_base.mako Thu Dec 17 15:36:51 2009 -0500
@@ -949,7 +949,13 @@
</tr>
%endif
## Grid operations.
- %if grid.operations:
+ <%
+ num_allow_multiple_ops = 0
+ for operation in grid.operations:
+ if operation.allow_multiple:
+ num_allow_multiple_ops += 1
+ %>
+ %if num_allow_multiple_ops:
<tr>
<td></td>
<td colspan="100">
diff -r 2b632af1f56d -r eee2356f187b templates/page/history_annotation_table.mako
--- a/templates/page/history_annotation_table.mako Thu Dec 17 14:32:44 2009 -0500
+++ b/templates/page/history_annotation_table.mako Thu Dec 17 15:36:51 2009 -0500
@@ -8,7 +8,7 @@
</tr>
<tr>
## Status messages and tags.
- <th colspan='2'>
+ <td colspan='2'>
%if history.deleted:
<div class="warningmessagesmall">
${_('This is a deleted history.')}
@@ -17,17 +17,17 @@
%if trans.get_user() is not None:
Tags: ${render_tagging_element_html( tags=history.tags, editable=False, use_toggle_link=False )}
%endif
- </th>
+ </td>
</tr>
<tr>
- <th colspan="2">Description of History:
+ <td colspan="2" class="annotation">Description of History:
<ol>
<li>What was the motivation for this history?
<li>What is the outcome of this history?
<li>What are unresolved questions from this history?
<li>What new questions arise from this history?
</ol>
- </th>
+ </td>
</tr>
## Table body. For each dataset, there is an area to annotate the dataset.
@@ -44,7 +44,7 @@
%for data in datasets:
%if data.visible:
<tr>
- <td valign="top"><span class="annotation">Describe this step: why was it done? what data does it produce?</span></td>
+ <td valign="top"><span class="annotation">Describe this step: why was it done? what data did it produce?</span></td>
##<td valign="top" class="annotation">Describe this step: why was it done? what data does it produce?</td>
<td>
<div class="historyItemContainer" id="historyItemContainer-${data.id}">
1
0
21 Dec '09
details: http://www.bx.psu.edu/hg/galaxy/rev/e7244f7d613b
changeset: 3187:e7244f7d613b
user: Kanwei Li <kanwei(a)gmail.com>
date: Fri Dec 18 14:18:56 2009 -0500
description:
Provide UCSC integration for GFF files. Closes #261
diffstat:
lib/galaxy/datatypes/interval.py | 65 ++++++++++++++++++++++----------
1 files changed, 45 insertions(+), 20 deletions(-)
diffs (119 lines):
diff -r 1528580cc311 -r e7244f7d613b lib/galaxy/datatypes/interval.py
--- a/lib/galaxy/datatypes/interval.py Fri Dec 18 10:27:00 2009 -0500
+++ b/lib/galaxy/datatypes/interval.py Fri Dec 18 14:18:56 2009 -0500
@@ -485,7 +485,23 @@
return True
except: return False
-class Gff( Tabular ):
+class _RemoteCallMixin:
+ def _get_remote_call_url( self, redirect_url, site_name, dataset, type, app, base_url ):
+ """Retrieve the URL to call out to an external site and retrieve data.
+ This routes our external URL through a local galaxy instance which makes
+ the data available, followed by redirecting to the remote site with a
+ link back to the available information.
+ """
+ internal_url = "%s" % url_for( controller='dataset', dataset_id=dataset.id, action='display_at', filename='%s_%s' % ( type, site_name ) )
+ base_url = app.config.get( "display_at_callback", base_url )
+ if base_url.startswith( 'https://' ):
+ base_url = base_url.replace( 'https', 'http', 1 )
+ display_url = urllib.quote_plus( "%s%s/display_as?id=%i&display_app=%s&authz_method=display_at" % \
+ ( base_url, url_for( controller='root' ), dataset.id, type ) )
+ link = '%s?redirect_url=%s&display_url=%s' % ( internal_url, redirect_url, display_url )
+ return link
+
+class Gff( Tabular, _RemoteCallMixin ):
"""Tab delimited data in Gff format"""
file_ext = "gff"
column_names = [ 'Seqname', 'Source', 'Feature', 'Start', 'End', 'Score', 'Strand', 'Frame', 'Group' ]
@@ -494,10 +510,11 @@
MetadataElement( name="columns", default=9, desc="Number of columns", readonly=True, visible=False )
MetadataElement( name="column_types", default=['str','str','str','int','int','int','str','str','str'], param=metadata.ColumnTypesParameter, desc="Column types", readonly=True, visible=False )
- def __init__(self, **kwd):
+ def __init__( self, **kwd ):
"""Initialize datatype, by adding GBrowse display app"""
Tabular.__init__(self, **kwd)
- self.add_display_app ( 'c_elegans', 'display in Wormbase', 'as_gbrowse_display_file', 'gbrowse_links' )
+ self.add_display_app( 'ucsc', 'display at UCSC', 'as_ucsc_display_file', 'ucsc_links' )
+ self.add_display_app( 'c_elegans', 'display in Wormbase', 'as_gbrowse_display_file', 'gbrowse_links' )
def set_meta( self, dataset, overwrite = True, **kwd ):
i = 0
for i, line in enumerate( file ( dataset.file_name ) ):
@@ -547,7 +564,13 @@
start = elems[2] # 6000000
stop = elems[3] # 6030000
break
- if not line.startswith( '#' ):
+ # Allow UCSC style browser and track info in the GFF file
+ if line.startswith("browser position"):
+ pos_info = line.split()[-1]
+ seqid, startend = pos_info.split(":")
+ start, end = startend.split("-")
+ break
+ if not line.startswith(('#', 'track', 'browser')) :
elems = line.split( '\t' )
if not seqid:
# We can only set the viewport for a single chromosome
@@ -566,6 +589,20 @@
return ( seqid, str( start ), str( stop ) )
else:
return ( '', '', '' )
+ def ucsc_links( self, dataset, type, app, base_url ):
+ ret_val = []
+ if dataset.has_data:
+ seqid, start, stop = self.get_estimated_display_viewport( dataset )
+ if seqid and start and stop:
+ for site_name, site_url in util.get_ucsc_by_build( dataset.dbkey ):
+ if site_name in app.config.ucsc_display_sites:
+ redirect_url = urllib.quote_plus(
+ "%sdb=%s&position=%s:%s-%s&hgt.customText=%%s" %
+ ( site_url, dataset.dbkey, seqid, start, stop ) )
+ link = self._get_remote_call_url( redirect_url, site_name, dataset, type, app, base_url )
+ ret_val.append( ( site_name, link ) )
+ return ret_val
+
def gbrowse_links( self, dataset, type, app, base_url ):
ret_val = []
if dataset.has_data:
@@ -576,7 +613,9 @@
if seqid and start and stop:
for site_name, site_url in util.get_gbrowse_sites_by_build( dataset.dbkey ):
if site_name in app.config.gbrowse_display_sites:
- link = "%s?start=%s&stop=%s&ref=%s&dbkey=%s" % ( site_url, start, stop, seqid, dataset.dbkey )
+ redirect_url = urllib.quote_plus( "%s%s/?ref=%s&start=%s&stop=%s&eurl=%%s" %
+ ( site_url, dataset.dbkey, seqid, start, stop ) )
+ link = self._get_remote_call_url( redirect_url, site_name, dataset, type, app, base_url )
ret_val.append( ( site_name, link ) )
return ret_val
def sniff( self, filename ):
@@ -728,7 +767,7 @@
except:
return False
-class Wiggle( Tabular ):
+class Wiggle( Tabular, _RemoteCallMixin ):
"""Tab delimited data in wiggle format"""
file_ext = "wig"
@@ -752,20 +791,6 @@
if i > num_check_lines:
break
return value
- def _get_remote_call_url( self, redirect_url, site_name, dataset, type, app, base_url ):
- """Retrieve the URL to call out to an external site and retrieve data.
- This routes our external URL through a local galaxy instance which makes
- the data available, followed by redirecting to the remote site with a
- link back to the available information.
- """
- internal_url = "%s" % url_for( controller='dataset', dataset_id=dataset.id, action='display_at', filename='%s_%s' % ( type, site_name ) )
- base_url = app.config.get( "display_at_callback", base_url )
- if base_url.startswith( 'https://' ):
- base_url = base_url.replace( 'https', 'http', 1 )
- display_url = urllib.quote_plus( "%s%s/display_as?id=%i&display_app=%s&authz_method=display_at" % \
- ( base_url, url_for( controller='root' ), dataset.id, type ) )
- link = '%s?redirect_url=%s&display_url=%s' % ( internal_url, redirect_url, display_url )
- return link
def _get_viewer_range( self, dataset ):
"""Retrieve the chromosome, start, end for an external viewer."""
if dataset.has_data:
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/362126943cd7
changeset: 3180:362126943cd7
user: jeremy goecks <jeremy.goecks at emory.edu>
date: Tue Dec 15 15:58:24 2009 -0500
description:
Bug fix for page annotation.
diffstat:
templates/page/history_annotation_table.mako | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff -r bf01713ce302 -r 362126943cd7 templates/page/history_annotation_table.mako
--- a/templates/page/history_annotation_table.mako Mon Dec 14 22:12:03 2009 -0500
+++ b/templates/page/history_annotation_table.mako Tue Dec 15 15:58:24 2009 -0500
@@ -15,7 +15,7 @@
</div>
%endif
%if trans.get_user() is not None:
- Tags: ${render_tagging_element_html( tagged_item=history, editable=False, use_toggle_link=False )}
+ Tags: ${render_tagging_element_html( tags=history.tags, editable=False, use_toggle_link=False )}
%endif
</th>
</tr>
1
0
21 Dec '09
details: http://www.bx.psu.edu/hg/galaxy/rev/bf01713ce302
changeset: 3179:bf01713ce302
user: jeremy goecks <jeremy.goecks at emory.edu>
date: Mon Dec 14 22:12:03 2009 -0500
description:
Added individual and community tags to pages. More refactoring of tagging code as well.
diffstat:
lib/galaxy/tags/tag_handler.py | 62 ++++++++++++++++++--
lib/galaxy/web/controllers/tag.py | 28 ++++-----
static/scripts/autocomplete_tagging.js | 46 ++++++++-------
templates/page/display.mako | 61 ++++++++++++++------
templates/tagging_common.mako | 81 +++++++++++++++++++-------
5 files changed, 192 insertions(+), 86 deletions(-)
diffs (487 lines):
diff -r 86cbda1bcf67 -r bf01713ce302 lib/galaxy/tags/tag_handler.py
--- a/lib/galaxy/tags/tag_handler.py Mon Dec 14 21:14:53 2009 -0500
+++ b/lib/galaxy/tags/tag_handler.py Mon Dec 14 22:12:03 2009 -0500
@@ -1,5 +1,9 @@
from galaxy.model import Tag
import re
+from sqlalchemy.sql.expression import func, and_
+from sqlalchemy.sql import select
+from galaxy.model import History, HistoryTagAssociation, Dataset, DatasetTagAssociation, \
+ HistoryDatasetAssociation, HistoryDatasetAssociationTagAssociation, Page, PageTagAssociation
class TagHandler( object ):
@@ -18,14 +22,56 @@
# Key-value separator.
key_value_separators = "=:"
- def __init__(self):
- self.tag_assoc_classes = dict()
+ # Item-specific information needed to perform tagging.
+ class ItemTagAssocInfo( object ):
+ def __init__( self, item_class, tag_assoc_class, item_id_col ):
+ self.item_class = item_class
+ self.tag_assoc_class = tag_assoc_class
+ self.item_id_col = item_id_col
+
+ # Initialize with known classes.
+ item_tag_assoc_info = {}
+ item_tag_assoc_info["History"] = ItemTagAssocInfo( History, HistoryTagAssociation, HistoryTagAssociation.table.c.history_id )
+ item_tag_assoc_info["HistoryDatasetAssociation"] = \
+ ItemTagAssocInfo( HistoryDatasetAssociation, HistoryDatasetAssociationTagAssociation, HistoryDatasetAssociationTagAssociation.table.c.history_dataset_association_id )
+ item_tag_assoc_info["Page"] = ItemTagAssocInfo( Page, PageTagAssociation, PageTagAssociation.table.c.page_id )
- def add_tag_assoc_class(self, entity_class, tag_assoc_class):
- self.tag_assoc_classes[entity_class] = tag_assoc_class
+ def get_tag_assoc_class(self, item_class):
+ """ Returns tag association class for item class. """
+ return self.item_tag_assoc_info[item_class.__name__].tag_assoc_class
- def get_tag_assoc_class(self, entity_class):
- return self.tag_assoc_classes[entity_class]
+ def get_id_col_in_item_tag_assoc_table( self, item_class):
+ """ Returns item id column in class' item-tag association table. """
+ return self.item_tag_assoc_info[item_class.__name__].item_id_col
+
+ def get_community_tags(self, sa_session, item=None, limit=None):
+ """ Returns community tags for an item. """
+
+ # Get item-tag association class.
+ item_class = item.__class__
+ item_tag_assoc_class = self.get_tag_assoc_class( item_class )
+ if not item_tag_assoc_class:
+ return []
+
+ # Build select statement.
+ cols_to_select = [ item_tag_assoc_class.table.c.tag_id, func.count('*') ]
+ from_obj = item_tag_assoc_class.table.join(item_class.table).join(Tag.table)
+ where_clause = ( self.get_id_col_in_item_tag_assoc_table(item_class) == item.id )
+ order_by = [ func.count("*").desc() ]
+ group_by = item_tag_assoc_class.table.c.tag_id
+
+ # Do query and get result set.
+ query = select(columns=cols_to_select, from_obj=from_obj,
+ whereclause=where_clause, group_by=group_by, order_by=order_by, limit=limit)
+ result_set = sa_session.execute(query)
+
+ # Return community tags.
+ community_tags = []
+ for row in result_set:
+ tag_id = row[0]
+ community_tags.append( self.get_tag_by_id( sa_session, tag_id ) )
+
+ return community_tags
def remove_item_tag( self, trans, item, tag_name ):
"""Remove a tag from an item."""
@@ -45,7 +91,7 @@
"""Delete tags from an item."""
# Delete item-tag associations.
for tag in item.tags:
- trans.sa_ession.delete( tag )
+ trans.sa_session.delete( tag )
# Delete tags from item.
del item.tags[:]
@@ -89,7 +135,7 @@
continue
# Create tag association based on item class.
- item_tag_assoc_class = self.tag_assoc_classes[item.__class__]
+ item_tag_assoc_class = self.get_tag_assoc_class( item.__class__ )
item_tag_assoc = item_tag_assoc_class()
# Add tag to association.
diff -r 86cbda1bcf67 -r bf01713ce302 lib/galaxy/web/controllers/tag.py
--- a/lib/galaxy/web/controllers/tag.py Mon Dec 14 21:14:53 2009 -0500
+++ b/lib/galaxy/web/controllers/tag.py Mon Dec 14 22:12:03 2009 -0500
@@ -13,19 +13,10 @@
def __init__(self, app):
BaseController.__init__(self, app)
-
- # Keep a list of taggable classes.
- self.taggable_classes = dict()
- self.taggable_classes[History.__name__] = History
- self.taggable_classes[HistoryDatasetAssociation.__name__] = HistoryDatasetAssociation
- self.taggable_classes[Page.__name__] = Page
-
+
# Set up tag handler to recognize the following items: History, HistoryDatasetAssociation, Page, ...
self.tag_handler = TagHandler()
- self.tag_handler.add_tag_assoc_class(History, HistoryTagAssociation)
- self.tag_handler.add_tag_assoc_class(HistoryDatasetAssociation, HistoryDatasetAssociationTagAssociation)
- self.tag_handler.add_tag_assoc_class(Page, PageTagAssociation)
-
+
@web.expose
@web.require_login( "Add tag to an item." )
def add_tag_async( self, trans, id=None, item_class=None, new_tag=None, context=None ):
@@ -91,6 +82,8 @@
item_class = History
elif item_class == 'HistoryDatasetAssociation':
item_class = HistoryDatasetAssociation
+ elif item_class == 'Page':
+ item_class = Page
q = q.encode('utf-8')
if q.find(":") == -1:
@@ -207,16 +200,16 @@
def _get_column_for_filtering_item_by_user_id(self, item_class):
""" Returns the column to use when filtering by user id. """
- # TODO: make this generic by using a dict() to map from item class to a "user id" column
- if item_class is History:
- return History.table.c.user_id
- elif item_class is HistoryDatasetAssociation:
+ if item_class is HistoryDatasetAssociation:
# Use the user_id associated with the HDA's history.
return History.table.c.user_id
+ else:
+ # Generically, just use the user_id column of the tagged item's table.
+ return item_class.table.c.user_id
def _get_item(self, trans, item_class_name, id):
""" Get an item based on type and id. """
- item_class = self.taggable_classes[item_class_name]
+ item_class = self.tag_handler.item_tag_assoc_info[item_class_name].item_class
item = trans.sa_session.query(item_class).filter("id=" + str(id))[0]
return item;
@@ -234,3 +227,6 @@
elif isinstance(item, HistoryDatasetAssociation):
# TODO.
pass
+ elif isinstance(item, Page):
+ # TODO.
+ pass
diff -r 86cbda1bcf67 -r bf01713ce302 static/scripts/autocomplete_tagging.js
--- a/static/scripts/autocomplete_tagging.js Mon Dec 14 21:14:53 2009 -0500
+++ b/static/scripts/autocomplete_tagging.js Mon Dec 14 22:12:03 2009 -0500
@@ -3,7 +3,22 @@
* @author: Jeremy Goecks
* @require: jquery.autocomplete plugin
*/
-jQuery.fn.autocomplete_tagging = function(elt_id, options)
+//
+// Initialize "tag click functions" for tags.
+//
+function init_tag_click_function(tag_elt, click_func)
+{
+ $(tag_elt).find('.tag-name').each( function() {
+ $(this).click( function() {
+ var tag_str = $(this).text();
+ var tag_name_and_value = tag_str.split(":")
+ click_func(tag_name_and_value[0], tag_name_and_value[1]);
+ return true;
+ });
+ });
+}
+
+jQuery.fn.autocomplete_tagging = function(options)
{
//
@@ -61,21 +76,17 @@
// Initalize object's elements.
//
- // Get elements for this object.
- var this_obj = $('#' + elt_id);
- var id_parts = $(this).attr('id').split("-");
- var obj_id = id_parts[ id_parts.length-1 ];
- var tag_area = this_obj.find('#tag-area-' + obj_id);
- var toggle_link = this_obj.find('#toggle-link-' + obj_id);
- var tag_input_field = this_obj.find('#tag-input');
+ // Get elements for this object. For this_obj, assume the last element with the id is the "this"; this is somewhat of a hack to address the problem
+ // that there may be two tagging elements for a single item if there are both community and individual tags for an element.
+ var this_obj = $(this);
+ var tag_area = this_obj.find('.tag-area');
+ var toggle_link = this_obj.find('.toggle-link');
+ var tag_input_field = this_obj.find('.tag-input');
var add_tag_button = this_obj.find('.add-tag-button');
// Initialize toggle link.
toggle_link.click( function() {
- var id = $(this).attr('id').split('-')[2];
-
// Take special actions depending on whether toggle is showing or hiding link.
- var tag_area = $('#tag-area-' + id);
var showing_tag_area = (tag_area.css("display") == "none");
var after_toggle_fn;
if (showing_tag_area)
@@ -210,7 +221,7 @@
}
var autocomplete_options =
{ selectFirst: false, formatItem : format_item_func, autoFill: false, highlight: false };
- tag_input_field.autocomplete(settings.ajax_autocomplete_tag_url, autocomplete_options);
+ tag_input_field.autocomplete(settings.ajax_autocomplete_tag_url, autocomplete_options);
// Initialize delete tag images for current tags.
@@ -218,16 +229,9 @@
init_delete_tag_image( $(this) );
});
- this_obj.find('.tag-name').each( function() {
- $(this).click( function() {
- var tag_str = $(this).text();
- var tag_name_and_value = tag_str.split(":")
- settings.tag_click_fn(tag_name_and_value[0], tag_name_and_value[1]);
- return true;
- });
- });
-
+ // Initialize tag click function.
+ init_tag_click_function($(this), settings.tag_click_fn);
// Initialize "add tag" button.
add_tag_button.click( function()
diff -r 86cbda1bcf67 -r bf01713ce302 templates/page/display.mako
--- a/templates/page/display.mako Mon Dec 14 21:14:53 2009 -0500
+++ b/templates/page/display.mako Mon Dec 14 22:12:03 2009 -0500
@@ -146,29 +146,35 @@
};
//
- // Function provides text for tagging toggle link.
+ // Handle click on community tag.
//
- var get_toggle_link_text = function(tags)
+ function community_tag_click(tag_name, tag_value)
{
- var text = "";
- var num_tags = array_length(tags);
- if (num_tags != 0)
- {
- text = num_tags + (num_tags != 1 ? " Tags" : " Tag");
- }
- else
- {
- // No tags.
- text = "Add tags to history";
- }
- return text;
- };
+ alert("community tag click: " + tag_name);
+ }
</script>
</%def>
<%def name="stylesheets()">
${parent.stylesheets()}
${h.css( "base", "history", "autocomplete_tagging" )}
+ <style>
+ .page-body
+ {
+ padding: 10px;
+ float: left;
+ width: 65%;
+ }
+ .page-meta
+ {
+ float: right;
+ width: 27%;
+ padding: 0.5em;
+ margin: 0.25em;
+ vertical-align: text-top;
+ border: 2px solid #DDDDDD;
+ }
+ </style>
</%def>
<%def name="init()">
@@ -180,6 +186,7 @@
%>
</%def>
+<%namespace file="../tagging_common.mako" import="render_tagging_element, render_community_tagging_element" />
<%def name="center_panel()">
@@ -191,9 +198,27 @@
<div class="unified-panel-body">
<div style="overflow: auto; height: 100%;">
- <div class="page text-content" style="padding: 10px;">
- ${page.latest_revision.content.decode( "utf-8" )}
- </div>
+ <div class="page text-content page-body">
+ ${page.latest_revision.content.decode( "utf-8" )}
+ </div>
+ <div class="page-meta">
+ <div><strong>Tags</strong></div>
+ <p>
+ ## Community tags.
+ <div>
+ Community:
+ ${render_community_tagging_element( tagged_item=page, tag_click_fn='community_tag_click', use_toggle_link=False )}
+ %if len ( page.tags ) == 0:
+ none
+ %endif
+ </div>
+ ## User tags.
+ <p>
+ <div>
+ Yours:
+ ${render_tagging_element( tagged_item=page, elt_context='display.mako', use_toggle_link=False )}
+ </div>
+ </div>
</div>
</div>
diff -r 86cbda1bcf67 -r bf01713ce302 templates/tagging_common.mako
--- a/templates/tagging_common.mako Mon Dec 14 21:14:53 2009 -0500
+++ b/templates/tagging_common.mako Mon Dec 14 22:12:03 2009 -0500
@@ -1,40 +1,59 @@
<%!
from cgi import escape
from galaxy.web.framework.helpers import iff
+ from random import random
+ from sys import maxint
+ from math import floor
+ from galaxy.tags.tag_handler import TagHandler
+ from galaxy.model import Tag, ItemTagAssociation
+
+ tag_handler = TagHandler()
%>
+
## Render a tagging element if there is a tagged_item.
%if tagged_item is not None:
${render_tagging_element(tagged_item=tagged_item, elt_context=elt_context, in_form=in_form, input_size=input_size, tag_click_fn=tag_click_fn)}
%endif
-## Render HTML for a tagging element.
-<%def name="render_tagging_element_html(tagged_item=None, editable=True, use_toggle_link=True, input_size='15', in_form=False)">
+## Render HTML for a list of tags.
+<%def name="render_tagging_element_html(elt_id=None, tags=None, editable=True, use_toggle_link=True, input_size='15', in_form=False)">
## Useful attributes.
<%
- tagged_item_id = str( trans.security.encode_id (tagged_item.id) )
- elt_id = "tag-element-" + tagged_item_id
+ num_tags = len( tags )
%>
- <div id="${elt_id}" class="tag-element">
+ <div class="tag-element"
+ %if elt_id:
+ id="${elt_id}"
+ %endif
+ ## Do not display element if there are no tags and it is not editable.
+ %if num_tags == 0 and not editable:
+ style="display: none"
+ %endif
+ >
%if use_toggle_link:
- <a id="toggle-link-${tagged_item_id}" class="toggle-link" href="#">${len(tagged_item.tags)} Tags</a>
+ <a class="toggle-link" href="#">${num_tags} Tags</a>
%endif
- <div id="tag-area-${tagged_item_id}" class="tag-area">
+ <div class="tag-area">
## Build buttons for current tags.
- %for tag in tagged_item.tags:
+ %for tag in tags:
<%
- tag_name = tag.user_tname
- tag_value = None
- if tag.value is not None:
+ ## Handle both Tag and ItemTagAssociation objects.
+ if isinstance( tag, Tag ):
+ tag_name = tag.name
+ tag_value = None
+ elif isinstance( tag, ItemTagAssociation ):
+ tag_name = tag.user_tname
tag_value = tag.user_value
## Convert tag name, value to unicode.
if isinstance( tag_name, str ):
tag_name = unicode( escape( tag_name ), 'utf-8' )
if tag_value:
tag_value = unicode( escape( tag_value ), 'utf-8' )
- tag_str = tag_name + ":" + tag_value
- else:
- tag_str = tag_name
+ if tag_value:
+ tag_str = tag_name + ":" + tag_value
+ else:
+ tag_str = tag_name
%>
<span class="tag-button">
<span class="tag-name">${tag_str}</span>
@@ -47,9 +66,9 @@
## Add tag input field. If element is in form, tag input is a textarea; otherwise element is a input type=text.
%if editable:
%if in_form:
- <textarea id='tag-input' class="tag-input" rows='1' cols='${input_size}'></textarea>
+ <textarea class="tag-input" rows='1' cols='${input_size}'></textarea>
%else:
- <input id='tag-input' class="tag-input" type='text' size='${input_size}'></input>
+ <input class="tag-input" type='text' size='${input_size}'></input>
%endif
## Add "add tag" button.
<img src='${h.url_for('/static/images/add_icon.png')}' rollover='${h.url_for('/static/images/add_icon_dark.png')}' class="add-tag-button"/>
@@ -58,17 +77,32 @@
</div>
</%def>
+## Render community tagging element.
+<%def name="render_community_tagging_element(tagged_item=None, use_toggle_link=False, tag_click_fn='default_tag_click_fn')">
+ ## Build HTML.
+ <%
+ elt_id = int ( floor ( random()*maxint ) )
+ community_tags = tag_handler.get_community_tags(trans.sa_session, tagged_item, 10)
+ %>
+ ${self.render_tagging_element_html(elt_id=elt_id, tags=community_tags, use_toggle_link=use_toggle_link, editable=False)}
+
+ ## Set up tag click function.
+ <script type="text/javascript">
+ init_tag_click_function($('#${elt_id}'), ${tag_click_fn});
+ </script>
+</%def>
+
## Render the tags 'tags' as an autocomplete element.
<%def name="render_tagging_element(tagged_item=None, elt_context=None, use_toggle_link=True, in_form=False, input_size='15', tag_click_fn='default_tag_click_fn', get_toggle_link_text_fn='default_get_toggle_link_text_fn', editable=True)">
## Useful attributes.
<%
tagged_item_id = str( trans.security.encode_id (tagged_item.id) )
- elt_id = "tag-element-" + tagged_item_id
+ elt_id = int ( floor ( random()*maxint ) )
%>
## Build HTML.
- ${self.render_tagging_element_html(tagged_item, editable, use_toggle_link, input_size, in_form)}
+ ${self.render_tagging_element_html(elt_id, tagged_item.tags, editable, use_toggle_link, input_size, in_form)}
## Build script that augments tags using progressive javascript.
<script type="text/javascript">
@@ -131,7 +165,7 @@
};
// Default function to handle a tag click.
- var default_tag_click_fn = function(tag_name, tag_value) {};
+ var default_tag_click_fn = function(tag_name, tag_value) { };
var options =
{
@@ -139,15 +173,16 @@
editable : ${iff( editable, 'true', 'false' )},
get_toggle_link_text_fn: ${get_toggle_link_text_fn},
tag_click_fn: ${tag_click_fn},
- ajax_autocomplete_tag_url: "${h.url_for( controller='tag', action='tag_autocomplete_data', id=tagged_item_id, item_class=tagged_item.__class__.__name__ )}",
- ajax_add_tag_url: "${h.url_for( controller='tag', action='add_tag_async', id=tagged_item_id, item_class=tagged_item.__class__.__name__, context=elt_context )}",
- ajax_delete_tag_url: "${h.url_for( controller='tag', action='remove_tag_async', id=tagged_item_id, item_class=tagged_item.__class__.__name__, context=elt_context )}",
+ ## Use forward slash in controller to suppress route memory.
+ ajax_autocomplete_tag_url: "${h.url_for( controller='/tag', action='tag_autocomplete_data', id=tagged_item_id, item_class=tagged_item.__class__.__name__ )}",
+ ajax_add_tag_url: "${h.url_for( controller='/tag', action='add_tag_async', id=tagged_item_id, item_class=tagged_item.__class__.__name__, context=elt_context )}",
+ ajax_delete_tag_url: "${h.url_for( controller='/tag', action='remove_tag_async', id=tagged_item_id, item_class=tagged_item.__class__.__name__, context=elt_context )}",
delete_tag_img: "${h.url_for('/static/images/delete_tag_icon_gray.png')}",
delete_tag_img_rollover: "${h.url_for('/static/images/delete_tag_icon_white.png')}",
use_toggle_link: ${iff( use_toggle_link, 'true', 'false' )},
};
- $("#${elt_id}").autocomplete_tagging('${elt_id}', options);
+ $('#${elt_id}').autocomplete_tagging(options);
</script>
## Use style to hide/display the tag area.
1
0
21 Dec '09
details: http://www.bx.psu.edu/hg/galaxy/rev/e905ef22c648
changeset: 3181:e905ef22c648
user: Nate Coraor <nate(a)bx.psu.edu>
date: Tue Dec 15 19:18:22 2009 -0500
description:
fix for parsing blastdb.loc for the megablast wrapper tool
diffstat:
tools/metag_tools/megablast_wrapper.py | 5 ++---
tools/metag_tools/megablast_wrapper.xml | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diffs (34 lines):
diff -r 362126943cd7 -r e905ef22c648 tools/metag_tools/megablast_wrapper.py
--- a/tools/metag_tools/megablast_wrapper.py Tue Dec 15 15:58:24 2009 -0500
+++ b/tools/metag_tools/megablast_wrapper.py Tue Dec 15 19:18:22 2009 -0500
@@ -30,7 +30,7 @@
#Parse Command Line
options, args = doc_optparse.parse( __doc__ )
- db_build = options.db_build.split( ' ' )[0]
+ db_build = options.db_build
query_filename = options.input.strip()
output_filename = options.output.strip()
mega_word_size = options.word_size # -W
@@ -62,8 +62,7 @@
if not line or line.startswith( '#' ):
continue
fields = line.split( '\t' )
- if len( fields ) == 2:
- db[ fields[0].split( ' ' )[0] ] = fields[1]
+ db[ fields[0] ] = fields[1]
if not db.has_key( db_build ):
stop_err( 'Cannot locate the target database. Please check your location file.' )
diff -r 362126943cd7 -r e905ef22c648 tools/metag_tools/megablast_wrapper.xml
--- a/tools/metag_tools/megablast_wrapper.xml Tue Dec 15 15:58:24 2009 -0500
+++ b/tools/metag_tools/megablast_wrapper.xml Tue Dec 15 19:18:22 2009 -0500
@@ -2,7 +2,7 @@
<description> compare short reads against htgs, nt, and wgs databases</description>
<command interpreter="python">
megablast_wrapper.py
- --db_build=$source_select
+ --db_build="$source_select"
--input=$input_query
--word_size=$word_size
--identity_cutoff=$iden_cutoff
1
0
21 Dec '09
details: http://www.bx.psu.edu/hg/galaxy/rev/256889bc552f
changeset: 3183:256889bc552f
user: Enis Afgan <afgane(a)gmail.com>
date: Thu Dec 17 08:25:31 2009 -0500
description:
Removed the requirement for a user to select a storage volume zone during UCI registration by adding '(any)' option in the dropdown menu followed by automatic selection.
diffstat:
lib/galaxy/web/controllers/cloud.py | 23 +++++++++++++++++++----
templates/cloud/configure_uci.mako | 2 +-
2 files changed, 20 insertions(+), 5 deletions(-)
diffs (60 lines):
diff -r add56c970e9c -r 256889bc552f lib/galaxy/web/controllers/cloud.py
--- a/lib/galaxy/web/controllers/cloud.py Thu Dec 17 07:21:38 2009 -0500
+++ b/lib/galaxy/web/controllers/cloud.py Thu Dec 17 08:25:31 2009 -0500
@@ -198,8 +198,9 @@
# Capture user configured instance information
uci = model.UCI()
uci.name = instanceName
- uci.credentials = trans.sa_session.query( model.CloudUserCredentials ) \
+ creds = trans.sa_session.query( model.CloudUserCredentials ) \
.filter( model.CloudUserCredentials.table.c.name==credName ).first()
+ uci.credentials = creds
uci.user= user
uci.total_size = volSize # This is OK now because new instance is being created and only one storage volume can be created at UCI creation time
uci.state = uci_states.NEW_UCI
@@ -208,6 +209,18 @@
storage.user = user
storage.uci = uci
storage.size = volSize
+ # If '(any)' zone was selected, just choose the first one that's available
+ if zone == "(any)":
+ zones = None
+ conn = get_connection( trans, creds )
+ if conn != None:
+ try:
+ zones = conn.get_all_zones()
+ if len( zones ) > 0:
+ zone = str( zones[0] ).split(':')[1]
+ except boto.exception.EC2ResponseError, e:
+ log.error( "Retrieving zones for credentials '%s' failed: %s" % ( storedCred.name, e ) )
+ providersToZones[storedCred.name] = [ "Retrieving zones failed: " + str( e ) ]
storage.availability_zone = zone
storage.status = store_status.ADDING
# Persist
@@ -235,9 +248,11 @@
avail_zones = []
try:
zones = conn.get_all_zones()
- for z in zones:
- z = str( z ).split(':')[1]
- avail_zones.append( z )
+ if len( zones ) > 0:
+ avail_zones.append( "(any)" )
+ for z in zones:
+ z = str( z ).split(':')[1]
+ avail_zones.append( z )
providersToZones[storedCred.name] = avail_zones
except boto.exception.EC2ResponseError, e:
log.error( "Retrieving zones for credentials '%s' failed: %s" % ( storedCred.name, e ) )
diff -r add56c970e9c -r 256889bc552f templates/cloud/configure_uci.mako
--- a/templates/cloud/configure_uci.mako Thu Dec 17 07:21:38 2009 -0500
+++ b/templates/cloud/configure_uci.mako Thu Dec 17 08:25:31 2009 -0500
@@ -97,7 +97,7 @@
cls += " form-row-error"
%>
<div class="${cls}">
- <label>Zone to create storage in:</label>
+ <label>Create storage in zone:</label>
<div class="form-row-input">
<select id="zones" name="zone" style="width:40em">
</select>
1
0