Skip to content

Commit

Permalink
Merge branch 'dannon-carlfeberhard-pephate' into pephate
Browse files Browse the repository at this point in the history
  • Loading branch information
carlfeberhard committed Jul 23, 2015
2 parents 84474c8 + 39c7209 commit c253eee
Show file tree
Hide file tree
Showing 25 changed files with 241 additions and 141 deletions.
Expand Up @@ -568,7 +568,8 @@ var PairedCollectionCreator = Backbone.View.extend( baseMVC.LoggableMixin ).exte
*/
createList : function( name ){
var creator = this,
url = '/api/histories/' + this.historyId + '/contents/dataset_collections';
root = ( window.Galaxy && Galaxy.options.root )? Galaxy.options.root : '/',
url = root + 'api/histories/' + this.historyId + '/contents/dataset_collections';

//TODO: use ListPairedCollection.create()
var ajaxData = {
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/mvc/tools.js
Expand Up @@ -262,7 +262,7 @@ var Tool = Backbone.Model.extend({

// Run job and resolve run_deferred to tool outputs.
$.when(ss_deferred.go()).then(function(result) {
run_deferred.resolve(new data.DatasetCollection().reset(result));
run_deferred.resolve(new data.DatasetCollection(result));
});
return run_deferred;
}
Expand Down
96 changes: 48 additions & 48 deletions client/galaxy/scripts/viz/sweepster.js
@@ -1,13 +1,13 @@
/**
* Visualization and components for Sweepster, a visualization for exploring a tool's parameter space via
* Visualization and components for Sweepster, a visualization for exploring a tool's parameter space via
* genomic visualization.
*/

define(["libs/underscore", "libs/d3", "viz/trackster/util", "viz/visualization", "viz/trackster/tracks", "mvc/tools", "mvc/data", "utils/config", "mvc/ui/icon-button"],
function(_, d3, util, visualization, tracks, tools, data, config, mod_icon_btn) {

/**
* A collection of tool input settings. Object is useful for keeping a list of settings
* A collection of tool input settings. Object is useful for keeping a list of settings
* for future use without changing the input's value and for preserving inputs order.
*/
var ToolInputsSettings = Backbone.Model.extend({
Expand All @@ -16,7 +16,7 @@ var ToolInputsSettings = Backbone.Model.extend({
values: null
}
});

/**
* Tree for a tool's parameters.
*/
Expand All @@ -25,7 +25,7 @@ var ToolParameterTree = Backbone.Model.extend({
tool: null,
tree_data: null
},

initialize: function(options) {
// Set up tool parameters to work with tree.
var self = this;
Expand Down Expand Up @@ -109,7 +109,7 @@ var ToolParameterTree = Backbone.Model.extend({
};
});
}

// Recurse to handle other parameters.
return _.map(settings, function(setting) {
return {
Expand Down Expand Up @@ -141,7 +141,7 @@ var ToolParameterTree = Backbone.Model.extend({
get_num_leaves: function() {
return this.get_tree_params().reduce(function(memo, param) { return memo * param.get_samples().length; }, 1);
},

/**
* Returns array of ToolInputsSettings objects based on a node and its subtree.
*/
Expand All @@ -159,7 +159,7 @@ var ToolParameterTree = Backbone.Model.extend({
cur_node = cur_node.parent;
}
}

// Walk subtree starting at clicked node to get full list of settings.
var self = this,
get_settings = function(node, settings) {
Expand All @@ -168,7 +168,7 @@ var ToolParameterTree = Backbone.Model.extend({
if (node.param) {
settings[node.param.get('name')] = node.value;
}

if (!node.children) {
// At leaf node, so return settings.
return new ToolInputsSettings({
Expand All @@ -182,10 +182,10 @@ var ToolParameterTree = Backbone.Model.extend({
}
},
all_settings = get_settings(target_node, fixed_settings);

// If user clicked on leaf, settings is a single dict. Convert to array for simplicity.
if (!_.isArray(all_settings)) { all_settings = [ all_settings ]; }

return all_settings;
},

Expand Down Expand Up @@ -235,7 +235,7 @@ var ToolParameterTree = Backbone.Model.extend({
* Returns a list of parameters used in tree.
*/
toJSON: function() {
// FIXME: returning and jsonifying complete param causes trouble on the server side,
// FIXME: returning and jsonifying complete param causes trouble on the server side,
// so just use essential attributes for now.
return this.get_tree_params().map(function(param) {
return {
Expand All @@ -255,7 +255,7 @@ var SweepsterTrack = Backbone.Model.extend({
settings: null,
regions: null
},

initialize: function(options) {
this.set('regions', options.regions);
if (options.track) {
Expand All @@ -272,7 +272,7 @@ var SweepsterTrack = Backbone.Model.extend({
var this_settings = this.get('settings'),
other_settings = a_track.get('settings');
for (var prop in this_settings) {
if (!other_settings[prop] ||
if (!other_settings[prop] ||
this_settings[prop] !== other_settings[prop]) {
return false;
}
Expand Down Expand Up @@ -316,8 +316,8 @@ var SweepsterVisualization = visualization.Visualization.extend({
this.set('tool_with_samplable_inputs', tool_with_samplable_inputs);
// Remove complex parameters for now.
tool_with_samplable_inputs.remove_inputs( [ 'data', 'hidden_data', 'conditional', 'text' ] );
this.set('parameter_tree', new ToolParameterTree({

this.set('parameter_tree', new ToolParameterTree({
tool: tool_with_samplable_inputs,
config: options.tree_config
}));
Expand Down Expand Up @@ -445,9 +445,9 @@ var SweepsterTrackView = Backbone.View.extend({
var ToolInputValOrSweepView = Backbone.View.extend({

// Template for rendering sweep inputs:
number_input_template: '<div class="form-row-input sweep">' +
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 %>">' +
'<input class="max" type="text" size="6" value="<%= max %>">' +
' samples: <input class="num_samples" type="text" size="1" value="<%= num_samples %>">' +
'</div>',

Expand All @@ -471,16 +471,16 @@ var ToolInputValOrSweepView = Backbone.View.extend({

// Add row for parameter sweep inputs.
if (input instanceof tools.IntegerToolParameter) {
sweep_inputs_row = $(_.template(this.number_input_template, this.model.toJSON()));
sweep_inputs_row = $( _.template(this.number_input_template)(this.model.toJSON()) );
}
else if (input instanceof tools.SelectToolParameter) {
var options = _.map(this.$el.find('select option'), function(option) {
return $(option).val();
}),
options_text = options.join(', ');
sweep_inputs_row = $(_.template(this.select_input_template, {
sweep_inputs_row = $( _.template(this.select_input_template)({
options: options_text
}));
}) );
}
sweep_inputs_row.insertAfter(single_input_row);

Expand All @@ -497,7 +497,7 @@ var ToolInputValOrSweepView = Backbone.View.extend({
$(this).hide();
self.$el.find('.icon-button.toggle').show();
}

},
{
title: 'Remove parameter from tree',
Expand All @@ -511,9 +511,9 @@ var ToolInputValOrSweepView = Backbone.View.extend({
self.$el.find('.icon-button.plus-button').show();
}
}
],
],
{

});
this.$el.prepend(menu.$el);

Expand Down Expand Up @@ -568,12 +568,12 @@ var ToolParameterTreeDesignView = Backbone.View.extend({
*/
var ToolParameterTreeView = Backbone.View.extend({
className: 'tool-parameter-tree',

initialize: function(options) {
// When tree data changes, re-render.
this.model.on('change:tree_data', this.render, this);
},

render: function() {
// Start fresh.
this.$el.children().remove();
Expand Down Expand Up @@ -640,7 +640,7 @@ var ToolParameterTreeView = Backbone.View.extend({
.on('mouseout', function() {
node.style('fill', '#000');
});

node.append("circle")
.attr("r", 9);

Expand All @@ -658,13 +658,13 @@ var ToolParameterTreeView = Backbone.View.extend({
var SweepsterVisualizationView = Backbone.View.extend({
className: 'Sweepster',

helpText:
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(options) {
this.canvas_manager = new visualization.CanvasManager(this.$el.parents('body'));
this.tool_param_tree_view = new ToolParameterTreeView({ model: this.model.get('parameter_tree') });
Expand All @@ -680,7 +680,7 @@ var SweepsterVisualizationView = Backbone.View.extend({
});

// Set block, reverse strand block colors; these colors will be used for all tracks.
this.config = config.ConfigSettingCollection.from_models_and_saved_values(
this.config = config.ConfigSettingCollection.from_models_and_saved_values(
[
{ key: 'name', label: 'Name', type: 'text', default_value: '' },
{ key: 'a_color', label: 'A Color', type: 'color', default_value: "#FF0000" },
Expand All @@ -693,7 +693,7 @@ var SweepsterVisualizationView = Backbone.View.extend({
], {}
);
},

render: function() {
// Render tree design view in left panel.
var tree_design_view = new ToolParameterTreeDesignView({
Expand Down Expand Up @@ -749,7 +749,7 @@ var SweepsterVisualizationView = Backbone.View.extend({
[
// Save.
/*
{ icon_class: 'disk--arrow', title: 'Save', on_click: function() {
{ icon_class: 'disk--arrow', title: 'Save', on_click: function() {
// Show saving dialog box
show_modal("Saving...", "progress");
Expand All @@ -760,8 +760,8 @@ var SweepsterVisualizationView = Backbone.View.extend({
'has_changes': false
});
})
.error(function() {
show_modal( "Could Not Save", "Could not save visualization. Please try again later.",
.error(function() {
show_modal( "Could Not Save", "Could not save visualization. Please try again later.",
{ "Close" : hide_modal } );
});
} },
Expand All @@ -772,14 +772,14 @@ var SweepsterVisualizationView = Backbone.View.extend({
title: 'Set display mode'
},
// Close viz.
{
icon_class: 'cross-circle',
title: 'Close',
on_click: function() {
{
icon_class: 'cross-circle',
title: 'Close',
on_click: function() {
window.location = "${h.url_for( controller='visualization', action='list' )}";
}
}
}
],
],
{
tooltip_config: {placement: 'bottom'}
});
Expand All @@ -797,13 +797,13 @@ var SweepsterVisualizationView = Backbone.View.extend({
});

make_popupmenu(menu.$el.find('.chevron-expand'), mode_mapping);

menu.$el.attr("style", "float: right");
$("#right .unified-panel-header-inner").append(menu.$el);
},

get_base_color: function(base) {
return this.config.get_value(base.toLowerCase() + '_color') ||
return this.config.get_value(base.toLowerCase() + '_color') ||
this.config.get_value('n_color');
},

Expand Down Expand Up @@ -857,7 +857,7 @@ var SweepsterVisualizationView = Backbone.View.extend({
},

/**
* Sets up handling when tree nodes are clicked. When a node is clicked, the tool is run for each of
* Sets up handling when tree nodes are clicked. When a node is clicked, the tool is run for each of
* the settings defined by the node's subtree and tracks are added for each run.
*/
handle_node_clicks: function() {
Expand All @@ -875,11 +875,11 @@ var SweepsterVisualizationView = Backbone.View.extend({

// Do not allow 10+ jobs to be run.
if (all_settings.length >= 10) {
show_modal("Whoa there cowboy!",
show_modal("Whoa there cowboy!",
"You clicked on a node to try " + self.model.get('tool').get('name') +
" with " + all_settings.length +
" different combinations of settings. You can only run 10 jobs at a time.",
{
{
"Ok": function() { hide_modal(); run_jobs_deferred.resolve(false); }
});
}
Expand All @@ -901,7 +901,7 @@ var SweepsterVisualizationView = Backbone.View.extend({
self.add_track(pm_track);
return pm_track;
});

// For each track, run tool using track's settings and update track.
_.each(new_tracks, function(pm_track, index) {
setTimeout(function() {
Expand All @@ -915,7 +915,7 @@ var SweepsterVisualizationView = Backbone.View.extend({
track_config = dataset.get('track_config');
// Set dataset to be the tool's output.
track_config.dataset = dataset;
// Set tool to null so that it is not unpacked; unpacking it messes with
// Set tool to null so that it is not unpacked; unpacking it messes with
// the tool parameters and parameter tree.
track_config.tool = null;

Expand All @@ -924,11 +924,11 @@ var SweepsterVisualizationView = Backbone.View.extend({
// Create and add track for output dataset.
var track_obj = tracks.object_from_template(track_config, self, null);
track_obj.init_for_tool_data();

pm_track.set('track', track_obj);
});
}, index * 10000);
});
});
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion config/datatypes_conf.xml.sample
Expand Up @@ -106,7 +106,7 @@
<display file="igb/gtf.xml" />
</datatype>
<datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary" mimetype="multipart/x-gzip" subclass="True" />
<datatype extension="h5" type="galaxy.datatypes.binary:Binary" mimetype="application/octet-stream" subclass="True" />
<datatype extension="h5" type="galaxy.datatypes.binary:Binary" mimetype="application/octet-stream" subclass="True" display_in_upload="True"/>
<datatype extension="html" type="galaxy.datatypes.images:Html" mimetype="text/html"/>
<datatype extension="interval" type="galaxy.datatypes.interval:Interval" display_in_upload="true" description="File must start with definition line in the following format (columns may be in any order)." >
<converter file="interval_to_bed_converter.xml" target_datatype="bed"/>
Expand Down
7 changes: 4 additions & 3 deletions config/galaxy.ini.sample
Expand Up @@ -973,9 +973,10 @@ use_interactive = True

# Very large metadata values can cause Galaxy crashes. This will allow
# limiting the maximum metadata key size (in bytes used in memory, not the end
# result database value size) Galaxy will attempt to save with a dataset. 0 to
# disable this feature. 5000000 seems to be a reasonable size.
#max_metadata_value_size = 0
# result database value size) Galaxy will attempt to save with a dataset. Use
# 0 to disable this feature. The default is 5MB, but as low as 1MB seems to be
# a reasonable size.
#max_metadata_value_size = 5242880

# If (for example) you run on a cluster and your datasets (by default,
# database/files/) are mounted read-only, this option will override tool output
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/config.py
Expand Up @@ -146,7 +146,7 @@ def __init__( self, **kwargs ):
self.tool_secret = kwargs.get( "tool_secret", "" )
self.id_secret = kwargs.get( "id_secret", "USING THE DEFAULT IS NOT SECURE!" )
self.retry_metadata_internally = string_as_bool( kwargs.get( "retry_metadata_internally", "True" ) )
self.max_metadata_value_size = int( kwargs.get( "max_metadata_value_size", 0 ) )
self.max_metadata_value_size = int( kwargs.get( "max_metadata_value_size", 5242880 ) )
self.use_remote_user = string_as_bool( kwargs.get( "use_remote_user", "False" ) )
self.normalize_remote_user_email = string_as_bool( kwargs.get( "normalize_remote_user_email", "False" ) )
self.remote_user_maildomain = kwargs.get( "remote_user_maildomain", None )
Expand Down

0 comments on commit c253eee

Please sign in to comment.