1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/1a4d6f11f284/ changeset: 1a4d6f11f284 user: jgoecks date: 2012-06-29 19:17:10 summary: Trackster modifications to work with new tools API controller. affected #: 6 files diff -r b2640a90e1b40a963be910329b243ae8c3fb9967 -r 1a4d6f11f28453aa98b32439a8df479a2830bc50 lib/galaxy/web/api/tools.py --- a/lib/galaxy/web/api/tools.py +++ b/lib/galaxy/web/api/tools.py @@ -135,7 +135,6 @@ run_on_regions = False regions = payload.get( 'regions', None ) if regions: - regions = from_json_string( regions ) if isinstance( regions, dict ): # Regions is a single region. regions = [ GenomeRegion.from_dict( regions ) ] diff -r b2640a90e1b40a963be910329b243ae8c3fb9967 -r 1a4d6f11f28453aa98b32439a8df479a2830bc50 static/scripts/mvc/data.js --- a/static/scripts/mvc/data.js +++ b/static/scripts/mvc/data.js @@ -4,10 +4,10 @@ */ var Dataset = Backbone.RelationalModel.extend({ defaults: { - id: "", - type: "", - name: "", - hda_ldda: "" + id: '', + type: '', + name: '', + hda_ldda: 'hda' } }); diff -r b2640a90e1b40a963be910329b243ae8c3fb9967 -r 1a4d6f11f28453aa98b32439a8df479a2830bc50 static/scripts/mvc/tools.js --- a/static/scripts/mvc/tools.js +++ b/static/scripts/mvc/tools.js @@ -112,7 +112,7 @@ return this._run({ action: 'rerun', target_dataset_id: target_dataset.id, - regions: JSON.stringify(regions) + regions: regions }); }, diff -r b2640a90e1b40a963be910329b243ae8c3fb9967 -r 1a4d6f11f28453aa98b32439a8df479a2830bc50 static/scripts/viz/trackster.js --- a/static/scripts/viz/trackster.js +++ b/static/scripts/viz/trackster.js @@ -87,6 +87,9 @@ * Helper to determine if object is jQuery deferred. */ var is_deferred = function ( d ) { + if (d === 'pending') { + console.log('pending'); + } return ( 'isResolved' in d ); }; @@ -1770,7 +1773,7 @@ var param_dict = {}; this.parent_div.find(":input").each(function() { var name = $(this).attr("name"), value = $(this).val(); - param_dict[name] = JSON.stringify(value); + param_dict[name] = value; }); return param_dict; }, @@ -1796,7 +1799,7 @@ tool.run( // URL params. { - dataset_id: this.track.original_dataset_id, + target_dataset_id: this.track.original_dataset_id, tool_id: tool.name }, null, @@ -1820,11 +1823,14 @@ var url_params = { - dataset_id: this.track.original_dataset_id, - chrom: this.track.view.chrom, - low: this.track.view.low, - high: this.track.view.high, - tool_id: this.name + target_dataset_id: this.track.original_dataset_id, + action: 'rerun', + tool_id: this.name, + regions: [{ + chrom: this.track.view.chrom, + start: this.track.view.low, + end: this.track.view.high + }] }, current_track = this.track, // Set name of track to include tool name, parameters, and region used. @@ -1871,10 +1877,7 @@ this.run(url_params, new_track, // Success callback. function(track_data) { - new_track.set_dataset(new Dataset({ - id: track_data.dataset_id, - hda_ldda: track_data.hda_ldda - })); + new_track.set_dataset(new Dataset(track_data)); new_track.tiles_div.text("Running job."); new_track.init(); } @@ -1885,9 +1888,15 @@ */ run: function(url_params, new_track, success_callback) { // Run tool. + url_params.inputs = this.get_param_values_dict(); var ss_deferred = new ServerStateDeferred({ - url: rerun_tool_url, - url_params: $.extend(url_params, this.get_param_values_dict()), + ajax_settings: { + url: galaxy_paths.get('tool_url'), + data: JSON.stringify(url_params), + dataType: "json", + contentType: 'application/json', + type: "POST" + }, interval: 2000, success_fn: function(response) { return response !== "pending"; @@ -4636,7 +4645,7 @@ // Paint summary tree into canvas var painter = new painters.SummaryTreePainter(result, tile_low, tile_high, this.prefs); painter.draw(ctx, canvas.width, canvas.height, w_scale); - return new SummaryTreeTile(track, tile_index, resolution, canvas, result.data, result.max); + return new SummaryTreeTile(track, region, resolution, canvas, result.data, result.max); } // Handle row-by-row tracks diff -r b2640a90e1b40a963be910329b243ae8c3fb9967 -r 1a4d6f11f28453aa98b32439a8df479a2830bc50 static/scripts/viz/visualization.js --- a/static/scripts/viz/visualization.js +++ b/static/scripts/viz/visualization.js @@ -420,20 +420,19 @@ }, /** - * as_str attribute using the format chrom:start-end can be - * used to set object's attributes. + * If options is a string, parsing using the format + * chrom:start-end is attempted to set object attributes. */ initialize: function(options) { - if (!this.get('chrom') && !this.get('start') && - !this.get('end') && 'as_str' in options) { - var pieces = options.as_str.split(':'), + if (typeof(options) === 'string') { + var pieces = options.split(':'), chrom = pieces[0], - start_end = pieces.split('-'), - start = start_end[0], - end = start_end[1]; - this.set('chrom', chrom); - this.set('start', start); - this.set('end', end); + start_end = pieces[1].split('-'); + this.set({ + chrom: chrom, + start: parseInt(start_end[0]), + end: parseInt(start_end[1]) + }); } }, diff -r b2640a90e1b40a963be910329b243ae8c3fb9967 -r 1a4d6f11f28453aa98b32439a8df479a2830bc50 templates/tracks/browser.mako --- a/templates/tracks/browser.mako +++ b/templates/tracks/browser.mako @@ -49,8 +49,7 @@ // Place URLs here so that url_for can be used to generate them. // galaxy_paths.set({ - visualization_url: "${h.url_for( action='save' )}", - run_tool_url: "${h.url_for( controller='/api/tools' )}" + visualization_url: "${h.url_for( action='save' )}" }); var add_track_async_url = "${h.url_for( action='add_track_async' )}", 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.