galaxy-commits
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- 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
- 15302 discussions
commit/galaxy-central: jgoecks: Load datasets into Scratchbook using divs rather than an iframe. Push URLs for TabularChunkedView into model, enable Scratchbook to use a function to load content, enable scrolling in frames, and some code/documentation fixes.
by commits-noreply@bitbucket.org 30 May '14
by commits-noreply@bitbucket.org 30 May '14
30 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/638dcaad4b8d/
Changeset: 638dcaad4b8d
User: jgoecks
Date: 2014-05-30 22:28:17
Summary: Load datasets into Scratchbook using divs rather than an iframe. Push URLs for TabularChunkedView into model, enable Scratchbook to use a function to load content, enable scrolling in frames, and some code/documentation fixes.
Affected #: 4 files
diff -r 79e1326aebb77ece64475a041ed8ca4b612d9e5e -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -69,6 +69,8 @@
// If first data chunk is available, next chunk is 1.
this.attributes.chunk_index = (this.attributes.first_data_chunk ? 1 : 0);
+ this.attributes.chunk_url = galaxy_config.root + 'dataset/display?dataset_id=' + this.id;
+ this.attributes.url_viz = galaxy_config.root + 'visualization';
},
/**
@@ -617,8 +619,10 @@
* and appends to parent_elt.
*/
var createTabularDatasetChunkedView = function(options) {
- // Create and set model.
- options.model = new TabularDataset(options.dataset_config);
+ // If no model, create and set model from dataset config.
+ if (!options.model) {
+ options.model = new TabularDataset(options.dataset_config);
+ }
var parent_elt = options.parent_elt;
var embedded = options.embedded;
diff -r 79e1326aebb77ece64475a041ed8ca4b612d9e5e -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -1,8 +1,9 @@
define([
"mvc/dataset/hda-model",
"mvc/base-mvc",
+ "mvc/data",
"utils/localization"
-], function( hdaModel, baseMVC, _l ){
+], function( hdaModel, baseMVC, dataset, _l ){
/* global Backbone */
/** @class Read only view for history content views to extend.
@@ -313,14 +314,24 @@
var self = this;
displayBtnData.onclick = function( ev ){
if( Galaxy.frame && Galaxy.frame.active ){
+ // Create frame with TabularChunkedView.
Galaxy.frame.add({
title : "Data Viewer: " + self.model.get('name'),
- type : "url",
- content : self.urls.display
+ type : "other",
+ content : function(parent_elt) {
+ var new_dataset = new dataset.TabularDataset({id: self.model.id});
+ $.when(new_dataset.fetch()).then(function() {
+ dataset.createTabularDatasetChunkedView({
+ model: new_dataset,
+ parent_elt: parent_elt,
+ embedded: true,
+ height: '100%'
+ });
+ });
+ }
});
ev.preventDefault();
}
-
};
}
displayBtnData.faIcon = 'fa-eye';
diff -r 79e1326aebb77ece64475a041ed8ca4b612d9e5e -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc static/scripts/mvc/ui/ui-frames.js
--- a/static/scripts/mvc/ui/ui-frames.js
+++ b/static/scripts/mvc/ui/ui-frames.js
@@ -136,7 +136,15 @@
});
},
- // adds and displays a new frame/window
+ /**
+ * Adds and displays a new frame.
+ *
+ * options:
+ * type: 'url' or 'other' ; if 'url', 'content' is treated as a URL and loaded into an iframe;
+ * if 'other', content is treated as a function or raw HTML. content function is passed a single
+ * argument that is the frame's content DOM element
+ * content: the content to be loaded into the frame.
+ */
add: function(options)
{
// frame default options
@@ -180,11 +188,21 @@
// append
var $frame_el = null;
- if (options.type == 'url') {
+ if (options.type === 'url') {
$frame_el = $(this._template_frame_url(frame_id.substring(1), options.title, options.content));
- } else {
+ }
+ else if (options.type === 'other') {
$frame_el = $(this._template_frame(frame_id.substring(1), options.title));
- $frame_el.find('.f-content').append(options.content);
+
+ // Load content into frame.
+ var content_elt = $frame_el.find('.f-content');
+ console.log(content_elt);
+ if (_.isFunction(options.content)) {
+ options.content(content_elt);
+ }
+ else {
+ content_elt.append(options.content);
+ }
}
$(this.el).append($frame_el);
@@ -529,13 +547,23 @@
this.hide();
},
- // scroll
+ /**
+ * Fired when scrolling occurs on panel.
+ */
_event_panel_scroll: function(e)
{
// check
if (this.event.type !== null || !this.visible)
return;
-
+
+ // Stop propagation if scrolling is happening inside a frame.
+ // TODO: could propagate scrolling if at top/bottom of frame.
+ var frames = $(e.srcElement).parents('.frame')
+ if (frames.length !== 0) {
+ e.stopPropagation();
+ return;
+ }
+
// prevent
e.preventDefault();
diff -r 79e1326aebb77ece64475a041ed8ca4b612d9e5e -r 638dcaad4b8dcabf236d732af6f451a92cdcf2bc templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -19,9 +19,6 @@
data.createTabularDatasetChunkedView({
dataset_config: _.extend( ${h.to_json_string( trans.security.encode_dict_ids( dataset.to_dict() ) )},
{
- url_viz: "${h.url_for( controller='/visualization')}",
- chunk_url: "${h.url_for( controller='/dataset', action='display',
- dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
}
),
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dannon: Resolve merge across branches.
by commits-noreply@bitbucket.org 30 May '14
by commits-noreply@bitbucket.org 30 May '14
30 May '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/79e1326aebb7/
Changeset: 79e1326aebb7
User: dannon
Date: 2014-05-30 22:06:08
Summary: Resolve merge across branches.
Affected #: 1 file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/aeacb40b527f/
Changeset: aeacb40b527f
Branch: next-stable
User: dannon
Date: 2014-05-30 21:59:32
Summary: Pack scripts.
Affected #: 1 file
diff -r aa58945453ab7a5ced6852a731a9dabb531f27d6 -r aeacb40b527f06eb7dc4138ab871b26a88b8d709 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;s.show();$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false;s.hide()}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/ebd72ac674d4/
Changeset: ebd72ac674d4
User: dannon
Date: 2014-05-30 22:00:49
Summary: Pack scripts.
Affected #: 1 file
diff -r 67549a8abdafdf2455d5190f3582c8ccfdac7a48 -r ebd72ac674d45a4c0ff20e1e224036e870b0fb21 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this,n=this.model.get("first_data_chunk");if(n){this._renderChunk(n)}else{$.when(o.model.get_next_chunk()).then(function(t){o._renderChunk(t)})}var p=false;this.scroll_elt.scroll(function(){if(!p&&o.scrolled_to_bottom()){p=true;s.show();$.when(o.model.get_next_chunk()).then(function(t){if(t){o._renderChunk(t);p=false;s.hide()}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/aa58945453ab/
Changeset: aa58945453ab
Branch: next-stable
User: dannon
Date: 2014-05-30 21:52:49
Summary: Fix loading indicator jqmigrate griping. Also improve it to where it's not looking for a global ajaxstart/ajaxstop.
Affected #: 1 file
diff -r cb1e86b187a38fce1b9601115fc1a51809f3b292 -r aa58945453ab7a5ced6852a731a9dabb531f27d6 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -135,14 +135,8 @@
render: function() {
// Add loading indicator.
var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+ this.$el.append(loading_indicator);
- loading_indicator.ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
-
- this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -172,10 +166,12 @@
// If not already loading a chunk and have scrolled to the bottom of this element, get next chunk.
if ( !loading_chunk && self.scrolled_to_bottom() ) {
loading_chunk = true;
+ loading_indicator.show();
$.when(self.model.get_next_chunk()).then(function(result) {
if (result) {
self._renderChunk(result);
loading_chunk = false;
+ loading_indicator.hide();
}
});
}
https://bitbucket.org/galaxy/galaxy-central/commits/67549a8abdaf/
Changeset: 67549a8abdaf
User: dannon
Date: 2014-05-30 21:53:13
Summary: Merge next-stable.
Affected #: 1 file
diff -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 -r 67549a8abdafdf2455d5190f3582c8ccfdac7a48 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -135,14 +135,8 @@
render: function() {
// Add loading indicator.
var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+ this.$el.append(loading_indicator);
- loading_indicator.ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
-
- this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -179,10 +173,12 @@
// If not already loading a chunk and have scrolled to the bottom of this element, get next chunk.
if ( !loading_chunk && self.scrolled_to_bottom() ) {
loading_chunk = true;
+ loading_indicator.show();
$.when(self.model.get_next_chunk()).then(function(result) {
if (result) {
self._renderChunk(result);
loading_chunk = false;
+ loading_indicator.hide();
}
});
}
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
12 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e14f0956dfc9/
Changeset: e14f0956dfc9
Branch: next-stable
User: dannon
Date: 2014-05-28 15:47:22
Summary: Cleanup prior to tabular work.
Affected #: 3 files
diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r e14f0956dfc984a11d495eb59f77131596110ae4 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -633,9 +633,9 @@
};
return {
- Dataset: Dataset,
+ Dataset: Dataset,
TabularDataset: TabularDataset,
- DatasetCollection: DatasetCollection,
+ DatasetCollection: DatasetCollection,
TabularDatasetChunkedView: TabularDatasetChunkedView,
createTabularDatasetChunkedView: createTabularDatasetChunkedView
};
diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r e14f0956dfc984a11d495eb59f77131596110ae4 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -9,7 +9,7 @@
%if item.datatype.CHUNKABLE:
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -17,21 +17,21 @@
});
require(['mvc/data'], function(data) {
- //
+ //
// Use tabular data display progressively by deleting data from page body
// and then showing dataset view.
- //
+ //
$('.page-body').children().remove();
data.createTabularDatasetChunkedView({
// TODO: encode id.
- dataset_config:
- _.extend( ${h.to_json_string( item.to_dict() )},
+ dataset_config:
+ _.extend( ${h.to_json_string( item.to_dict() )},
{
- chunk_url: "${h.url_for( controller='/dataset', action='display',
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( item.id ))}",
first_data_chunk: ${first_chunk}
- }
+ }
),
parent_elt: $('.page-body')
});
@@ -58,9 +58,9 @@
<%def name="render_item_links( data )">
## Provide links to save data and import dataset.
<a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a>
- <a
+ <a
href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
- class="icon-button import"
+ class="icon-button import"
title="Import dataset"></a></%def>
@@ -70,7 +70,7 @@
%if data_to_render:
%if truncated:
<div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below. |
+ This dataset is large and only the first megabyte is shown below. |
<a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div>
%endif
@@ -100,9 +100,9 @@
| ${get_item_name( item ) | h}
</div></div>
-
+
<div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
+ <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right">
${self.render_item_links( item )}
@@ -110,7 +110,7 @@
<div>
${self.render_item_header( item )}
</div>
-
+
${self.render_item( item, item_data )}
</div></div>
@@ -123,20 +123,20 @@
About this ${get_class_display_name( item.__class__ )}
</div></div>
-
+
<div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4>
-
+
<p>${item.history.user.username | h}</p>
-
+
<div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=iden…"></div>
- ## Page meta.
-
+ ## Page meta.
+
## No links for datasets right now.
-
+
## Tags.
<p><h4>Tags</h4>
@@ -155,8 +155,8 @@
Yours:
${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
</div>
- </div>
+ </div></div></div>
-</%def>
\ No newline at end of file
+</%def>
diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r e14f0956dfc984a11d495eb59f77131596110ae4 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -8,7 +8,7 @@
${h.js( "libs/require" )}
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -23,7 +23,7 @@
chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
- }
+ }
),
parent_elt: $('body')
});
https://bitbucket.org/galaxy/galaxy-central/commits/e0470cb34e7a/
Changeset: e0470cb34e7a
Branch: next-stable
User: dannon
Date: 2014-05-29 14:22:47
Summary: Merge.
Affected #: 1 file
diff -r e14f0956dfc984a11d495eb59f77131596110ae4 -r e0470cb34e7a14198fa635055abd81def09bba06 job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -204,6 +204,10 @@
using message queues (in the more traditional mode Galaxy sends
files to and pull files from the LWR - this is obviously less
appropriate when using a message queue).
+
+ The default_file_action currently requires pycurl be available
+ to Galaxy (presumably in its virtualenv). Making this dependency
+ optional is an open task.
--><param id="default_file_action">remote_transfer</param></destination>
https://bitbucket.org/galaxy/galaxy-central/commits/b99e3eee6217/
Changeset: b99e3eee6217
User: dannon
Date: 2014-05-29 14:23:03
Summary: Merge next-stable.
Affected #: 3 files
diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r b99e3eee6217db24efa3fad12bd5c00289522056 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -640,9 +640,9 @@
};
return {
- Dataset: Dataset,
+ Dataset: Dataset,
TabularDataset: TabularDataset,
- DatasetCollection: DatasetCollection,
+ DatasetCollection: DatasetCollection,
TabularDatasetChunkedView: TabularDatasetChunkedView,
createTabularDatasetChunkedView: createTabularDatasetChunkedView
};
diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r b99e3eee6217db24efa3fad12bd5c00289522056 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -9,7 +9,7 @@
%if item.datatype.CHUNKABLE:
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -17,21 +17,21 @@
});
require(['mvc/data'], function(data) {
- //
+ //
// Use tabular data display progressively by deleting data from page body
// and then showing dataset view.
- //
+ //
$('.page-body').children().remove();
data.createTabularDatasetChunkedView({
// TODO: encode id.
- dataset_config:
- _.extend( ${h.to_json_string( item.to_dict() )},
+ dataset_config:
+ _.extend( ${h.to_json_string( item.to_dict() )},
{
- chunk_url: "${h.url_for( controller='/dataset', action='display',
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( item.id ))}",
first_data_chunk: ${first_chunk}
- }
+ }
),
parent_elt: $('.page-body')
});
@@ -58,9 +58,9 @@
<%def name="render_item_links( data )">
## Provide links to save data and import dataset.
<a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a>
- <a
+ <a
href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
- class="icon-button import"
+ class="icon-button import"
title="Import dataset"></a></%def>
@@ -70,7 +70,7 @@
%if data_to_render:
%if truncated:
<div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below. |
+ This dataset is large and only the first megabyte is shown below. |
<a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div>
%endif
@@ -100,9 +100,9 @@
| ${get_item_name( item ) | h}
</div></div>
-
+
<div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
+ <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right">
${self.render_item_links( item )}
@@ -110,7 +110,7 @@
<div>
${self.render_item_header( item )}
</div>
-
+
${self.render_item( item, item_data )}
</div></div>
@@ -123,20 +123,20 @@
About this ${get_class_display_name( item.__class__ )}
</div></div>
-
+
<div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4>
-
+
<p>${item.history.user.username | h}</p>
-
+
<div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=iden…"></div>
- ## Page meta.
-
+ ## Page meta.
+
## No links for datasets right now.
-
+
## Tags.
<p><h4>Tags</h4>
@@ -155,8 +155,8 @@
Yours:
${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
</div>
- </div>
+ </div></div></div>
-</%def>
\ No newline at end of file
+</%def>
diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r b99e3eee6217db24efa3fad12bd5c00289522056 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -8,7 +8,7 @@
${h.js( "libs/require" )}
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -23,7 +23,7 @@
chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
- }
+ }
),
parent_elt: $('body')
});
https://bitbucket.org/galaxy/galaxy-central/commits/60aa2c0c0b21/
Changeset: 60aa2c0c0b21
User: dannon
Date: 2014-05-29 22:28:08
Summary: merge.
Affected #: 1 file
diff -r b99e3eee6217db24efa3fad12bd5c00289522056 -r 60aa2c0c0b21f4c52b1f83c7f19d0b148e198ee0 lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -243,10 +243,11 @@
datatype_class_name = test_result
test_result = trans.app.datatypes_registry.get_datatype_class_by_name( datatype_class_name )
if not test_result:
- # warn if can't find class, but continue (with other tests)
- log.warn( 'visualizations_registry cannot find class (%s)' +
- ' for applicability test on: %s, id: %s', datatype_class_name,
- target_object, getattr( target_object, 'id', '' ) )
+ # but continue (with other tests) if can't find class by that name
+ #if self.debug:
+ # log.warn( 'visualizations_registry cannot find class (%s)' +
+ # ' for applicability test on: %s, id: %s', datatype_class_name,
+ # target_object, getattr( target_object, 'id', '' ) )
continue
#NOTE: tests are OR'd, if any test passes - the visualization can be applied
https://bitbucket.org/galaxy/galaxy-central/commits/a37133f7364d/
Changeset: a37133f7364d
Branch: next-stable
User: dannon
Date: 2014-05-30 17:11:32
Summary: Add loading indicator back that disappeared (unintentionally?) in b12b245510be
Affected #: 1 file
diff -r b8fef1dfa8e8eb5afdeaa96236a0a9990f7c532b -r a37133f7364d75f3749e9eb72c0195b446dce781 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -133,6 +133,16 @@
},
render: function() {
+ // Add loading indicator.
+ var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+
+ loading_indicator.ajaxStart(function(){
+ $(this).show();
+ }).ajaxStop(function(){
+ $(this).hide();
+ });
+
+ this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -170,11 +180,6 @@
});
}
});
- $('#loading_indicator').ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
},
/**
https://bitbucket.org/galaxy/galaxy-central/commits/79a9d2b2c110/
Changeset: 79a9d2b2c110
User: dannon
Date: 2014-05-30 17:11:46
Summary: Merge.
Affected #: 1 file
diff -r 60aa2c0c0b21f4c52b1f83c7f19d0b148e198ee0 -r 79a9d2b2c11024b5cd3a67ef84f25d9c07029a85 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -133,6 +133,16 @@
},
render: function() {
+ // Add loading indicator.
+ var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+
+ loading_indicator.ajaxStart(function(){
+ $(this).show();
+ }).ajaxStop(function(){
+ $(this).hide();
+ });
+
+ this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -177,11 +187,6 @@
});
}
});
- $('#loading_indicator').ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
},
/**
https://bitbucket.org/galaxy/galaxy-central/commits/afb293ca337b/
Changeset: afb293ca337b
Branch: next-stable
User: dannon
Date: 2014-05-30 17:33:08
Summary: Pack scripts.
Affected #: 1 file
diff -r a37133f7364d75f3749e9eb72c0195b446dce781 -r afb293ca337be1e04a34f22a310367d99ff2a38f static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/47fbab3029e5/
Changeset: 47fbab3029e5
User: dannon
Date: 2014-05-30 17:33:18
Summary: Merge next-stable.
Affected #: 1 file
diff -r 79a9d2b2c11024b5cd3a67ef84f25d9c07029a85 -r 47fbab3029e5fe1a1f3334bbcfa46c5856c63bc7 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/cded8178bb48/
Changeset: cded8178bb48
Branch: next-stable
User: dannon
Date: 2014-05-30 17:34:15
Summary: Merge.
Affected #: 1 file
diff -r afb293ca337be1e04a34f22a310367d99ff2a38f -r cded8178bb4834236d9ae6239c14b928ae2d282b lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -498,7 +498,7 @@
# Check that the file is in the right location
local_filename = os.path.abspath( value['path'] )
assert local_filename.startswith( upload_store ), \
- "Filename provided by nginx is not in correct directory"
+ "Filename provided by nginx (%s) is not in correct directory (%s)" % (local_filename, upload_store)
value = dict(
filename=value["name"],
local_filename=local_filename
https://bitbucket.org/galaxy/galaxy-central/commits/f48fbe6866a5/
Changeset: f48fbe6866a5
User: dannon
Date: 2014-05-30 17:35:27
Summary: Merge
Affected #: 2 files
diff -r 3409e283965f58ec4bf96594f980a8e6ee2cb058 -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -133,6 +133,16 @@
},
render: function() {
+ // Add loading indicator.
+ var loading_indicator = $('<div/>').attr('id', 'loading_indicator');
+
+ loading_indicator.ajaxStart(function(){
+ $(this).show();
+ }).ajaxStop(function(){
+ $(this).hide();
+ });
+
+ this.$el.append(loading_indicator);
// Add data table and header.
var data_table = $('<table/>').attr({
id: 'content_table',
@@ -177,11 +187,6 @@
});
}
});
- $('#loading_indicator').ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
},
/**
diff -r 3409e283965f58ec4bf96594f980a8e6ee2cb058 -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var s=$("<div/>").attr("id","loading_indicator");s.ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()});this.$el.append(s);var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(t){if(t){n._renderChunk(t);p=false}})}})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/cb1e86b187a3/
Changeset: cb1e86b187a3
Branch: next-stable
User: dannon
Date: 2014-05-30 17:37:13
Summary: Merge.
Affected #: 3 files
diff -r cded8178bb4834236d9ae6239c14b928ae2d282b -r cb1e86b187a38fce1b9601115fc1a51809f3b292 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -638,9 +638,9 @@
};
return {
- Dataset: Dataset,
+ Dataset: Dataset,
TabularDataset: TabularDataset,
- DatasetCollection: DatasetCollection,
+ DatasetCollection: DatasetCollection,
TabularDatasetChunkedView: TabularDatasetChunkedView,
createTabularDatasetChunkedView: createTabularDatasetChunkedView
};
diff -r cded8178bb4834236d9ae6239c14b928ae2d282b -r cb1e86b187a38fce1b9601115fc1a51809f3b292 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -9,7 +9,7 @@
%if item.datatype.CHUNKABLE:
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -17,21 +17,21 @@
});
require(['mvc/data'], function(data) {
- //
+ //
// Use tabular data display progressively by deleting data from page body
// and then showing dataset view.
- //
+ //
$('.page-body').children().remove();
data.createTabularDatasetChunkedView({
// TODO: encode id.
- dataset_config:
- _.extend( ${h.to_json_string( item.to_dict() )},
+ dataset_config:
+ _.extend( ${h.to_json_string( item.to_dict() )},
{
- chunk_url: "${h.url_for( controller='/dataset', action='display',
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( item.id ))}",
first_data_chunk: ${first_chunk}
- }
+ }
),
parent_elt: $('.page-body')
});
@@ -58,9 +58,9 @@
<%def name="render_item_links( data )">
## Provide links to save data and import dataset.
<a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a>
- <a
+ <a
href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
- class="icon-button import"
+ class="icon-button import"
title="Import dataset"></a></%def>
@@ -70,7 +70,7 @@
%if data_to_render:
%if truncated:
<div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below. |
+ This dataset is large and only the first megabyte is shown below. |
<a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div>
%endif
@@ -100,9 +100,9 @@
| ${get_item_name( item ) | h}
</div></div>
-
+
<div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
+ <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right">
${self.render_item_links( item )}
@@ -110,7 +110,7 @@
<div>
${self.render_item_header( item )}
</div>
-
+
${self.render_item( item, item_data )}
</div></div>
@@ -123,20 +123,20 @@
About this ${get_class_display_name( item.__class__ )}
</div></div>
-
+
<div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4>
-
+
<p>${item.history.user.username | h}</p>
-
+
<div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=iden…"></div>
- ## Page meta.
-
+ ## Page meta.
+
## No links for datasets right now.
-
+
## Tags.
<p><h4>Tags</h4>
@@ -155,8 +155,8 @@
Yours:
${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
</div>
- </div>
+ </div></div></div>
-</%def>
\ No newline at end of file
+</%def>
diff -r cded8178bb4834236d9ae6239c14b928ae2d282b -r cb1e86b187a38fce1b9601115fc1a51809f3b292 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -8,7 +8,7 @@
${h.js( "libs/require" )}
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -23,7 +23,7 @@
chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
- }
+ }
),
parent_elt: $('body')
});
https://bitbucket.org/galaxy/galaxy-central/commits/25ab1fe9dbc7/
Changeset: 25ab1fe9dbc7
User: dannon
Date: 2014-05-30 17:38:13
Summary: Merge.
Affected #: 3 files
diff -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -645,9 +645,9 @@
};
return {
- Dataset: Dataset,
+ Dataset: Dataset,
TabularDataset: TabularDataset,
- DatasetCollection: DatasetCollection,
+ DatasetCollection: DatasetCollection,
TabularDatasetChunkedView: TabularDatasetChunkedView,
createTabularDatasetChunkedView: createTabularDatasetChunkedView
};
diff -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 templates/webapps/galaxy/dataset/display.mako
--- a/templates/webapps/galaxy/dataset/display.mako
+++ b/templates/webapps/galaxy/dataset/display.mako
@@ -9,7 +9,7 @@
%if item.datatype.CHUNKABLE:
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -17,21 +17,21 @@
});
require(['mvc/data'], function(data) {
- //
+ //
// Use tabular data display progressively by deleting data from page body
// and then showing dataset view.
- //
+ //
$('.page-body').children().remove();
data.createTabularDatasetChunkedView({
// TODO: encode id.
- dataset_config:
- _.extend( ${h.to_json_string( item.to_dict() )},
+ dataset_config:
+ _.extend( ${h.to_json_string( item.to_dict() )},
{
- chunk_url: "${h.url_for( controller='/dataset', action='display',
+ chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( item.id ))}",
first_data_chunk: ${first_chunk}
- }
+ }
),
parent_elt: $('.page-body')
});
@@ -58,9 +58,9 @@
<%def name="render_item_links( data )">
## Provide links to save data and import dataset.
<a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk" title="Save dataset"></a>
- <a
+ <a
href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
- class="icon-button import"
+ class="icon-button import"
title="Import dataset"></a></%def>
@@ -70,7 +70,7 @@
%if data_to_render:
%if truncated:
<div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below. |
+ This dataset is large and only the first megabyte is shown below. |
<a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a></div>
%endif
@@ -100,9 +100,9 @@
| ${get_item_name( item ) | h}
</div></div>
-
+
<div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
+ <div style="overflow: auto; height: 100%;"><div class="page-body"><div style="float: right">
${self.render_item_links( item )}
@@ -110,7 +110,7 @@
<div>
${self.render_item_header( item )}
</div>
-
+
${self.render_item( item, item_data )}
</div></div>
@@ -123,20 +123,20 @@
About this ${get_class_display_name( item.__class__ )}
</div></div>
-
+
<div class="unified-panel-body"><div style="overflow: auto; height: 100%;"><div style="padding: 10px;"><h4>Author</h4>
-
+
<p>${item.history.user.username | h}</p>
-
+
<div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=iden…"></div>
- ## Page meta.
-
+ ## Page meta.
+
## No links for datasets right now.
-
+
## Tags.
<p><h4>Tags</h4>
@@ -155,8 +155,8 @@
Yours:
${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
</div>
- </div>
+ </div></div></div>
-</%def>
\ No newline at end of file
+</%def>
diff -r f48fbe6866a56e0f05d36d84da8450d06bdac9c7 -r 25ab1fe9dbc7659fbf3cdfea26d5f03e4c521701 templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -8,7 +8,7 @@
${h.js( "libs/require" )}
<script type="text/javascript">
- require.config({
+ require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/backbone/backbone": { exports: "Backbone" },
@@ -23,7 +23,7 @@
chunk_url: "${h.url_for( controller='/dataset', action='display',
dataset_id=trans.security.encode_id( dataset.id ))}",
first_data_chunk: ${chunk}
- }
+ }
),
parent_elt: $('body')
});
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2a7b890c09c1/
Changeset: 2a7b890c09c1
Branch: next-stable
User: dannon
Date: 2014-05-29 23:23:51
Summary: Improve assertion logging for upload_store mismatch
Affected #: 1 file
diff -r b8fef1dfa8e8eb5afdeaa96236a0a9990f7c532b -r 2a7b890c09c1fb677378e099a5f0637c2036b310 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -498,7 +498,7 @@
# Check that the file is in the right location
local_filename = os.path.abspath( value['path'] )
assert local_filename.startswith( upload_store ), \
- "Filename provided by nginx is not in correct directory"
+ "Filename provided by nginx (%s) is not in correct directory (%s)" % (local_filename, upload_store)
value = dict(
filename=value["name"],
local_filename=local_filename
https://bitbucket.org/galaxy/galaxy-central/commits/3409e283965f/
Changeset: 3409e283965f
User: dannon
Date: 2014-05-29 23:24:03
Summary: Merge.
Affected #: 1 file
diff -r 675be4213255a51c84ff52973bc199fa6d2152a1 -r 3409e283965f58ec4bf96594f980a8e6ee2cb058 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -498,7 +498,7 @@
# Check that the file is in the right location
local_filename = os.path.abspath( value['path'] )
assert local_filename.startswith( upload_store ), \
- "Filename provided by nginx is not in correct directory"
+ "Filename provided by nginx (%s) is not in correct directory (%s)" % (local_filename, upload_store)
value = dict(
filename=value["name"],
local_filename=local_filename
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b8fef1dfa8e8/
Changeset: b8fef1dfa8e8
Branch: next-stable
User: carlfeberhard
Date: 2014-05-29 22:25:44
Summary: Silence log warnings when class names are not found in the visualizations registry applicability tests
Affected #: 1 file
diff -r 3edca70df09ded514c1e6a46701372638c4596a9 -r b8fef1dfa8e8eb5afdeaa96236a0a9990f7c532b lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -243,10 +243,11 @@
datatype_class_name = test_result
test_result = trans.app.datatypes_registry.get_datatype_class_by_name( datatype_class_name )
if not test_result:
- # warn if can't find class, but continue (with other tests)
- log.warn( 'visualizations_registry cannot find class (%s)' +
- ' for applicability test on: %s, id: %s', datatype_class_name,
- target_object, getattr( target_object, 'id', '' ) )
+ # but continue (with other tests) if can't find class by that name
+ #if self.debug:
+ # log.warn( 'visualizations_registry cannot find class (%s)' +
+ # ' for applicability test on: %s, id: %s', datatype_class_name,
+ # target_object, getattr( target_object, 'id', '' ) )
continue
#NOTE: tests are OR'd, if any test passes - the visualization can be applied
https://bitbucket.org/galaxy/galaxy-central/commits/675be4213255/
Changeset: 675be4213255
User: carlfeberhard
Date: 2014-05-29 22:25:59
Summary: merge
Affected #: 1 file
diff -r 34d179b55c859f9c669c73733bde2684cf9d4a9f -r 675be4213255a51c84ff52973bc199fa6d2152a1 lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -243,10 +243,11 @@
datatype_class_name = test_result
test_result = trans.app.datatypes_registry.get_datatype_class_by_name( datatype_class_name )
if not test_result:
- # warn if can't find class, but continue (with other tests)
- log.warn( 'visualizations_registry cannot find class (%s)' +
- ' for applicability test on: %s, id: %s', datatype_class_name,
- target_object, getattr( target_object, 'id', '' ) )
+ # but continue (with other tests) if can't find class by that name
+ #if self.debug:
+ # log.warn( 'visualizations_registry cannot find class (%s)' +
+ # ' for applicability test on: %s, id: %s', datatype_class_name,
+ # target_object, getattr( target_object, 'id', '' ) )
continue
#NOTE: tests are OR'd, if any test passes - the visualization can be applied
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e69024c183a7/
Changeset: e69024c183a7
User: jmchilton
Date: 2014-05-29 07:15:38
Summary: Unit tests for RunnerParams.
Small changes to make this easier - mostly just defining constants.
Affected #: 2 files
diff -r cc0f9182fcb0b18730dd79c6889de4c8a58d4446 -r e69024c183a7403bae7b0801faa8f0db5fc1e5c0 lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -24,20 +24,27 @@
STOP_SIGNAL = object()
+JOB_RUNNER_PARAMETER_UNKNOWN_MESSAGE = "Invalid job runner parameter for this plugin: %s"
+JOB_RUNNER_PARAMETER_MAP_PROBLEM_MESSAGE = "Job runner parameter '%s' value '%s' could not be converted to the correct type"
+JOB_RUNNER_PARAMETER_VALIDATION_FAILED_MESSAGE = "Job runner parameter %s failed validation"
+
+
class RunnerParams( object ):
def __init__( self, specs=None, params=None ):
self.specs = specs or dict()
self.params = params or dict()
for name, value in self.params.items():
- assert name in self.specs, 'Invalid job runner parameter for this plugin: %s' % name
+ assert name in self.specs, JOB_RUNNER_PARAMETER_UNKNOWN_MESSAGE % name
if 'map' in self.specs[ name ]:
try:
self.params[ name ] = self.specs[ name ][ 'map' ]( value )
- except Exception, e:
- raise Exception( 'Job runner parameter "%s" value "%s" could not be converted to the correct type: %s' % ( name, value, e ) )
+ except Exception:
+ message = JOB_RUNNER_PARAMETER_MAP_PROBLEM_MESSAGE % ( name, value )
+ log.exception(message)
+ raise Exception( message )
if 'valid' in self.specs[ name ]:
- assert self.specs[ name ][ 'valid' ]( value ), 'Job runner parameter %s failed validation' % name
+ assert self.specs[ name ][ 'valid' ]( value ), JOB_RUNNER_PARAMETER_VALIDATION_FAILED_MESSAGE % name
def __getattr__( self, name ):
return self.params.get( name, self.specs[ name ][ 'default' ] )
@@ -46,13 +53,15 @@
class BaseJobRunner( object ):
+ DEFAULT_SPECS = dict( recheck_missing_job_retries=dict( map=int, valid=lambda x: x >= 0, default=0 ) )
+
def __init__( self, app, nworkers, **kwargs ):
"""Start the job runner
"""
self.app = app
self.sa_session = app.model.context
self.nworkers = nworkers
- runner_param_specs = dict( recheck_missing_job_retries=dict( map=int, valid=lambda x: x >= 0, default=0 ) )
+ runner_param_specs = self.DEFAULT_SPECS.copy()
if 'runner_param_specs' in kwargs:
runner_param_specs.update( kwargs.pop( 'runner_param_specs' ) )
if kwargs:
diff -r cc0f9182fcb0b18730dd79c6889de4c8a58d4446 -r e69024c183a7403bae7b0801faa8f0db5fc1e5c0 test/unit/jobs/test_runner_params.py
--- /dev/null
+++ b/test/unit/jobs/test_runner_params.py
@@ -0,0 +1,48 @@
+from galaxy.jobs import runners
+
+
+def test_default_specs():
+ # recheck_missing_job_retries is integer >= 0
+ params = runners.RunnerParams( specs=runners.BaseJobRunner.DEFAULT_SPECS, params=dict( recheck_missing_job_retries="1" ) )
+ assert params.recheck_missing_job_retries == 1
+ assert params["recheck_missing_job_retries"] == 1
+
+ exception_raised = False
+ try:
+ runners.RunnerParams( specs=runners.BaseJobRunner.DEFAULT_SPECS, params=dict( recheck_missing_job_retries=-1 ) )
+ except Exception:
+ exception_raised = True
+ assert exception_raised
+
+
+def test_missing_parameter():
+ exception = None
+ try:
+ runners.RunnerParams( specs={}, params=dict( foo="bar" ) )
+ except Exception as e:
+ exception = e
+ assert exception.message == runners.JOB_RUNNER_PARAMETER_UNKNOWN_MESSAGE % "foo"
+
+
+def test_invalid_parameter():
+ exception = None
+ try:
+ runners.RunnerParams( specs=dict( foo=dict( valid=lambda x: x != "bar", defualt="baz" ) ), params=dict( foo="bar" ) )
+ except Exception as e:
+ exception = e
+ assert exception.message == runners.JOB_RUNNER_PARAMETER_VALIDATION_FAILED_MESSAGE % "foo"
+
+
+def test_map_problem():
+ exception = None
+ try:
+ runners.RunnerParams( specs=dict( foo=dict( map=lambda x: 1 / 0, default="baz" ) ), params=dict( foo="bar" ) )
+ except Exception as e:
+ exception = e
+ assert exception.message == runners.JOB_RUNNER_PARAMETER_MAP_PROBLEM_MESSAGE % ( "foo", "bar" )
+
+
+def test_param_default():
+ runner_params = runners.RunnerParams( specs=dict( foo=dict( default="baz" ) ), params={} )
+ assert runner_params["foo"] == "baz"
+ assert runner_params.foo == "baz"
https://bitbucket.org/galaxy/galaxy-central/commits/34d179b55c85/
Changeset: 34d179b55c85
User: jmchilton
Date: 2014-05-29 07:15:38
Summary: Generalize RunnerParams.
Create ParamsWithSpecs class in galaxy.util. If we are going to build out specs for all LWR client parameters - would be nice if they could be reused on the LWR server side where relevant (e.g. AMQP connection parameters).
Slightly modified implementation that extends collections.defaultdict so that operations like iterating over parameters, fetching keys, etc... are available so LWR runner param handling code can look like destination param handling code.
Affected #: 2 files
diff -r e69024c183a7403bae7b0801faa8f0db5fc1e5c0 -r 34d179b55c859f9c669c73733bde2684cf9d4a9f lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -16,6 +16,7 @@
from galaxy import model
from galaxy.util import DATABASE_MAX_STRING_SIZE, shrink_stream_by_size
from galaxy.util import in_directory
+from galaxy.util import ParamsWithSpecs
from galaxy.jobs.runners.util.job_script import job_script
from galaxy.jobs.runners.util.env import env_to_statement
@@ -29,27 +30,16 @@
JOB_RUNNER_PARAMETER_VALIDATION_FAILED_MESSAGE = "Job runner parameter %s failed validation"
-class RunnerParams( object ):
+class RunnerParams( ParamsWithSpecs ):
- def __init__( self, specs=None, params=None ):
- self.specs = specs or dict()
- self.params = params or dict()
- for name, value in self.params.items():
- assert name in self.specs, JOB_RUNNER_PARAMETER_UNKNOWN_MESSAGE % name
- if 'map' in self.specs[ name ]:
- try:
- self.params[ name ] = self.specs[ name ][ 'map' ]( value )
- except Exception:
- message = JOB_RUNNER_PARAMETER_MAP_PROBLEM_MESSAGE % ( name, value )
- log.exception(message)
- raise Exception( message )
- if 'valid' in self.specs[ name ]:
- assert self.specs[ name ][ 'valid' ]( value ), JOB_RUNNER_PARAMETER_VALIDATION_FAILED_MESSAGE % name
+ def _param_unknown_error( self, name ):
+ raise Exception( JOB_RUNNER_PARAMETER_UNKNOWN_MESSAGE % name )
- def __getattr__( self, name ):
- return self.params.get( name, self.specs[ name ][ 'default' ] )
+ def _param_map_error( self, name, value ):
+ raise Exception( JOB_RUNNER_PARAMETER_MAP_PROBLEM_MESSAGE % ( name, value ) )
- __getitem__ = __getattr__
+ def _param_vaildation_error( self, name, value ):
+ raise Exception( JOB_RUNNER_PARAMETER_VALIDATION_FAILED_MESSAGE % name )
class BaseJobRunner( object ):
diff -r e69024c183a7403bae7b0801faa8f0db5fc1e5c0 -r 34d179b55c859f9c669c73733bde2684cf9d4a9f lib/galaxy/util/__init__.py
--- a/lib/galaxy/util/__init__.py
+++ b/lib/galaxy/util/__init__.py
@@ -7,6 +7,7 @@
from __future__ import absolute_import
import binascii
+import collections
import errno
import grp
import json
@@ -693,6 +694,44 @@
def string_to_object( s ):
return pickle.loads( binascii.unhexlify( s ) )
+
+class ParamsWithSpecs( collections.defaultdict ):
+ """
+ """
+
+ def __init__( self, specs=None, params=None ):
+ self.specs = specs or dict()
+ self.params = params or dict()
+ for name, value in self.params.items():
+ if name not in self.specs:
+ self._param_unknown_error( name )
+ if 'map' in self.specs[ name ]:
+ try:
+ self.params[ name ] = self.specs[ name ][ 'map' ]( value )
+ except Exception:
+ self._param_map_error( name, value )
+ if 'valid' in self.specs[ name ]:
+ if not self.specs[ name ][ 'valid' ]( value ):
+ self._param_vaildation_error( name, value )
+
+ self.update( self.params )
+
+ def __missing__( self, name ):
+ return self.specs[ name ][ 'default' ]
+
+ def __getattr__( self, name ):
+ return self[ name ]
+
+ def _param_unknown_error( self, name ):
+ raise NotImplementedError()
+
+ def _param_map_error( self, name, value ):
+ raise NotImplementedError()
+
+ def _param_vaildation_error( self, name, value ):
+ raise NotImplementedError()
+
+
def compare_urls( url1, url2, compare_scheme=True, compare_hostname=True, compare_path=True ):
url1 = urlparse( url1 )
url2 = urlparse( url2 )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3edca70df09d/
Changeset: 3edca70df09d
Branch: next-stable
User: jmchilton
Date: 2014-05-29 04:14:52
Summary: More MQ-LWR documentation.
Mention pycurl dependency when using LWR client in this fashion.
Affected #: 1 file
diff -r eed45027e219df9c4fc87fcfc788380ecc500b1a -r 3edca70df09ded514c1e6a46701372638c4596a9 job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -204,6 +204,10 @@
using message queues (in the more traditional mode Galaxy sends
files to and pull files from the LWR - this is obviously less
appropriate when using a message queue).
+
+ The default_file_action currently requires pycurl be available
+ to Galaxy (presumably in its virtualenv). Making this dependency
+ optional is an open task.
--><param id="default_file_action">remote_transfer</param></destination>
https://bitbucket.org/galaxy/galaxy-central/commits/cc0f9182fcb0/
Changeset: cc0f9182fcb0
User: jmchilton
Date: 2014-05-29 04:15:08
Summary: Merge latest next-stable.
Affected #: 1 file
diff -r f415f6c5ecf22720f5bc8d8ae983cbc713831890 -r cc0f9182fcb0b18730dd79c6889de4c8a58d4446 job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -204,6 +204,10 @@
using message queues (in the more traditional mode Galaxy sends
files to and pull files from the LWR - this is obviously less
appropriate when using a message queue).
+
+ The default_file_action currently requires pycurl be available
+ to Galaxy (presumably in its virtualenv). Making this dependency
+ optional is an open task.
--><param id="default_file_action">remote_transfer</param></destination>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fa67fbfa58e1/
Changeset: fa67fbfa58e1
User: jmchilton
Date: 2014-05-29 03:25:53
Summary: Bugfix for a06c6c9.
With improved testing :).
Affected #: 2 files
diff -r 85aa79e9ab9a87a5b5fea0ed1039aeb9a5c23642 -r fa67fbfa58e16ad2f1a18c9e53fac2b02c7ab7f0 lib/galaxy/dataset_collections/__init__.py
--- a/lib/galaxy/dataset_collections/__init__.py
+++ b/lib/galaxy/dataset_collections/__init__.py
@@ -147,7 +147,10 @@
):
assert source == "hdca" # for now
source_hdca = self.__get_history_collection_instance( trans, encoded_source_id )
- parent.add_dataset_collection( source_hdca.copy() )
+ new_hdca = source_hdca.copy()
+ parent.add_dataset_collection( new_hdca )
+ trans.sa_session.add( new_hdca )
+ trans.sa_session.flush()
return source_hdca
def _set_from_dict( self, trans, dataset_collection_instance, new_data ):
diff -r 85aa79e9ab9a87a5b5fea0ed1039aeb9a5c23642 -r fa67fbfa58e16ad2f1a18c9e53fac2b02c7ab7f0 test/api/test_history_contents.py
--- a/test/api/test_history_contents.py
+++ b/test/api/test_history_contents.py
@@ -150,8 +150,10 @@
source='hdca',
content=hdca_id,
)
+ assert len( self._get( "histories/%s/contents/dataset_collections" % second_history_id ).json() ) == 0
create_response = self._post( "histories/%s/contents/dataset_collections" % second_history_id, create_data )
self.__check_create_collection_response( create_response )
+ assert len( self._get( "histories/%s/contents/dataset_collections" % second_history_id ).json() ) == 1
def __check_create_collection_response( self, response ):
self._assert_status_code_is( response, 200 )
https://bitbucket.org/galaxy/galaxy-central/commits/f415f6c5ecf2/
Changeset: f415f6c5ecf2
User: jmchilton
Date: 2014-05-29 03:25:53
Summary: More extract functional tests.
Add test for extracting copied, mapped datasets and copied input dataset collections from history.
Affected #: 2 files
diff -r fa67fbfa58e16ad2f1a18c9e53fac2b02c7ab7f0 -r f415f6c5ecf22720f5bc8d8ae983cbc713831890 lib/galaxy/workflow/extract.py
--- a/lib/galaxy/workflow/extract.py
+++ b/lib/galaxy/workflow/extract.py
@@ -2,6 +2,7 @@
histories.
"""
from galaxy.util.odict import odict
+from galaxy import exceptions
from galaxy import model
from galaxy.tools.parameters.basic import (
DataToolParameter,
@@ -88,6 +89,8 @@
for hid in dataset_collection_ids:
step = model.WorkflowStep()
step.type = 'data_collection_input'
+ if hid not in summary.collection_types:
+ raise exceptions.RequestParameterInvalidException( "hid %s does not appear to be a collection" % hid )
collection_type = summary.collection_types[ hid ]
step.tool_inputs = dict( name="Input Dataset Collection", collection_type=collection_type )
hid_to_output_pair[ hid ] = ( step, 'output' )
diff -r fa67fbfa58e16ad2f1a18c9e53fac2b02c7ab7f0 -r f415f6c5ecf22720f5bc8d8ae983cbc713831890 test/api/test_workflows.py
--- a/test/api/test_workflows.py
+++ b/test/api/test_workflows.py
@@ -106,12 +106,7 @@
offset = 0
old_contents = self._get( "histories/%s/contents" % old_history_id ).json()
for old_dataset in old_contents:
- payload = dict(
- source="hda",
- content=old_dataset["id"]
- )
- response = self._post( "histories/%s/contents/datasets" % history_id, payload )
- self._assert_status_code_is( response, 200 )
+ self.__copy_content_to_history( history_id, old_dataset )
new_contents = self._get( "histories/%s/contents" % history_id ).json()
input_hids = map( lambda c: c[ "hid" ], new_contents[ (offset + 0):(offset + 2) ] )
cat1_job_id = self.__job_id( history_id, new_contents[ (offset + 2) ][ "id" ] )
@@ -186,40 +181,33 @@
@skip_without_tool( "random_lines1" )
def test_extract_mapping_workflow_from_history( self ):
history_id = self.dataset_populator.new_history()
- hdca = self.dataset_collection_populator.create_pair_in_history( history_id, contents=["1 2 3\n4 5 6", "7 8 9\n10 11 10"] ).json()
- hdca_id = hdca[ "id" ]
- inputs1 = {
- "input|__collection_multirun__": hdca_id,
- "num_lines": 2
- }
- implicit_hdca1, job_id1 = self._run_tool_get_collection_and_job_id( history_id, "random_lines1", inputs1 )
- inputs2 = {
- "input|__collection_multirun__": implicit_hdca1[ "id" ],
- "num_lines": 1
- }
- _, job_id2 = self._run_tool_get_collection_and_job_id( history_id, "random_lines1", inputs2 )
+ hdca, job_id1, job_id2 = self.__run_random_lines_mapped_over_pair( history_id )
downloaded_workflow = self._extract_and_download_workflow(
from_history_id=history_id,
dataset_collection_ids=dumps( [ hdca[ "hid" ] ] ),
job_ids=dumps( [ job_id1, job_id2 ] ),
workflow_name="test import from mapping history",
)
- # Assert workflow is input connected to a tool step with one output
- # connected to another tool step.
- assert len( downloaded_workflow[ "steps" ] ) == 3
- collect_step_idx = self._assert_first_step_is_paired_input( downloaded_workflow )
- tool_steps = self._get_steps_of_type( downloaded_workflow, "tool", expected_len=2 )
- tool_step_idxs = []
- tool_input_step_idxs = []
- for tool_step in tool_steps:
- self._assert_has_key( tool_step[ "input_connections" ], "input" )
- input_step_idx = tool_step[ "input_connections" ][ "input" ][ "id" ]
- tool_step_idxs.append( tool_step[ "id" ] )
- tool_input_step_idxs.append( input_step_idx )
+ self.__assert_looks_like_randomlines_mapping_workflow( downloaded_workflow )
- assert collect_step_idx not in tool_step_idxs
- assert tool_input_step_idxs[ 0 ] == collect_step_idx
- assert tool_input_step_idxs[ 1 ] == tool_step_idxs[ 0 ]
+ def test_extract_copied_mapping_from_history( self ):
+ old_history_id = self.dataset_populator.new_history()
+ hdca, job_id1, job_id2 = self.__run_random_lines_mapped_over_pair( old_history_id )
+
+ history_id = self.dataset_populator.new_history()
+ old_contents = self._get( "histories/%s/contents" % old_history_id ).json()
+ for old_content in old_contents:
+ self.__copy_content_to_history( history_id, old_content )
+ # API test is somewhat contrived since there is no good way
+ # to retrieve job_id1, job_id2 like this for copied dataset
+ # collections I don't think.
+ downloaded_workflow = self._extract_and_download_workflow(
+ from_history_id=history_id,
+ dataset_collection_ids=dumps( [ hdca[ "hid" ] ] ),
+ job_ids=dumps( [ job_id1, job_id2 ] ),
+ workflow_name="test import from history",
+ )
+ self.__assert_looks_like_randomlines_mapping_workflow( downloaded_workflow )
@skip_without_tool( "random_lines1" )
@skip_without_tool( "multi_data_param" )
@@ -259,6 +247,56 @@
reduction_step_input = reduction_step[ "input_connections" ][ "f1" ]
assert reduction_step_input[ "id"] == random_lines_map_step[ "id" ]
+ def __copy_content_to_history( self, history_id, content ):
+ if content[ "history_content_type" ] == "dataset":
+ payload = dict(
+ source="hda",
+ content=content["id"]
+ )
+ response = self._post( "histories/%s/contents/datasets" % history_id, payload )
+
+ else:
+ payload = dict(
+ source="hdca",
+ content=content["id"]
+ )
+ response = self._post( "histories/%s/contents/dataset_collections" % history_id, payload )
+ self._assert_status_code_is( response, 200 )
+ return response.json()
+
+ def __run_random_lines_mapped_over_pair( self, history_id ):
+ hdca = self.dataset_collection_populator.create_pair_in_history( history_id, contents=["1 2 3\n4 5 6", "7 8 9\n10 11 10"] ).json()
+ hdca_id = hdca[ "id" ]
+ inputs1 = {
+ "input|__collection_multirun__": hdca_id,
+ "num_lines": 2
+ }
+ implicit_hdca1, job_id1 = self._run_tool_get_collection_and_job_id( history_id, "random_lines1", inputs1 )
+ inputs2 = {
+ "input|__collection_multirun__": implicit_hdca1[ "id" ],
+ "num_lines": 1
+ }
+ _, job_id2 = self._run_tool_get_collection_and_job_id( history_id, "random_lines1", inputs2 )
+ return hdca, job_id1, job_id2
+
+ def __assert_looks_like_randomlines_mapping_workflow( self, downloaded_workflow ):
+ # Assert workflow is input connected to a tool step with one output
+ # connected to another tool step.
+ assert len( downloaded_workflow[ "steps" ] ) == 3
+ collect_step_idx = self._assert_first_step_is_paired_input( downloaded_workflow )
+ tool_steps = self._get_steps_of_type( downloaded_workflow, "tool", expected_len=2 )
+ tool_step_idxs = []
+ tool_input_step_idxs = []
+ for tool_step in tool_steps:
+ self._assert_has_key( tool_step[ "input_connections" ], "input" )
+ input_step_idx = tool_step[ "input_connections" ][ "input" ][ "id" ]
+ tool_step_idxs.append( tool_step[ "id" ] )
+ tool_input_step_idxs.append( input_step_idx )
+
+ assert collect_step_idx not in tool_step_idxs
+ assert tool_input_step_idxs[ 0 ] == collect_step_idx
+ assert tool_input_step_idxs[ 1 ] == tool_step_idxs[ 0 ]
+
def _run_tool_get_collection_and_job_id( self, history_id, tool_id, inputs ):
run_output1 = self.dataset_populator.run_tool(
tool_id=tool_id,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0