1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/a2d161919806/
changeset: a2d161919806
user: jgoecks
date: 2012-07-11 19:19:23
summary: Small viz tweaks.
affected #: 3 files
diff -r 33676ce91213156e434e9c9c2f2def8d9fbbecc2 -r a2d1619198063084b99a1e6e8c75e1658593c448 static/scripts/packed/viz/paramamonster.js
--- a/static/scripts/packed/viz/paramamonster.js
+++ b/static/scripts/packed/viz/paramamonster.js
@@ -1,1 +1,1 @@
-var ToolInputsSettings=Backbone.Model.extend({defaults:{inputs:null,values:null}});var ToolParameterTree=Backbone.RelationalModel.extend({defaults:{tool:null,tree_data:null},initialize:function(b){var a=this;this.get("tool").get("inputs").each(function(c){if(!c.get_samples()){return}c.on("change:min change:max change:num_samples",function(d){if(d.get("in_ptree")){a.set_tree_data()}},a);c.on("change:in_ptree",function(d){if(d.get("in_ptree")){a.add_param(d)}else{a.remove_param(d)}a.set_tree_data()},a)});if(b.config){_.each(b.config,function(d){var c=a.get("tool").get("inputs").find(function(e){return e.get("name")===d.name});a.add_param(c);c.set(d)})}},add_param:function(a){if(a.get("ptree_index")){return}a.set("in_ptree",true);a.set("ptree_index",this.get_tree_params().length)},remove_param:function(a){a.set("in_ptree",false);a.set("ptree_index",null);_(this.get_tree_params()).each(function(b,c){b.set("ptree_index",c+1)})},set_tree_data:function(){var b=_.map(this.get_tree_params(),function(d){return{param:d,samples:d.get_samples()}});var a=0,c=function(g,d){var i=g[d],h=i.param,f=h.get("label"),e=i.samples;if(g.length-1===d){return _.map(e,function(j){return{id:a++,name:j,param:h,value:j}})}return _.map(e,function(j){return{id:a++,name:j,param:h,value:j,children:c(g,d+1)}})};this.set("tree_data",{name:"Root",id:a++,children:(b.length!==0?c(b,0):null)})},get_tree_params:function(){return _(this.get("tool").get("inputs").where({in_ptree:true})).sortBy(function(a){return a.get("ptree_index")})},get_num_leaves:function(){return this.get_tree_params().reduce(function(a,b){return a*b.get_samples().length},1)},get_node_settings:function(e){var c=this.get("tool").get_inputs_dict();var f=e.parent;if(f){while(f.depth!==0){c[f.param.get("name")]=f.value;f=f.parent}}var a=this,b=function(h,g){if(h.param){g[h.param.get("name")]=h.value}if(!h.children){return new ToolInputsSettings({inputs:a.get("tool").get("inputs"),values:g})}else{return _.flatten(_.map(h.children,function(i){return b(i,_.clone(g))}))}},d=b(e,c);if(!_.isArray(d)){d=[d]}return d},get_connected_nodes:function(c){var d=function(e){if(!e.children){return e}else{return _.flatten([e,_.map(e.children,function(f){return d(f)})])}};var b=[],a=c.parent;while(a){b.push(a);a=a.parent}return _.flatten([b,d(c)])},get_leaf:function(b){var c=this.get("tree_data"),a=function(d){return _.find(d,function(e){return b[e.param.get("name")]===e.value})};while(c.children){c=a(c.children)}return c},toJSON:function(){return this.get_tree_params().map(function(a){return{name:a.get("name"),min:a.get("min"),max:a.get("max"),num_samples:a.get("num_samples")}})}});var ParamaMonsterTrack=Backbone.RelationalModel.extend({defaults:{track:null,mode:"Pack",settings:null,regions:null},relations:[{type:Backbone.HasMany,key:"regions",relatedModel:"GenomeRegion"}],initialize:function(a){if(a.track){var b=_.extend({data_url:galaxy_paths.get("raw_data_url"),converted_datasets_state_url:galaxy_paths.get("dataset_state_url")},a.track);this.set("track",object_from_template(b,{},null))}},same_settings:function(a){var b=this.get("settings"),c=a.get("settings");for(var d in b){if(!c[d]||b[d]!==c[d]){return false}}return true},toJSON:function(){return{track:this.get("track").to_dict(),settings:this.get("settings"),regions:this.get("regions")}}});var TrackCollection=Backbone.Collection.extend({model:ParamaMonsterTrack});var ParamaMonsterVisualization=Visualization.extend({defaults:_.extend({},Visualization.prototype.defaults,{dataset:null,tool:null,parameter_tree:null,regions:null,tracks:null,default_mode:"Pack"}),relations:[{type:Backbone.HasOne,key:"dataset",relatedModel:"Dataset"},{type:Backbone.HasOne,key:"tool",relatedModel:"Tool"},{type:Backbone.HasMany,key:"regions",relatedModel:"GenomeRegion"},{type:Backbone.HasMany,key:"tracks",relatedModel:"ParamaMonsterTrack"}],initialize:function(a){var b=this.get("tool").copy(true);this.set("tool_with_samplable_inputs",b);this.set("parameter_tree",new ToolParameterTree({tool:b,config:a.tree_config}))},add_track:function(a){this.get("tracks").add(a)},toJSON:function(){return{id:this.get("id"),title:"Parameter exploration for dataset '"+this.get("dataset").get("name")+"'",type:"paramamonster",dataset_id:this.get("dataset").id,tool_id:this.get("tool").id,regions:this.get("regions").toJSON(),tree_config:this.get("parameter_tree").toJSON(),tracks:this.get("tracks").toJSON()}}});var ParamaMonsterTrackView=Backbone.View.extend({tagName:"tr",TILE_LEN:250,initialize:function(a){this.canvas_manager=a.canvas_manager;this.render();this.model.on("change:track change:mode",this.draw_tiles,this)},render:function(){var f=this.model.get("settings"),b=f.get("values"),d=$("<td/>").addClass("settings").appendTo(this.$el),c=$("<div/>").addClass("track-info").hide().appendTo(d);c.append($("<div/>").css("font-weight","bold").text("Track Settings"));f.get("inputs").each(function(h){c.append(h.get("label")+": "+b[h.get("name")]+"<br/>")});var a=this,g=$("<button/>").appendTo(c).text("Run on complete dataset").click(function(){c.toggle();a.trigger("run_on_dataset",f)});var e=create_icon_buttons_menu([{title:"Settings",icon_class:"gear track-settings",on_click:function(){c.toggle()},tipsy_config:{gravity:"s"}},{title:"Remove",icon_class:"cross-circle",on_click:function(){a.$el.remove();$(".tipsy").remove()}}]);d.prepend(e.$el);this.model.get("regions").each(function(){a.$el.append($("<td/>").addClass("tile").html($("<img/>").attr("src",galaxy_paths.get("image_path")+"/loading_large_white_bg.gif")))});if(this.model.get("track")){this.draw_tiles()}},draw_tiles:function(){var b=this,a=this.model.get("track"),d=this.model.get("regions"),c=this.$el.find("td.tile");if(!a){return}$.when(a.data_manager.data_is_ready()).then(function(e){d.each(function(h,g){var f=h.length()/b.TILE_LEN,j=1/f,i=b.model.get("mode");$.when(a.data_manager.get_data(h,i,f,{})).then(function(l){var k=b.canvas_manager.new_canvas();k.width=b.TILE_LEN;k.height=a.get_canvas_height(l,i,j,k.width);a.draw_tile(l,k.getContext("2d"),i,f,h,j);$(c[g]).empty().append(k)})})})}});var ToolInputValOrSweepView=Backbone.View.extend({number_input_template:'<div class="form-row-input sweep"><input class="min" type="text" size="6" value="<%= min %>"> - <input class="max" type="text" size="6" value="<%= max %>"> samples: <input class="num_samples" type="text" size="1" value="<%= num_samples %>"></div>',select_input_template:'<div class="form-row-input sweep"><%= options %></div>',initialize:function(a){this.$el=a.tool_row;this.render()},render:function(){var b=this.model,f=b.get("type"),h=this.$el.find(".form-row-input"),d=null;h.find(":input").change(function(){b.set("value",$(this).val())});if(f==="number"){d=$(_.template(this.number_input_template,this.model.toJSON()))}else{if(f==="select"){var c=_.map(this.$el.find("select option"),function(i){return $(i).val()}),e=c.join(", ");d=$(_.template(this.select_input_template,{options:e}))}}d.insertAfter(h);var a=this,g=create_icon_buttons_menu([{title:"Add parameter to tree",icon_class:"plus-button",on_click:function(){b.set("in_ptree",true);h.hide();d.show();$(this).hide();a.$el.find(".icon-button.toggle").show()}},{title:"Remove parameter from tree",icon_class:"toggle",on_click:function(){b.set("in_ptree",false);d.hide();h.show();$(this).hide();a.$el.find(".icon-button.plus-button").show()}}],{tipsy_config:{gravity:"s"}});this.$el.prepend(g.$el);if(b.get("in_ptree")){h.hide();a.$el.find(".icon-button.plus-button").hide()}else{a.$el.find(".icon-button.toggle").hide();d.hide()}_.each(["min","max","num_samples"],function(i){d.find("."+i).change(function(){b.set(i,parseFloat($(this).val()))})})}});var ToolParameterTreeDesignView=Backbone.View.extend({className:"tree-design",initialize:function(a){this.render()},render:function(){var c=new ToolFormView({model:this.model.get("tool")});c.render();this.$el.append(c.$el);var b=this,a=b.model.get("tool").get("inputs");this.$el.find(".form-row").not(".form-actions").each(function(d){var e=new ToolInputValOrSweepView({model:a.at(d),tool_row:$(this)})})}});var ToolParameterTreeView=Backbone.View.extend({className:"tool-parameter-tree",initialize:function(a){this.model.on("change:tree_data",this.render,this)},render:function(){this.$el.children().remove();var i=this.model.get_tree_params();if(!i.length){return}this.width=100*(2+i.length);this.height=15*this.model.get_num_leaves();var h=this;var g=d3.layout.cluster().size([this.height,this.width-160]);var c=d3.svg.diagonal().projection(function(j){return[j.y,j.x]});var a=g.nodes(this.model.get("tree_data"));var d=_.uniq(_.pluck(a,"y"));_.each(i,function(l,k){var j=d[k+1],m=$("#center").position().left;h.$el.append($("<div>").addClass("label").text(l.get("label")).css("left",j+m))});var b=d3.select(this.$el[0]).append("svg").attr("width",this.width).attr("height",this.height+20).append("g").attr("transform","translate(40, 10)");var f=b.selectAll("path.link").data(g.links(a)).enter().append("path").attr("class","link").attr("d",c);var e=b.selectAll("g.node").data(a).enter().append("g").attr("class","node").attr("transform",function(j){return"translate("+j.y+","+j.x+")"}).on("mouseover",function(k){var j=_.pluck(h.model.get_connected_nodes(k),"id");e.filter(function(l){return _.find(j,function(m){return m===l.id})!==undefined}).style("fill","#f00")}).on("mouseout",function(){e.style("fill","#000")});e.append("circle").attr("r",9);e.append("text").attr("dx",function(j){return j.children?-12:12}).attr("dy",3).attr("text-anchor",function(j){return j.children?"end":"start"}).text(function(j){return j.name})}});var ParamaMonsterVisualizationView=Backbone.View.extend({className:"paramamonster",helpText:"<div><h4>Getting Started</h4><ol><li>Create a parameter tree by using the icons next to the tool's parameter names to add or remove parameters.<li>Adjust the tree by using parameter inputs to select min, max, and number of samples<li>Run the tool with different settings by clicking on tree nodes</ol></div>",initialize:function(b){this.canvas_manager=new CanvasManager(this.$el.parents("body"));this.tool_param_tree_view=new ToolParameterTreeView({model:this.model.get("parameter_tree")});this.track_collection_container=$("<table/>").addClass("tracks");this.model.get("parameter_tree").on("change:tree_data",this.handle_node_clicks,this);var a=this;this.model.get("tracks").each(function(c){c.get("track").view=a})},render:function(){var g=new ToolParameterTreeDesignView({model:this.model.get("parameter_tree")});$("#left").append(g.$el);var j=this,d=j.model.get("regions"),h=$("<tr/>").appendTo(this.track_collection_container);d.each(function(k){h.append($("<th>").text(k.toString()))});h.children().first().attr("colspan",2);var e=$("<div>").addClass("tiles");$("#right").append(e.append(this.track_collection_container));j.model.get("tracks").each(function(k){j.add_track(k)});var i=$(this.helpText).addClass("help"),f=create_icon_buttons_menu([{title:"Close",icon_class:"cross-circle",on_click:function(){$(".tipsy").remove();i.remove()},tipsy_config:{gravity:"s"}}]);i.prepend(f.$el.css("float","right"));$("#center").append(i);this.tool_param_tree_view.render();$("#center").append(this.tool_param_tree_view.$el);this.handle_node_clicks();var c=create_icon_buttons_menu([{icon_class:"chevron-expand",title:"Set display mode"},{icon_class:"cross-circle",title:"Close",on_click:function(){window.location="${h.url_for( controller='visualization', action='list' )}"}}],{tipsy_config:{gravity:"n"}});var b=["Squish","Pack"],a={};_.each(b,function(k){a[k]=function(){j.model.set("default_mode",k);j.model.get("tracks").each(function(l){l.set("mode",k)})}});make_popupmenu(c.$el.find(".chevron-expand"),a);c.$el.attr("style","float: right");$("#right .unified-panel-header-inner").append(c.$el)},run_tool_on_dataset:function(b){var a=this.model.get("tool"),d=a.get("name"),c=this.model.get("dataset");a.set_input_values(b.get("values"));$.when(a.rerun(c)).then(function(e){});show_modal("Running "+d+" on complete dataset",d+" is running on dataset '"+c.get("name")+"'. Outputs are in the dataset's history.",{Ok:function(){hide_modal()}})},add_track:function(d){var b=this,c=this.model.get("parameter_tree");b.model.add_track(d);var a=new ParamaMonsterTrackView({model:d,canvas_manager:b.canvas_manager});a.on("run_on_dataset",b.run_tool_on_dataset,b);b.track_collection_container.append(a.$el);a.$el.hover(function(){var f=c.get_leaf(d.get("settings").get("values"));var e=_.pluck(c.get_connected_nodes(f),"id");d3.select(b.tool_param_tree_view.$el[0]).selectAll("g.node").filter(function(g){return _.find(e,function(h){return h===g.id})!==undefined}).style("fill","#f00")},function(){d3.select(b.tool_param_tree_view.$el[0]).selectAll("g.node").style("fill","#000")});return d},handle_node_clicks:function(){var a=this,b=this.model.get("parameter_tree"),d=this.model.get("regions"),c=d3.select(this.tool_param_tree_view.$el[0]).selectAll("g.node");c.on("click",function(k,g){var f=a.model.get("tool"),j=a.model.get("dataset"),h=b.get_node_settings(k),e=$.Deferred();if(h.length>=10){show_modal("Whoa there cowboy!","You clicked on a node to try "+a.model.get("tool").get("name")+" with "+h.length+" different combinations of settings. You can only run 10 jobs at a time.",{Ok:function(){hide_modal();e.resolve(false)}})}else{e.resolve(true)}$.when(e).then(function(i){if(!i){return}var l=_.map(h,function(m){var n=new ParamaMonsterTrack({settings:m,regions:d,mode:a.model.get("default_mode")});a.add_track(n);return n});_.each(l,function(n,m){setTimeout(function(){f.set_input_values(n.get("settings").get("values"));$.when(f.rerun(j,d)).then(function(p){var q=_.extend({data_url:galaxy_paths.get("raw_data_url"),converted_datasets_state_url:galaxy_paths.get("dataset_state_url")},p.first().get("track_config")),o=object_from_template(q,a,null);n.set("track",o)})},m*10000)})})})}});
\ No newline at end of file
+var ToolInputsSettings=Backbone.Model.extend({defaults:{inputs:null,values:null}});var ToolParameterTree=Backbone.RelationalModel.extend({defaults:{tool:null,tree_data:null},initialize:function(b){var a=this;this.get("tool").get("inputs").each(function(c){if(!c.get_samples()){return}c.on("change:min change:max change:num_samples",function(d){if(d.get("in_ptree")){a.set_tree_data()}},a);c.on("change:in_ptree",function(d){if(d.get("in_ptree")){a.add_param(d)}else{a.remove_param(d)}a.set_tree_data()},a)});if(b.config){_.each(b.config,function(d){var c=a.get("tool").get("inputs").find(function(e){return e.get("name")===d.name});a.add_param(c);c.set(d)})}},add_param:function(a){if(a.get("ptree_index")){return}a.set("in_ptree",true);a.set("ptree_index",this.get_tree_params().length)},remove_param:function(a){a.set("in_ptree",false);a.set("ptree_index",null);_(this.get_tree_params()).each(function(b,c){b.set("ptree_index",c+1)})},set_tree_data:function(){var b=_.map(this.get_tree_params(),function(d){return{param:d,samples:d.get_samples()}});var a=0,c=function(g,d){var i=g[d],h=i.param,f=h.get("label"),e=i.samples;if(g.length-1===d){return _.map(e,function(j){return{id:a++,name:j,param:h,value:j}})}return _.map(e,function(j){return{id:a++,name:j,param:h,value:j,children:c(g,d+1)}})};this.set("tree_data",{name:"Root",id:a++,children:(b.length!==0?c(b,0):null)})},get_tree_params:function(){return _(this.get("tool").get("inputs").where({in_ptree:true})).sortBy(function(a){return a.get("ptree_index")})},get_num_leaves:function(){return this.get_tree_params().reduce(function(a,b){return a*b.get_samples().length},1)},get_node_settings:function(e){var c=this.get("tool").get_inputs_dict();var f=e.parent;if(f){while(f.depth!==0){c[f.param.get("name")]=f.value;f=f.parent}}var a=this,b=function(h,g){if(h.param){g[h.param.get("name")]=h.value}if(!h.children){return new ToolInputsSettings({inputs:a.get("tool").get("inputs"),values:g})}else{return _.flatten(_.map(h.children,function(i){return b(i,_.clone(g))}))}},d=b(e,c);if(!_.isArray(d)){d=[d]}return d},get_connected_nodes:function(c){var d=function(e){if(!e.children){return e}else{return _.flatten([e,_.map(e.children,function(f){return d(f)})])}};var b=[],a=c.parent;while(a){b.push(a);a=a.parent}return _.flatten([b,d(c)])},get_leaf:function(b){var c=this.get("tree_data"),a=function(d){return _.find(d,function(e){return b[e.param.get("name")]===e.value})};while(c.children){c=a(c.children)}return c},toJSON:function(){return this.get_tree_params().map(function(a){return{name:a.get("name"),min:a.get("min"),max:a.get("max"),num_samples:a.get("num_samples")}})}});var ParamaMonsterTrack=Backbone.RelationalModel.extend({defaults:{track:null,mode:"Pack",settings:null,regions:null},relations:[{type:Backbone.HasMany,key:"regions",relatedModel:"GenomeRegion"}],initialize:function(a){if(a.track){var b=_.extend({data_url:galaxy_paths.get("raw_data_url"),converted_datasets_state_url:galaxy_paths.get("dataset_state_url")},a.track);this.set("track",object_from_template(b,{},null))}},same_settings:function(a){var b=this.get("settings"),c=a.get("settings");for(var d in b){if(!c[d]||b[d]!==c[d]){return false}}return true},toJSON:function(){return{track:this.get("track").to_dict(),settings:this.get("settings"),regions:this.get("regions")}}});var TrackCollection=Backbone.Collection.extend({model:ParamaMonsterTrack});var ParamaMonsterVisualization=Visualization.extend({defaults:_.extend({},Visualization.prototype.defaults,{dataset:null,tool:null,parameter_tree:null,regions:null,tracks:null,default_mode:"Pack"}),relations:[{type:Backbone.HasOne,key:"dataset",relatedModel:"Dataset"},{type:Backbone.HasOne,key:"tool",relatedModel:"Tool"},{type:Backbone.HasMany,key:"regions",relatedModel:"GenomeRegion"},{type:Backbone.HasMany,key:"tracks",relatedModel:"ParamaMonsterTrack"}],initialize:function(a){var b=this.get("tool").copy(true);this.set("tool_with_samplable_inputs",b);this.set("parameter_tree",new ToolParameterTree({tool:b,config:a.tree_config}))},add_track:function(a){this.get("tracks").add(a)},toJSON:function(){return{id:this.get("id"),title:"Parameter exploration for dataset '"+this.get("dataset").get("name")+"'",type:"paramamonster",dataset_id:this.get("dataset").id,tool_id:this.get("tool").id,regions:this.get("regions").toJSON(),tree_config:this.get("parameter_tree").toJSON(),tracks:this.get("tracks").toJSON()}}});var ParamaMonsterTrackView=Backbone.View.extend({tagName:"tr",TILE_LEN:250,initialize:function(a){this.canvas_manager=a.canvas_manager;this.render();this.model.on("change:track change:mode",this.draw_tiles,this)},render:function(){var f=this.model.get("settings"),b=f.get("values"),d=$("<td/>").addClass("settings").appendTo(this.$el),c=$("<div/>").addClass("track-info").hide().appendTo(d);c.append($("<div/>").css("font-weight","bold").text("Track Settings"));f.get("inputs").each(function(h){c.append(h.get("label")+": "+b[h.get("name")]+"<br/>")});var a=this,g=$("<button/>").appendTo(c).text("Run on complete dataset").click(function(){c.toggle();a.trigger("run_on_dataset",f)});var e=create_icon_buttons_menu([{title:"Settings",icon_class:"gear track-settings",on_click:function(){c.toggle()},tipsy_config:{gravity:"s"}},{title:"Remove",icon_class:"cross-circle",on_click:function(){a.$el.remove();$(".tipsy").remove()}}]);d.prepend(e.$el);this.model.get("regions").each(function(){a.$el.append($("<td/>").addClass("tile").html($("<img/>").attr("src",galaxy_paths.get("image_path")+"/loading_large_white_bg.gif")))});if(this.model.get("track")){this.draw_tiles()}},draw_tiles:function(){var b=this,a=this.model.get("track"),d=this.model.get("regions"),c=this.$el.find("td.tile");if(!a){return}$.when(a.data_manager.data_is_ready()).then(function(e){d.each(function(h,g){var f=h.length()/b.TILE_LEN,j=1/f,i=b.model.get("mode");$.when(a.data_manager.get_data(h,i,f,{})).then(function(l){var k=b.canvas_manager.new_canvas();k.width=b.TILE_LEN;k.height=a.get_canvas_height(l,i,j,k.width);a.draw_tile(l,k.getContext("2d"),i,f,h,j);$(c[g]).empty().append(k)})})})}});var ToolInputValOrSweepView=Backbone.View.extend({number_input_template:'<div class="form-row-input sweep"><input class="min" type="text" size="6" value="<%= min %>"> - <input class="max" type="text" size="6" value="<%= max %>"> samples: <input class="num_samples" type="text" size="1" value="<%= num_samples %>"></div>',select_input_template:'<div class="form-row-input sweep"><%= options %></div>',initialize:function(a){this.$el=a.tool_row;this.render()},render:function(){var b=this.model,f=b.get("type"),h=this.$el.find(".form-row-input"),d=null;h.find(":input").change(function(){b.set("value",$(this).val())});if(f==="number"){d=$(_.template(this.number_input_template,this.model.toJSON()))}else{if(f==="select"){var c=_.map(this.$el.find("select option"),function(i){return $(i).val()}),e=c.join(", ");d=$(_.template(this.select_input_template,{options:e}))}}d.insertAfter(h);var a=this,g=create_icon_buttons_menu([{title:"Add parameter to tree",icon_class:"plus-button",on_click:function(){b.set("in_ptree",true);h.hide();d.show();$(this).hide();a.$el.find(".icon-button.toggle").show()}},{title:"Remove parameter from tree",icon_class:"toggle",on_click:function(){b.set("in_ptree",false);d.hide();h.show();$(this).hide();a.$el.find(".icon-button.plus-button").show()}}],{tipsy_config:{gravity:"s"}});this.$el.prepend(g.$el);if(b.get("in_ptree")){h.hide();a.$el.find(".icon-button.plus-button").hide()}else{a.$el.find(".icon-button.toggle").hide();d.hide()}_.each(["min","max","num_samples"],function(i){d.find("."+i).change(function(){b.set(i,parseFloat($(this).val()))})})}});var ToolParameterTreeDesignView=Backbone.View.extend({className:"tree-design",initialize:function(a){this.render()},render:function(){var c=new ToolFormView({model:this.model.get("tool")});c.render();this.$el.append(c.$el);var b=this,a=b.model.get("tool").get("inputs");this.$el.find(".form-row").not(".form-actions").each(function(d){var e=new ToolInputValOrSweepView({model:a.at(d),tool_row:$(this)})})}});var ToolParameterTreeView=Backbone.View.extend({className:"tool-parameter-tree",initialize:function(a){this.model.on("change:tree_data",this.render,this)},render:function(){this.$el.children().remove();var i=this.model.get_tree_params();if(!i.length){return}this.width=100*(2+i.length);this.height=15*this.model.get_num_leaves();var h=this;var g=d3.layout.cluster().size([this.height,this.width-160]);var c=d3.svg.diagonal().projection(function(j){return[j.y,j.x]});var a=g.nodes(this.model.get("tree_data"));var d=_.uniq(_.pluck(a,"y"));_.each(i,function(l,k){var j=d[k+1],m=$("#center").position().left;h.$el.append($("<div>").addClass("label").text(l.get("label")).css("left",j+m))});var b=d3.select(this.$el[0]).append("svg").attr("width",this.width).attr("height",this.height+30).append("g").attr("transform","translate(40, 20)");var f=b.selectAll("path.link").data(g.links(a)).enter().append("path").attr("class","link").attr("d",c);var e=b.selectAll("g.node").data(a).enter().append("g").attr("class","node").attr("transform",function(j){return"translate("+j.y+","+j.x+")"}).on("mouseover",function(k){var j=_.pluck(h.model.get_connected_nodes(k),"id");e.filter(function(l){return _.find(j,function(m){return m===l.id})!==undefined}).style("fill","#f00")}).on("mouseout",function(){e.style("fill","#000")});e.append("circle").attr("r",9);e.append("text").attr("dx",function(j){return j.children?-12:12}).attr("dy",3).attr("text-anchor",function(j){return j.children?"end":"start"}).text(function(j){return j.name})}});var ParamaMonsterVisualizationView=Backbone.View.extend({className:"paramamonster",helpText:"<div><h4>Getting Started</h4><ol><li>Create a parameter tree by using the icons next to the tool's parameter names to add or remove parameters.<li>Adjust the tree by using parameter inputs to select min, max, and number of samples<li>Run the tool with different settings by clicking on tree nodes</ol></div>",initialize:function(b){this.canvas_manager=new CanvasManager(this.$el.parents("body"));this.tool_param_tree_view=new ToolParameterTreeView({model:this.model.get("parameter_tree")});this.track_collection_container=$("<table/>").addClass("tracks");this.model.get("parameter_tree").on("change:tree_data",this.handle_node_clicks,this);var a=this;this.model.get("tracks").each(function(c){c.get("track").view=a})},render:function(){var g=new ToolParameterTreeDesignView({model:this.model.get("parameter_tree")});$("#left").append(g.$el);var j=this,d=j.model.get("regions"),h=$("<tr/>").appendTo(this.track_collection_container);d.each(function(k){h.append($("<th>").text(k.toString()))});h.children().first().attr("colspan",2);var e=$("<div>").addClass("tiles");$("#right").append(e.append(this.track_collection_container));j.model.get("tracks").each(function(k){j.add_track(k)});var i=$(this.helpText).addClass("help"),f=create_icon_buttons_menu([{title:"Close",icon_class:"cross-circle",on_click:function(){$(".tipsy").remove();i.remove()},tipsy_config:{gravity:"s"}}]);i.prepend(f.$el.css("float","right"));$("#center").append(i);this.tool_param_tree_view.render();$("#center").append(this.tool_param_tree_view.$el);this.handle_node_clicks();var c=create_icon_buttons_menu([{icon_class:"chevron-expand",title:"Set display mode"},{icon_class:"cross-circle",title:"Close",on_click:function(){window.location="${h.url_for( controller='visualization', action='list' )}"}}],{tipsy_config:{gravity:"n"}});var b=["Squish","Pack"],a={};_.each(b,function(k){a[k]=function(){j.model.set("default_mode",k);j.model.get("tracks").each(function(l){l.set("mode",k)})}});make_popupmenu(c.$el.find(".chevron-expand"),a);c.$el.attr("style","float: right");$("#right .unified-panel-header-inner").append(c.$el)},run_tool_on_dataset:function(b){var a=this.model.get("tool"),d=a.get("name"),c=this.model.get("dataset");a.set_input_values(b.get("values"));$.when(a.rerun(c)).then(function(e){});show_modal("Running "+d+" on complete dataset",d+" is running on dataset '"+c.get("name")+"'. Outputs are in the dataset's history.",{Ok:function(){hide_modal()}})},add_track:function(d){var b=this,c=this.model.get("parameter_tree");b.model.add_track(d);var a=new ParamaMonsterTrackView({model:d,canvas_manager:b.canvas_manager});a.on("run_on_dataset",b.run_tool_on_dataset,b);b.track_collection_container.append(a.$el);a.$el.hover(function(){var f=c.get_leaf(d.get("settings").get("values"));var e=_.pluck(c.get_connected_nodes(f),"id");d3.select(b.tool_param_tree_view.$el[0]).selectAll("g.node").filter(function(g){return _.find(e,function(h){return h===g.id})!==undefined}).style("fill","#f00")},function(){d3.select(b.tool_param_tree_view.$el[0]).selectAll("g.node").style("fill","#000")});return d},handle_node_clicks:function(){var a=this,b=this.model.get("parameter_tree"),d=this.model.get("regions"),c=d3.select(this.tool_param_tree_view.$el[0]).selectAll("g.node");c.on("click",function(k,g){var f=a.model.get("tool"),j=a.model.get("dataset"),h=b.get_node_settings(k),e=$.Deferred();if(h.length>=10){show_modal("Whoa there cowboy!","You clicked on a node to try "+a.model.get("tool").get("name")+" with "+h.length+" different combinations of settings. You can only run 10 jobs at a time.",{Ok:function(){hide_modal();e.resolve(false)}})}else{e.resolve(true)}$.when(e).then(function(i){if(!i){return}var l=_.map(h,function(m){var n=new ParamaMonsterTrack({settings:m,regions:d,mode:a.model.get("default_mode")});a.add_track(n);return n});_.each(l,function(n,m){setTimeout(function(){f.set_input_values(n.get("settings").get("values"));$.when(f.rerun(j,d)).then(function(p){var q=_.extend({data_url:galaxy_paths.get("raw_data_url"),converted_datasets_state_url:galaxy_paths.get("dataset_state_url")},p.first().get("track_config")),o=object_from_template(q,a,null);n.set("track",o)})},m*10000)})})})}});
\ No newline at end of file
diff -r 33676ce91213156e434e9c9c2f2def8d9fbbecc2 -r a2d1619198063084b99a1e6e8c75e1658593c448 static/scripts/viz/paramamonster.js
--- a/static/scripts/viz/paramamonster.js
+++ b/static/scripts/viz/paramamonster.js
@@ -638,9 +638,9 @@
var vis = d3.select(this.$el[0])
.append("svg")
.attr("width", this.width)
- .attr("height", this.height + 20)
+ .attr("height", this.height + 30)
.append("g")
- .attr("transform", "translate(40, 10)");
+ .attr("transform", "translate(40, 20)");
// Draw links.
var link = vis.selectAll("path.link")
diff -r 33676ce91213156e434e9c9c2f2def8d9fbbecc2 -r a2d1619198063084b99a1e6e8c75e1658593c448 templates/visualization/circster.mako
--- a/templates/visualization/circster.mako
+++ b/templates/visualization/circster.mako
@@ -57,7 +57,6 @@
} }
]);
- menu.render();
menu.$el.attr("style", "float: right");
$("#center .unified-panel-header-inner").append(menu.$el);
// Manual tipsy config because default gravity is S and cannot be changed.
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/33676ce91213/
changeset: 33676ce91213
user: dan
date: 2012-07-11 18:01:16
summary: Fix for history items going to different histories if current history is switched while the workflow is still being queued.
affected #: 1 file
diff -r f673cb8e75d9978ef069fd0dcad9ee0dc065ac6e -r 33676ce91213156e434e9c9c2f2def8d9fbbecc2 lib/galaxy/web/controllers/workflow.py
--- a/lib/galaxy/web/controllers/workflow.py
+++ b/lib/galaxy/web/controllers/workflow.py
@@ -1409,6 +1409,9 @@
nh_name = '%s on %s' % (nh_name, mx_ds_name)
new_history = trans.app.model.History( user=trans.user, name=nh_name )
trans.sa_session.add( new_history )
+ target_history = new_history
+ else:
+ target_history = trans.get_history()
# Run each step, connecting outputs to inputs
workflow_invocation = model.WorkflowInvocation()
workflow_invocation.workflow = workflow
@@ -1429,7 +1432,7 @@
except KeyError, k:
error( "Error due to input mapping of '%s' in '%s'. A common cause of this is conditional outputs that cannot be determined until runtime, please review your workflow." % (tool.name, k.message))
# Execute it
- job, out_data = tool.execute( trans, step.state.inputs, history=new_history)
+ job, out_data = tool.execute( trans, step.state.inputs, history=target_history)
outputs[ step.id ] = out_data
# Create new PJA associations with the created job, to be run on completion.
# PJA Parameter Replacement (only applies to immediate actions-- rename specifically, for now)
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/f673cb8e75d9/
changeset: f673cb8e75d9
user: greg
date: 2012-07-11 17:53:22
summary: Fixes for installing tool dependencies, and uninstalling repositories and tool dependencies.
affected #: 2 files
diff -r 005f732eb00f76e7d1319dfb8288953aff9b8939 -r f673cb8e75d9978ef069fd0dcad9ee0dc065ac6e lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -1210,6 +1210,8 @@
ElementInclude.include( root )
fabric_version_checked = False
for elem in root:
+ # Only install the package if it is not already installed.
+ can_install = False
if elem.tag == 'package':
package_name = elem.get( 'name', None )
package_version = elem.get( 'version', None )
@@ -1217,8 +1219,6 @@
# The value of tool_dependencies will be None only when this method is called by the InstallManager. In that case, tool
# dependency installation is not ajaxian, so the ToolDependency objects do not yet exist.
if tool_dependencies:
- # Only install the package if it is not already installed.
- can_install = False
for tool_dependency in tool_dependencies:
if tool_dependency.name==package_name and tool_dependency.version==package_version:
can_install = tool_dependency.status in [ app.model.ToolDependency.installation_status.NEVER_INSTALLED,
@@ -1457,6 +1457,7 @@
log.debug( error_message )
if removed:
tool_dependency.status = trans.model.ToolDependency.installation_status.UNINSTALLED
+ tool_dependency.error_message = None
trans.sa_session.add( tool_dependency )
trans.sa_session.flush()
return removed, error_message
diff -r 005f732eb00f76e7d1319dfb8288953aff9b8939 -r f673cb8e75d9978ef069fd0dcad9ee0dc065ac6e lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -437,6 +437,7 @@
tool_shed_repository.deleted = True
if remove_from_disk_checked:
tool_shed_repository.status = trans.model.ToolShedRepository.installation_status.UNINSTALLED
+ tool_shed_repository.error_message = None
else:
tool_shed_repository.status = trans.model.ToolShedRepository.installation_status.DEACTIVATED
trans.sa_session.add( tool_shed_repository )
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/005f732eb00f/
changeset: 005f732eb00f
user: greg
date: 2012-07-11 16:47:51
summary: Fix the sqlite db connection string in the community app so local tool sheds will work when using sqlite.
affected #: 1 file
diff -r 85dccacdfa80ba7818979049810a7891102fe2ef -r 005f732eb00f76e7d1319dfb8288953aff9b8939 lib/galaxy/webapps/community/app.py
--- a/lib/galaxy/webapps/community/app.py
+++ b/lib/galaxy/webapps/community/app.py
@@ -17,13 +17,12 @@
config.configure_logging( self.config )
# Set up datatypes registry
self.datatypes_registry = galaxy.datatypes.registry.Registry()
- # TODO: Handle datatypes included in repositories - the following will only load datatypes_conf.xml.
self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config )
# Determine the database url
if self.config.database_connection:
db_url = self.config.database_connection
else:
- db_url = "sqlite://%s?isolation_level=IMMEDIATE" % self.config.database
+ db_url = "sqlite:///%s?isolation_level=IMMEDIATE" % self.config.database
# Initialize database / check for appropriate schema version
from galaxy.webapps.community.model.migrate.check import create_or_verify_database
create_or_verify_database( db_url, self.config.database_engine_options )
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/3e6ab1cf0c2e/
changeset: 3e6ab1cf0c2e
user: greg
date: 2012-07-10 22:23:34
summary: Migrate the freebayes tool out of the Galaxy code distribution.
affected #: 4 files
diff -r d07c00d96b60746a1e83713530a9070bf818e16c -r 3e6ab1cf0c2eebbc886a7911e970f43bbfde522b lib/galaxy/tool_shed/migrate/versions/0003_tools.py
--- /dev/null
+++ b/lib/galaxy/tool_shed/migrate/versions/0003_tools.py
@@ -0,0 +1,12 @@
+"""
+The freebayes tool has been eliminated from the distribution . The repository named freebayes from the main
+Galaxy tool shed at http://toolshed.g2.bx.psu.edu will be installed into your local Galaxy instance at the
+location discussed above by running the following command.
+"""
+
+import sys
+
+def upgrade():
+ print __doc__
+def downgrade():
+ pass
diff -r d07c00d96b60746a1e83713530a9070bf818e16c -r 3e6ab1cf0c2eebbc886a7911e970f43bbfde522b scripts/migrate_tools/0003_tools.sh
--- /dev/null
+++ b/scripts/migrate_tools/0003_tools.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd `dirname $0`/../..
+python ./scripts/migrate_tools/migrate_tools.py 0003_tools.xml $@
diff -r d07c00d96b60746a1e83713530a9070bf818e16c -r 3e6ab1cf0c2eebbc886a7911e970f43bbfde522b scripts/migrate_tools/0003_tools.xml
--- /dev/null
+++ b/scripts/migrate_tools/0003_tools.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<toolshed name="toolshed.g2.bx.psu.edu">
+ <repository name="freebayes" description="Galaxy Freebayes Bayesian genetic variant detector tool" changeset_revision="046c7983e2ff">
+ <tool id="freebayes" version="0.0.2 " file="freebayes.xml" />
+ </repository>
+</toolshed>
diff -r d07c00d96b60746a1e83713530a9070bf818e16c -r 3e6ab1cf0c2eebbc886a7911e970f43bbfde522b tools/variant_detection/freebayes.xml
--- a/tools/variant_detection/freebayes.xml
+++ /dev/null
@@ -1,670 +0,0 @@
-<?xml version="1.0"?>
-<tool id="freebayes" name="FreeBayes" version="0.0.2">
- <requirements>
- <requirement type="package" version="0.9.4">freebayes</requirement>
- <requirement type="package">samtools</requirement>
- </requirements>
- <description> - Bayesian genetic variant detector</description>
- <command>
- ##set up input files
- #set $reference_fasta_filename = "localref.fa"
- #if str( $reference_source.reference_source_selector ) == "history":
- ln -s "${reference_source.ref_file}" "${reference_fasta_filename}" &&
- samtools faidx "${reference_fasta_filename}" 2>&1 || echo "Error running samtools faidx for FreeBayes" >&2 &&
- #else:
- #set $reference_fasta_filename = str( $reference_source.ref_file.fields.path )
- #end if
- #for $bam_count, $input_bam in enumerate( $reference_source.input_bams ):
- ln -s "${input_bam.input_bam}" "localbam_${bam_count}.bam" &&
- ln -s "${input_bam.input_bam.metadata.bam_index}" "localbam_${bam_count}.bam.bai" &&
- #end for
- ##finished setting up inputs
-
- ##start FreeBayes commandline
- freebayes
- #for $bam_count, $input_bam in enumerate( $reference_source.input_bams ):
- --bam "localbam_${bam_count}.bam"
- #end for
- --fasta-reference "${reference_fasta_filename}"
-
- ##outputs
- --vcf "${output_vcf}"
-
- ##advanced options
- #if str( $options_type.options_type_selector ) == "advanced":
- ##additional outputs
- #if $options_type.output_trace_option:
- --trace "${output_trace}"
- #end if
- #if $options_type.output_failed_alleles_option:
- --failed-alleles "${output_failed_alleles_bed}"
- #end if
-
- ##additional inputs
- #if str( $options_type.target_limit_type.target_limit_type_selector ) == "limit_by_target_file":
- --targets "${options_type.target_limit_type.input_target_bed}"
- #elif str( $options_type.target_limit_type.target_limit_type_selector ) == "limit_by_region":
- --region "${options_type.target_limit_type.region_chromosome}:${options_type.target_limit_type.region_start}..${options_type.target_limit_type.region_end}"
- #end if
- #if $options_type.input_sample_file:
- --samples "${options_type.input_sample_file}"
- #end if
- #if $options_type.input_populations_file:
- --populations "${options_type.input_populations_file}"
- #end if
- #if $options_type.input_cnv_map_bed:
- --cnv-map "${options_type.input_cnv_map_bed}"
- #end if
- #if str( $options_type.input_variant_type.input_variant_type_selector ) == "provide_vcf":
- --variant-input "${options_type.input_variant_type.input_variant_vcf}"
- ${options_type.input_variant_type.only_use_input_alleles}
- #end if
-
- ##reporting
- #if str( $options_type.section_reporting_type.section_reporting_type_selector ) == "set":
- --pvar "${options_type.section_reporting_type.pvar}"
- ${options_type.section_reporting_type.show_reference_repeats}
- #end if
-
- ##population model
- #if str( $options_type.section_population_model_type.section_population_model_type_selector ) == "set":
- --theta "${options_type.section_population_model_type.theta}"
- --ploidy "${options_type.section_population_model_type.ploidy}"
- ${options_type.section_population_model_type.pooled}
- #end if
-
- ##reference allele
- #if str( $options_type.use_reference_allele_type.use_reference_allele_type_selector ) == "include_reference_allele":
- --use-reference-allele
- ${options_type.use_reference_allele_type.diploid_reference}
- --reference-quality "${options_type.use_reference_allele_type.reference_quality_mq},${options_type.use_reference_allele_type.reference_quality_bq}"
- #end if
-
- ##allele scope
- #if str( $options_type.section_allele_scope_type.section_allele_scope_type_selector ) == "set":
- ${options_type.section_allele_scope_type.no_snps}
- ${options_type.section_allele_scope_type.no_indels}
- ${options_type.section_allele_scope_type.no_mnps}
- ${options_type.section_allele_scope_type.no_complex}
- --use-best-n-alleles "${options_type.section_allele_scope_type.use_best_n_alleles}"
- #if $options_type.section_allele_scope_type.max_complex_gap:
- --max-complex-gap "${options_type.section_allele_scope_type.max_complex_gap}"
- #end if
- #end if
-
- ##indel realignment
- ${options_type.left_align_indels}
-
- ##input filters
- #if str( $options_type.section_input_filters_type.section_input_filters_type_selector ) == "set":
- ${options_type.section_input_filters_type.use_duplicate_reads}
- #if str( $options_type.section_input_filters_type.no_filter_type.no_filter_type_selector ) == "apply_filters":
- --min-mapping-quality "${options_type.section_input_filters_type.no_filter_type.min_mapping_quality}"
- --min-base-quality "${options_type.section_input_filters_type.no_filter_type.min_base_quality}"
- --min-supporting-quality "${options_type.section_input_filters_type.no_filter_type.min_supporting_quality_mq},${options_type.section_input_filters_type.no_filter_type.min_supporting_quality_bq}"
- #else:
- --no-filters
- #end if
- --mismatch-base-quality-threshold "${options_type.section_input_filters_type.mismatch_base_quality_threshold}"
- #if $options_type.section_input_filters_type.read_mismatch_limit:
- --read-mismatch-limit "${options_type.section_input_filters_type.read_mismatch_limit}"
- #end if
- --read-max-mismatch-fraction "${options_type.section_input_filters_type.read_max_mismatch_fraction}"
- #if $options_type.section_input_filters_type.read_snp_limit:
- --read-snp-limit "${options_type.section_input_filters_type.read_snp_limit}"
- #end if
- #if $options_type.section_input_filters_type.read_indel_limit:
- --read-indel-limit "${options_type.section_input_filters_type.read_indel_limit}"
- #end if
- --indel-exclusion-window "${options_type.section_input_filters_type.indel_exclusion_window}"
- --min-alternate-fraction "${options_type.section_input_filters_type.min_alternate_fraction}"
- --min-alternate-count "${options_type.section_input_filters_type.min_alternate_count}"
- --min-alternate-qsum "${options_type.section_input_filters_type.min_alternate_qsum}"
- --min-alternate-total "${options_type.section_input_filters_type.min_alternate_total}"
- --min-coverage "${options_type.section_input_filters_type.min_coverage}"
- #end if
-
- ##bayesian priors
- #if str( $options_type.section_bayesian_priors_type.section_bayesian_priors_type_selector ) == "set":
- ${options_type.section_bayesian_priors_type.no_ewens_priors}
- ${options_type.section_bayesian_priors_type.no_population_priors}
- ${options_type.section_bayesian_priors_type.hwe_priors}
- #end if
-
- ##observation prior expectations
- #if str( $options_type.section_observation_prior_expectations_type.section_observation_prior_expectations_type_selector ) == "set":
- ${options_type.section_observation_prior_expectations_type.binomial_obs_priors}
- ${options_type.section_observation_prior_expectations_type.allele_balance_priors}
- #end if
-
- ##algorithmic features
- #if str( $options_type.section_algorithmic_features_type.section_algorithmic_features_type_selector ) == "set":
- --site-selection-max-iterations "${options_type.section_algorithmic_features_type.site_selection_max_iterations}"
- --genotyping-max-iterations "${options_type.section_algorithmic_features_type.genotyping_max_iterations}"
- --genotyping-max-banddepth "${options_type.section_algorithmic_features_type.genotyping_max_banddepth}"
- --posterior-integration-limits "${options_type.section_algorithmic_features_type.posterior_integration_limits_n},${options_type.section_algorithmic_features_type.posterior_integration_limits_m}"
- ${options_type.section_algorithmic_features_type.no_permute}
- ${options_type.section_algorithmic_features_type.exclude_unobserved_genotypes}
- #if $options_type.section_algorithmic_features_type.genotype_variant_threshold:
- --genotype-variant-threshold "${options_type.section_algorithmic_features_type.genotype_variant_threshold}"
- #end if
- ${options_type.section_algorithmic_features_type.use_mapping_quality}
- --read-dependence-factor "${options_type.section_algorithmic_features_type.read_dependence_factor}"
- ${options_type.section_algorithmic_features_type.no_marginals}
- #end if
-
- #end if
- </command>
- <inputs>
- <conditional name="reference_source">
- <param name="reference_source_selector" type="select" label="Choose the source for the reference list">
- <option value="cached">Locally cached</option>
- <option value="history">History</option>
- </param>
- <when value="cached">
- <repeat name="input_bams" title="Sample BAM file" min="1">
- <param name="input_bam" type="data" format="bam" label="BAM file">
- <validator type="unspecified_build" />
- <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="value" message="Sequences are not currently available for the specified build." />
- </param>
- </repeat>
- <param name="ref_file" type="select" label="Using reference genome">
- <options from_data_table="sam_fa_indexes">
- <!-- <filter type="sam_fa_indexes" key="dbkey" ref="input_bam" column="value"/> does not yet work in a repeat...-->
- </options>
- <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
- </param>
- </when>
- <when value="history"><!-- FIX ME!!!! -->
- <repeat name="input_bams" title="Sample BAM file" min="1">
- <param name="input_bam" type="data" format="bam" label="BAM file" />
- </repeat>
- <param name="ref_file" type="data" format="fasta" label="Using reference file" />
- </when>
- </conditional>
-
- <conditional name="options_type">
- <param name="options_type_selector" type="select" label="Basic or Advanced options">
- <option value="basic" selected="True">Basic</option>
- <option value="advanced">Advanced</option>
- </param>
- <when value="basic">
- <!-- Do nothing here -->
- </when>
- <when value="advanced">
-
- <!-- output -->
- <param name="output_failed_alleles_option" type="boolean" truevalue="--failed-alleles" falsevalue="" checked="False" label="Write out failed alleles file" />
- <param name="output_trace_option" type="boolean" truevalue="--trace" falsevalue="" checked="False" label="Write out algorithm trace file" />
-
-
- <!-- input -->
- <conditional name="target_limit_type">
- <param name="target_limit_type_selector" type="select" label="Limit analysis to listed targets">
- <option value="do_not_limit" selected="True">Do not limit</option>
- <option value="limit_by_target_file">Limit by target file</option>
- <option value="limit_by_region">Limit to region</option>
- </param>
- <when value="do_not_limit">
- <!-- Do nothing here -->
- </when>
- <when value="limit_by_target_file">
- <param name="input_target_bed" type="data" format="bed" label="Limit analysis to targets listed in the BED-format FILE." />
- </when>
- <when value="limit_by_region">
- <param name="region_chromosome" type="text" label="Region Chromosome" value="" /><!--only once? -->
- <param name="region_start" type="integer" label="Region Start" value="" />
- <param name="region_end" type="integer" label="Region End" value="" />
- </when>
- </conditional>
- <param name="input_sample_file" type="data" format="txt" label="Limit analysis to samples listed (one per line) in the FILE" optional="True" />
- <param name="input_populations_file" type="data" format="txt" label="Populations File" optional="True" />
- <param name="input_cnv_map_bed" type="data" format="bed" label="Read a copy number map from the BED file FILE" optional="True" />
- <conditional name="input_variant_type">
- <param name="input_variant_type_selector" type="select" label="Provide variants file">
- <option value="do_not_provide" selected="True">Do not provide</option>
- <option value="provide_vcf">Provide VCF file</option>
- </param>
- <when value="do_not_provide">
- <!-- Do nothing here -->
- </when>
- <when value="provide_vcf">
- <param name="input_variant_vcf" type="data" format="vcf" label="Use variants reported in VCF file as input to the algorithm" />
- <param name="only_use_input_alleles" type="boolean" truevalue="--only-use-input-alleles" falsevalue="" checked="False" label="Only provide variant calls and genotype likelihoods for sites in VCF" />
- </when>
- </conditional>
-
-
- <!-- reporting -->
- <conditional name="section_reporting_type">
- <param name="section_reporting_type_selector" type="select" label="Set Reporting options">
- <option value="do_not_set" selected="True">Do not set</option>
- <option value="set">Set</option>
- </param>
- <when value="do_not_set">
- <!-- do nothing here -->
- </when>
- <when value="set">
- <param name="pvar" type="float" label="Report sites if the probability that there is a polymorphism at the site is greater" value="0.0001" />
- <param name="show_reference_repeats" type="boolean" truevalue="--show-reference-repeats" falsevalue="" checked="False" label="Calculate and show information about reference repeats" />
- </when>
- </conditional>
-
-
- <!-- population model -->
- <conditional name="section_population_model_type">
- <param name="section_population_model_type_selector" type="select" label="Set population model options">
- <option value="do_not_set" selected="True">Do not set</option>
- <option value="set">Set</option>
- </param>
- <when value="do_not_set">
- <!-- do nothing here -->
- </when>
- <when value="set">
- <param name="theta" type="float" label="expected mutation rate or pairwise nucleotide diversity among the population" value="0.001" help="This serves as the single parameter to the Ewens Sampling Formula prior model"/>
- <param name="ploidy" type="integer" label="default ploidy for the analysis" value="2" />
- <param name="pooled" type="boolean" truevalue="--pooled" falsevalue="" checked="False" label="Assume that samples result from pooled sequencing" help="When using this flag, set --ploidy to the number of alleles in each sample." />
- </when>
- </conditional>
-
- <!-- reference allele -->
- <conditional name="use_reference_allele_type">
- <param name="use_reference_allele_type_selector" type="select" label="Include the reference allele in the analysis">
- <option value="do_not_include_reference_allele" selected="True">Do not include</option>
- <option value="include_reference_allele">Include</option>
- </param>
- <when value="do_not_include_reference_allele">
- <!-- Do nothing here -->
- </when>
- <when value="include_reference_allele">
- <param name="diploid_reference" type="boolean" truevalue="--diploid-reference" falsevalue="" checked="False" label="Treat reference as diploid" />
- <param name="reference_quality_mq" type="integer" label="Assign mapping quality" value="100" />
- <param name="reference_quality_bq" type="integer" label="Assign base quality" value="60" />
- </when>
- </conditional>
-
- <!-- allele scope -->
- <conditional name="section_allele_scope_type">
- <param name="section_allele_scope_type_selector" type="select" label="Set allele scope options">
- <option value="do_not_set" selected="True">Do not set</option>
- <option value="set">Set</option>
- </param>
- <when value="do_not_set">
- <!-- do nothing here -->
- </when>
- <when value="set">
- <param name="no_snps" type="boolean" truevalue="--no-snps" falsevalue="" checked="False" label="Ignore SNP alleles" />
- <param name="no_indels" type="boolean" truevalue="--no-indels" falsevalue="" checked="False" label="Ignore insertion and deletion alleles" />
- <param name="no_mnps" type="boolean" truevalue="--no-mnps" falsevalue="" checked="False" label="Ignore multi-nuceotide polymorphisms, MNPs" />
- <param name="no_complex" type="boolean" truevalue="--no-complex" falsevalue="" checked="False" label="Ignore complex events (composites of other classes)" />
- <param name="use_best_n_alleles" type="integer" label="Evaluate only the best N SNP alleles" value="0" min="0" help="Ranked by sum of supporting quality scores; Set to 0 to use all" />
- <param name="max_complex_gap" type="integer" label="Allow complex alleles with contiguous embedded matches of up to this length" value="" optional="True"/>
- </when>
- </conditional>
-
- <!-- indel realignment -->
- <param name="left_align_indels" type="boolean" truevalue="--left-align-indels" falsevalue="" checked="False" label="Left-realign and merge gaps embedded in reads" />
-
- <!-- input filters -->
- <conditional name="section_input_filters_type">
- <param name="section_input_filters_type_selector" type="select" label="Set input filters options">
- <option value="do_not_set" selected="True">Do not set</option>
- <option value="set">Set</option>
- </param>
- <when value="do_not_set">
- <!-- do nothing here -->
- </when>
- <when value="set">
- <param name="use_duplicate_reads" type="boolean" truevalue="--use-duplicate-reads" falsevalue="" checked="False" label="Include duplicate-marked alignments in the analysis" />
- <conditional name="no_filter_type">
- <param name="no_filter_type_selector" type="select" label="Apply filters">
- <option value="apply_filters" selected="True">Apply</option>
- <option value="no_filters">Do not apply</option>
- </param>
- <when value="no_filters">
- <!-- Do nothing here --><!-- no-filters -->
- </when>
- <when value="apply_filters">
- <param name="min_mapping_quality" type="integer" label="Exclude alignments from analysis if they have a mapping quality less than" value="30" />
- <param name="min_base_quality" type="integer" label="Exclude alleles from analysis if their supporting base quality less than" value="20" />
- <param name="min_supporting_quality_mq" type="integer" label="In order to consider an alternate allele, at least one supporting alignment must have mapping quality" value="0" />
- <param name="min_supporting_quality_bq" type="integer" label="In order to consider an alternate allele, at least one supporting alignment must have base quality" value="0" />
- </when>
- </conditional>
- <param name="mismatch_base_quality_threshold" type="integer" label="Count mismatches toward read-mismatch-limit if the base quality of the mismatch is >=" value="10" />
- <param name="read_mismatch_limit" type="integer" label="Exclude reads with more than N mismatches where each mismatch has base quality >= mismatch-base-quality-threshold" value="" optional="True" />
- <param name="read_max_mismatch_fraction" type="float" label="Exclude reads with more than N [0,1] fraction of mismatches where each mismatch has base quality >= mismatch-base-quality-threshold" value="1.0" />
- <param name="read_snp_limit" type="integer" label="Exclude reads with more than N base mismatches, ignoring gaps with quality >= mismatch-base-quality-threshold" value="" optional="True" />
- <param name="read_indel_limit" type="integer" label="Exclude reads with more than N separate gaps" value="" optional="True" />
- <param name="indel_exclusion_window" type="integer" label="Ignore portions of alignments this many bases from a putative insertion or deletion allele" value="0" />
- <param name="min_alternate_fraction" type="float" label="Require at least this fraction of observations supporting an alternate allele within a single individual in the in order to evaluate the position" value="0" />
- <param name="min_alternate_count" type="integer" label="Require at least this count of observations supporting an alternate allele within a single individual in order to evaluate the position" value="1" />
- <param name="min_alternate_qsum" type="integer" label="Require at least this sum of quality of observations supporting an alternate allele within a single individual in order to evaluate the position" value="0" />
- <param name="min_alternate_total" type="integer" label="Require at least this count of observations supporting an alternate allele within the total population in order to use the allele in analysis" value="1" />
- <param name="min_coverage" type="integer" label="Require at least this coverage to process a site" value="0" />
- </when>
- </conditional>
-
-
- <!-- bayesian priors -->
- <conditional name="section_bayesian_priors_type">
- <param name="section_bayesian_priors_type_selector" type="select" label="Set bayesian priors options">
- <option value="do_not_set" selected="True">Do not set</option>
- <option value="set">Set</option>
- </param>
- <when value="do_not_set">
- <!-- do nothing here -->
- </when>
- <when value="set">
- <param name="no_ewens_priors" type="boolean" truevalue="--no-ewens-priors" falsevalue="" checked="False" label="Turns off the Ewens' Sampling Formula component of the priors" />
- <param name="no_population_priors" type="boolean" truevalue="--no-population-priors" falsevalue="" checked="False" label="No population priors" help="Equivalent to --pooled --no-ewens-priors" />
- <param name="hwe_priors" type="boolean" truevalue="--hwe-priors" falsevalue="" checked="False" label="Use the probability of the combination arising under HWE given the allele frequency as estimated by observation frequency" />
- </when>
- </conditional>
-
- <!-- observation prior expectations -->
- <conditional name="section_observation_prior_expectations_type">
- <param name="section_observation_prior_expectations_type_selector" type="select" label="Set observation prior expectations options">
- <option value="do_not_set" selected="True">Do not set</option>
- <option value="set">Set</option>
- </param>
- <when value="do_not_set">
- <!-- do nothing here -->
- </when>
- <when value="set">
- <param name="binomial_obs_priors" type="boolean" truevalue="--binomial-obs-priors" falsevalue="" checked="False" label="Incorporate expectations about osbervations into the priors, Uses read placement probability, strand balance probability, and read position (5'-3') probability" />
- <param name="allele_balance_priors" type="boolean" truevalue="--allele-balance-priors" falsevalue="" checked="False" label="Use aggregate probability of observation balance between alleles as a component of the priors. Best for observations with minimal inherent reference bias" />
- </when>
- </conditional>
-
-
- <!-- algorithmic features -->
- <conditional name="section_algorithmic_features_type">
- <param name="section_algorithmic_features_type_selector" type="select" label="Set algorithmic features options">
- <option value="do_not_set" selected="True">Do not set</option>
- <option value="set">Set</option>
- </param>
- <when value="do_not_set">
- <!-- do nothing here -->
- </when>
- <when value="set">
- <param name="site_selection_max_iterations" type="integer" label="Uses hill-climbing algorithm to search posterior space for N iterations to determine if the site should be evaluated." value="5" help="Set to 0 to prevent use of this algorithm for site selection, and to a low integer for improvide site selection at a slight performance penalty" />
- <param name="genotyping_max_iterations" type="integer" label="Iterate no more than N times during genotyping step" value="25" />
- <param name="genotyping_max_banddepth" type="integer" label="Integrate no deeper than the Nth best genotype by likelihood when genotyping" value="6" />
- <param name="posterior_integration_limits_n" type="integer" label="Posteriror integration limit N" help="Integrate all genotype combinations in our posterior space which include no more than N samples with their Mth best data likelihood." value="1" />
- <param name="posterior_integration_limits_m" type="integer" label="Posteriror integration limit M" help="Integrate all genotype combinations in our posterior space which include no more than N samples with their Mth best data likelihood." value="3" />
- <param name="no_permute" type="boolean" truevalue="--no-permute" falsevalue="" checked="False" label="Do not scale prior probability of genotype combination given allele frequency by the number of permutations of included genotypes" />
- <param name="exclude_unobserved_genotypes" type="boolean" truevalue="--exclude-unobserved-genotypes" falsevalue="" checked="False" label="Skip sample genotypings for which the sample has no supporting reads" />
- <param name="genotype_variant_threshold" type="integer" label="Limit posterior integration to samples where the second-best genotype likelihood is no more than log(N) from the highest genotype likelihood for the sample" value="" optional="True" />
- <param name="use_mapping_quality" type="boolean" truevalue="--use-mapping-quality" falsevalue="" checked="False" label="Use mapping quality of alleles when calculating data likelihoods" />
- <param name="read_dependence_factor" type="float" label="Incorporate non-independence of reads by scaling successive observations by this factor during data likelihood calculations" value="0.9" />
- <param name="no_marginals" type="boolean" truevalue="--no-marginals" falsevalue="" checked="False" label="Do not calculate the marginal probability of genotypes. Saves time and improves scaling performance in large populations" />
- </when>
- </conditional>
-
-
- </when>
- </conditional>
-
- </inputs>
- <outputs>
- <data format="vcf" name="output_vcf" label="${tool.name} on ${on_string} (variants)" />
- <data format="bed" name="output_failed_alleles_bed" label="${tool.name} on ${on_string} (failed alleles)">
- <filter>options_type['options_type_selector'] == "advanced" and options_type['output_failed_alleles_option'] is True</filter>
- </data>
- <data format="txt" name="output_trace" label="${tool.name} on ${on_string} (trace)">
- <filter>options_type['options_type_selector'] == "advanced" and options_type['output_trace_option'] is True</filter>
- </data>
- </outputs>
- <tests>
- <test>
- <param name="reference_source_selector" value="history" />
- <param name="ref_file" ftype="fasta" value="phiX.fasta"/>
- <param name="input_bam" ftype="bam" value="gatk/fake_phiX_reads_1.bam"/>
- <param name="options_type_selector" value="basic"/>
- <output name="output_vcf" file="variant_detection/freebayes/freebayes_out_1.vcf.contains" compare="contains"/>
- <!-- <output name="output_failed_alleles_bed" file="empty_file.dat" />
- <output name="output_trace" file="variant_detection/freebayes/freebayes_out_1.output_trace" /> -->
- </test>
- </tests>
- <help>
-**What it does**
-
-This tool uses FreeBayes to call SNPS given a reference sequence and a BAM alignment file.
-
-FreeBayes is a high-performance, flexible, and open-source Bayesian genetic variant detector. It operates on BAM alignment files, which are produced by most contemporary short-read aligners.
-
-In addition to substantial performance improvements over its predecessors (PolyBayes, GigaBayes, and BamBayes), it expands the scope of SNP and small-indel variant calling to populations of individuals with heterogeneous copy number. FreeBayes is currently under active development.
-
-Go `here <http://bioinformatics.bc.edu/marthlab/FreeBayes>`_ for details on FreeBayes.
-
-------
-
-**Inputs**
-
-FreeBayes accepts an input aligned BAM file.
-
-
-**Outputs**
-
-The output is in the VCF format.
-
--------
-
-**Settings**::
-
- input and output:
-
- -b --bam FILE Add FILE to the set of BAM files to be analyzed.
- -c --stdin Read BAM input on stdin.
- -v --vcf FILE Output VCF-format results to FILE.
- -f --fasta-reference FILE
- Use FILE as the reference sequence for analysis.
- An index file (FILE.fai) will be created if none exists.
- If neither --targets nor --region are specified, FreeBayes
- will analyze every position in this reference.
- -t --targets FILE
- Limit analysis to targets listed in the BED-format FILE.
- -r --region <chrom>:<start_position>..<end_position>
- Limit analysis to the specified region, 0-base coordinates,
- end_position not included (same as BED format).
- -s --samples FILE
- Limit analysis to samples listed (one per line) in the FILE.
- By default FreeBayes will analyze all samples in its input
- BAM files.
- --populations FILE
- Each line of FILE should list a sample and a population which
- it is part of. The population-based bayesian inference model
- will then be partitioned on the basis of the populations.
- -A --cnv-map FILE
- Read a copy number map from the BED file FILE, which has
- the format:
- reference sequence, start, end, sample name, copy number
- ... for each region in each sample which does not have the
- default copy number as set by --ploidy.
- -L --trace FILE Output an algorithmic trace to FILE.
- --failed-alleles FILE
- Write a BED file of the analyzed positions which do not
- pass --pvar to FILE.
- -@ --variant-input VCF
- Use variants reported in VCF file as input to the algorithm.
- A report will be generated for every record in the VCF file.
- -l --only-use-input-alleles
- Only provide variant calls and genotype likelihoods for sites
- and alleles which are provided in the VCF input, and provide
- output in the VCF for all input alleles, not just those which
- have support in the data.
-
- reporting:
-
- -P --pvar N Report sites if the probability that there is a polymorphism
- at the site is greater than N. default: 0.0001
- -_ --show-reference-repeats
- Calculate and show information about reference repeats in
- the VCF output.
-
- population model:
-
- -T --theta N The expected mutation rate or pairwise nucleotide diversity
- among the population under analysis. This serves as the
- single parameter to the Ewens Sampling Formula prior model
- default: 0.001
- -p --ploidy N Sets the default ploidy for the analysis to N. default: 2
- -J --pooled Assume that samples result from pooled sequencing.
- When using this flag, set --ploidy to the number of
- alleles in each sample.
-
- reference allele:
-
- -Z --use-reference-allele
- This flag includes the reference allele in the analysis as
- if it is another sample from the same population.
- -H --diploid-reference
- If using the reference sequence as a sample (-Z),
- treat it as diploid. default: false (reference is haploid)
- --reference-quality MQ,BQ
- Assign mapping quality of MQ to the reference allele at each
- site and base quality of BQ. default: 100,60
-
- allele scope:
-
- -I --no-snps Ignore SNP alleles.
- -i --no-indels Ignore insertion and deletion alleles.
- -X --no-mnps Ignore multi-nuceotide polymorphisms, MNPs.
- -u --no-complex Ignore complex events (composites of other classes).
- -n --use-best-n-alleles N
- Evaluate only the best N SNP alleles, ranked by sum of
- supporting quality scores. (Set to 0 to use all; default: all)
- -E --max-complex-gap N
- Allow complex alleles with contiguous embedded matches of up
- to this length.
-
- indel realignment:
-
- -O --left-align-indels
- Left-realign and merge gaps embedded in reads. default: false
-
- input filters:
-
- -4 --use-duplicate-reads
- Include duplicate-marked alignments in the analysis.
- default: exclude duplicates
- -m --min-mapping-quality Q
- Exclude alignments from analysis if they have a mapping
- quality less than Q. default: 30
- -q --min-base-quality Q
- Exclude alleles from analysis if their supporting base
- quality is less than Q. default: 20
- -R --min-supporting-quality MQ,BQ
- In order to consider an alternate allele, at least one supporting
- alignment must have mapping quality MQ, and one supporting
- allele must have base quality BQ. default: 0,0, unset
- -Q --mismatch-base-quality-threshold Q
- Count mismatches toward --read-mismatch-limit if the base
- quality of the mismatch is >= Q. default: 10
- -U --read-mismatch-limit N
- Exclude reads with more than N mismatches where each mismatch
- has base quality >= mismatch-base-quality-threshold.
- default: ~unbounded
- -z --read-max-mismatch-fraction N
- Exclude reads with more than N [0,1] fraction of mismatches where
- each mismatch has base quality >= mismatch-base-quality-threshold
- default: 1.0
- -$ --read-snp-limit N
- Exclude reads with more than N base mismatches, ignoring gaps
- with quality >= mismatch-base-quality-threshold.
- default: ~unbounded
- -e --read-indel-limit N
- Exclude reads with more than N separate gaps.
- default: ~unbounded
- -0 --no-filters Do not use any input base and mapping quality filters
- Equivalent to -m 0 -q 0 -R 0 -S 0
- -x --indel-exclusion-window
- Ignore portions of alignments this many bases from a
- putative insertion or deletion allele. default: 0
- -F --min-alternate-fraction N
- Require at least this fraction of observations supporting
- an alternate allele within a single individual in the
- in order to evaluate the position. default: 0.0
- -C --min-alternate-count N
- Require at least this count of observations supporting
- an alternate allele within a single individual in order
- to evaluate the position. default: 1
- -3 --min-alternate-qsum N
- Require at least this sum of quality of observations supporting
- an alternate allele within a single individual in order
- to evaluate the position. default: 0
- -G --min-alternate-total N
- Require at least this count of observations supporting
- an alternate allele within the total population in order
- to use the allele in analysis. default: 1
- -! --min-coverage N
- Require at least this coverage to process a site. default: 0
-
- bayesian priors:
-
- -Y --no-ewens-priors
- Turns off the Ewens' Sampling Formula component of the priors.
- -k --no-population-priors
- Equivalent to --pooled --no-ewens-priors
- -w --hwe-priors Use the probability of the combination arising under HWE given
- the allele frequency as estimated by observation frequency.
-
- observation prior expectations:
-
- -V --binomial-obs-priors
- Incorporate expectations about osbervations into the priors,
- Uses read placement probability, strand balance probability,
- and read position (5'-3') probability.
- -a --allele-balance-priors
- Use aggregate probability of observation balance between alleles
- as a component of the priors. Best for observations with minimal
- inherent reference bias.
-
- algorithmic features:
-
- -M --site-selection-max-iterations N
- Uses hill-climbing algorithm to search posterior space for N
- iterations to determine if the site should be evaluated. Set to 0
- to prevent use of this algorithm for site selection, and
- to a low integer for improvide site selection at a slight
- performance penalty. default: 5.
- -B --genotyping-max-iterations N
- Iterate no more than N times during genotyping step. default: 25.
- --genotyping-max-banddepth N
- Integrate no deeper than the Nth best genotype by likelihood when
- genotyping. default: 6.
- -W --posterior-integration-limits N,M
- Integrate all genotype combinations in our posterior space
- which include no more than N samples with their Mth best
- data likelihood. default: 1,3.
- -K --no-permute
- Do not scale prior probability of genotype combination given allele
- frequency by the number of permutations of included genotypes.
- -N --exclude-unobserved-genotypes
- Skip sample genotypings for which the sample has no supporting reads.
- -S --genotype-variant-threshold N
- Limit posterior integration to samples where the second-best
- genotype likelihood is no more than log(N) from the highest
- genotype likelihood for the sample. default: ~unbounded
- -j --use-mapping-quality
- Use mapping quality of alleles when calculating data likelihoods.
- -D --read-dependence-factor N
- Incorporate non-independence of reads by scaling successive
- observations by this factor during data likelihood
- calculations. default: 0.9
- -= --no-marginals
- Do not calculate the marginal probability of genotypes. Saves
- time and improves scaling performance in large populations.
-
-
-------
-
-**Citation**
-
-For the underlying tool, please cite `FreeBayes <http://bioinformatics.bc.edu/marthlab/FreeBayes>`_.
-
-If you use this tool in Galaxy, please cite Blankenberg D, et al. *In preparation.*
-
- </help>
-</tool>
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.