diff --git a/client/galaxy/scripts/mvc/form/form-parameters.js b/client/galaxy/scripts/mvc/form/form-parameters.js index 030f3594a50..0ddcc484898 100644 --- a/client/galaxy/scripts/mvc/form/form-parameters.js +++ b/client/galaxy/scripts/mvc/form/form-parameters.js @@ -5,8 +5,9 @@ define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/form/form-select-content', 'mvc/ui/ui-select-library', + 'mvc/ui/ui-select-ftp', 'mvc/ui/ui-color-picker'], - function(Utils, Ui, SelectContent, SelectLibrary, ColorPicker) { + function(Utils, Ui, SelectContent, SelectLibrary, SelectFtp, ColorPicker) { // create form view return Backbone.Model.extend({ @@ -26,9 +27,10 @@ define(['utils/utils', 'hidden' : '_fieldHidden', 'hidden_data' : '_fieldHidden', 'baseurl' : '_fieldHidden', - 'library_data' : '_fieldLibrary' + 'library_data' : '_fieldLibrary', + 'ftpfile' : '_fieldFtp' }, - + // initialize initialize: function(app, options) { this.app = app; @@ -53,7 +55,7 @@ define(['utils/utils', if (fieldClass && typeof(this[fieldClass]) === 'function') { field = this[fieldClass].call(this, input_def); } - + // identify field type if (!field) { // flag @@ -172,7 +174,7 @@ define(['utils/utils', } }); }, - + /** Text input field */ _fieldText: function(input_def) { @@ -272,6 +274,20 @@ define(['utils/utils', self.app.trigger('change'); } }); + }, + + /** FTP file field + */ + _fieldFtp: function(input_def) { + var self = this; + return new SelectFtp.View({ + id : 'field-' + input_def.id, + optional : input_def.optional, + multiple : input_def.multiple, + onchange : function() { + self.app.trigger('change'); + } + }); } }); diff --git a/client/galaxy/scripts/mvc/form/form-section.js b/client/galaxy/scripts/mvc/form/form-section.js index 8d11614099e..d84271c2fcc 100644 --- a/client/galaxy/scripts/mvc/form/form-section.js +++ b/client/galaxy/scripts/mvc/form/form-section.js @@ -285,6 +285,11 @@ define(['utils/utils', } }); + // add expansion event handler + this.app.on('expand', function(input_id) { + (portlet.$el.find('#' + input_id).length > 0) && !visible && portlet.$header.trigger('click'); + }); + // show sub section if requested if (input_def.expanded) { portlet.$header.trigger('click'); diff --git a/client/galaxy/scripts/mvc/form/form-view.js b/client/galaxy/scripts/mvc/form/form-view.js index 312d9e8c2b7..d74bff73e4f 100644 --- a/client/galaxy/scripts/mvc/form/form-view.js +++ b/client/galaxy/scripts/mvc/form/form-view.js @@ -111,6 +111,9 @@ define(['utils/utils', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc', // mark error input_element.error(message || 'Please verify this parameter.'); + // trigger expand event for parent containers + this.trigger('expand', input_id); + // scroll to first input element if (!silent) { $('html, body').animate({ diff --git a/client/galaxy/scripts/mvc/ui/ui-list.js b/client/galaxy/scripts/mvc/ui/ui-list.js new file mode 100644 index 00000000000..8f7e4625cb3 --- /dev/null +++ b/client/galaxy/scripts/mvc/ui/ui-list.js @@ -0,0 +1,157 @@ +// dependencies +define(['utils/utils', 'mvc/ui/ui-portlet', 'mvc/ui/ui-misc'], function(Utils, Portlet, Ui) { + +// ui list element +var View = Backbone.View.extend({ + // create portlet to keep track of selected list elements + initialize : function(options) { + // link this + var self = this; + + // initialize options + this.options = options; + this.name = options.name || 'element'; + this.multiple = options.multiple || false; + + // create message handler + this.message = new Ui.Message({ cls: 'ui-margin-top' }); + + // create portlet + this.portlet = new Portlet.View({ cls: 'ui-portlet-section' }); + + // create select field containing the options which can be inserted into the list + this.select = new Ui.Select.View({ optional : options.optional }); + + // create insert new list element button + this.button = new Ui.ButtonIcon({ + icon : 'fa fa-sign-in', + floating : 'left', + tooltip : 'Insert new ' + this.name, + onclick : function() { + self.add({ + id : self.select.value(), + name : self.select.text() + }); + } + }); + + // build main element + this.setElement(this._template(options)); + this.$('.ui-list-message').append(this.message.$el); + this.$('.ui-list-portlet').append(this.portlet.$el); + this.$('.ui-list-button').append(this.button.$el); + this.$('.ui-list-select').append(this.select.$el); + }, + + /** Return/Set currently selected list elements */ + value: function(val) { + // set new value + if (val !== undefined) { + this.portlet.empty(); + if ($.isArray(val)) { + for (var i in val) { + var v = val[i]; + var v_id = null; + var v_name = null; + if ($.type(v) != 'string') { + v_id = v.id; + v_name = v.name; + } else { + v_id = v_name = v; + } + if (v_id != null) { + this.add({ + id : v_id, + name : v_name + }); + } + } + } + this._refresh(); + } + // get current value + var lst = []; + this.$('.ui-list-id').each(function() { + lst.push({ + id : $(this).prop('id'), + name : $(this).find('.ui-list-name').html() + }); + }); + if (lst.length == 0) { + return null; + } + return lst; + }, + + /** Add row */ + add: function(options) { + var self = this; + if (this.$('[id="' + options.id + '"]').length === 0) { + if (Utils.validate(options.id)) { + var $el = $(this._templateRow({ + id : options.id, + name : options.name + })); + $el.on('click', function() { + $el.remove(); + self._refresh(); + }); + $el.on('mouseover', function() { + $el.addClass('portlet-highlight'); + }); + $el.on('mouseout', function() { + $el.removeClass('portlet-highlight'); + }); + this.portlet.append($el); + this._refresh(); + } else { + this.message.update({ message: 'Please select a valid ' + this.name + '.', status: 'danger' }); + } + } else { + this.message.update({ message: 'This ' + this.name + ' is already in the list.' }); + } + }, + + /** Update available options */ + update: function(options) { + this.select.update(options); + }, + + /** Refresh view */ + _refresh: function() { + if (this.$('.ui-list-id').length > 0) { + !this.multiple && this.button.disable(); + this.$('.ui-list-portlet').show(); + } else { + this.button.enable(); + this.$('.ui-list-portlet').hide(); + } + this.options.onchange && this.options.onchange(); + }, + + /** Main Template */ + _template: function(options) { + return '
' + + '
' + + '' + + '' + + '
' + + '
' + + '
' + + '
'; + }, + + /** Row Template */ + _templateRow: function(options) { + return '
' + + '' + + '' + options.name + '' + + '
'; + } +}); + +return { + View: View +} + +}); diff --git a/client/galaxy/scripts/mvc/ui/ui-misc.js b/client/galaxy/scripts/mvc/ui/ui-misc.js index 920bdb87b1a..ae36a02c9ef 100644 --- a/client/galaxy/scripts/mvc/ui/ui-misc.js +++ b/client/galaxy/scripts/mvc/ui/ui-misc.js @@ -199,7 +199,7 @@ var ButtonIcon = Backbone.View.extend({ }); // add tooltip - $(this.el).tooltip({title: options.tooltip, placement: 'bottom'}); + this.$button.tooltip({title: options.tooltip, placement: 'bottom'}); }, // disable @@ -229,18 +229,16 @@ var ButtonIcon = Backbone.View.extend({ } // string - var str = '
'; - - // title + var str = '
' + + '
'; if (options.title) { - str += '
' + - ' ' + - '' + options.title + '' + - '
'; + str += ' ' + + '' + options.title + ''; } else { - str += ''; + str += ''; } - str += '
'; + str += '
' + + '
'; return str; } }); @@ -277,6 +275,7 @@ var Message = Backbone.View.extend({ optionsDefault: { message : null, status : 'info', + cls : '', persistent : false }, @@ -286,7 +285,7 @@ var Message = Backbone.View.extend({ this.options = Utils.merge(options, this.optionsDefault); // create new element - this.setElement('
'); + this.setElement('
'); // show initial message if (this.options.message) { diff --git a/client/galaxy/scripts/mvc/ui/ui-portlet.js b/client/galaxy/scripts/mvc/ui/ui-portlet.js index d427f7dc1bb..e2c3ac311fe 100644 --- a/client/galaxy/scripts/mvc/ui/ui-portlet.js +++ b/client/galaxy/scripts/mvc/ui/ui-portlet.js @@ -88,7 +88,12 @@ var View = Backbone.View.extend({ append: function($el) { this.$content.append($el); }, - + + // remove all content + empty: function() { + this.$content.empty(); + }, + // content content: function() { return this.$content; diff --git a/client/galaxy/scripts/mvc/ui/ui-select-ftp.js b/client/galaxy/scripts/mvc/ui/ui-select-ftp.js new file mode 100644 index 00000000000..3f01cbac20b --- /dev/null +++ b/client/galaxy/scripts/mvc/ui/ui-select-ftp.js @@ -0,0 +1,53 @@ +// dependencies +define(['utils/utils', 'mvc/ui/ui-list'], + function(Utils, List) { + +/** + * FTP file selector + */ +var View = Backbone.View.extend({ + // initialize + initialize : function(options) { + // link this + var self = this; + + // create ui-list view to keep track of selected ftp files + this.ftpfile_list = new List.View({ + name : 'file', + optional : options.optional, + multiple : options.multiple, + onchange : function() { + options.onchange && options.onchange(self.value()); + } + }); + + // create elements + this.setElement(this.ftpfile_list.$el); + + // initial fetch of ftps + Utils.get({ + url : galaxy_config.root + 'api/remote_files', + success : function(response) { + var data = []; + for (var i in response) { + data.push({ + value : response[i]['path'], + label : response[i]['path'] + }); + } + self.ftpfile_list.update(data); + } + }); + }, + + /** Return/Set currently selected ftp datasets */ + value: function(val) { + return this.ftpfile_list.value(val); + } +}); + +return { + View: View +} + +}); diff --git a/client/galaxy/scripts/mvc/ui/ui-select-library.js b/client/galaxy/scripts/mvc/ui/ui-select-library.js index aaa105def18..fdffa445625 100644 --- a/client/galaxy/scripts/mvc/ui/ui-select-library.js +++ b/client/galaxy/scripts/mvc/ui/ui-select-library.js @@ -1,6 +1,6 @@ // dependencies -define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs', 'mvc/tools/tools-template'], - function(Utils, Ui, Tabs, ToolTemplate) { +define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-table', 'mvc/ui/ui-list'], + function(Utils, Ui, Table, List) { // collection of libraries var Libraries = Backbone.Collection.extend({ @@ -13,7 +13,7 @@ var LibraryDatasets = Backbone.Collection.extend({ var self = this; this.config = new Backbone.Model({ library_id: null }); this.config.on('change', function() { - self.fetch({reset: true}); + self.fetch({ reset: true }); }); }, url: function() { @@ -36,15 +36,16 @@ var View = Backbone.View.extend({ this.options = options; // select field for the library + // TODO: Remove this once the library API supports searching for library datasets this.library_select = new Ui.Select.View({ - optional : options.optional, onchange : function(value) { self.datasets.config.set('library_id', value); } }); - // select field for the library dataset - this.dataset_select = new Ui.Select.View({ + // create ui-list view to keep track of selected data libraries + this.dataset_list = new List.View({ + name : 'dataset', optional : options.optional, multiple : options.multiple, onchange : function() { @@ -62,7 +63,6 @@ var View = Backbone.View.extend({ }); }); self.library_select.update(data); - self.trigger('change'); }); // add reset handler for fetched library datasets @@ -74,13 +74,12 @@ var View = Backbone.View.extend({ if (model.get('type') === 'file') { data.push({ value : model.id, - label : library_current + model.get('name') + label : model.get('name') }); } }); } - self.dataset_select.update(data); - self.trigger('change'); + self.dataset_list.update(data); }); // add change event. fires on trigger @@ -88,10 +87,10 @@ var View = Backbone.View.extend({ options.onchange && options.onchange(self.value()); }); - // create element + // create elements this.setElement(this._template()); this.$('.library-select').append(this.library_select.$el); - this.$('.dataset-select').append(this.dataset_select.$el); + this.$el.append(this.dataset_list.$el); // initial fetch of libraries this.libraries.fetch({ @@ -106,8 +105,8 @@ var View = Backbone.View.extend({ }, /** Return/Set currently selected library datasets */ - value: function(new_val) { - return this.dataset_select.value(); + value: function(val) { + return this.dataset_list.value(val); }, /** Template */ @@ -117,10 +116,6 @@ var View = Backbone.View.extend({ 'Select Library' + '' + '
' + - '
' + - 'Select Dataset' + - '' + - '
' + '
'; } }); diff --git a/client/galaxy/scripts/utils/utils.js b/client/galaxy/scripts/utils/utils.js index 827cbb5e1c8..97e04855493 100644 --- a/client/galaxy/scripts/utils/utils.js +++ b/client/galaxy/scripts/utils/utils.js @@ -39,7 +39,7 @@ function validate (value) { return false; } for (var i in value) { - if (['__null__', '__undefined__', 'None', null, undefined].indexOf(value[i]) > -1) { + if (['__null__', '__undefined__', null, undefined].indexOf(value[i]) > -1) { return false; } } diff --git a/client/galaxy/style/less/ui.less b/client/galaxy/style/less/ui.less index adf9a0fe5b2..53b9c914c48 100644 --- a/client/galaxy/style/less/ui.less +++ b/client/galaxy/style/less/ui.less @@ -278,6 +278,9 @@ background: @side-panel-bg; border-bottom: solid darken(@side-panel-bg, 10%) 1px; } + .portlet-highlight { + text-decoration: underline; + } } .ui-portlet-narrow { @@ -501,6 +504,30 @@ } } +.ui-list { + .ui-list-select { + float: left; + width: ~'calc(100% - 27px)'; + } + .ui-list-button { + .ui-button-icon { + margin-top: 3px; + margin-right: 5px; + } + } + .ui-list-message, .ui-list-portlet { + clear: both; + } + .ui-list-id { + cursor: pointer; + margin-top: 5px; + .ui-list-delete { + font-size: 1.2em; + margin-right: 5px; + } + } +} + .ui-select { position: relative; .button { diff --git a/config/datatypes_conf.xml.sample b/config/datatypes_conf.xml.sample index cf91919f5cf..0be717d1e48 100644 --- a/config/datatypes_conf.xml.sample +++ b/config/datatypes_conf.xml.sample @@ -119,6 +119,7 @@ + diff --git a/config/plugins/interactive_environments/common/templates/ie.mako b/config/plugins/interactive_environments/common/templates/ie.mako index f80eb2498ce..2437602672b 100644 --- a/config/plugins/interactive_environments/common/templates/ie.mako +++ b/config/plugins/interactive_environments/common/templates/ie.mako @@ -5,7 +5,7 @@ // does not use these. ie_password_auth = ${ ie_request.javascript_boolean(ie_request.attr.PASSWORD_AUTH) }; ie_apache_urls = ${ ie_request.javascript_boolean(ie_request.attr.APACHE_URLS) }; -ie_password = '${ ie_request.attr.notebook_pw }'; +ie_password = '${ ie_request.notebook_pw }'; var galaxy_root = '${ ie_request.attr.root }'; diff --git a/config/plugins/interactive_environments/ipython/config/ipython.ini.sample b/config/plugins/interactive_environments/ipython/config/ipython.ini.sample index b8c9e8ed007..b52d5760911 100644 --- a/config/plugins/interactive_environments/ipython/config/ipython.ini.sample +++ b/config/plugins/interactive_environments/ipython/config/ipython.ini.sample @@ -12,10 +12,10 @@ command = docker # The docker image name that should be started. -image = bgruening/docker-ipython-notebook:0.2 +image = bgruening/docker-ipython-notebook:dev # Additional arguments that are passed to the `docker run` command. -command_inject = --sig-proxy=true +command_inject = --sig-proxy=true -e DEBUG=false # URL to access the Galaxy API with from the spawn Docker containter, if empty # this falls back to galaxy.ini's galaxy_infrastructure_url and finally to the diff --git a/config/plugins/interactive_environments/ipython/templates/ipython.mako b/config/plugins/interactive_environments/ipython/templates/ipython.mako index 8f3a3d6655a..a0a3b1e7059 100644 --- a/config/plugins/interactive_environments/ipython/templates/ipython.mako +++ b/config/plugins/interactive_environments/ipython/templates/ipython.mako @@ -3,16 +3,20 @@ <% import os import shutil -import tempfile -import subprocess +import hashlib # Sets ID and sets up a lot of other variables ie_request.load_deploy_config() ie_request.attr.docker_port = 6789 # Create tempdir in galaxy -temp_dir = os.path.abspath( tempfile.mkdtemp() ) -# Write out conf file...needs work -ie_request.write_conf_file(temp_dir) +temp_dir = ie_request.temp_dir + +if ie_request.attr.PASSWORD_AUTH: + m = hashlib.sha1() + m.update( ie_request.notebook_pw + ie_request.notebook_pw_salt ) + PASSWORD = 'sha1:%s:%s' % (ie_request.notebook_pw_salt, m.hexdigest()) +else: + PASSWORD = "none" ## IPython Specific # Prepare an empty notebook @@ -34,9 +38,12 @@ else: notebook_access_url = ie_request.url_template('${PROXY_URL}/ipython/${PORT}/notebooks/ipython_galaxy_notebook.ipynb') notebook_login_url = ie_request.url_template('${PROXY_URL}/ipython/${PORT}/login?next=%2Fipython%2F${PORT}%2Ftree') -docker_cmd = ie_request.docker_cmd(temp_dir) -ie_request.log.info("Starting IPython docker container with command [%s]" % docker_cmd) -subprocess.call(docker_cmd, shell=True) + +# Add all environment variables collected from Galaxy's IE infrastructure +ie_request.launch(env_override={ + 'notebook_password': PASSWORD, +}) + %> diff --git a/config/plugins/interactive_environments/ipython/templates/notebook.ipynb b/config/plugins/interactive_environments/ipython/templates/notebook.ipynb index 97c8f2970f3..f44ffb39aec 100644 --- a/config/plugins/interactive_environments/ipython/templates/notebook.ipynb +++ b/config/plugins/interactive_environments/ipython/templates/notebook.ipynb @@ -20,7 +20,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "You can access your data via the dataset number. For example, ``handle = get(42)``.", + "You can access your data via the dataset number. For example, ``handle = open(get(42), 'r')``.", "To save data, write your data to a file, and then call ``put('filename.txt')``. The dataset will then be available in your galaxy history.", "Notebooks can be saved to Galaxy by clicking the large green button at the top right of the IPython interface.
", "More help and informations can be found on the project [website](https://github.com/bgruening/galaxy-ipython)." diff --git a/config/plugins/interactive_environments/rstudio/config/rstudio.ini.sample b/config/plugins/interactive_environments/rstudio/config/rstudio.ini.sample new file mode 100644 index 00000000000..ed0b64ff7ce --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/config/rstudio.ini.sample @@ -0,0 +1,19 @@ +[main] +# This cannot be changed +password_auth = True +# Other +apache_urls = False +ssl = False + +[docker] +command = docker +image = erasche/docker-rstudio-notebook:dev + +# Additional arguments that are passed to the `docker run` command. `-u` +# settings are completely ignored. +command_inject = --sig-proxy=true -e DEBUG=false + +# URL to access the Galaxy API with from the spawned Docker container, if empty +# this falls back to galaxy.ini's galaxy_infrastructure_url and finally to the +# Docker host of the spawned container, if that is also not set. +#galaxy_url= diff --git a/config/plugins/interactive_environments/rstudio/config/rstudio.xml b/config/plugins/interactive_environments/rstudio/config/rstudio.xml new file mode 100644 index 00000000000..ad42cd92f01 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/config/rstudio.xml @@ -0,0 +1,17 @@ + + + + + + HistoryDatasetAssociation + tabular.Tabular + data.Text + binary.RData + dataset_id + + + + dataset_id + + + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/base64.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/base64.js new file mode 100644 index 00000000000..77b3868abf9 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/base64.js @@ -0,0 +1,73 @@ +// ==== File: base64.js +var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var b64pad="="; + +function hex2b64(h) { + var i; + var c; + var ret = ""; + for(i = 0; i+3 <= h.length; i+=3) { + c = parseInt(h.substring(i,i+3),16); + ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63); + } + if(i+1 == h.length) { + c = parseInt(h.substring(i,i+1),16); + ret += b64map.charAt(c << 2); + } + else if(i+2 == h.length) { + c = parseInt(h.substring(i,i+2),16); + ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4); + } + while((ret.length & 3) > 0) ret += b64pad; + return ret; +} + +// convert a base64 string to hex +function b64tohex(s) { + var ret = "" + var i; + var k = 0; // b64 state, 0-3 + var slop; + for(i = 0; i < s.length; ++i) { + if(s.charAt(i) == b64pad) break; + v = b64map.indexOf(s.charAt(i)); + if(v < 0) continue; + if(k == 0) { + ret += int2char(v >> 2); + slop = v & 3; + k = 1; + } + else if(k == 1) { + ret += int2char((slop << 2) | (v >> 4)); + slop = v & 0xf; + k = 2; + } + else if(k == 2) { + ret += int2char(slop); + ret += int2char(v >> 2); + slop = v & 3; + k = 3; + } + else { + ret += int2char((slop << 2) | (v >> 4)); + ret += int2char(v & 0xf); + k = 0; + } + } + if(k == 1) + ret += int2char(slop << 2); + return ret; +} + +// convert a base64 string to a byte/number array +function b64toBA(s) { + //piggyback on b64tohex for now, optimize later + var h = b64tohex(s); + var i; + var a = new Array(); + for(i = 0; 2*i < h.length; ++i) { + a[i] = parseInt(h.substring(2*i,2*i+2),16); + } + return a; +} + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/jsbn.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/jsbn.js new file mode 100644 index 00000000000..801841d7184 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/jsbn.js @@ -0,0 +1,562 @@ +// Downloaded from http://www-cs-students.stanford.edu/~tjw/ at Tue Nov 30 00:42:57 PST 2010 +// ==== File: jsbn.js +// Copyright (c) 2005 Tom Wu +// All Rights Reserved. +// See "LICENSE" for details. + +// Basic JavaScript BN library - subset useful for RSA encryption. + +// Bits per digit +var dbits; + +// JavaScript engine analysis +var canary = 0xdeadbeefcafe; +var j_lm = ((canary&0xffffff)==0xefcafe); + +// (public) Constructor +function BigInteger(a,b,c) { + if(a != null) + if("number" == typeof a) this.fromNumber(a,b,c); + else if(b == null && "string" != typeof a) this.fromString(a,256); + else this.fromString(a,b); +} + +// return new, unset BigInteger +function nbi() { return new BigInteger(null); } + +// am: Compute w_j += (x*this_i), propagate carries, +// c is initial carry, returns final carry. +// c < 3*dvalue, x < 2*dvalue, this_i < dvalue +// We need to select the fastest one that works in this environment. + +// am1: use a single mult and divide to get the high bits, +// max digit bits should be 26 because +// max internal value = 2*dvalue^2-2*dvalue (< 2^53) +function am1(i,x,w,j,c,n) { + while(--n >= 0) { + var v = x*this[i++]+w[j]+c; + c = Math.floor(v/0x4000000); + w[j++] = v&0x3ffffff; + } + return c; +} +// am2 avoids a big mult-and-extract completely. +// Max digit bits should be <= 30 because we do bitwise ops +// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) +function am2(i,x,w,j,c,n) { + var xl = x&0x7fff, xh = x>>15; + while(--n >= 0) { + var l = this[i]&0x7fff; + var h = this[i++]>>15; + var m = xh*l+h*xl; + l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); + c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); + w[j++] = l&0x3fffffff; + } + return c; +} +// Alternately, set max digit bits to 28 since some +// browsers slow down when dealing with 32-bit numbers. +function am3(i,x,w,j,c,n) { + var xl = x&0x3fff, xh = x>>14; + while(--n >= 0) { + var l = this[i]&0x3fff; + var h = this[i++]>>14; + var m = xh*l+h*xl; + l = xl*l+((m&0x3fff)<<14)+w[j]+c; + c = (l>>28)+(m>>14)+xh*h; + w[j++] = l&0xfffffff; + } + return c; +} +if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; +} +else if(j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; +} +else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; +} + +BigInteger.prototype.DB = dbits; +BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; + r.t = this.t; + r.s = this.s; +} + +// (protected) set from integer value x, -DV <= x < DV +function bnpFromInt(x) { + this.t = 1; + this.s = (x<0)?-1:0; + if(x > 0) this[0] = x; + else if(x < -1) this[0] = x+DV; + else this.t = 0; +} + +// return bigint initialized to value +function nbv(i) { var r = nbi(); r.fromInt(i); return r; } + +// (protected) set from string and radix +function bnpFromString(s,b) { + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 256) k = 8; // byte array + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else { this.fromRadix(s,b); return; } + this.t = 0; + this.s = 0; + var i = s.length, mi = false, sh = 0; + while(--i >= 0) { + var x = (k==8)?s[i]&0xff:intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if(sh == 0) + this[this.t++] = x; + else if(sh+k > this.DB) { + this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); + } + else + this[this.t-1] |= x<= this.DB) sh -= this.DB; + } + if(k == 8 && (s[0]&0x80) != 0) { + this.s = -1; + if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; +} + +// (public) return string representation in given radix +function bnToString(b) { + if(this.s < 0) return "-"+this.negate().toString(b); + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else return this.toRadix(b); + var km = (1< 0) { + if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } + while(i >= 0) { + if(p < k) { + d = (this[i]&((1<>(p+=this.DB-k); + } + else { + d = (this[i]>>(p-=k))&km; + if(p <= 0) { p += this.DB; --i; } + } + if(d > 0) m = true; + if(m) r += int2char(d); + } + } + return m?r:"0"; +} + +// (public) -this +function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } + +// (public) |this| +function bnAbs() { return (this.s<0)?this.negate():this; } + +// (public) return + if this > a, - if this < a, 0 if equal +function bnCompareTo(a) { + var r = this.s-a.s; + if(r != 0) return r; + var i = this.t; + r = i-a.t; + if(r != 0) return r; + while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; + return 0; +} + +// returns bit length of the integer x +function nbits(x) { + var r = 1, t; + if((t=x>>>16) != 0) { x = t; r += 16; } + if((t=x>>8) != 0) { x = t; r += 8; } + if((t=x>>4) != 0) { x = t; r += 4; } + if((t=x>>2) != 0) { x = t; r += 2; } + if((t=x>>1) != 0) { x = t; r += 1; } + return r; +} + +// (public) return the number of bits in "this" +function bnBitLength() { + if(this.t <= 0) return 0; + return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); +} + +// (protected) r = this << n*DB +function bnpDLShiftTo(n,r) { + var i; + for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; + for(i = n-1; i >= 0; --i) r[i] = 0; + r.t = this.t+n; + r.s = this.s; +} + +// (protected) r = this >> n*DB +function bnpDRShiftTo(n,r) { + for(var i = n; i < this.t; ++i) r[i-n] = this[i]; + r.t = Math.max(this.t-n,0); + r.s = this.s; +} + +// (protected) r = this << n +function bnpLShiftTo(n,r) { + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<= 0; --i) { + r[i+ds+1] = (this[i]>>cbs)|c; + c = (this[i]&bm)<= 0; --i) r[i] = 0; + r[ds] = c; + r.t = this.t+ds+1; + r.s = this.s; + r.clamp(); +} + +// (protected) r = this >> n +function bnpRShiftTo(n,r) { + r.s = this.s; + var ds = Math.floor(n/this.DB); + if(ds >= this.t) { r.t = 0; return; } + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<>bs; + for(var i = ds+1; i < this.t; ++i) { + r[i-ds-1] |= (this[i]&bm)<>bs; + } + if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; + } + if(a.t < this.t) { + c -= a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c -= a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = (c<0)?-1:0; + if(c < -1) r[i++] = this.DV+c; + else if(c > 0) r[i++] = c; + r.t = i; + r.clamp(); +} + +// (protected) r = this * a, r != this,a (HAC 14.12) +// "this" should be the larger one if appropriate. +function bnpMultiplyTo(a,r) { + var x = this.abs(), y = a.abs(); + var i = x.t; + r.t = i+y.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); + r.s = 0; + r.clamp(); + if(this.s != a.s) BigInteger.ZERO.subTo(r,r); +} + +// (protected) r = this^2, r != this (HAC 14.16) +function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2*x.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < x.t-1; ++i) { + var c = x.am(i,x[i],r,2*i,0,1); + if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { + r[i+x.t] -= x.DV; + r[i+x.t+1] = 1; + } + } + if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); + r.s = 0; + r.clamp(); +} + +// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) +// r != q, this != m. q or r may be null. +function bnpDivRemTo(m,q,r) { + var pm = m.abs(); + if(pm.t <= 0) return; + var pt = this.abs(); + if(pt.t < pm.t) { + if(q != null) q.fromInt(0); + if(r != null) this.copyTo(r); + return; + } + if(r == null) r = nbi(); + var y = nbi(), ts = this.s, ms = m.s; + var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus + if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } + else { pm.copyTo(y); pt.copyTo(r); } + var ys = y.t; + var y0 = y[ys-1]; + if(y0 == 0) return; + var yt = y0*(1<1)?y[ys-2]>>this.F2:0); + var d1 = this.FV/yt, d2 = (1<= 0) { + r[r.t++] = 1; + r.subTo(t,r); + } + BigInteger.ONE.dlShiftTo(ys,t); + t.subTo(y,y); // "negative" y so we can replace sub with am later + while(y.t < ys) y[y.t++] = 0; + while(--j >= 0) { + // Estimate quotient digit + var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); + if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out + y.dlShiftTo(j,t); + r.subTo(t,r); + while(r[i] < --qd) r.subTo(t,r); + } + } + if(q != null) { + r.drShiftTo(ys,q); + if(ts != ms) BigInteger.ZERO.subTo(q,q); + } + r.t = ys; + r.clamp(); + if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder + if(ts < 0) BigInteger.ZERO.subTo(r,r); +} + +// (public) this mod a +function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a,null,r); + if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); + return r; +} + +// Modular reduction using "classic" algorithm +function Classic(m) { this.m = m; } +function cConvert(x) { + if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; +} +function cRevert(x) { return x; } +function cReduce(x) { x.divRemTo(this.m,null,x); } +function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } +function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +Classic.prototype.convert = cConvert; +Classic.prototype.revert = cRevert; +Classic.prototype.reduce = cReduce; +Classic.prototype.mulTo = cMulTo; +Classic.prototype.sqrTo = cSqrTo; + +// (protected) return "-1/this % 2^DB"; useful for Mont. reduction +// justification: +// xy == 1 (mod m) +// xy = 1+km +// xy(2-xy) = (1+km)(1-km) +// x[y(2-xy)] = 1-k^2m^2 +// x[y(2-xy)] == 1 (mod m^2) +// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 +// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. +// JS multiply "overflows" differently from C/C++, so care is needed here. +function bnpInvDigit() { + if(this.t < 1) return 0; + var x = this[0]; + if((x&1) == 0) return 0; + var y = x&3; // y == 1/x mod 2^2 + y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 + y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 + y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y>0)?this.DV-y:-y; +} + +// Montgomery reduction +function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp&0x7fff; + this.mph = this.mp>>15; + this.um = (1<<(m.DB-15))-1; + this.mt2 = 2*m.t; +} + +// xR mod m +function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t,r); + r.divRemTo(this.m,null,r); + if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); + return r; +} + +// x/R mod m +function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; +} + +// x = x/R mod m (HAC 14.32) +function montReduce(x) { + while(x.t <= this.mt2) // pad x so am has enough room later + x[x.t++] = 0; + for(var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i]&0x7fff; + var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; + // use am to combine the multiply-shift-add into one call + j = i+this.m.t; + x[j] += this.m.am(0,u0,x,i,0,this.m.t); + // propagate carry + while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } + } + x.clamp(); + x.drShiftTo(this.m.t,x); + if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); +} + +// r = "x^2/R mod m"; x != r +function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +// r = "xy/R mod m"; x,y != r +function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + +Montgomery.prototype.convert = montConvert; +Montgomery.prototype.revert = montRevert; +Montgomery.prototype.reduce = montReduce; +Montgomery.prototype.mulTo = montMulTo; +Montgomery.prototype.sqrTo = montSqrTo; + +// (protected) true iff this is even +function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } + +// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) +function bnpExp(e,z) { + if(e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; + g.copyTo(r); + while(--i >= 0) { + z.sqrTo(r,r2); + if((e&(1< 0) z.mulTo(r2,g,r); + else { var t = r; r = r2; r2 = t; } + } + return z.revert(r); +} + +// (public) this^e % m, 0 <= e < 2^32 +function bnModPowInt(e,m) { + var z; + if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); + return this.exp(e,z); +} + +// protected +BigInteger.prototype.copyTo = bnpCopyTo; +BigInteger.prototype.fromInt = bnpFromInt; +BigInteger.prototype.fromString = bnpFromString; +BigInteger.prototype.clamp = bnpClamp; +BigInteger.prototype.dlShiftTo = bnpDLShiftTo; +BigInteger.prototype.drShiftTo = bnpDRShiftTo; +BigInteger.prototype.lShiftTo = bnpLShiftTo; +BigInteger.prototype.rShiftTo = bnpRShiftTo; +BigInteger.prototype.subTo = bnpSubTo; +BigInteger.prototype.multiplyTo = bnpMultiplyTo; +BigInteger.prototype.squareTo = bnpSquareTo; +BigInteger.prototype.divRemTo = bnpDivRemTo; +BigInteger.prototype.invDigit = bnpInvDigit; +BigInteger.prototype.isEven = bnpIsEven; +BigInteger.prototype.exp = bnpExp; + +// public +BigInteger.prototype.toString = bnToString; +BigInteger.prototype.negate = bnNegate; +BigInteger.prototype.abs = bnAbs; +BigInteger.prototype.compareTo = bnCompareTo; +BigInteger.prototype.bitLength = bnBitLength; +BigInteger.prototype.mod = bnMod; +BigInteger.prototype.modPowInt = bnModPowInt; + +// "constants" +BigInteger.ZERO = nbv(0); +BigInteger.ONE = nbv(1); + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/prng4.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/prng4.js new file mode 100644 index 00000000000..5cd681256c1 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/prng4.js @@ -0,0 +1,47 @@ +// ==== File: prng4.js +// prng4.js - uses Arcfour as a PRNG + +function Arcfour() { + this.i = 0; + this.j = 0; + this.S = new Array(); +} + +// Initialize arcfour context from key, an array of ints, each from [0..255] +function ARC4init(key) { + var i, j, t; + for(i = 0; i < 256; ++i) + this.S[i] = i; + j = 0; + for(i = 0; i < 256; ++i) { + j = (j + this.S[i] + key[i % key.length]) & 255; + t = this.S[i]; + this.S[i] = this.S[j]; + this.S[j] = t; + } + this.i = 0; + this.j = 0; +} + +function ARC4next() { + var t; + this.i = (this.i + 1) & 255; + this.j = (this.j + this.S[this.i]) & 255; + t = this.S[this.i]; + this.S[this.i] = this.S[this.j]; + this.S[this.j] = t; + return this.S[(t + this.S[this.i]) & 255]; +} + +Arcfour.prototype.init = ARC4init; +Arcfour.prototype.next = ARC4next; + +// Plug in your RNG constructor here +function prng_newstate() { + return new Arcfour(); +} + +// Pool size must be a multiple of 4 and greater than 32. +// An array of bytes the size of the pool will be passed to init() +var rng_psize = 256; + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/rng.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/rng.js new file mode 100644 index 00000000000..24bae0f8ec8 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/rng.js @@ -0,0 +1,70 @@ +// ==== File: rng.js +// Random number generator - requires a PRNG backend, e.g. prng4.js + +// For best results, put code like +// +// in your main HTML document. + +var rng_state; +var rng_pool; +var rng_pptr; + +// Mix in a 32-bit integer into the pool +function rng_seed_int(x) { + rng_pool[rng_pptr++] ^= x & 255; + rng_pool[rng_pptr++] ^= (x >> 8) & 255; + rng_pool[rng_pptr++] ^= (x >> 16) & 255; + rng_pool[rng_pptr++] ^= (x >> 24) & 255; + if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; +} + +// Mix in the current time (w/milliseconds) into the pool +function rng_seed_time() { + rng_seed_int(new Date().getTime()); +} + +// Initialize the pool with junk if needed. +if(rng_pool == null) { + rng_pool = new Array(); + rng_pptr = 0; + var t; + if(navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) { + // Extract entropy (256 bits) from NS4 RNG if available + var z = window.crypto.random(32); + for(t = 0; t < z.length; ++t) + rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; + } + while(rng_pptr < rng_psize) { // extract some randomness from Math.random() + t = Math.floor(65536 * Math.random()); + rng_pool[rng_pptr++] = t >>> 8; + rng_pool[rng_pptr++] = t & 255; + } + rng_pptr = 0; + rng_seed_time(); + //rng_seed_int(window.screenX); + //rng_seed_int(window.screenY); +} + +function rng_get_byte() { + if(rng_state == null) { + rng_seed_time(); + rng_state = prng_newstate(); + rng_state.init(rng_pool); + for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) + rng_pool[rng_pptr] = 0; + rng_pptr = 0; + //rng_pool = null; + } + // TODO: allow reseeding after first request + return rng_state.next(); +} + +function rng_get_bytes(ba) { + var i; + for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); +} + +function SecureRandom() {} + +SecureRandom.prototype.nextBytes = rng_get_bytes; + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/rsa.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/rsa.js new file mode 100644 index 00000000000..b2e37c35540 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/rsa.js @@ -0,0 +1,114 @@ +// ==== File: rsa.js +// Depends on jsbn.js and rng.js + +// Version 1.1: support utf-8 encoding in pkcs1pad2 + +// convert a (hex) string to a bignum object +function parseBigInt(str,r) { + return new BigInteger(str,r); +} + +function linebrk(s,n) { + var ret = ""; + var i = 0; + while(i + n < s.length) { + ret += s.substring(i,i+n) + "\n"; + i += n; + } + return ret + s.substring(i,s.length); +} + +function byte2Hex(b) { + if(b < 0x10) + return "0" + b.toString(16); + else + return b.toString(16); +} + +// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint +function pkcs1pad2(s,n) { + if(n < s.length + 11) { // TODO: fix for utf-8 + alert("Message too long for RSA"); + return null; + } + var ba = new Array(); + var i = s.length - 1; + while(i >= 0 && n > 0) { + var c = s.charCodeAt(i--); + if(c < 128) { // encode using utf-8 + ba[--n] = c; + } + else if((c > 127) && (c < 2048)) { + ba[--n] = (c & 63) | 128; + ba[--n] = (c >> 6) | 192; + } + else { + ba[--n] = (c & 63) | 128; + ba[--n] = ((c >> 6) & 63) | 128; + ba[--n] = (c >> 12) | 224; + } + } + ba[--n] = 0; + var rng = new SecureRandom(); + var x = new Array(); + while(n > 2) { // random non-zero pad + x[0] = 0; + while(x[0] == 0) rng.nextBytes(x); + ba[--n] = x[0]; + } + ba[--n] = 2; + ba[--n] = 0; + return new BigInteger(ba); +} + +// "empty" RSA key constructor +function RSAKey() { + this.n = null; + this.e = 0; + this.d = null; + this.p = null; + this.q = null; + this.dmp1 = null; + this.dmq1 = null; + this.coeff = null; +} + +// Set the public key fields N and e from hex strings +function RSASetPublic(N,E) { + if(N != null && E != null && N.length > 0 && E.length > 0) { + this.n = parseBigInt(N,16); + this.e = parseInt(E,16); + } + else + alert("Invalid RSA public key"); +} + +// Perform raw public operation on "x": return x^e (mod n) +function RSADoPublic(x) { + return x.modPowInt(this.e, this.n); +} + +// Return the PKCS#1 RSA encryption of "text" as an even-length hex string +function RSAEncrypt(text) { + var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3); + if(m == null) return null; + var c = this.doPublic(m); + if(c == null) return null; + var h = c.toString(16); + if((h.length & 1) == 0) return h; else return "0" + h; +} + +// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string +//function RSAEncryptB64(text) { +// var h = this.encrypt(text); +// if(h) return hex2b64(h); else return null; +//} + +// protected +RSAKey.prototype.doPublic = RSADoPublic; + +// public +RSAKey.prototype.setPublic = RSASetPublic; +RSAKey.prototype.encrypt = RSAEncrypt; +//RSAKey.prototype.encrypt_b64 = RSAEncryptB64; + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio.big.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio.big.js new file mode 100644 index 00000000000..2389ea47282 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio.big.js @@ -0,0 +1,861 @@ +// Downloaded from http://www-cs-students.stanford.edu/~tjw/ at Tue Nov 30 00:42:57 PST 2010 +// ==== File: jsbn.js +// Copyright (c) 2005 Tom Wu +// All Rights Reserved. +// See "LICENSE" for details. + +// Basic JavaScript BN library - subset useful for RSA encryption. + +// Bits per digit +var dbits; + +// JavaScript engine analysis +var canary = 0xdeadbeefcafe; +var j_lm = ((canary&0xffffff)==0xefcafe); + +// (public) Constructor +function BigInteger(a,b,c) { + if(a != null) + if("number" == typeof a) this.fromNumber(a,b,c); + else if(b == null && "string" != typeof a) this.fromString(a,256); + else this.fromString(a,b); +} + +// return new, unset BigInteger +function nbi() { return new BigInteger(null); } + +// am: Compute w_j += (x*this_i), propagate carries, +// c is initial carry, returns final carry. +// c < 3*dvalue, x < 2*dvalue, this_i < dvalue +// We need to select the fastest one that works in this environment. + +// am1: use a single mult and divide to get the high bits, +// max digit bits should be 26 because +// max internal value = 2*dvalue^2-2*dvalue (< 2^53) +function am1(i,x,w,j,c,n) { + while(--n >= 0) { + var v = x*this[i++]+w[j]+c; + c = Math.floor(v/0x4000000); + w[j++] = v&0x3ffffff; + } + return c; +} +// am2 avoids a big mult-and-extract completely. +// Max digit bits should be <= 30 because we do bitwise ops +// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) +function am2(i,x,w,j,c,n) { + var xl = x&0x7fff, xh = x>>15; + while(--n >= 0) { + var l = this[i]&0x7fff; + var h = this[i++]>>15; + var m = xh*l+h*xl; + l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); + c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); + w[j++] = l&0x3fffffff; + } + return c; +} +// Alternately, set max digit bits to 28 since some +// browsers slow down when dealing with 32-bit numbers. +function am3(i,x,w,j,c,n) { + var xl = x&0x3fff, xh = x>>14; + while(--n >= 0) { + var l = this[i]&0x3fff; + var h = this[i++]>>14; + var m = xh*l+h*xl; + l = xl*l+((m&0x3fff)<<14)+w[j]+c; + c = (l>>28)+(m>>14)+xh*h; + w[j++] = l&0xfffffff; + } + return c; +} +if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; +} +else if(j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; +} +else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; +} + +BigInteger.prototype.DB = dbits; +BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; + r.t = this.t; + r.s = this.s; +} + +// (protected) set from integer value x, -DV <= x < DV +function bnpFromInt(x) { + this.t = 1; + this.s = (x<0)?-1:0; + if(x > 0) this[0] = x; + else if(x < -1) this[0] = x+DV; + else this.t = 0; +} + +// return bigint initialized to value +function nbv(i) { var r = nbi(); r.fromInt(i); return r; } + +// (protected) set from string and radix +function bnpFromString(s,b) { + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 256) k = 8; // byte array + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else { this.fromRadix(s,b); return; } + this.t = 0; + this.s = 0; + var i = s.length, mi = false, sh = 0; + while(--i >= 0) { + var x = (k==8)?s[i]&0xff:intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if(sh == 0) + this[this.t++] = x; + else if(sh+k > this.DB) { + this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); + } + else + this[this.t-1] |= x<= this.DB) sh -= this.DB; + } + if(k == 8 && (s[0]&0x80) != 0) { + this.s = -1; + if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; +} + +// (public) return string representation in given radix +function bnToString(b) { + if(this.s < 0) return "-"+this.negate().toString(b); + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else return this.toRadix(b); + var km = (1< 0) { + if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } + while(i >= 0) { + if(p < k) { + d = (this[i]&((1<>(p+=this.DB-k); + } + else { + d = (this[i]>>(p-=k))&km; + if(p <= 0) { p += this.DB; --i; } + } + if(d > 0) m = true; + if(m) r += int2char(d); + } + } + return m?r:"0"; +} + +// (public) -this +function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } + +// (public) |this| +function bnAbs() { return (this.s<0)?this.negate():this; } + +// (public) return + if this > a, - if this < a, 0 if equal +function bnCompareTo(a) { + var r = this.s-a.s; + if(r != 0) return r; + var i = this.t; + r = i-a.t; + if(r != 0) return r; + while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; + return 0; +} + +// returns bit length of the integer x +function nbits(x) { + var r = 1, t; + if((t=x>>>16) != 0) { x = t; r += 16; } + if((t=x>>8) != 0) { x = t; r += 8; } + if((t=x>>4) != 0) { x = t; r += 4; } + if((t=x>>2) != 0) { x = t; r += 2; } + if((t=x>>1) != 0) { x = t; r += 1; } + return r; +} + +// (public) return the number of bits in "this" +function bnBitLength() { + if(this.t <= 0) return 0; + return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); +} + +// (protected) r = this << n*DB +function bnpDLShiftTo(n,r) { + var i; + for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; + for(i = n-1; i >= 0; --i) r[i] = 0; + r.t = this.t+n; + r.s = this.s; +} + +// (protected) r = this >> n*DB +function bnpDRShiftTo(n,r) { + for(var i = n; i < this.t; ++i) r[i-n] = this[i]; + r.t = Math.max(this.t-n,0); + r.s = this.s; +} + +// (protected) r = this << n +function bnpLShiftTo(n,r) { + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<= 0; --i) { + r[i+ds+1] = (this[i]>>cbs)|c; + c = (this[i]&bm)<= 0; --i) r[i] = 0; + r[ds] = c; + r.t = this.t+ds+1; + r.s = this.s; + r.clamp(); +} + +// (protected) r = this >> n +function bnpRShiftTo(n,r) { + r.s = this.s; + var ds = Math.floor(n/this.DB); + if(ds >= this.t) { r.t = 0; return; } + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<>bs; + for(var i = ds+1; i < this.t; ++i) { + r[i-ds-1] |= (this[i]&bm)<>bs; + } + if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; + } + if(a.t < this.t) { + c -= a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c -= a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = (c<0)?-1:0; + if(c < -1) r[i++] = this.DV+c; + else if(c > 0) r[i++] = c; + r.t = i; + r.clamp(); +} + +// (protected) r = this * a, r != this,a (HAC 14.12) +// "this" should be the larger one if appropriate. +function bnpMultiplyTo(a,r) { + var x = this.abs(), y = a.abs(); + var i = x.t; + r.t = i+y.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); + r.s = 0; + r.clamp(); + if(this.s != a.s) BigInteger.ZERO.subTo(r,r); +} + +// (protected) r = this^2, r != this (HAC 14.16) +function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2*x.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < x.t-1; ++i) { + var c = x.am(i,x[i],r,2*i,0,1); + if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { + r[i+x.t] -= x.DV; + r[i+x.t+1] = 1; + } + } + if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); + r.s = 0; + r.clamp(); +} + +// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) +// r != q, this != m. q or r may be null. +function bnpDivRemTo(m,q,r) { + var pm = m.abs(); + if(pm.t <= 0) return; + var pt = this.abs(); + if(pt.t < pm.t) { + if(q != null) q.fromInt(0); + if(r != null) this.copyTo(r); + return; + } + if(r == null) r = nbi(); + var y = nbi(), ts = this.s, ms = m.s; + var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus + if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } + else { pm.copyTo(y); pt.copyTo(r); } + var ys = y.t; + var y0 = y[ys-1]; + if(y0 == 0) return; + var yt = y0*(1<1)?y[ys-2]>>this.F2:0); + var d1 = this.FV/yt, d2 = (1<= 0) { + r[r.t++] = 1; + r.subTo(t,r); + } + BigInteger.ONE.dlShiftTo(ys,t); + t.subTo(y,y); // "negative" y so we can replace sub with am later + while(y.t < ys) y[y.t++] = 0; + while(--j >= 0) { + // Estimate quotient digit + var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); + if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out + y.dlShiftTo(j,t); + r.subTo(t,r); + while(r[i] < --qd) r.subTo(t,r); + } + } + if(q != null) { + r.drShiftTo(ys,q); + if(ts != ms) BigInteger.ZERO.subTo(q,q); + } + r.t = ys; + r.clamp(); + if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder + if(ts < 0) BigInteger.ZERO.subTo(r,r); +} + +// (public) this mod a +function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a,null,r); + if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); + return r; +} + +// Modular reduction using "classic" algorithm +function Classic(m) { this.m = m; } +function cConvert(x) { + if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; +} +function cRevert(x) { return x; } +function cReduce(x) { x.divRemTo(this.m,null,x); } +function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } +function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +Classic.prototype.convert = cConvert; +Classic.prototype.revert = cRevert; +Classic.prototype.reduce = cReduce; +Classic.prototype.mulTo = cMulTo; +Classic.prototype.sqrTo = cSqrTo; + +// (protected) return "-1/this % 2^DB"; useful for Mont. reduction +// justification: +// xy == 1 (mod m) +// xy = 1+km +// xy(2-xy) = (1+km)(1-km) +// x[y(2-xy)] = 1-k^2m^2 +// x[y(2-xy)] == 1 (mod m^2) +// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 +// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. +// JS multiply "overflows" differently from C/C++, so care is needed here. +function bnpInvDigit() { + if(this.t < 1) return 0; + var x = this[0]; + if((x&1) == 0) return 0; + var y = x&3; // y == 1/x mod 2^2 + y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 + y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 + y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y>0)?this.DV-y:-y; +} + +// Montgomery reduction +function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp&0x7fff; + this.mph = this.mp>>15; + this.um = (1<<(m.DB-15))-1; + this.mt2 = 2*m.t; +} + +// xR mod m +function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t,r); + r.divRemTo(this.m,null,r); + if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); + return r; +} + +// x/R mod m +function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; +} + +// x = x/R mod m (HAC 14.32) +function montReduce(x) { + while(x.t <= this.mt2) // pad x so am has enough room later + x[x.t++] = 0; + for(var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i]&0x7fff; + var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; + // use am to combine the multiply-shift-add into one call + j = i+this.m.t; + x[j] += this.m.am(0,u0,x,i,0,this.m.t); + // propagate carry + while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } + } + x.clamp(); + x.drShiftTo(this.m.t,x); + if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); +} + +// r = "x^2/R mod m"; x != r +function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +// r = "xy/R mod m"; x,y != r +function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + +Montgomery.prototype.convert = montConvert; +Montgomery.prototype.revert = montRevert; +Montgomery.prototype.reduce = montReduce; +Montgomery.prototype.mulTo = montMulTo; +Montgomery.prototype.sqrTo = montSqrTo; + +// (protected) true iff this is even +function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } + +// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) +function bnpExp(e,z) { + if(e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; + g.copyTo(r); + while(--i >= 0) { + z.sqrTo(r,r2); + if((e&(1< 0) z.mulTo(r2,g,r); + else { var t = r; r = r2; r2 = t; } + } + return z.revert(r); +} + +// (public) this^e % m, 0 <= e < 2^32 +function bnModPowInt(e,m) { + var z; + if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); + return this.exp(e,z); +} + +// protected +BigInteger.prototype.copyTo = bnpCopyTo; +BigInteger.prototype.fromInt = bnpFromInt; +BigInteger.prototype.fromString = bnpFromString; +BigInteger.prototype.clamp = bnpClamp; +BigInteger.prototype.dlShiftTo = bnpDLShiftTo; +BigInteger.prototype.drShiftTo = bnpDRShiftTo; +BigInteger.prototype.lShiftTo = bnpLShiftTo; +BigInteger.prototype.rShiftTo = bnpRShiftTo; +BigInteger.prototype.subTo = bnpSubTo; +BigInteger.prototype.multiplyTo = bnpMultiplyTo; +BigInteger.prototype.squareTo = bnpSquareTo; +BigInteger.prototype.divRemTo = bnpDivRemTo; +BigInteger.prototype.invDigit = bnpInvDigit; +BigInteger.prototype.isEven = bnpIsEven; +BigInteger.prototype.exp = bnpExp; + +// public +BigInteger.prototype.toString = bnToString; +BigInteger.prototype.negate = bnNegate; +BigInteger.prototype.abs = bnAbs; +BigInteger.prototype.compareTo = bnCompareTo; +BigInteger.prototype.bitLength = bnBitLength; +BigInteger.prototype.mod = bnMod; +BigInteger.prototype.modPowInt = bnModPowInt; + +// "constants" +BigInteger.ZERO = nbv(0); +BigInteger.ONE = nbv(1); +// ==== File: prng4.js +// prng4.js - uses Arcfour as a PRNG + +function Arcfour() { + this.i = 0; + this.j = 0; + this.S = new Array(); +} + +// Initialize arcfour context from key, an array of ints, each from [0..255] +function ARC4init(key) { + var i, j, t; + for(i = 0; i < 256; ++i) + this.S[i] = i; + j = 0; + for(i = 0; i < 256; ++i) { + j = (j + this.S[i] + key[i % key.length]) & 255; + t = this.S[i]; + this.S[i] = this.S[j]; + this.S[j] = t; + } + this.i = 0; + this.j = 0; +} + +function ARC4next() { + var t; + this.i = (this.i + 1) & 255; + this.j = (this.j + this.S[this.i]) & 255; + t = this.S[this.i]; + this.S[this.i] = this.S[this.j]; + this.S[this.j] = t; + return this.S[(t + this.S[this.i]) & 255]; +} + +Arcfour.prototype.init = ARC4init; +Arcfour.prototype.next = ARC4next; + +// Plug in your RNG constructor here +function prng_newstate() { + return new Arcfour(); +} + +// Pool size must be a multiple of 4 and greater than 32. +// An array of bytes the size of the pool will be passed to init() +var rng_psize = 256; +// ==== File: rng.js +// Random number generator - requires a PRNG backend, e.g. prng4.js + +// For best results, put code like +// +// in your main HTML document. + +var rng_state; +var rng_pool; +var rng_pptr; + +// Mix in a 32-bit integer into the pool +function rng_seed_int(x) { + rng_pool[rng_pptr++] ^= x & 255; + rng_pool[rng_pptr++] ^= (x >> 8) & 255; + rng_pool[rng_pptr++] ^= (x >> 16) & 255; + rng_pool[rng_pptr++] ^= (x >> 24) & 255; + if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; +} + +// Mix in the current time (w/milliseconds) into the pool +function rng_seed_time() { + rng_seed_int(new Date().getTime()); +} + +// Initialize the pool with junk if needed. +if(rng_pool == null) { + rng_pool = new Array(); + rng_pptr = 0; + var t; + if(navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) { + // Extract entropy (256 bits) from NS4 RNG if available + var z = window.crypto.random(32); + for(t = 0; t < z.length; ++t) + rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; + } + while(rng_pptr < rng_psize) { // extract some randomness from Math.random() + t = Math.floor(65536 * Math.random()); + rng_pool[rng_pptr++] = t >>> 8; + rng_pool[rng_pptr++] = t & 255; + } + rng_pptr = 0; + rng_seed_time(); + //rng_seed_int(window.screenX); + //rng_seed_int(window.screenY); +} + +function rng_get_byte() { + if(rng_state == null) { + rng_seed_time(); + rng_state = prng_newstate(); + rng_state.init(rng_pool); + for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) + rng_pool[rng_pptr] = 0; + rng_pptr = 0; + //rng_pool = null; + } + // TODO: allow reseeding after first request + return rng_state.next(); +} + +function rng_get_bytes(ba) { + var i; + for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); +} + +function SecureRandom() {} + +SecureRandom.prototype.nextBytes = rng_get_bytes; +// ==== File: rsa.js +// Depends on jsbn.js and rng.js + +// Version 1.1: support utf-8 encoding in pkcs1pad2 + +// convert a (hex) string to a bignum object +function parseBigInt(str,r) { + return new BigInteger(str,r); +} + +function linebrk(s,n) { + var ret = ""; + var i = 0; + while(i + n < s.length) { + ret += s.substring(i,i+n) + "\n"; + i += n; + } + return ret + s.substring(i,s.length); +} + +function byte2Hex(b) { + if(b < 0x10) + return "0" + b.toString(16); + else + return b.toString(16); +} + +// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint +function pkcs1pad2(s,n) { + if(n < s.length + 11) { // TODO: fix for utf-8 + alert("Message too long for RSA"); + return null; + } + var ba = new Array(); + var i = s.length - 1; + while(i >= 0 && n > 0) { + var c = s.charCodeAt(i--); + if(c < 128) { // encode using utf-8 + ba[--n] = c; + } + else if((c > 127) && (c < 2048)) { + ba[--n] = (c & 63) | 128; + ba[--n] = (c >> 6) | 192; + } + else { + ba[--n] = (c & 63) | 128; + ba[--n] = ((c >> 6) & 63) | 128; + ba[--n] = (c >> 12) | 224; + } + } + ba[--n] = 0; + var rng = new SecureRandom(); + var x = new Array(); + while(n > 2) { // random non-zero pad + x[0] = 0; + while(x[0] == 0) rng.nextBytes(x); + ba[--n] = x[0]; + } + ba[--n] = 2; + ba[--n] = 0; + return new BigInteger(ba); +} + +// "empty" RSA key constructor +function RSAKey() { + this.n = null; + this.e = 0; + this.d = null; + this.p = null; + this.q = null; + this.dmp1 = null; + this.dmq1 = null; + this.coeff = null; +} + +// Set the public key fields N and e from hex strings +function RSASetPublic(N,E) { + if(N != null && E != null && N.length > 0 && E.length > 0) { + this.n = parseBigInt(N,16); + this.e = parseInt(E,16); + } + else + alert("Invalid RSA public key"); +} + +// Perform raw public operation on "x": return x^e (mod n) +function RSADoPublic(x) { + return x.modPowInt(this.e, this.n); +} + +// Return the PKCS#1 RSA encryption of "text" as an even-length hex string +function RSAEncrypt(text) { + var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3); + if(m == null) return null; + var c = this.doPublic(m); + if(c == null) return null; + var h = c.toString(16); + if((h.length & 1) == 0) return h; else return "0" + h; +} + +// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string +//function RSAEncryptB64(text) { +// var h = this.encrypt(text); +// if(h) return hex2b64(h); else return null; +//} + +// protected +RSAKey.prototype.doPublic = RSADoPublic; + +// public +RSAKey.prototype.setPublic = RSASetPublic; +RSAKey.prototype.encrypt = RSAEncrypt; +//RSAKey.prototype.encrypt_b64 = RSAEncryptB64; +// ==== File: base64.js +var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var b64pad="="; + +function hex2b64(h) { + var i; + var c; + var ret = ""; + for(i = 0; i+3 <= h.length; i+=3) { + c = parseInt(h.substring(i,i+3),16); + ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63); + } + if(i+1 == h.length) { + c = parseInt(h.substring(i,i+1),16); + ret += b64map.charAt(c << 2); + } + else if(i+2 == h.length) { + c = parseInt(h.substring(i,i+2),16); + ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4); + } + while((ret.length & 3) > 0) ret += b64pad; + return ret; +} + +// convert a base64 string to hex +function b64tohex(s) { + var ret = "" + var i; + var k = 0; // b64 state, 0-3 + var slop; + for(i = 0; i < s.length; ++i) { + if(s.charAt(i) == b64pad) break; + v = b64map.indexOf(s.charAt(i)); + if(v < 0) continue; + if(k == 0) { + ret += int2char(v >> 2); + slop = v & 3; + k = 1; + } + else if(k == 1) { + ret += int2char((slop << 2) | (v >> 4)); + slop = v & 0xf; + k = 2; + } + else if(k == 2) { + ret += int2char(slop); + ret += int2char(v >> 2); + slop = v & 3; + k = 3; + } + else { + ret += int2char((slop << 2) | (v >> 4)); + ret += int2char(v & 0xf); + k = 0; + } + } + if(k == 1) + ret += int2char(slop << 2); + return ret; +} + +// convert a base64 string to a byte/number array +function b64toBA(s) { + //piggyback on b64tohex for now, optimize later + var h = b64tohex(s); + var i; + var a = new Array(); + for(i = 0; 2*i < h.length; ++i) { + a[i] = parseInt(h.substring(2*i,2*i+2),16); + } + return a; +} diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio.min.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio.min.js new file mode 100644 index 00000000000..f74debec619 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio.min.js @@ -0,0 +1,24 @@ +var g,j,k=(244837814094590&16777215)==15715070;function l(b,a,c){if(b!=null)if("number"==typeof b)this.ca(b,a,c);else a==null&&"string"!=typeof b?this.z(b,256):this.z(b,a)}function m(){return new l(null)}function o(b,a,c,d,e,f){for(;--f>=0;){var h=a*this[b++]+c[d]+e;e=Math.floor(h/67108864);c[d++]=h&67108863}return e} +function p(b,a,c,d,e,f){var h=a&32767;for(a=a>>15;--f>=0;){var i=this[b]&32767,n=this[b++]>>15,r=a*i+n*h;i=h*i+((r&32767)<<15)+c[d]+(e&1073741823);e=(i>>>30)+(r>>>15)+a*n+(e>>>30);c[d++]=i&1073741823}return e}function s(b,a,c,d,e,f){var h=a&16383;for(a=a>>14;--f>=0;){var i=this[b]&16383,n=this[b++]>>14,r=a*i+n*h;i=h*i+((r&16383)<<14)+c[d]+e;e=(i>>28)+(r>>14)+a*n;c[d++]=i&268435455}return e} +if(k&&navigator.appName=="Microsoft Internet Explorer"){l.prototype.i=p;j=30}else if(k&&navigator.appName!="Netscape"){l.prototype.i=o;j=26}else{l.prototype.i=s;j=28}g=l.prototype;g.c=j;g.g=(1<=0;--a)b[a]=this[a];b.a=this.a;b.b=this.b}function D(b){this.a=1;this.b=b<0?-1:0;if(b>0)this[0]=b;else if(b<-1)this[0]=b+DV;else this.a=0}function E(b){var a=m();a.w(b);return a} +function F(b,a){if(a==16)a=4;else if(a==8)a=3;else if(a==256)a=8;else if(a==2)a=1;else if(a==32)a=5;else if(a==4)a=2;else{this.da(b,a);return}this.b=this.a=0;for(var c=b.length,d=false,e=0;--c>=0;){var f=a==8?b[c]&255:A(b,c);if(f<0){if(b.charAt(c)=="-")d=true}else{d=false;if(e==0)this[this.a++]=f;else if(e+a>this.c){this[this.a-1]|=(f&(1<>this.c-e}else this[this.a-1]|=f<=this.c)e-=this.c}}if(a==8&&(b[0]&128)!=0){this.b=-1;if(e>0)this[this.a-1]|=(1<0&&this[this.a-1]==b;)--this.a} +function I(b){if(this.b<0)return"-"+this.G().toString(b);if(b==16)b=4;else if(b==8)b=3;else if(b==2)b=1;else if(b==32)b=5;else if(b==4)b=2;else return this.ga(b);var a=(1<0){if(h>h)>0){d=true;e=t.charAt(c)}for(;f>=0;){if(h>(h+=this.c-b)}else{c=this[f]>>(h-=b)&a;if(h<=0){h+=this.c;--f}}if(c>0)d=true;if(d)e+=t.charAt(c)}}return d?e:"0"} +function J(){var b=m();G.f(this,b);return b}function K(){return this.b<0?this.G():this}function L(b){var a=this.b-b.b;if(a!=0)return a;var c=this.a;a=c-b.a;if(a!=0)return a;for(;--c>=0;)if((a=this[c]-b[c])!=0)return a;return 0}function M(b){var a=1,c;if((c=b>>>16)!=0){b=c;a+=16}if((c=b>>8)!=0){b=c;a+=8}if((c=b>>4)!=0){b=c;a+=4}if((c=b>>2)!=0){b=c;a+=2}if(b>>1!=0)a+=1;return a}function N(){if(this.a<=0)return 0;return this.c*(this.a-1)+M(this[this.a-1]^this.b&this.g)} +function aa(b,a){var c;for(c=this.a-1;c>=0;--c)a[c+b]=this[c];for(c=b-1;c>=0;--c)a[c]=0;a.a=this.a+b;a.b=this.b}function ba(b,a){for(var c=b;c=0;--h){a[h+b+1]=this[h]>>d|f;f=(this[h]&e)<=0;--h)a[h]=0;a[b]=f;a.a=this.a+b+1;a.b=this.b;a.j()} +function da(b,a){a.b=this.b;var c=Math.floor(b/this.c);if(c>=this.a)a.a=0;else{b=b%this.c;var d=this.c-b,e=(1<>b;for(var f=c+1;f>b}if(b>0)a[this.a-c-1]|=(this.b&e)<>=this.c}if(b.a>=this.c}d+=this.b}else{for(d+=this.b;c>=this.c}d-=b.b}a.b=d<0?-1:0;if(d<-1)a[c++]=this.h+d;else if(d>0)a[c++]=d;a.a=c;a.j()}function fa(b,a){var c=this.abs(),d=b.abs(),e=c.a;for(a.a=e+d.a;--e>=0;)a[e]=0;for(e=0;e=0;)b[c]=0;for(c=0;c=a.h){b[c+a.a]-=a.h;b[c+a.a+1]=1}}if(b.a>0)b[b.a-1]+=a.i(c,a[c],b,2*c,0,1);b.b=0;b.j()} +function ha(b,a,c){var d=b.abs();if(!(d.a<=0)){var e=this.abs();if(e.a0){d.A(i,f);e.A(i,c)}else{d.m(f);e.m(c)}d=f.a;e=f[d-1];if(e!=0){var n=e*(1<1?f[d-2]>>this.s:0),r=this.K/n;n=(1<=0){c[c.a++]=1;c.f(q,c)}O.o(d,q);for(q.f(f,f);f.a=0;){var C=c[--w]==e?this.g:Math.floor(c[w]* +r+(c[w-1]+ia)*n);if((c[w]+=f.i(0,C,c,y,0,d))0&&c.W(i,c);h<0&&G.f(c,c)}}}}function ja(b){var a=m();this.abs().p(b,null,a);this.b<0&&a.l(G)>0&&b.f(a,a);return a}function P(b){this.d=b}function ka(b){return b.b<0||b.l(this.d)>=0?b.R(this.d):b}function la(b){return b}function ma(b){b.p(this.d,null,b)}function na(b,a,c){b.F(a,c);this.reduce(c)}function oa(b,a){b.J(a);this.reduce(a)}g=P.prototype;g.t=ka; +g.H=la;g.reduce=ma;g.D=na;g.I=oa;function pa(){if(this.a<1)return 0;var b=this[0];if((b&1)==0)return 0;var a=b&3;a=a*(2-(b&15)*a)&15;a=a*(2-(b&255)*a)&255;a=a*(2-((b&65535)*a&65535))&65535;a=a*(2-b*a%this.h)%this.h;return a>0?this.h-a:-a}function Q(b){this.d=b;this.B=b.P();this.C=this.B&32767;this.T=this.B>>15;this.Y=(1<0&&this.d.f(a,a);return a} +function ra(b){var a=m();b.m(a);this.reduce(a);return a}function sa(b){for(;b.a<=this.U;)b[b.a++]=0;for(var a=0;a>15)*this.C&this.Y)<<15)&b.g;c=a+this.d.a;for(b[c]+=this.d.i(0,d,b,a,0,this.d.a);b[c]>=b.h;){b[c]-=b.h;b[++c]++}}b.j();b.u(this.d.a,b);b.l(this.d)>=0&&b.f(this.d,b)}function ta(b,a){b.J(a);this.reduce(a)}function ua(b,a,c){b.F(a,c);this.reduce(c)}g=Q.prototype;g.t=qa;g.H=ra;g.reduce=sa;g.D=ua;g.I=ta; +function va(){return(this.a>0?this[0]&1:this.b)==0}function wa(b,a){if(b>4294967295||b<1)return O;var c=m(),d=m(),e=a.t(this),f=M(b)-1;for(e.m(c);--f>=0;){a.I(c,d);if((b&1<0)a.D(d,e,c);else{var h=c;c=d;d=h}}return a.H(c)}function xa(b,a){a=b<256||a.Q()?new P(a):new Q(a);return this.exp(b,a)}g=l.prototype;g.m=B;g.w=D;g.z=F;g.j=H;g.o=aa;g.u=ba;g.A=ca;g.W=da;g.f=ea;g.F=fa;g.J=ga;g.p=ha;g.P=pa;g.Q=va;g.exp=wa;g.toString=I;g.G=J;g.abs=K;g.l=L;g.L=N;g.R=ja;g.S=xa;var G=E(0),O=E(1); +function R(){this.n=this.k=0;this.e=[]}function ya(b){var a,c,d;for(a=0;a<256;++a)this.e[a]=a;for(a=c=0;a<256;++a){c=c+this.e[a]+b[a%b.length]&255;d=this.e[a];this.e[a]=this.e[c];this.e[c]=d}this.n=this.k=0}function za(){var b;this.k=this.k+1&255;this.n=this.n+this.e[this.k]&255;b=this.e[this.k];this.e[this.k]=this.e[this.n];this.e[this.n]=b;return this.e[b+this.e[this.k]&255]}R.prototype.O=ya;R.prototype.next=za;var S=256,T,U,V; +function W(b){U[V++]^=b&255;U[V++]^=b>>8&255;U[V++]^=b>>16&255;U[V++]^=b>>24&255;if(V>=S)V-=S}if(U==null){U=[];V=0;var X;if(navigator.appName=="Netscape"&&navigator.appVersion<"5"&&window.crypto){var Y=window.crypto.random(32);for(X=0;X>>8;U[V++]=X&255}V=0;W((new Date).getTime())}function Aa(){if(T==null){W((new Date).getTime());T=new R;T.O(U);for(V=0;V0&&a.length>0){this.q=new l(b,16);this.v=parseInt(a,16)}else alert("Invalid RSA public key")}function Da(b){return b.S(this.v,this.q)} +function Ea(b){var a;a=this.q.L()+7>>3;if(a=0&&a>0;){var e=b.charCodeAt(d--);if(e<128)c[--a]=e;else if(e>127&&e<2048){c[--a]=e&63|128;c[--a]=e>>6|192}else{c[--a]=e&63|128;c[--a]=e>>6&63|128;c[--a]=e>>12|224}}c[--a]=0;b=new Z;for(d=[];a>2;){for(d[0]=0;d[0]==0;)b.V(d);c[--a]=d[0]}c[--a]=2;c[--a]=0;a=new l(c)}if(a==null)return null;a=this.M(a);if(a==null)return null;a=a.toString(16);return(a.length&1)==0?a:"0"+a} +ZZZ.prototype.M=Da;ZZZ.prototype.X=Ca;ZZZ.prototype.N=Ea;window.encrypt=function(b,a,c){var d=new ZZZ;d.X(c,a);b=d.N(b);d="";for(a=0;a+3<=b.length;a+=3){c=parseInt(b.substring(a,a+3),16);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c>>6)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c&63)}if(a+1==b.length){c=parseInt(b.substring(a,a+1),16);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c<<2)}else if(a+2==b.length){c=parseInt(b.substring(a,a+2),16);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(c>> +2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((c&3)<<4)}for(;(d.length&3)>0;)d+="=";return d}; + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/base64.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/base64.js new file mode 100644 index 00000000000..77b3868abf9 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/base64.js @@ -0,0 +1,73 @@ +// ==== File: base64.js +var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var b64pad="="; + +function hex2b64(h) { + var i; + var c; + var ret = ""; + for(i = 0; i+3 <= h.length; i+=3) { + c = parseInt(h.substring(i,i+3),16); + ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63); + } + if(i+1 == h.length) { + c = parseInt(h.substring(i,i+1),16); + ret += b64map.charAt(c << 2); + } + else if(i+2 == h.length) { + c = parseInt(h.substring(i,i+2),16); + ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4); + } + while((ret.length & 3) > 0) ret += b64pad; + return ret; +} + +// convert a base64 string to hex +function b64tohex(s) { + var ret = "" + var i; + var k = 0; // b64 state, 0-3 + var slop; + for(i = 0; i < s.length; ++i) { + if(s.charAt(i) == b64pad) break; + v = b64map.indexOf(s.charAt(i)); + if(v < 0) continue; + if(k == 0) { + ret += int2char(v >> 2); + slop = v & 3; + k = 1; + } + else if(k == 1) { + ret += int2char((slop << 2) | (v >> 4)); + slop = v & 0xf; + k = 2; + } + else if(k == 2) { + ret += int2char(slop); + ret += int2char(v >> 2); + slop = v & 3; + k = 3; + } + else { + ret += int2char((slop << 2) | (v >> 4)); + ret += int2char(v & 0xf); + k = 0; + } + } + if(k == 1) + ret += int2char(slop << 2); + return ret; +} + +// convert a base64 string to a byte/number array +function b64toBA(s) { + //piggyback on b64tohex for now, optimize later + var h = b64tohex(s); + var i; + var a = new Array(); + for(i = 0; 2*i < h.length; ++i) { + a[i] = parseInt(h.substring(2*i,2*i+2),16); + } + return a; +} + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/jsbn.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/jsbn.js new file mode 100644 index 00000000000..801841d7184 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/jsbn.js @@ -0,0 +1,562 @@ +// Downloaded from http://www-cs-students.stanford.edu/~tjw/ at Tue Nov 30 00:42:57 PST 2010 +// ==== File: jsbn.js +// Copyright (c) 2005 Tom Wu +// All Rights Reserved. +// See "LICENSE" for details. + +// Basic JavaScript BN library - subset useful for RSA encryption. + +// Bits per digit +var dbits; + +// JavaScript engine analysis +var canary = 0xdeadbeefcafe; +var j_lm = ((canary&0xffffff)==0xefcafe); + +// (public) Constructor +function BigInteger(a,b,c) { + if(a != null) + if("number" == typeof a) this.fromNumber(a,b,c); + else if(b == null && "string" != typeof a) this.fromString(a,256); + else this.fromString(a,b); +} + +// return new, unset BigInteger +function nbi() { return new BigInteger(null); } + +// am: Compute w_j += (x*this_i), propagate carries, +// c is initial carry, returns final carry. +// c < 3*dvalue, x < 2*dvalue, this_i < dvalue +// We need to select the fastest one that works in this environment. + +// am1: use a single mult and divide to get the high bits, +// max digit bits should be 26 because +// max internal value = 2*dvalue^2-2*dvalue (< 2^53) +function am1(i,x,w,j,c,n) { + while(--n >= 0) { + var v = x*this[i++]+w[j]+c; + c = Math.floor(v/0x4000000); + w[j++] = v&0x3ffffff; + } + return c; +} +// am2 avoids a big mult-and-extract completely. +// Max digit bits should be <= 30 because we do bitwise ops +// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) +function am2(i,x,w,j,c,n) { + var xl = x&0x7fff, xh = x>>15; + while(--n >= 0) { + var l = this[i]&0x7fff; + var h = this[i++]>>15; + var m = xh*l+h*xl; + l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); + c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); + w[j++] = l&0x3fffffff; + } + return c; +} +// Alternately, set max digit bits to 28 since some +// browsers slow down when dealing with 32-bit numbers. +function am3(i,x,w,j,c,n) { + var xl = x&0x3fff, xh = x>>14; + while(--n >= 0) { + var l = this[i]&0x3fff; + var h = this[i++]>>14; + var m = xh*l+h*xl; + l = xl*l+((m&0x3fff)<<14)+w[j]+c; + c = (l>>28)+(m>>14)+xh*h; + w[j++] = l&0xfffffff; + } + return c; +} +if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; +} +else if(j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; +} +else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; +} + +BigInteger.prototype.DB = dbits; +BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; + r.t = this.t; + r.s = this.s; +} + +// (protected) set from integer value x, -DV <= x < DV +function bnpFromInt(x) { + this.t = 1; + this.s = (x<0)?-1:0; + if(x > 0) this[0] = x; + else if(x < -1) this[0] = x+DV; + else this.t = 0; +} + +// return bigint initialized to value +function nbv(i) { var r = nbi(); r.fromInt(i); return r; } + +// (protected) set from string and radix +function bnpFromString(s,b) { + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 256) k = 8; // byte array + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else { this.fromRadix(s,b); return; } + this.t = 0; + this.s = 0; + var i = s.length, mi = false, sh = 0; + while(--i >= 0) { + var x = (k==8)?s[i]&0xff:intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if(sh == 0) + this[this.t++] = x; + else if(sh+k > this.DB) { + this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); + } + else + this[this.t-1] |= x<= this.DB) sh -= this.DB; + } + if(k == 8 && (s[0]&0x80) != 0) { + this.s = -1; + if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; +} + +// (public) return string representation in given radix +function bnToString(b) { + if(this.s < 0) return "-"+this.negate().toString(b); + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else return this.toRadix(b); + var km = (1< 0) { + if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } + while(i >= 0) { + if(p < k) { + d = (this[i]&((1<>(p+=this.DB-k); + } + else { + d = (this[i]>>(p-=k))&km; + if(p <= 0) { p += this.DB; --i; } + } + if(d > 0) m = true; + if(m) r += int2char(d); + } + } + return m?r:"0"; +} + +// (public) -this +function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } + +// (public) |this| +function bnAbs() { return (this.s<0)?this.negate():this; } + +// (public) return + if this > a, - if this < a, 0 if equal +function bnCompareTo(a) { + var r = this.s-a.s; + if(r != 0) return r; + var i = this.t; + r = i-a.t; + if(r != 0) return r; + while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; + return 0; +} + +// returns bit length of the integer x +function nbits(x) { + var r = 1, t; + if((t=x>>>16) != 0) { x = t; r += 16; } + if((t=x>>8) != 0) { x = t; r += 8; } + if((t=x>>4) != 0) { x = t; r += 4; } + if((t=x>>2) != 0) { x = t; r += 2; } + if((t=x>>1) != 0) { x = t; r += 1; } + return r; +} + +// (public) return the number of bits in "this" +function bnBitLength() { + if(this.t <= 0) return 0; + return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); +} + +// (protected) r = this << n*DB +function bnpDLShiftTo(n,r) { + var i; + for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; + for(i = n-1; i >= 0; --i) r[i] = 0; + r.t = this.t+n; + r.s = this.s; +} + +// (protected) r = this >> n*DB +function bnpDRShiftTo(n,r) { + for(var i = n; i < this.t; ++i) r[i-n] = this[i]; + r.t = Math.max(this.t-n,0); + r.s = this.s; +} + +// (protected) r = this << n +function bnpLShiftTo(n,r) { + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<= 0; --i) { + r[i+ds+1] = (this[i]>>cbs)|c; + c = (this[i]&bm)<= 0; --i) r[i] = 0; + r[ds] = c; + r.t = this.t+ds+1; + r.s = this.s; + r.clamp(); +} + +// (protected) r = this >> n +function bnpRShiftTo(n,r) { + r.s = this.s; + var ds = Math.floor(n/this.DB); + if(ds >= this.t) { r.t = 0; return; } + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<>bs; + for(var i = ds+1; i < this.t; ++i) { + r[i-ds-1] |= (this[i]&bm)<>bs; + } + if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; + } + if(a.t < this.t) { + c -= a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c -= a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = (c<0)?-1:0; + if(c < -1) r[i++] = this.DV+c; + else if(c > 0) r[i++] = c; + r.t = i; + r.clamp(); +} + +// (protected) r = this * a, r != this,a (HAC 14.12) +// "this" should be the larger one if appropriate. +function bnpMultiplyTo(a,r) { + var x = this.abs(), y = a.abs(); + var i = x.t; + r.t = i+y.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); + r.s = 0; + r.clamp(); + if(this.s != a.s) BigInteger.ZERO.subTo(r,r); +} + +// (protected) r = this^2, r != this (HAC 14.16) +function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2*x.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < x.t-1; ++i) { + var c = x.am(i,x[i],r,2*i,0,1); + if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { + r[i+x.t] -= x.DV; + r[i+x.t+1] = 1; + } + } + if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); + r.s = 0; + r.clamp(); +} + +// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) +// r != q, this != m. q or r may be null. +function bnpDivRemTo(m,q,r) { + var pm = m.abs(); + if(pm.t <= 0) return; + var pt = this.abs(); + if(pt.t < pm.t) { + if(q != null) q.fromInt(0); + if(r != null) this.copyTo(r); + return; + } + if(r == null) r = nbi(); + var y = nbi(), ts = this.s, ms = m.s; + var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus + if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } + else { pm.copyTo(y); pt.copyTo(r); } + var ys = y.t; + var y0 = y[ys-1]; + if(y0 == 0) return; + var yt = y0*(1<1)?y[ys-2]>>this.F2:0); + var d1 = this.FV/yt, d2 = (1<= 0) { + r[r.t++] = 1; + r.subTo(t,r); + } + BigInteger.ONE.dlShiftTo(ys,t); + t.subTo(y,y); // "negative" y so we can replace sub with am later + while(y.t < ys) y[y.t++] = 0; + while(--j >= 0) { + // Estimate quotient digit + var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); + if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out + y.dlShiftTo(j,t); + r.subTo(t,r); + while(r[i] < --qd) r.subTo(t,r); + } + } + if(q != null) { + r.drShiftTo(ys,q); + if(ts != ms) BigInteger.ZERO.subTo(q,q); + } + r.t = ys; + r.clamp(); + if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder + if(ts < 0) BigInteger.ZERO.subTo(r,r); +} + +// (public) this mod a +function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a,null,r); + if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); + return r; +} + +// Modular reduction using "classic" algorithm +function Classic(m) { this.m = m; } +function cConvert(x) { + if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; +} +function cRevert(x) { return x; } +function cReduce(x) { x.divRemTo(this.m,null,x); } +function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } +function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +Classic.prototype.convert = cConvert; +Classic.prototype.revert = cRevert; +Classic.prototype.reduce = cReduce; +Classic.prototype.mulTo = cMulTo; +Classic.prototype.sqrTo = cSqrTo; + +// (protected) return "-1/this % 2^DB"; useful for Mont. reduction +// justification: +// xy == 1 (mod m) +// xy = 1+km +// xy(2-xy) = (1+km)(1-km) +// x[y(2-xy)] = 1-k^2m^2 +// x[y(2-xy)] == 1 (mod m^2) +// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 +// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. +// JS multiply "overflows" differently from C/C++, so care is needed here. +function bnpInvDigit() { + if(this.t < 1) return 0; + var x = this[0]; + if((x&1) == 0) return 0; + var y = x&3; // y == 1/x mod 2^2 + y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 + y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 + y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y>0)?this.DV-y:-y; +} + +// Montgomery reduction +function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp&0x7fff; + this.mph = this.mp>>15; + this.um = (1<<(m.DB-15))-1; + this.mt2 = 2*m.t; +} + +// xR mod m +function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t,r); + r.divRemTo(this.m,null,r); + if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); + return r; +} + +// x/R mod m +function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; +} + +// x = x/R mod m (HAC 14.32) +function montReduce(x) { + while(x.t <= this.mt2) // pad x so am has enough room later + x[x.t++] = 0; + for(var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i]&0x7fff; + var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; + // use am to combine the multiply-shift-add into one call + j = i+this.m.t; + x[j] += this.m.am(0,u0,x,i,0,this.m.t); + // propagate carry + while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } + } + x.clamp(); + x.drShiftTo(this.m.t,x); + if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); +} + +// r = "x^2/R mod m"; x != r +function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +// r = "xy/R mod m"; x,y != r +function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + +Montgomery.prototype.convert = montConvert; +Montgomery.prototype.revert = montRevert; +Montgomery.prototype.reduce = montReduce; +Montgomery.prototype.mulTo = montMulTo; +Montgomery.prototype.sqrTo = montSqrTo; + +// (protected) true iff this is even +function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } + +// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) +function bnpExp(e,z) { + if(e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; + g.copyTo(r); + while(--i >= 0) { + z.sqrTo(r,r2); + if((e&(1< 0) z.mulTo(r2,g,r); + else { var t = r; r = r2; r2 = t; } + } + return z.revert(r); +} + +// (public) this^e % m, 0 <= e < 2^32 +function bnModPowInt(e,m) { + var z; + if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); + return this.exp(e,z); +} + +// protected +BigInteger.prototype.copyTo = bnpCopyTo; +BigInteger.prototype.fromInt = bnpFromInt; +BigInteger.prototype.fromString = bnpFromString; +BigInteger.prototype.clamp = bnpClamp; +BigInteger.prototype.dlShiftTo = bnpDLShiftTo; +BigInteger.prototype.drShiftTo = bnpDRShiftTo; +BigInteger.prototype.lShiftTo = bnpLShiftTo; +BigInteger.prototype.rShiftTo = bnpRShiftTo; +BigInteger.prototype.subTo = bnpSubTo; +BigInteger.prototype.multiplyTo = bnpMultiplyTo; +BigInteger.prototype.squareTo = bnpSquareTo; +BigInteger.prototype.divRemTo = bnpDivRemTo; +BigInteger.prototype.invDigit = bnpInvDigit; +BigInteger.prototype.isEven = bnpIsEven; +BigInteger.prototype.exp = bnpExp; + +// public +BigInteger.prototype.toString = bnToString; +BigInteger.prototype.negate = bnNegate; +BigInteger.prototype.abs = bnAbs; +BigInteger.prototype.compareTo = bnCompareTo; +BigInteger.prototype.bitLength = bnBitLength; +BigInteger.prototype.mod = bnMod; +BigInteger.prototype.modPowInt = bnModPowInt; + +// "constants" +BigInteger.ZERO = nbv(0); +BigInteger.ONE = nbv(1); + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/prng4.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/prng4.js new file mode 100644 index 00000000000..5cd681256c1 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/prng4.js @@ -0,0 +1,47 @@ +// ==== File: prng4.js +// prng4.js - uses Arcfour as a PRNG + +function Arcfour() { + this.i = 0; + this.j = 0; + this.S = new Array(); +} + +// Initialize arcfour context from key, an array of ints, each from [0..255] +function ARC4init(key) { + var i, j, t; + for(i = 0; i < 256; ++i) + this.S[i] = i; + j = 0; + for(i = 0; i < 256; ++i) { + j = (j + this.S[i] + key[i % key.length]) & 255; + t = this.S[i]; + this.S[i] = this.S[j]; + this.S[j] = t; + } + this.i = 0; + this.j = 0; +} + +function ARC4next() { + var t; + this.i = (this.i + 1) & 255; + this.j = (this.j + this.S[this.i]) & 255; + t = this.S[this.i]; + this.S[this.i] = this.S[this.j]; + this.S[this.j] = t; + return this.S[(t + this.S[this.i]) & 255]; +} + +Arcfour.prototype.init = ARC4init; +Arcfour.prototype.next = ARC4next; + +// Plug in your RNG constructor here +function prng_newstate() { + return new Arcfour(); +} + +// Pool size must be a multiple of 4 and greater than 32. +// An array of bytes the size of the pool will be passed to init() +var rng_psize = 256; + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/rng.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/rng.js new file mode 100644 index 00000000000..24bae0f8ec8 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/rng.js @@ -0,0 +1,70 @@ +// ==== File: rng.js +// Random number generator - requires a PRNG backend, e.g. prng4.js + +// For best results, put code like +// +// in your main HTML document. + +var rng_state; +var rng_pool; +var rng_pptr; + +// Mix in a 32-bit integer into the pool +function rng_seed_int(x) { + rng_pool[rng_pptr++] ^= x & 255; + rng_pool[rng_pptr++] ^= (x >> 8) & 255; + rng_pool[rng_pptr++] ^= (x >> 16) & 255; + rng_pool[rng_pptr++] ^= (x >> 24) & 255; + if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; +} + +// Mix in the current time (w/milliseconds) into the pool +function rng_seed_time() { + rng_seed_int(new Date().getTime()); +} + +// Initialize the pool with junk if needed. +if(rng_pool == null) { + rng_pool = new Array(); + rng_pptr = 0; + var t; + if(navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) { + // Extract entropy (256 bits) from NS4 RNG if available + var z = window.crypto.random(32); + for(t = 0; t < z.length; ++t) + rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; + } + while(rng_pptr < rng_psize) { // extract some randomness from Math.random() + t = Math.floor(65536 * Math.random()); + rng_pool[rng_pptr++] = t >>> 8; + rng_pool[rng_pptr++] = t & 255; + } + rng_pptr = 0; + rng_seed_time(); + //rng_seed_int(window.screenX); + //rng_seed_int(window.screenY); +} + +function rng_get_byte() { + if(rng_state == null) { + rng_seed_time(); + rng_state = prng_newstate(); + rng_state.init(rng_pool); + for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) + rng_pool[rng_pptr] = 0; + rng_pptr = 0; + //rng_pool = null; + } + // TODO: allow reseeding after first request + return rng_state.next(); +} + +function rng_get_bytes(ba) { + var i; + for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); +} + +function SecureRandom() {} + +SecureRandom.prototype.nextBytes = rng_get_bytes; + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/rsa.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/rsa.js new file mode 100644 index 00000000000..b2e37c35540 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/rstudio/rsa.js @@ -0,0 +1,114 @@ +// ==== File: rsa.js +// Depends on jsbn.js and rng.js + +// Version 1.1: support utf-8 encoding in pkcs1pad2 + +// convert a (hex) string to a bignum object +function parseBigInt(str,r) { + return new BigInteger(str,r); +} + +function linebrk(s,n) { + var ret = ""; + var i = 0; + while(i + n < s.length) { + ret += s.substring(i,i+n) + "\n"; + i += n; + } + return ret + s.substring(i,s.length); +} + +function byte2Hex(b) { + if(b < 0x10) + return "0" + b.toString(16); + else + return b.toString(16); +} + +// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint +function pkcs1pad2(s,n) { + if(n < s.length + 11) { // TODO: fix for utf-8 + alert("Message too long for RSA"); + return null; + } + var ba = new Array(); + var i = s.length - 1; + while(i >= 0 && n > 0) { + var c = s.charCodeAt(i--); + if(c < 128) { // encode using utf-8 + ba[--n] = c; + } + else if((c > 127) && (c < 2048)) { + ba[--n] = (c & 63) | 128; + ba[--n] = (c >> 6) | 192; + } + else { + ba[--n] = (c & 63) | 128; + ba[--n] = ((c >> 6) & 63) | 128; + ba[--n] = (c >> 12) | 224; + } + } + ba[--n] = 0; + var rng = new SecureRandom(); + var x = new Array(); + while(n > 2) { // random non-zero pad + x[0] = 0; + while(x[0] == 0) rng.nextBytes(x); + ba[--n] = x[0]; + } + ba[--n] = 2; + ba[--n] = 0; + return new BigInteger(ba); +} + +// "empty" RSA key constructor +function RSAKey() { + this.n = null; + this.e = 0; + this.d = null; + this.p = null; + this.q = null; + this.dmp1 = null; + this.dmq1 = null; + this.coeff = null; +} + +// Set the public key fields N and e from hex strings +function RSASetPublic(N,E) { + if(N != null && E != null && N.length > 0 && E.length > 0) { + this.n = parseBigInt(N,16); + this.e = parseInt(E,16); + } + else + alert("Invalid RSA public key"); +} + +// Perform raw public operation on "x": return x^e (mod n) +function RSADoPublic(x) { + return x.modPowInt(this.e, this.n); +} + +// Return the PKCS#1 RSA encryption of "text" as an even-length hex string +function RSAEncrypt(text) { + var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3); + if(m == null) return null; + var c = this.doPublic(m); + if(c == null) return null; + var h = c.toString(16); + if((h.length & 1) == 0) return h; else return "0" + h; +} + +// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string +//function RSAEncryptB64(text) { +// var h = this.encrypt(text); +// if(h) return hex2b64(h); else return null; +//} + +// protected +RSAKey.prototype.doPublic = RSADoPublic; + +// public +RSAKey.prototype.setPublic = RSASetPublic; +RSAKey.prototype.encrypt = RSAEncrypt; +//RSAKey.prototype.encrypt_b64 = RSAEncryptB64; + diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/base64.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/base64.js new file mode 100644 index 00000000000..ad53bb8ed06 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/base64.js @@ -0,0 +1,71 @@ +var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var b64padchar="="; + +function hex2b64(h) { + var i; + var c; + var ret = ""; + for(i = 0; i+3 <= h.length; i+=3) { + c = parseInt(h.substring(i,i+3),16); + ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63); + } + if(i+1 == h.length) { + c = parseInt(h.substring(i,i+1),16); + ret += b64map.charAt(c << 2); + } + else if(i+2 == h.length) { + c = parseInt(h.substring(i,i+2),16); + ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4); + } + while((ret.length & 3) > 0) ret += b64padchar; + return ret; +} + +// convert a base64 string to hex +function b64tohex(s) { + var ret = "" + var i; + var k = 0; // b64 state, 0-3 + var slop; + for(i = 0; i < s.length; ++i) { + if(s.charAt(i) == b64padchar) break; + v = b64map.indexOf(s.charAt(i)); + if(v < 0) continue; + if(k == 0) { + ret += int2char(v >> 2); + slop = v & 3; + k = 1; + } + else if(k == 1) { + ret += int2char((slop << 2) | (v >> 4)); + slop = v & 0xf; + k = 2; + } + else if(k == 2) { + ret += int2char(slop); + ret += int2char(v >> 2); + slop = v & 3; + k = 3; + } + else { + ret += int2char((slop << 2) | (v >> 4)); + ret += int2char(v & 0xf); + k = 0; + } + } + if(k == 1) + ret += int2char(slop << 2); + return ret; +} + +// convert a base64 string to a byte/number array +function b64toBA(s) { + //piggyback on b64tohex for now, optimize later + var h = b64tohex(s); + var i; + var a = new Array(); + for(i = 0; 2*i < h.length; ++i) { + a[i] = parseInt(h.substring(2*i,2*i+2),16); + } + return a; +} diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/jsbn.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/jsbn.js new file mode 100644 index 00000000000..4ed7c8362da --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/jsbn.js @@ -0,0 +1,559 @@ +// Copyright (c) 2005 Tom Wu +// All Rights Reserved. +// See "LICENSE" for details. + +// Basic JavaScript BN library - subset useful for RSA encryption. + +// Bits per digit +var dbits; + +// JavaScript engine analysis +var canary = 0xdeadbeefcafe; +var j_lm = ((canary&0xffffff)==0xefcafe); + +// (public) Constructor +function BigInteger(a,b,c) { + if(a != null) + if("number" == typeof a) this.fromNumber(a,b,c); + else if(b == null && "string" != typeof a) this.fromString(a,256); + else this.fromString(a,b); +} + +// return new, unset BigInteger +function nbi() { return new BigInteger(null); } + +// am: Compute w_j += (x*this_i), propagate carries, +// c is initial carry, returns final carry. +// c < 3*dvalue, x < 2*dvalue, this_i < dvalue +// We need to select the fastest one that works in this environment. + +// am1: use a single mult and divide to get the high bits, +// max digit bits should be 26 because +// max internal value = 2*dvalue^2-2*dvalue (< 2^53) +function am1(i,x,w,j,c,n) { + while(--n >= 0) { + var v = x*this[i++]+w[j]+c; + c = Math.floor(v/0x4000000); + w[j++] = v&0x3ffffff; + } + return c; +} +// am2 avoids a big mult-and-extract completely. +// Max digit bits should be <= 30 because we do bitwise ops +// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) +function am2(i,x,w,j,c,n) { + var xl = x&0x7fff, xh = x>>15; + while(--n >= 0) { + var l = this[i]&0x7fff; + var h = this[i++]>>15; + var m = xh*l+h*xl; + l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); + c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); + w[j++] = l&0x3fffffff; + } + return c; +} +// Alternately, set max digit bits to 28 since some +// browsers slow down when dealing with 32-bit numbers. +function am3(i,x,w,j,c,n) { + var xl = x&0x3fff, xh = x>>14; + while(--n >= 0) { + var l = this[i]&0x3fff; + var h = this[i++]>>14; + var m = xh*l+h*xl; + l = xl*l+((m&0x3fff)<<14)+w[j]+c; + c = (l>>28)+(m>>14)+xh*h; + w[j++] = l&0xfffffff; + } + return c; +} +if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; +} +else if(j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; +} +else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; +} + +BigInteger.prototype.DB = dbits; +BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; + r.t = this.t; + r.s = this.s; +} + +// (protected) set from integer value x, -DV <= x < DV +function bnpFromInt(x) { + this.t = 1; + this.s = (x<0)?-1:0; + if(x > 0) this[0] = x; + else if(x < -1) this[0] = x+this.DV; + else this.t = 0; +} + +// return bigint initialized to value +function nbv(i) { var r = nbi(); r.fromInt(i); return r; } + +// (protected) set from string and radix +function bnpFromString(s,b) { + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 256) k = 8; // byte array + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else { this.fromRadix(s,b); return; } + this.t = 0; + this.s = 0; + var i = s.length, mi = false, sh = 0; + while(--i >= 0) { + var x = (k==8)?s[i]&0xff:intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if(sh == 0) + this[this.t++] = x; + else if(sh+k > this.DB) { + this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); + } + else + this[this.t-1] |= x<= this.DB) sh -= this.DB; + } + if(k == 8 && (s[0]&0x80) != 0) { + this.s = -1; + if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; +} + +// (public) return string representation in given radix +function bnToString(b) { + if(this.s < 0) return "-"+this.negate().toString(b); + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else return this.toRadix(b); + var km = (1< 0) { + if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } + while(i >= 0) { + if(p < k) { + d = (this[i]&((1<>(p+=this.DB-k); + } + else { + d = (this[i]>>(p-=k))&km; + if(p <= 0) { p += this.DB; --i; } + } + if(d > 0) m = true; + if(m) r += int2char(d); + } + } + return m?r:"0"; +} + +// (public) -this +function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } + +// (public) |this| +function bnAbs() { return (this.s<0)?this.negate():this; } + +// (public) return + if this > a, - if this < a, 0 if equal +function bnCompareTo(a) { + var r = this.s-a.s; + if(r != 0) return r; + var i = this.t; + r = i-a.t; + if(r != 0) return (this.s<0)?-r:r; + while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; + return 0; +} + +// returns bit length of the integer x +function nbits(x) { + var r = 1, t; + if((t=x>>>16) != 0) { x = t; r += 16; } + if((t=x>>8) != 0) { x = t; r += 8; } + if((t=x>>4) != 0) { x = t; r += 4; } + if((t=x>>2) != 0) { x = t; r += 2; } + if((t=x>>1) != 0) { x = t; r += 1; } + return r; +} + +// (public) return the number of bits in "this" +function bnBitLength() { + if(this.t <= 0) return 0; + return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); +} + +// (protected) r = this << n*DB +function bnpDLShiftTo(n,r) { + var i; + for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; + for(i = n-1; i >= 0; --i) r[i] = 0; + r.t = this.t+n; + r.s = this.s; +} + +// (protected) r = this >> n*DB +function bnpDRShiftTo(n,r) { + for(var i = n; i < this.t; ++i) r[i-n] = this[i]; + r.t = Math.max(this.t-n,0); + r.s = this.s; +} + +// (protected) r = this << n +function bnpLShiftTo(n,r) { + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<= 0; --i) { + r[i+ds+1] = (this[i]>>cbs)|c; + c = (this[i]&bm)<= 0; --i) r[i] = 0; + r[ds] = c; + r.t = this.t+ds+1; + r.s = this.s; + r.clamp(); +} + +// (protected) r = this >> n +function bnpRShiftTo(n,r) { + r.s = this.s; + var ds = Math.floor(n/this.DB); + if(ds >= this.t) { r.t = 0; return; } + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<>bs; + for(var i = ds+1; i < this.t; ++i) { + r[i-ds-1] |= (this[i]&bm)<>bs; + } + if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; + } + if(a.t < this.t) { + c -= a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c -= a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = (c<0)?-1:0; + if(c < -1) r[i++] = this.DV+c; + else if(c > 0) r[i++] = c; + r.t = i; + r.clamp(); +} + +// (protected) r = this * a, r != this,a (HAC 14.12) +// "this" should be the larger one if appropriate. +function bnpMultiplyTo(a,r) { + var x = this.abs(), y = a.abs(); + var i = x.t; + r.t = i+y.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); + r.s = 0; + r.clamp(); + if(this.s != a.s) BigInteger.ZERO.subTo(r,r); +} + +// (protected) r = this^2, r != this (HAC 14.16) +function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2*x.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < x.t-1; ++i) { + var c = x.am(i,x[i],r,2*i,0,1); + if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { + r[i+x.t] -= x.DV; + r[i+x.t+1] = 1; + } + } + if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); + r.s = 0; + r.clamp(); +} + +// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) +// r != q, this != m. q or r may be null. +function bnpDivRemTo(m,q,r) { + var pm = m.abs(); + if(pm.t <= 0) return; + var pt = this.abs(); + if(pt.t < pm.t) { + if(q != null) q.fromInt(0); + if(r != null) this.copyTo(r); + return; + } + if(r == null) r = nbi(); + var y = nbi(), ts = this.s, ms = m.s; + var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus + if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } + else { pm.copyTo(y); pt.copyTo(r); } + var ys = y.t; + var y0 = y[ys-1]; + if(y0 == 0) return; + var yt = y0*(1<1)?y[ys-2]>>this.F2:0); + var d1 = this.FV/yt, d2 = (1<= 0) { + r[r.t++] = 1; + r.subTo(t,r); + } + BigInteger.ONE.dlShiftTo(ys,t); + t.subTo(y,y); // "negative" y so we can replace sub with am later + while(y.t < ys) y[y.t++] = 0; + while(--j >= 0) { + // Estimate quotient digit + var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); + if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out + y.dlShiftTo(j,t); + r.subTo(t,r); + while(r[i] < --qd) r.subTo(t,r); + } + } + if(q != null) { + r.drShiftTo(ys,q); + if(ts != ms) BigInteger.ZERO.subTo(q,q); + } + r.t = ys; + r.clamp(); + if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder + if(ts < 0) BigInteger.ZERO.subTo(r,r); +} + +// (public) this mod a +function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a,null,r); + if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); + return r; +} + +// Modular reduction using "classic" algorithm +function Classic(m) { this.m = m; } +function cConvert(x) { + if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; +} +function cRevert(x) { return x; } +function cReduce(x) { x.divRemTo(this.m,null,x); } +function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } +function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +Classic.prototype.convert = cConvert; +Classic.prototype.revert = cRevert; +Classic.prototype.reduce = cReduce; +Classic.prototype.mulTo = cMulTo; +Classic.prototype.sqrTo = cSqrTo; + +// (protected) return "-1/this % 2^DB"; useful for Mont. reduction +// justification: +// xy == 1 (mod m) +// xy = 1+km +// xy(2-xy) = (1+km)(1-km) +// x[y(2-xy)] = 1-k^2m^2 +// x[y(2-xy)] == 1 (mod m^2) +// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 +// should reduce x and y(2-xy) by m^2 at each step to keep size bounded. +// JS multiply "overflows" differently from C/C++, so care is needed here. +function bnpInvDigit() { + if(this.t < 1) return 0; + var x = this[0]; + if((x&1) == 0) return 0; + var y = x&3; // y == 1/x mod 2^2 + y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 + y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 + y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y>0)?this.DV-y:-y; +} + +// Montgomery reduction +function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp&0x7fff; + this.mph = this.mp>>15; + this.um = (1<<(m.DB-15))-1; + this.mt2 = 2*m.t; +} + +// xR mod m +function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t,r); + r.divRemTo(this.m,null,r); + if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); + return r; +} + +// x/R mod m +function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; +} + +// x = x/R mod m (HAC 14.32) +function montReduce(x) { + while(x.t <= this.mt2) // pad x so am has enough room later + x[x.t++] = 0; + for(var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i]&0x7fff; + var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; + // use am to combine the multiply-shift-add into one call + j = i+this.m.t; + x[j] += this.m.am(0,u0,x,i,0,this.m.t); + // propagate carry + while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } + } + x.clamp(); + x.drShiftTo(this.m.t,x); + if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); +} + +// r = "x^2/R mod m"; x != r +function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + +// r = "xy/R mod m"; x,y != r +function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + +Montgomery.prototype.convert = montConvert; +Montgomery.prototype.revert = montRevert; +Montgomery.prototype.reduce = montReduce; +Montgomery.prototype.mulTo = montMulTo; +Montgomery.prototype.sqrTo = montSqrTo; + +// (protected) true iff this is even +function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } + +// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) +function bnpExp(e,z) { + if(e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; + g.copyTo(r); + while(--i >= 0) { + z.sqrTo(r,r2); + if((e&(1< 0) z.mulTo(r2,g,r); + else { var t = r; r = r2; r2 = t; } + } + return z.revert(r); +} + +// (public) this^e % m, 0 <= e < 2^32 +function bnModPowInt(e,m) { + var z; + if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); + return this.exp(e,z); +} + +// protected +BigInteger.prototype.copyTo = bnpCopyTo; +BigInteger.prototype.fromInt = bnpFromInt; +BigInteger.prototype.fromString = bnpFromString; +BigInteger.prototype.clamp = bnpClamp; +BigInteger.prototype.dlShiftTo = bnpDLShiftTo; +BigInteger.prototype.drShiftTo = bnpDRShiftTo; +BigInteger.prototype.lShiftTo = bnpLShiftTo; +BigInteger.prototype.rShiftTo = bnpRShiftTo; +BigInteger.prototype.subTo = bnpSubTo; +BigInteger.prototype.multiplyTo = bnpMultiplyTo; +BigInteger.prototype.squareTo = bnpSquareTo; +BigInteger.prototype.divRemTo = bnpDivRemTo; +BigInteger.prototype.invDigit = bnpInvDigit; +BigInteger.prototype.isEven = bnpIsEven; +BigInteger.prototype.exp = bnpExp; + +// public +BigInteger.prototype.toString = bnToString; +BigInteger.prototype.negate = bnNegate; +BigInteger.prototype.abs = bnAbs; +BigInteger.prototype.compareTo = bnCompareTo; +BigInteger.prototype.bitLength = bnBitLength; +BigInteger.prototype.mod = bnMod; +BigInteger.prototype.modPowInt = bnModPowInt; + +// "constants" +BigInteger.ZERO = nbv(0); +BigInteger.ONE = nbv(1); diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/prng4.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/prng4.js new file mode 100644 index 00000000000..3034f3f1158 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/prng4.js @@ -0,0 +1,45 @@ +// prng4.js - uses Arcfour as a PRNG + +function Arcfour() { + this.i = 0; + this.j = 0; + this.S = new Array(); +} + +// Initialize arcfour context from key, an array of ints, each from [0..255] +function ARC4init(key) { + var i, j, t; + for(i = 0; i < 256; ++i) + this.S[i] = i; + j = 0; + for(i = 0; i < 256; ++i) { + j = (j + this.S[i] + key[i % key.length]) & 255; + t = this.S[i]; + this.S[i] = this.S[j]; + this.S[j] = t; + } + this.i = 0; + this.j = 0; +} + +function ARC4next() { + var t; + this.i = (this.i + 1) & 255; + this.j = (this.j + this.S[this.i]) & 255; + t = this.S[this.i]; + this.S[this.i] = this.S[this.j]; + this.S[this.j] = t; + return this.S[(t + this.S[this.i]) & 255]; +} + +Arcfour.prototype.init = ARC4init; +Arcfour.prototype.next = ARC4next; + +// Plug in your RNG constructor here +function prng_newstate() { + return new Arcfour(); +} + +// Pool size must be a multiple of 4 and greater than 32. +// An array of bytes the size of the pool will be passed to init() +var rng_psize = 256; diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/rng.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/rng.js new file mode 100644 index 00000000000..9db13825fb6 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/rng.js @@ -0,0 +1,75 @@ +// Random number generator - requires a PRNG backend, e.g. prng4.js + +// For best results, put code like +// +// in your main HTML document. + +var rng_state; +var rng_pool; +var rng_pptr; + +// Mix in a 32-bit integer into the pool +function rng_seed_int(x) { + rng_pool[rng_pptr++] ^= x & 255; + rng_pool[rng_pptr++] ^= (x >> 8) & 255; + rng_pool[rng_pptr++] ^= (x >> 16) & 255; + rng_pool[rng_pptr++] ^= (x >> 24) & 255; + if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; +} + +// Mix in the current time (w/milliseconds) into the pool +function rng_seed_time() { + rng_seed_int(new Date().getTime()); +} + +// Initialize the pool with junk if needed. +if(rng_pool == null) { + rng_pool = new Array(); + rng_pptr = 0; + var t; + if(window.crypto && window.crypto.getRandomValues) { + // Use webcrypto if available + var ua = new Uint8Array(32); + window.crypto.getRandomValues(ua); + for(t = 0; t < 32; ++t) + rng_pool[rng_pptr++] = ua[t]; + } + if(navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) { + // Extract entropy (256 bits) from NS4 RNG if available + var z = window.crypto.random(32); + for(t = 0; t < z.length; ++t) + rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; + } + while(rng_pptr < rng_psize) { // extract some randomness from Math.random() + t = Math.floor(65536 * Math.random()); + rng_pool[rng_pptr++] = t >>> 8; + rng_pool[rng_pptr++] = t & 255; + } + rng_pptr = 0; + rng_seed_time(); + //rng_seed_int(window.screenX); + //rng_seed_int(window.screenY); +} + +function rng_get_byte() { + if(rng_state == null) { + rng_seed_time(); + rng_state = prng_newstate(); + rng_state.init(rng_pool); + for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) + rng_pool[rng_pptr] = 0; + rng_pptr = 0; + //rng_pool = null; + } + // TODO: allow reseeding after first request + return rng_state.next(); +} + +function rng_get_bytes(ba) { + var i; + for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); +} + +function SecureRandom() {} + +SecureRandom.prototype.nextBytes = rng_get_bytes; diff --git a/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/rsa.js b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/rsa.js new file mode 100644 index 00000000000..9f8664037c4 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/crypto/wu/rsa.js @@ -0,0 +1,112 @@ +// Depends on jsbn.js and rng.js + +// Version 1.1: support utf-8 encoding in pkcs1pad2 + +// convert a (hex) string to a bignum object +function parseBigInt(str,r) { + return new BigInteger(str,r); +} + +function linebrk(s,n) { + var ret = ""; + var i = 0; + while(i + n < s.length) { + ret += s.substring(i,i+n) + "\n"; + i += n; + } + return ret + s.substring(i,s.length); +} + +function byte2Hex(b) { + if(b < 0x10) + return "0" + b.toString(16); + else + return b.toString(16); +} + +// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint +function pkcs1pad2(s,n) { + if(n < s.length + 11) { // TODO: fix for utf-8 + alert("Message too long for RSA"); + return null; + } + var ba = new Array(); + var i = s.length - 1; + while(i >= 0 && n > 0) { + var c = s.charCodeAt(i--); + if(c < 128) { // encode using utf-8 + ba[--n] = c; + } + else if((c > 127) && (c < 2048)) { + ba[--n] = (c & 63) | 128; + ba[--n] = (c >> 6) | 192; + } + else { + ba[--n] = (c & 63) | 128; + ba[--n] = ((c >> 6) & 63) | 128; + ba[--n] = (c >> 12) | 224; + } + } + ba[--n] = 0; + var rng = new SecureRandom(); + var x = new Array(); + while(n > 2) { // random non-zero pad + x[0] = 0; + while(x[0] == 0) rng.nextBytes(x); + ba[--n] = x[0]; + } + ba[--n] = 2; + ba[--n] = 0; + return new BigInteger(ba); +} + +// "empty" RSA key constructor +function RSAKey() { + this.n = null; + this.e = 0; + this.d = null; + this.p = null; + this.q = null; + this.dmp1 = null; + this.dmq1 = null; + this.coeff = null; +} + +// Set the public key fields N and e from hex strings +function RSASetPublic(N,E) { + if(N != null && E != null && N.length > 0 && E.length > 0) { + this.n = parseBigInt(N,16); + this.e = parseInt(E,16); + } + else + alert("Invalid RSA public key"); +} + +// Perform raw public operation on "x": return x^e (mod n) +function RSADoPublic(x) { + return x.modPowInt(this.e, this.n); +} + +// Return the PKCS#1 RSA encryption of "text" as an even-length hex string +function RSAEncrypt(text) { + var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3); + if(m == null) return null; + var c = this.doPublic(m); + if(c == null) return null; + var h = c.toString(16); + if((h.length & 1) == 0) return h; else return "0" + h; +} + +// Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string +//function RSAEncryptB64(text) { +// var h = this.encrypt(text); +// if(h) return hex2b64(h); else return null; +//} + +// protected +RSAKey.prototype.doPublic = RSADoPublic; + +// public +RSAKey.prototype.setPublic = RSASetPublic; +RSAKey.prototype.encrypt = RSAEncrypt; +//RSAKey.prototype.encrypt_b64 = RSAEncryptB64; diff --git a/config/plugins/interactive_environments/rstudio/static/js/rstudio.js b/config/plugins/interactive_environments/rstudio/static/js/rstudio.js new file mode 100644 index 00000000000..7229a2b5bed --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/static/js/rstudio.js @@ -0,0 +1,106 @@ +function message_failed_auth(password){ + toastr.info( + "Automatic authorization failed. You can manually login with:
" + password + "
More details ...", + "Please login manually", + {'closeButton': true, 'timeOut': 100000, 'tapToDismiss': false} + ); +} + +function message_failed_connection(){ + toastr.error( + "Could not connect to IPython Notebook. Please contact your administrator. More details ...", + "Security warning", + {'closeButton': true, 'timeOut': 20000, 'tapToDismiss': true} + ); +} + + +/** + * Load an interactive environment (IE) from a remote URL + * @param {String} password: password used to authenticate to the remote resource + * @param {String} notebook_login_url: URL that should be POSTed to for login + * @param {String} notebook_access_url: the URL embeded in the page and loaded + * + */ +function load_notebook(notebook_login_url, notebook_access_url, notebook_pubkey_url, username){ + $( document ).ready(function() { + // Test notebook_login_url for accessibility, executing the login+load function whenever + // we've successfully connected to the IE. + test_ie_availability(notebook_pubkey_url, function(){ + var payload = username + "\n" + ie_password; + $.ajax({ + type: 'GET', + url: notebook_pubkey_url, + xhrFields: { + withCredentials: true + }, + success: function(response_text){ + var chunks = response_text.split(':', 2); + var exp = chunks[0]; + var mod = chunks[1]; + console.log("Found " + exp +" and " + mod); + var rsa = new RSAKey(); + rsa.setPublic(mod, exp); + console.log("Encrypting '" + username + "', '" + ie_password + "'"); + var enc_hex = rsa.encrypt(payload); + var encrypted = hex2b64(enc_hex); + console.log("E: " + encrypted); + _handle_notebook_loading(encrypted, notebook_login_url, notebook_access_url); + } + }); + + }); + }); +} + +/** + * Must be implemented by IEs + */ +function _handle_notebook_loading(password, notebook_login_url, notebook_access_url){ + if ( ie_password_auth ) { + $.ajax({ + type: "POST", + // to the Login URL + url: notebook_login_url, + // With our password + data: { + 'v': password, + 'persist': 1, + 'clientPath': '/rstudio/auth-sign-in', + 'appUri': '', + }, + contentType: "application/x-www-form-urlencoded", + xhrFields: { + withCredentials: true + }, + // If that is successful, load the notebook + success: function(){ + append_notebook(notebook_access_url); + }, + error: function(jqxhr, status, error){ + if(ie_password_auth && !ie_apache_urls){ + // Failure now happens because the redirect that RStudio gives us includes the + // port internal to nginx. (E.g. localhost:NNNN/rstudio/NNNN/) + // so disabling the message here makes sense as long as it's working correctly + // + // Additionally: + // XMLHttpRequest cannot load http://localhost:46725/rstudio/46725/. The + // 'Access-Control-Allow-Origin' header has a value 'http://localhost:8081' that + // is not equal to the supplied origin. Origin 'null' is therefore not allowed + // access. + // message_failed_auth(ie_password); + append_notebook(notebook_access_url); + }else{ + message_failed_connection(); + // Do we want to try and load the notebook anyway? Just in case? + append_notebook(notebook_access_url); + } + } + }); + } + else { + // Not using password auth, just embed it to avoid content-origin issues. + message_no_auth(); + append_notebook(notebook_access_url); + } +} diff --git a/config/plugins/interactive_environments/rstudio/templates/rstudio.mako b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako new file mode 100644 index 00000000000..0fc4d2a4ba2 --- /dev/null +++ b/config/plugins/interactive_environments/rstudio/templates/rstudio.mako @@ -0,0 +1,67 @@ +<%namespace file="ie.mako" name="ie"/> +<% +import os +import shutil +import time + +# Sets ID and sets up a lot of other variables +ie_request.load_deploy_config() +ie_request.attr.docker_port = 80 +# Create tempdir in galaxy +temp_dir = ie_request.temp_dir +PASSWORD = ie_request.notebook_pw +USERNAME = "galaxy" + +## General IE specific +# Access URLs for the notebook from within galaxy. +# TODO: Make this work without pointing directly to IE. Currently does not work +# through proxy. +notebook_pubkey_url = ie_request.url_template('${PROXY_URL}/rstudio/${PORT}/auth-public-key') +notebook_access_url = ie_request.url_template('${PROXY_URL}/rstudio/${PORT}/') +notebook_login_url = ie_request.url_template('${PROXY_URL}/rstudio/${PORT}/auth-do-sign-in') + +# Did the user give us an RData file? +if hda.datatype.__class__.__name__ == "RData": + shutil.copy( hda.file_name, os.path.join(temp_dir, '.RData') ) + +ie_request.launch(env_override={ + 'notebook_username': USERNAME, + 'notebook_password': PASSWORD, + 'cors_origin': ie_request.attr.proxy_url, +}) +%> + + +${ ie.load_default_js() } + + + +
+
+ + diff --git a/config/plugins/visualizations/README.txt b/config/plugins/visualizations/README.txt index 5722c2dc573..07ca615cd1e 100644 --- a/config/plugins/visualizations/README.txt +++ b/config/plugins/visualizations/README.txt @@ -8,9 +8,6 @@ Properly configured and written visualizations will be accessible to the user when they click the 'visualizations' icon for a dataset in their history panel. -The framework must be enabled in your 'galaxy.ini' file by uncommenting (and -having a valid path for) the 'visualizations_plugin_directory' entry. - For more information, see http://wiki.galaxyproject.org/VisualizationsRegistry diff --git a/display_applications/igv/bam.xml b/display_applications/igv/bam.xml index 275e6aa16ef..be1758c870a 100644 --- a/display_applications/igv/bam.xml +++ b/display_applications/igv/bam.xml @@ -85,9 +85,9 @@ #if $site_id.startswith( 'local_' ) - ${site_link}?file=${bam_file.qp}&genome=${site_organism}&merge=true&name=${qp( $bam_file.name )} + ${site_link}?file=${bam_file.qp}&genome=${site_organism}&merge=true&name=${qp( ( $bam_file.name or $DATASET_HASH ).replace( ',', ';' ) )} #elif $site_id.startswith( 'web_link_' ): - ${site_link}?sessionURL=${bam_file.qp}&genome=${site_organism}&merge=true&name=${qp( $bam_file.name )} + ${site_link}?sessionURL=${bam_file.qp}&genome=${site_organism}&merge=true&name=${qp( ( $bam_file.name or $DATASET_HASH ).replace( ',', ';' ) )} #else: ${jnlp.url} #end if @@ -101,7 +101,7 @@ ${ $dataset.dbkey == $value } - http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bam_file.qp}&genome=${bam_file.dbkey}&merge=true&name=${qp( $bam_file.name )} + http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bam_file.qp}&genome=${bam_file.dbkey}&merge=true&name=${qp( ( $bam_file.name or $DATASET_HASH ).replace( ',', ';' ) )} diff --git a/display_applications/igv/gff.xml b/display_applications/igv/gff.xml index 57e60bbadc4..d23c4274e53 100644 --- a/display_applications/igv/gff.xml +++ b/display_applications/igv/gff.xml @@ -84,9 +84,9 @@ #if $site_id.startswith( 'local_' ) - ${site_link}?file=${gff_file.qp}&genome=${site_organism}&merge=true&name=${qp( $gff_file.name )} + ${site_link}?file=${gff_file.qp}&genome=${site_organism}&merge=true&name=${qp( ( $gff_file.name or $DATASET_HASH ).replace( ',', ';' ) )} #elif $site_id.startswith( 'web_link_' ): - ${site_link}?sessionURL=${gff_file.qp}&genome=${site_organism}&merge=true&name=${qp( $gff_file.name )} + ${site_link}?sessionURL=${gff_file.qp}&genome=${site_organism}&merge=true&name=${qp( ( $gff_file.name or $DATASET_HASH ).replace( ',', ';' ) )} #else: ${jnlp.url} #end if @@ -100,7 +100,7 @@ ${ $dataset.dbkey == $value } - http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${gff_file.qp}&genome=${gff_file.dbkey}&merge=true&name=${qp( $gff_file.name )} + http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${gff_file.qp}&genome=${gff_file.dbkey}&merge=true&name=${qp( ( $gff_file.name or $DATASET_HASH ).replace( ',', ';' ) )} diff --git a/display_applications/igv/interval_as_bed.xml b/display_applications/igv/interval_as_bed.xml new file mode 100644 index 00000000000..302c6f0fa17 --- /dev/null +++ b/display_applications/igv/interval_as_bed.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + ${$site_id.startswith( 'local_' ) or $dataset.dbkey in $site_dbkeys} + + + ${redirect_url} + + + + #if ($dataset.dbkey in $site_dbkeys) + $site_organisms[ $site_dbkeys.index( $bed_file.dbkey ) ] + #else: + $bed_file.dbkey + #end if + + + <?xml version="1.0" encoding="utf-8"?> +<jnlp + spec="1.0+" + codebase="${site_link}"> + <information> + <title>IGV 1.5</title> + <vendor>The Broad Institute</vendor> + <homepage href="http://www.broadinstitute.org/igv"/> + <description>IGV Software</description> + <description kind="short">IGV</description> + </information> + <security> + <all-permissions/> + </security> + <resources> + +<j2se version="1.5+" initial-heap-size="256m" max-heap-size="1100m"/> + <jar href="igv.jar" download="eager" main="true"/> + <jar href="batik-codec.jar" download="eager"/> + <property name="apple.laf.useScreenMenuBar" value="true"/> + <property name="com.apple.mrj.application.growbox.intrudes" value="false"/> + <property name="com.apple.mrj.application.live-resize" value="true"/> + <property name="com.apple.macos.smallTabs" value="true"/> + </resources> + + <resources os="Mac" arch="i386"> + <property name="apple.awt.graphics.UseQuartz" value="false"/> + <nativelib href="hdfnative-macintel.jar"/> + </resources> + + <resources os="Mac" arch="ppc"> + <property name="apple.awt.graphics.UseQuartz" value="false"/> + <nativelib href="hdfnative-macppc.jar"/> + </resources> + + <resources os="Mac" arch="PowerPC"> + <property name="apple.awt.graphics.UseQuartz" value="false"/> + <nativelib href="hdfnative-macppc.jar"/> + </resources> + + <resources os="Windows"> + <property name="sun.java2d.noddraw" value="true"/> + <nativelib href="hdfnative-win.jar"/> + </resources> + + <resources os="Linux"> + <nativelib href="hdfnative-linux64.jar"/> + </resources> + + <application-desc main-class="org.broad.igv.ui.IGVMainFrame"> + <argument>-g</argument> + <argument>${site_organism}</argument> + <argument>${bed_file.url}</argument> + </application-desc> +</jnlp> + + + #if $site_id.startswith( 'local_' ) + ${site_link}?file=${bed_file.qp}&genome=${site_organism}&merge=true&name=${qp( ( $bed_file.name or $DATASET_HASH ).replace( ',', ';' ) )} + #elif $site_id.startswith( 'web_link_' ): + ${site_link}?sessionURL=${bed_file.qp}&genome=${site_organism}&merge=true&name=${qp( ( $bed_file.name or $DATASET_HASH ).replace( ',', ';' ) )} + #else: + ${jnlp.url} + #end if + + + + + + + + ${ $dataset.dbkey == $value } + + + http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bed_file.qp}&genome=${bed_file.dbkey}&merge=true&name=${qp( ( $bed_file.name or $DATASET_HASH ).replace( ',', ';' ) )} + + + + + + + diff --git a/display_applications/igv/vcf.xml b/display_applications/igv/vcf.xml index 00321d22e77..28c76f25d46 100644 --- a/display_applications/igv/vcf.xml +++ b/display_applications/igv/vcf.xml @@ -85,9 +85,9 @@ #if $site_id.startswith( 'local_' ) - ${site_link}?file=${bgzip_file.qp}&genome=${site_organism}&merge=true&name=${qp( $bgzip_file.name )} + ${site_link}?file=${bgzip_file.qp}&genome=${site_organism}&merge=true&name=${qp( ( $bgzip_file.name or $DATASET_HASH ).replace( ',', ';' ) )} #elif $site_id.startswith( 'web_link_' ): - ${site_link}?sessionURL=${bgzip_file.qp}&genome=${site_organism}&merge=true&name=${qp( $bgzip_file.name )} + ${site_link}?sessionURL=${bgzip_file.qp}&genome=${site_organism}&merge=true&name=${qp( ( $bgzip_file.name or $DATASET_HASH ).replace( ',', ';' ) )} #else: ${jnlp.url} #end if @@ -101,7 +101,7 @@ ${ $dataset.dbkey == $value } - http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bgzip_file.qp}&genome=$bgzip_file.dbkey&merge=true&name=${qp( $bgzip_file.name )} + http://www.broadinstitute.org/igv/projects/current/igv.php?sessionURL=${bgzip_file.qp}&genome=$bgzip_file.dbkey&merge=true&name=${qp( ( $bgzip_file.name or $DATASET_HASH ).replace( ',', ';' ) )} diff --git a/doc/source/_static/style.css b/doc/source/_static/style.css new file mode 100644 index 00000000000..ae29519975b --- /dev/null +++ b/doc/source/_static/style.css @@ -0,0 +1,3 @@ +div.floatright { + float: right; +} diff --git a/doc/source/_templates/layout.html b/doc/source/_templates/layout.html new file mode 100644 index 00000000000..324da72b53b --- /dev/null +++ b/doc/source/_templates/layout.html @@ -0,0 +1,5 @@ +{# layout.html #} +{# Import the theme's layout. #} +{% extends "!layout.html" %} + +{% set css_files = css_files + ['_static/style.css'] %} diff --git a/doc/source/index.rst b/doc/source/index.rst index 52e5032c8a1..02142d04c86 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -46,6 +46,8 @@ Contents Application Documentation + Releases + Indices and tables ================== diff --git a/doc/source/releases/13.01_announce.rst b/doc/source/releases/13.01_announce.rst new file mode 100644 index 00000000000..1f6ad49c71c --- /dev/null +++ b/doc/source/releases/13.01_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +January 2013 Galaxy Release (v 13.01) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_01_11_DistributionNewsBrief + +.. include:: _thanks.rst diff --git a/doc/source/releases/13.02_announce.rst b/doc/source/releases/13.02_announce.rst new file mode 100644 index 00000000000..09a67d50e33 --- /dev/null +++ b/doc/source/releases/13.02_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +February 2013 Galaxy Release (v 13.02) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_02_08_GalaxyNewsBrief + +.. include:: _thanks.rst diff --git a/doc/source/releases/13.04_announce.rst b/doc/source/releases/13.04_announce.rst new file mode 100644 index 00000000000..e2f93782b34 --- /dev/null +++ b/doc/source/releases/13.04_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +April 2013 Galaxy Release (v 13.04) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_04_01_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/13.06_announce.rst b/doc/source/releases/13.06_announce.rst new file mode 100644 index 00000000000..58afa3846a1 --- /dev/null +++ b/doc/source/releases/13.06_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +June 2013 Galaxy Release (v 13.06) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_06_03_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/13.08_announce.rst b/doc/source/releases/13.08_announce.rst new file mode 100644 index 00000000000..44c8ad154fc --- /dev/null +++ b/doc/source/releases/13.08_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +August 2013 Galaxy Release (v 13.08) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_08_12_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/13.11_announce.rst b/doc/source/releases/13.11_announce.rst new file mode 100644 index 00000000000..4fb4c7c48ba --- /dev/null +++ b/doc/source/releases/13.11_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +November 2013 Galaxy Release (v 13.11) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2013_11_04_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/14.02_announce.rst b/doc/source/releases/14.02_announce.rst new file mode 100644 index 00000000000..94462d732b6 --- /dev/null +++ b/doc/source/releases/14.02_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +February 2014 Galaxy Release (v 14.02) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_02_10_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/14.04_announce.rst b/doc/source/releases/14.04_announce.rst new file mode 100644 index 00000000000..22e02c8993e --- /dev/null +++ b/doc/source/releases/14.04_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +April 2014 Galaxy Release (v 14.04) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_04_14_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/14.06_announce.rst b/doc/source/releases/14.06_announce.rst new file mode 100644 index 00000000000..5b690ef3d60 --- /dev/null +++ b/doc/source/releases/14.06_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +June 2014 Galaxy Release (v 14.06) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_06_02_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/14.08_announce.rst b/doc/source/releases/14.08_announce.rst new file mode 100644 index 00000000000..7052e85c8f1 --- /dev/null +++ b/doc/source/releases/14.08_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +August 2014 Galaxy Release (v 14.08) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_08_11_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/14.10_announce.rst b/doc/source/releases/14.10_announce.rst new file mode 100644 index 00000000000..e6aaf567d39 --- /dev/null +++ b/doc/source/releases/14.10_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +October 2014 Galaxy Release (v 14.10) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2014_10_06_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/15.01_announce.rst b/doc/source/releases/15.01_announce.rst new file mode 100644 index 00000000000..f670f3ced21 --- /dev/null +++ b/doc/source/releases/15.01_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +January 2015 Galaxy Release (v 15.01) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2015_01_13_Galaxy_Distribution + +.. include:: _thanks.rst diff --git a/doc/source/releases/15.03_announce.rst b/doc/source/releases/15.03_announce.rst new file mode 100644 index 00000000000..7206175f6a1 --- /dev/null +++ b/doc/source/releases/15.03_announce.rst @@ -0,0 +1,11 @@ +=========================================================== +March 2015 Galaxy Release (v 15.03) +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/News/2015_03_GalaxyRelease + +.. include:: _thanks.rst diff --git a/doc/source/releases/15.05.rst b/doc/source/releases/15.05.rst new file mode 100644 index 00000000000..7e5aea7fbdb --- /dev/null +++ b/doc/source/releases/15.05.rst @@ -0,0 +1,358 @@ +.. to_doc + +------------------------------- +15.05 +------------------------------- + +.. enhancements + +Enhancements +------------------------------- + +.. starthighlight +* Pluggable framework to custom authentication (including new LDAP/Active + Directory integration). Thanks to many including Andrew Robinson, + Nicola Soranzo, and David Trudgian. `Pull Request 1`_, `Pull Request 33`_, + `Pull Request 51`_, `Pull Request 75`_, `Pull Request 98`_, + `Pull Request 216`_ +* Implement a new ``section`` tag for tool parameters. `Pull Request 35`_, + `Trello `__ +* New UI widgets allowing much more flexibility when creating simple dataset + pair and list collections. `Pull Request 134`_, + `Trello `__ +.. endhighlight +* Improved JavaScript build system for client code and libraries (now + using uglify_ and featuring `Source Maps`_). 72c876c_, 9a7f5fc_, 648a623_, + 22f280f_, `Trello `__ +* Add an `External Display Application`_ for viewing GFF/GTF files with IGV_. + `Pull Request 70`_, `Trello `__ +* Use TravisCI_ and Tox_ for continuous integration testing. + `Pull Request 40`_, `Pull Request 62`_, `Pull Request 97`_, + `Pull Request 99`_, `Pull Request 123`_, `Pull Request 222`_, + `Pull Request 235`_, +* Infrastructure for improved toolbox and Tool Shed searching. + `Pull Request 9`_, `Pull Request 116`_, `Pull Request 142`_, + `Pull Request 226`_, c2eb74c_, 2bf52fe_, ec549db_, + `Trello `__, `Trello `__ +* Enhance UI to allow renaming dataset collections. 21d1d6b_ +* Improve highlighting of current/active content history panel. + `Pull Request 126`_ +* Improvements to UI and API for histories and collections. e36e51e_, + 1e55206_, 0c79680_ +* Update history dataset API to account for job re-submission. b4cf49a_ +* Allow recalculating user disk usage from the admin interface. 964e081_ +* Collect significantly more metadata for BAM files. `Pull Request 107`_, + `Pull Request 108`_ +* Implement ``detect_errors`` attribute on command of tool XML. + `Pull Request 117`_ +* Allow setting ``auto_format="True"`` on tool ``output`` tags. + `Pull Request 130`_ +* Allow testing tool outputs based on MD5 hashes. `Pull Request 125`_ +* Improved Cheetah type casting for int/float values. `Pull Request 121`_ +* Add option to pass arbitrary parameters to gem install as part of + the tool shed ``setup_ruby_environment`` Tool Shed install action - + thanks to Björn Grüning. `Pull Request 118`_ +* Add ``argument`` attribute to tool parameters. `Pull Request 8`_ +* Improve link and message that appears after workflows are run. + `Pull Request 143`_ +* Add NCBI SRA datatype - thanks to Matt Shirley. `Pull Request 87`_ +* Stronger toolbox filtering. `Pull Request 119`_ +* Allow updating Tool Shed repositories via the API - thanks to Eric Rasche. + `Pull Request 30`_ +* Expose category list in show call for Tool Shed repositories - thanks to + Eric Rasche. `Pull Request 29`_ +* Add API endpoint to create Tool Shed repositories. `Pull Request 2`_ +* Do not configure Galaxy to use the test Tool Shed by default. + `Pull Request 38`_ +* Add fields and improve display of Tool Shed repositories. + a24e206_, d6d61bc_, `Trello `__ +* Enhance multi-selection widgets to allow key combinations ``Ctrl-A`` + and ``Ctrl-X``. e8564d7_, `Trello `__ +* New, consistent button for displaying citation BibTeX. `Pull Request 19`_ +* Improved ``README`` reflecting move to Github - thanks in part to Eric + Rasche. `PR #2 (old repo) + `__, + 226e826_, 2650d09_, 7d5dde8_ +* Update application to use new logo. 2748f9d_, `Pull Request 187`_, + `Pull Request 206`_ +* Update many documentation links to use https sites - thanks to + Nicola Soranzo. 8254cab_ +* Sync report options config with ``galaxy.ini`` - thanks to Björn Grüning. + `Pull Request 12`_ +* Eliminate need to use API key to list tools via API. cd7abe8_ +* Restore function necessary for splitting sequence datatypes - thanks to + Roberto Alonso. `Pull Request 5`_ +* Suppress filenames in SAM merge using ``egrep`` - thanks to Peter Cock + and Roberto Alonso. `Pull Request 4`_ +* Option to sort counts in ``Count1`` tool (``tools/filters/uniq.xml``) - + thanks to Peter Cock. `Pull Request 16`_ +* Preserve spaces in ``Count1`` tool (``tools/filters/uniq.xml``) - thanks to + Peter Cock. `Pull Request 13`_ +* `Interactive Environments`_ improvements and fixes from multiple + developers including Eric Rasche and Björn Grüning. `Pull Request 69`_, + `Pull Request 73`_, `Pull Request 131`_, `Pull Request 135`_, + `Pull Request 152`_, `Pull Request 197`_ +* Enable multi-part upload for exporting files with the GenomeSpace export + tool. `Pull Request 74`_, `Trello `__ +* Large refactoring, expansion, and increase in test coverage for "managers". + `Pull Request 76`_ +* Improved display of headers in tool help. 157eba6_, + `Biostar `__ +* Uniform configuration of "From" field for sent emails - thanks to Nicola + Soranzo. `Pull Request 23`_ +* Allow setting ``job_conf.xml`` params via environment variables & + ``galaxy.ini``. dde2fc9_ +* Allow a tool data table to declare that duplicate entries are not + allowed. `Pull Request 245`_ +* Add verbose test error flag option in run_tests.sh. 62f0495_ +* Update ``.gitignore`` to include ``run_api_tests.html``. b52cc98_ +* Add experimental options to run tests in Docker. e99adb5_ +* Improve ``run_test.sh --help`` documentation to detail running specific + tests. `Pull Request 86`_ +* Remove older, redundant history tests. `Pull Request 120`_, + `Trello `__ +* Add test tool demonstrating citing a Github repository. 65def71_ +* Add option to track all automated changes to the integrated tool panel. + 10bb492_ +* Make tool version explicit in all distribution tool - thanks to Peter Cock. + `Pull Request 14`_. +* Relocate the external metadata setting script. `Pull Request 7`_ +* Parameterize script used to pull new builds from the UCSC Browser. + e4e5df0_ +* Enhance jobs and workflow logging to report timings. 06346a4_ +* Add debug message for dynamic options exceptions. `Pull Request 91`_ +* Remove demo sequencer app. 3af3bf5_ +* Tweaks to the Pulsar's handling of async messages. `Pull Request 109`_ +* Return more specific API authentication errors. 71a64ca_ +* Upgrade Python dependency sqlalchemy to 1.0.0. d725aab_, `Pull Request 129`_ +* Upgrade Python dependency amqp to 1.4.6. `Pull Request 128`_ +* Upgrade Python dependency kombu to 3.0.24. `Pull Request 128`_ +* Upgrade JavaScript dependency raven.js to 1.1.17. bcd1701_ + +.. fixes + +Fixes +------------------------------- + +* During the 15.05 development cycle dozens of fixes were pushed to the + ``release_15.03`` branch of Galaxy. These are all included in 15.05 and + summarized `here + `__ + (with special thanks to Björn Grüning and Marius van den Beek). +* Fix race condition that would occasionally prevent Galaxy from starting + properly. `Pull Request 198`_, `Trello `__ +* Fix scatter plot API communications for certain proxied Galaxy instances - + thanks to @yhoogstrate. `Pull Request 89`_ +* Fix bug in collectl_ job metrics plugin - thanks to Carrie Ganote. + `Pull Request 231`_ +* Fix late validation of tool parameters. `Pull Request 115`_ +* Fix ``fasta_to_tabular_converter.py`` (for implicit conversion) - thanks to + Peter Cock. `Pull Request 11`_ +* Fix to eliminate race condition by collecting extra files before declaring + dataset's OK. `Pull Request 48`_ +* Fix setting current history for certain proxied Galaxy instances - thanks + to @wezen. 6946e46_. +* Fix typo in tool failure testing example - thanks to Peter Cock. + `Pull Request 18`_. +* Fix Galaxy to default to using SSL for communicating with Tool Sheds. + 0b037a2_ +* Fix data source tools to open in ``_top`` window. + `Pull Request 17`_ +* Fix to fallback to name for tool parameters without labels. + `Pull Request 189`_, `Trello `__ +* Fix to remove redundant version ids in tool version selector. + `Pull Request 244`_ +* Fix for downloading metadata files. `Pull Request 234`_ +* Fix for history failing to render if it contains more exotic dataset + collection types. `Pull Request 196`_ +* Fixes for BaseURLToolParameter. `Pull Request 247`_ +* Fix to suppress pysam binary incompatibility warning when using datatypes + in ``binary.py``. `Pull Request 252`_ +* Fix for library UI duplication bug. `Pull Request 179`_ +* Fix for `Backbone.js`_ loading as AMD_. 4e5218f_ +* Other small Tool Shed fixes. 815f86f_, 76e0915_ +* Fix file closing in ``lped_to_pbed_converter``. 182b67f_ +* Fix undefined variables in Tool Shed ``add_repository_entry`` API script. + 47e6f08_ +* Fix user registration to respect use_panels when in the Galaxy app. + 7ac8631_, `Trello `__ +* Fix bug in scramble exception, incorrect reference to source_path 79d50d8_ +* Fix error handling in ``pbed_to_lped``. 7aecd7a_ +* Fix error handling in Tool Shed step handler for ``chmod`` action. 1454396_ +* Fix ``__safe_string_wrapper`` in tool evaluation object_wrapper. ab6f13e_ +* Fixes for data types and data providers. c1d2d1f_, 8da70bb_, 0b83b1e_ +* Fixes for Tool Shed commit and mercurial handling modules. 6102edf_, + b639bc0_, debea9d_ +* Fix to clean working directory during job re-submission. `Pull Request 236`_ +* Fix bug when task splitting jobs fail. `Pull Request 214`_ +* Fix some minor typos in comment docs in ``config/galaxy.ini.sample``. + `Pull Request 210`_ +* Fix admin disk usage message. `Pull Request 205`_, + `Trello `__ +* Fix to sessionStorage Model to suppress QUOTA DOMExceptions when Safari + users are in private browsing mode. 0c94f04_ + +.. _IGV: https://www.broadinstitute.org/igv/ +.. _External Display Application: https://wiki.galaxyproject.org/Admin/Tools/External%20Display%20Applications%20Tutorial +.. _Interactive Environments: https://wiki.galaxyproject.org/Admin/IEs +.. _TravisCI: https://travis-ci.org/ +.. _Tox: https://testrun.org/tox/latest/ +.. _Source Maps: https://developer.chrome.com/devtools/docs/javascript-debugging#source-maps +.. _uglify: https://developer.chrome.com/devtools/docs/javascript-debugging#source-maps +.. _collectl: http://collectl.sourceforge.net/ +.. _Backbone.js: http://backbonejs.org/ +.. _AMD: http://requirejs.org/docs/whyamd.html + +.. github_links +.. _Pull Request 129: https://github.com/galaxyproject/galaxy/pull/129 +.. _Pull Request 128: https://github.com/galaxyproject/galaxy/pull/128 +.. _Pull Request 2: https://github.com/galaxyproject/galaxy/pull/2 +.. _Pull Request 247: https://github.com/galaxyproject/galaxy/pull/247 +.. _Pull Request 252: https://github.com/galaxyproject/galaxy/pull/252 +.. _Pull Request 245: https://github.com/galaxyproject/galaxy/pull/245 +.. _Pull Request 244: https://github.com/galaxyproject/galaxy/pull/244 +.. _Pull Request 236: https://github.com/galaxyproject/galaxy/pull/236 +.. _Pull Request 235: https://github.com/galaxyproject/galaxy/pull/235 +.. _Pull Request 222: https://github.com/galaxyproject/galaxy/pull/222 +.. _Pull Request 234: https://github.com/galaxyproject/galaxy/pull/234 +.. _Pull Request 231: https://github.com/galaxyproject/galaxy/pull/231 +.. _Pull Request 226: https://github.com/galaxyproject/galaxy/pull/226 +.. _Pull Request 216: https://github.com/galaxyproject/galaxy/pull/216 +.. _Pull Request 215: https://github.com/galaxyproject/galaxy/pull/215 +.. _Pull Request 214: https://github.com/galaxyproject/galaxy/pull/214 +.. _Pull Request 198: https://github.com/galaxyproject/galaxy/pull/198 +.. _Pull Request 210: https://github.com/galaxyproject/galaxy/pull/210 +.. _Pull Request 206: https://github.com/galaxyproject/galaxy/pull/206 +.. _Pull Request 205: https://github.com/galaxyproject/galaxy/pull/205 +.. _Pull Request 197: https://github.com/galaxyproject/galaxy/pull/197 +.. _Pull Request 196: https://github.com/galaxyproject/galaxy/pull/196 +.. _Pull Request 189: https://github.com/galaxyproject/galaxy/pull/189 +.. _Pull Request 187: https://github.com/galaxyproject/galaxy/pull/187 +.. _Pull Request 179: https://github.com/galaxyproject/galaxy/pull/179 +.. _Pull Request 153: https://github.com/galaxyproject/galaxy/pull/153 +.. _Pull Request 152: https://github.com/galaxyproject/galaxy/pull/152 +.. _5abb8ad: https://github.com/galaxyproject/galaxy/commit/5abb8ad +.. _Pull Request 130: https://github.com/galaxyproject/galaxy/pull/130 +.. _Pull Request 146: https://github.com/galaxyproject/galaxy/pull/146 +.. _Pull Request 135: https://github.com/galaxyproject/galaxy/pull/135 +.. _Pull Request 143: https://github.com/galaxyproject/galaxy/pull/143 +.. _Pull Request 142: https://github.com/galaxyproject/galaxy/pull/142 +.. _Pull Request 131: https://github.com/galaxyproject/galaxy/pull/131 +.. _d725aab: https://github.com/galaxyproject/galaxy/commit/d725aab +.. _Pull Request 126: https://github.com/galaxyproject/galaxy/pull/126 +.. _e09761e: https://github.com/galaxyproject/galaxy/commit/e09761e +.. _8d3c531: https://github.com/galaxyproject/galaxy/commit/8d3c531 +.. _Pull Request 125: https://github.com/galaxyproject/galaxy/pull/125 +.. _Pull Request 123: https://github.com/galaxyproject/galaxy/pull/123 +.. _Pull Request 121: https://github.com/galaxyproject/galaxy/pull/121 +.. _Pull Request 120: https://github.com/galaxyproject/galaxy/pull/120 +.. _Pull Request 119: https://github.com/galaxyproject/galaxy/pull/119 +.. _Pull Request 117: https://github.com/galaxyproject/galaxy/pull/117 +.. _Pull Request 118: https://github.com/galaxyproject/galaxy/pull/118 +.. _Pull Request 134: https://github.com/galaxyproject/galaxy/pull/134 +.. _Pull Request 116: https://github.com/galaxyproject/galaxy/pull/116 +.. _Pull Request 109: https://github.com/galaxyproject/galaxy/pull/109 +.. _647cf55: https://github.com/galaxyproject/galaxy/commit/647cf55 +.. _Pull Request 108: https://github.com/galaxyproject/galaxy/pull/108 +.. _Pull Request 107: https://github.com/galaxyproject/galaxy/pull/107 +.. _8254cab: https://github.com/galaxyproject/galaxy/commit/8254cab +.. _Pull Request 99: https://github.com/galaxyproject/galaxy/pull/99 +.. _Pull Request 98: https://github.com/galaxyproject/galaxy/pull/98 +.. _Pull Request 115: https://github.com/galaxyproject/galaxy/pull/115 +.. _Pull Request 97: https://github.com/galaxyproject/galaxy/pull/97 +.. _Pull Request 91: https://github.com/galaxyproject/galaxy/pull/91 +.. _Pull Request 89: https://github.com/galaxyproject/galaxy/pull/89 +.. _Pull Request 86: https://github.com/galaxyproject/galaxy/pull/86 +.. _Pull Request 87: https://github.com/galaxyproject/galaxy/pull/87 +.. _Pull Request 73: https://github.com/galaxyproject/galaxy/pull/73 +.. _Pull Request 74: https://github.com/galaxyproject/galaxy/pull/74 +.. _Pull Request 75: https://github.com/galaxyproject/galaxy/pull/75 +.. _Pull Request 70: https://github.com/galaxyproject/galaxy/pull/70 +.. _Pull Request 69: https://github.com/galaxyproject/galaxy/pull/69 +.. _Pull Request 62: https://github.com/galaxyproject/galaxy/pull/62 +.. _Pull Request 51: https://github.com/galaxyproject/galaxy/pull/51 +.. _Pull Request 76: https://github.com/galaxyproject/galaxy/pull/76 +.. _2650d09: https://github.com/galaxyproject/galaxy/commit/2650d09 +.. _7d5dde8: https://github.com/galaxyproject/galaxy/commit/7d5dde8 +.. _2748f9d: https://github.com/galaxyproject/galaxy/commit/2748f9d +.. _d6d61bc: https://github.com/galaxyproject/galaxy/commit/d6d61bc +.. _815f86f: https://github.com/galaxyproject/galaxy/commit/815f86f +.. _76e0915: https://github.com/galaxyproject/galaxy/commit/76e0915 +.. _bce8171: https://github.com/galaxyproject/galaxy/commit/bce8171 +.. _06346a4: https://github.com/galaxyproject/galaxy/commit/06346a4 +.. _b4cf49a: https://github.com/galaxyproject/galaxy/commit/b4cf49a +.. _Pull Request 40: https://github.com/galaxyproject/galaxy/pull/40 +.. _Pull Request 38: https://github.com/galaxyproject/galaxy/pull/38 +.. _a24e206: https://github.com/galaxyproject/galaxy/commit/a24e206 +.. _Pull Request 35: https://github.com/galaxyproject/galaxy/pull/35 +.. _e36e51e: https://github.com/galaxyproject/galaxy/commit/e36e51e +.. _1e55206: https://github.com/galaxyproject/galaxy/commit/1e55206 +.. _0c79680: https://github.com/galaxyproject/galaxy/commit/0c79680 +.. _Pull Request 1: https://github.com/galaxyproject/galaxy/pull/1 +.. _Pull Request 33: https://github.com/galaxyproject/galaxy/pull/33 +.. _Pull Request 48: https://github.com/galaxyproject/galaxy/pull/48 +.. _21d1d6b: https://github.com/galaxyproject/galaxy/commit/21d1d6b +.. _Pull Request 30: https://github.com/galaxyproject/galaxy/pull/30 +.. _Pull Request 29: https://github.com/galaxyproject/galaxy/pull/29 +.. _c0e5509: https://github.com/galaxyproject/galaxy/commit/c0e5509 +.. _157eba6: https://github.com/galaxyproject/galaxy/commit/157eba6 +.. _72c876c: https://github.com/galaxyproject/galaxy/commit/72c876c +.. _9a7f5fc: https://github.com/galaxyproject/galaxy/commit/9a7f5fc +.. _648a623: https://github.com/galaxyproject/galaxy/commit/648a623 +.. _59028c0: https://github.com/galaxyproject/galaxy/commit/59028c0 +.. _bcd1701: https://github.com/galaxyproject/galaxy/commit/bcd1701 +.. _22f280f: https://github.com/galaxyproject/galaxy/commit/22f280f +.. _6946e46: https://github.com/galaxyproject/galaxy/commit/6946e46 +.. _65def71: https://github.com/galaxyproject/galaxy/commit/65def71 +.. _4e5218f: https://github.com/galaxyproject/galaxy/commit/4e5218f +.. _Pull Request 16: https://github.com/galaxyproject/galaxy/pull/16 +.. _Pull Request 13: https://github.com/galaxyproject/galaxy/pull/13 +.. _e8564d7: https://github.com/galaxyproject/galaxy/commit/e8564d7 +.. _Pull Request 23: https://github.com/galaxyproject/galaxy/pull/23 +.. _Pull Request 22: https://github.com/galaxyproject/galaxy/pull/22 +.. _10bb492: https://github.com/galaxyproject/galaxy/commit/10bb492 +.. _Pull Request 19: https://github.com/galaxyproject/galaxy/pull/19 +.. _Pull Request 18: https://github.com/galaxyproject/galaxy/pull/18 +.. _0b037a2: https://github.com/galaxyproject/galaxy/commit/0b037a2 +.. _Pull Request 17: https://github.com/galaxyproject/galaxy/pull/17 +.. _b29a5e9: https://github.com/galaxyproject/galaxy/commit/b29a5e9 +.. _Pull Request 14: https://github.com/galaxyproject/galaxy/pull/14 +.. _7aecd7a: https://github.com/galaxyproject/galaxy/commit/7aecd7a +.. _Pull Request 12: https://github.com/galaxyproject/galaxy/pull/12 +.. _cd7abe8: https://github.com/galaxyproject/galaxy/commit/cd7abe8 +.. _62f0495: https://github.com/galaxyproject/galaxy/commit/62f0495 +.. _Pull Request 11: https://github.com/galaxyproject/galaxy/pull/11 +.. _Pull Request 9: https://github.com/galaxyproject/galaxy/pull/9 +.. _632ec4e: https://github.com/galaxyproject/galaxy/commit/632ec4e +.. _Pull Request 8: https://github.com/galaxyproject/galaxy/pull/8 +.. _Pull Request 7: https://github.com/galaxyproject/galaxy/pull/7 +.. _b52cc98: https://github.com/galaxyproject/galaxy/commit/b52cc98 +.. _1454396: https://github.com/galaxyproject/galaxy/commit/1454396 +.. _8da70bb: https://github.com/galaxyproject/galaxy/commit/8da70bb +.. _b639bc0: https://github.com/galaxyproject/galaxy/commit/b639bc0 +.. _ab6f13e: https://github.com/galaxyproject/galaxy/commit/ab6f13e +.. _debea9d: https://github.com/galaxyproject/galaxy/commit/debea9d +.. _6102edf: https://github.com/galaxyproject/galaxy/commit/6102edf +.. _c1d2d1f: https://github.com/galaxyproject/galaxy/commit/c1d2d1f +.. _0b83b1e: https://github.com/galaxyproject/galaxy/commit/0b83b1e +.. _216fb95: https://github.com/galaxyproject/galaxy/commit/216fb95 +.. _182b67f: https://github.com/galaxyproject/galaxy/commit/182b67f +.. _47e6f08: https://github.com/galaxyproject/galaxy/commit/47e6f08 +.. _7ac8631: https://github.com/galaxyproject/galaxy/commit/7ac8631 +.. _2bf52fe: https://github.com/galaxyproject/galaxy/commit/2bf52fe +.. _e4e5df0: https://github.com/galaxyproject/galaxy/commit/e4e5df0 +.. _6e17bf4: https://github.com/galaxyproject/galaxy/commit/6e17bf4 +.. _0c94f04: https://github.com/galaxyproject/galaxy/commit/0c94f04 +.. _Pull Request 1: https://github.com/galaxyproject/galaxy/pull/1 +.. _ec549db: https://github.com/galaxyproject/galaxy/commit/ec549db +.. _226e826: https://github.com/galaxyproject/galaxy/commit/226e826 +.. _79d50d8: https://github.com/galaxyproject/galaxy/commit/79d50d8 +.. _964e081: https://github.com/galaxyproject/galaxy/commit/964e081 +.. _Pull Request 5: https://github.com/galaxyproject/galaxy/pull/5 +.. _1f1bb29: https://github.com/galaxyproject/galaxy/commit/1f1bb29 +.. _Pull Request 4: https://github.com/galaxyproject/galaxy/pull/4 +.. _dde2fc9: https://github.com/galaxyproject/galaxy/commit/dde2fc9 +.. _c2eb74c: https://github.com/galaxyproject/galaxy/commit/c2eb74c +.. _71a64ca: https://github.com/galaxyproject/galaxy/commit/71a64ca +.. _3af3bf5: https://github.com/galaxyproject/galaxy/commit/3af3bf5 +.. _e99adb5: https://github.com/galaxyproject/galaxy/commit/e99adb5 diff --git a/doc/source/releases/15.05_announce.rst b/doc/source/releases/15.05_announce.rst new file mode 100644 index 00000000000..db98dc32bdc --- /dev/null +++ b/doc/source/releases/15.05_announce.rst @@ -0,0 +1,58 @@ +=========================================================== +May 2015 Galaxy Release (v 15.05) +=========================================================== + +.. include:: _header.rst + +Highlights +=========================================================== + +**Authentication Plugins** + Galaxy now has native support for LDAP and Active Directory via a new + community developed authentication plugin system. + +**Tool Sections** + Tool parameters may now be groupped into collapsable sections. + +**Collection Creators** + New widgets have been added that allow much more flexibility when creating + simple dataset pair and list collections. + +`Github `__ +=========================================================== + +New + .. code-block:: shell + + % git clone -b master https://github.com/galaxyproject/galaxy.git + +Update to latest stable release + .. code-block:: shell + + % git checkout master && pull --ff-only origin master + +Update to exact version + .. code-block:: shell + + % git checkout v15.05 + + +`BitBucket `__ +=========================================================== + +Upgrade + .. code-block:: shell + + % hg pull + % hg update latest_15.05 + + +See `our wiki `__ for additional details regarding the source code locations. + +Release Notes +=========================================================== + +.. include:: 15.05.rst + :start-after: enhancements + +.. include:: _thanks.rst diff --git a/doc/source/releases/_header.rst b/doc/source/releases/_header.rst new file mode 100644 index 00000000000..c982e72796d --- /dev/null +++ b/doc/source/releases/_header.rst @@ -0,0 +1,3 @@ +.. image:: https://wiki.galaxyproject.org/Images/GalaxyLogo?action=AttachFile&do=get&target=galaxy_logo_25percent_transparent.png + :alt: Get the Galaxy Release Your Way + :target: http://getgalaxy.org diff --git a/doc/source/releases/_thanks.rst b/doc/source/releases/_thanks.rst new file mode 100644 index 00000000000..388a44e4c50 --- /dev/null +++ b/doc/source/releases/_thanks.rst @@ -0,0 +1,7 @@ +To stay up to date with Galaxy's progress watch our `screencasts `__, +read our `wiki `__, and follow +`@galaxyproject `__ on Twitter. + +*Thanks for using Galaxy!* + +`The Galaxy Team `__ diff --git a/doc/source/releases/index.rst b/doc/source/releases/index.rst new file mode 100644 index 00000000000..388893091ac --- /dev/null +++ b/doc/source/releases/index.rst @@ -0,0 +1,21 @@ +Releases +======== + +.. toctree:: + :maxdepth: 1 + + 15.05_announce + 15.03_announce + 15.01_announce + 14.10_announce + 14.08_announce + 14.06_announce + 14.04_announce + 14.02_announce + 13.11_announce + 13.08_announce + 13.06_announce + 13.04_announce + 13.02_announce + 13.01_announce + older_releases diff --git a/doc/source/releases/older_releases.rst b/doc/source/releases/older_releases.rst new file mode 100644 index 00000000000..98aebbe9745 --- /dev/null +++ b/doc/source/releases/older_releases.rst @@ -0,0 +1,11 @@ +=========================================================== +Galaxy Releases older than v 13.01 +=========================================================== + +.. include:: _header.rst + +Please see the `Galaxy wiki`_ for announcement and release notes. + +.. _Galaxy wiki: https://wiki.galaxyproject.org/DevNewsBriefs + +.. include:: _thanks.rst diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index eed993c890b..cc7362a7c90 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -12,6 +12,7 @@ import struct import subprocess import tempfile import re +import warnings import zipfile from galaxy import eggs @@ -24,8 +25,11 @@ from galaxy.datatypes.metadata import MetadataElement, MetadataParameter, ListPa from galaxy.datatypes import metadata import dataproviders -eggs.require( "pysam" ) -from pysam import csamtools +with warnings.catch_warnings(): + warnings.simplefilter( "ignore" ) + eggs.require( "pysam" ) + from pysam import csamtools + log = logging.getLogger(__name__) diff --git a/lib/galaxy/jobs/actions/post.py b/lib/galaxy/jobs/actions/post.py index eff28baf095..da867d47aa6 100644 --- a/lib/galaxy/jobs/actions/post.py +++ b/lib/galaxy/jobs/actions/post.py @@ -8,6 +8,9 @@ import logging import socket from galaxy.util import send_mail from galaxy.util.json import dumps +from galaxy import eggs +eggs.require( "MarkupSafe" ) +from markupsafe import escape log = logging.getLogger( __name__ ) @@ -50,7 +53,7 @@ class DefaultJobAction(object): @classmethod def get_short_str(cls, pja): if pja.action_arguments: - return "%s -> %s" % (pja.action_type, pja.action_arguments) + return "%s -> %s" % (pja.action_type, escape(pja.action_arguments)) else: return "%s" % pja.action_type @@ -91,7 +94,7 @@ class EmailAction(DefaultJobAction): @classmethod def get_short_str(cls, pja): if pja.action_arguments and 'host' in pja.action_arguments: - return "Email the current user from server %s when this job is complete." % pja.action_arguments['host'] + return "Email the current user from server %s when this job is complete." % escape(pja.action_arguments['host']) else: return "Email the current user when this job is complete." @@ -127,7 +130,8 @@ class ChangeDatatypeAction(DefaultJobAction): @classmethod def get_short_str(cls, pja): - return "Set the datatype of output '%s' to '%s'" % (pja.output_name, pja.action_arguments['newtype']) + return "Set the datatype of output '%s' to '%s'" % (escape(pja.output_name), + escape(pja.action_arguments['newtype'])) class RenameDatasetAction(DefaultJobAction): @@ -235,7 +239,8 @@ class RenameDatasetAction(DefaultJobAction): def get_short_str(cls, pja): # Prevent renaming a dataset to the empty string. if pja.action_arguments and pja.action_arguments.get('newname', ''): - return "Rename output '%s' to '%s'." % (pja.output_name, pja.action_arguments['newname']) + return "Rename output '%s' to '%s'." % (escape(pja.output_name), + escape(pja.action_arguments['newname'])) else: return "Rename action used without a new name specified. Output name will be unchanged." @@ -260,7 +265,7 @@ class HideDatasetAction(DefaultJobAction): @classmethod def get_short_str(cls, pja): - return "Hide output '%s'." % pja.output_name + return "Hide output '%s'." % escape(pja.output_name) class DeleteDatasetAction(DefaultJobAction): @@ -336,7 +341,7 @@ class ColumnSetAction(DefaultJobAction): @classmethod def get_short_str(cls, pja): - return "Set the following metadata values:
" + "
".join(['%s : %s' % (k, v) for k, v in pja.action_arguments.iteritems()]) + return "Set the following metadata values:
" + "
".join(['%s : %s' % (escape(k), escape(v)) for k, v in pja.action_arguments.iteritems()]) class SetMetadataAction(DefaultJobAction): @@ -455,7 +460,8 @@ class TagDatasetAction(DefaultJobAction): @classmethod def get_short_str(cls, pja): if pja.action_arguments and pja.action_arguments.get('tags', ''): - return "Add tag(s) '%s' to '%s'." % (pja.action_arguments['tags'], pja.output_name) + return "Add tag(s) '%s' to '%s'." % (escape(pja.action_arguments['tags']), + escape(pja.output_name)) else: return "Tag addition action used without a tag specified. No tag will be added." diff --git a/lib/galaxy/managers/collections.py b/lib/galaxy/managers/collections.py index b129ff5d61e..eda9df90e71 100644 --- a/lib/galaxy/managers/collections.py +++ b/lib/galaxy/managers/collections.py @@ -73,7 +73,9 @@ class DatasetCollectionManager( object ): for input_name, input_collection in implicit_collection_info[ "implicit_inputs" ]: dataset_collection_instance.add_implicit_input_collection( input_name, input_collection ) for output_dataset in implicit_collection_info.get( "outputs" ): - if isinstance( output_dataset, model.HistoryDatasetCollectionAssociation ): + if isinstance( output_dataset, model.HistoryDatasetAssociation ): + output_dataset.hidden_beneath_collection_instance = dataset_collection_instance + elif isinstance( output_dataset, model.HistoryDatasetCollectionAssociation ): dataset_collection_instance.add_implicit_input_collection( input_name, input_collection ) else: # dataset collection, don't need to do anything... diff --git a/lib/galaxy/managers/context.py b/lib/galaxy/managers/context.py index 39471fae855..8190c2a8a09 100644 --- a/lib/galaxy/managers/context.py +++ b/lib/galaxy/managers/context.py @@ -139,7 +139,11 @@ class ProvidesUserContext( object ): @property def user_ftp_dir( self ): identifier = self.app.config.ftp_upload_dir_identifier - return os.path.join( self.app.config.ftp_upload_dir, getattr( self.user, identifier ) ) + base_dir = self.app.config.ftp_upload_dir + if base_dir is None: + return None + else: + return os.path.join( base_dir, getattr( self.user, identifier ) ) class ProvidesHistoryContext( object ): diff --git a/lib/galaxy/managers/histories.py b/lib/galaxy/managers/histories.py index b167e07a0e6..14e53aa230d 100644 --- a/lib/galaxy/managers/histories.py +++ b/lib/galaxy/managers/histories.py @@ -282,21 +282,21 @@ class HistorySerializer( sharable.SharableModelSerializer, deletable.PurgableSer state = states.ERROR # TODO: history_state and state_counts are classically calc'd at the same time # so this is rel. ineff. - if we keep this... - hda_state_counts = self.serialize_state_counts( history, 'counts', exclude_deleted=False, **context ) + hda_state_counts = self.serialize_state_counts( history, 'counts', exclude_deleted=True, **context ) num_hdas = sum( hda_state_counts.values() ) if num_hdas == 0: state = states.NEW else: if ( hda_state_counts[ states.RUNNING ] > 0 - or hda_state_counts[ states.SETTING_METADATA ] > 0 - or hda_state_counts[ states.UPLOAD ] > 0 ): + or hda_state_counts[ states.SETTING_METADATA ] > 0 + or hda_state_counts[ states.UPLOAD ] > 0 ): state = states.RUNNING # TODO: this method may be more useful if we *also* polled the histories jobs here too elif hda_state_counts[ states.QUEUED ] > 0: state = states.QUEUED elif ( hda_state_counts[ states.ERROR ] > 0 - or hda_state_counts[ states.FAILED_METADATA ] > 0 ): + or hda_state_counts[ states.FAILED_METADATA ] > 0 ): state = states.ERROR elif hda_state_counts[ states.OK ] == num_hdas: state = states.OK diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index ee70e2b97f3..22ea22c0b92 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -60,16 +60,6 @@ from galaxy.model.item_attrs import Dictifiable from tool_shed.util import shed_util_common as suc from .loader import template_macro_params, raw_tool_xml_tree, imported_macro_paths from .execute import execute as execute_job -from .wrappers import ( - ToolParameterValueWrapper, - RawObjectWrapper, - LibraryDatasetValueWrapper, - InputValueWrapper, - SelectToolParameterWrapper, - DatasetFilenameWrapper, - DatasetListWrapper, - DatasetCollectionWrapper, -) import galaxy.jobs @@ -1890,10 +1880,12 @@ class Tool( object, Dictifiable ): """ args = dict() for key, param in self.inputs.iteritems(): - if isinstance( param, HiddenToolParameter ): + # BaseURLToolParameter is now a subclass of HiddenToolParameter, so + # we must check if param is a BaseURLToolParameter first + if isinstance( param, BaseURLToolParameter ): + args[key] = param.get_initial_value( trans, None ) + elif isinstance( param, HiddenToolParameter ): args[key] = model.User.expand_user_properties( trans.user, param.value ) - elif isinstance( param, BaseURLToolParameter ): - args[key] = param.get_value( trans ) else: raise Exception( "Unexpected parameter type" ) return args @@ -2332,6 +2324,12 @@ class Tool( object, Dictifiable ): 'id' : trans.security.encode_id(v.id), 'src' : 'hdca' } + elif isinstance(v, trans.app.model.LibraryDatasetDatasetAssociation): + return { + 'id' : trans.security.encode_id(v.id), + 'name': v.name, + 'src' : 'ldda' + } elif isinstance(v, bool): if v is True: return 'true' @@ -2550,7 +2548,8 @@ class Tool( object, Dictifiable ): tool_versions = [] tools = self.app.toolbox.get_loaded_tools_by_lineage(self.id) for t in tools: - tool_versions.append(t.version) + if not t.version in tool_versions: + tool_versions.append(t.version) # add information with underlying requirements and their versions tool_requirements = [] diff --git a/lib/galaxy/tools/data/__init__.py b/lib/galaxy/tools/data/__init__.py index c90b188027c..fe965b6b575 100644 --- a/lib/galaxy/tools/data/__init__.py +++ b/lib/galaxy/tools/data/__init__.py @@ -185,6 +185,7 @@ class ToolDataTable( object ): self.comment_char = config_element.get( 'comment_char' ) self.empty_field_value = config_element.get( 'empty_field_value', '' ) self.empty_field_values = {} + self.allow_duplicate_entries = util.asbool( config_element.get( 'allow_duplicate_entries', True ) ) self.here = filename and os.path.dirname(filename) self.filenames = odict() self.tool_data_path = tool_data_path @@ -354,6 +355,11 @@ class TabularToolDataTable( ToolDataTable, Dictifiable ): self.filenames[ filename ] = info #save info about table self._merged_load_info.append( ( other_table.__class__, other_table._load_info ) ) + # If we are merging in a data table that does not allow duplicates, enforce that upon the data table + if self.allow_duplicate_entries and not other_table.allow_duplicate_entries: + log.debug( 'While attempting to merge tool data table "%s", the other instance of the table specified that duplicate entries are not allowed, now deduplicating all previous entries.', self.name ) + self.allow_duplicate_entries = False + self._deduplicate_data() #add data entries and return current data table version return self.add_entries( other_table.data, allow_duplicates=allow_duplicates, persist=persist, persist_on_error=persist_on_error, entry_source=entry_source, **kwd ) @@ -426,6 +432,8 @@ class TabularToolDataTable( ToolDataTable, Dictifiable ): def extend_data_with( self, filename, errors=None ): here = os.path.dirname(os.path.abspath(filename)) self.data.extend( self.parse_file_fields( open( filename ), errors=errors, here=here ) ) + if not self.allow_duplicate_entries: + self._deduplicate_data() def parse_file_fields( self, reader, errors=None, here="__HERE__" ): """ @@ -536,7 +544,7 @@ class TabularToolDataTable( ToolDataTable, Dictifiable ): is_error = False if self.largest_index < len( fields ): fields = self._replace_field_separators( fields ) - if fields not in self.get_fields() or allow_duplicates: + if fields not in self.get_fields() or ( allow_duplicates and self.allow_duplicate_entries ): self.data.append( fields ) else: log.debug( "Attempted to add fields (%s) to data table '%s', but this entry already exists and allow_duplicates is False.", fields, self.name ) @@ -624,6 +632,20 @@ class TabularToolDataTable( ToolDataTable, Dictifiable ): replace = " " return map( lambda x: x.replace( separator, replace ), fields ) + def _deduplicate_data( self ): + # Remove duplicate entries, without recreating self.data object + dup_lines = [] + hash_list = [] + for i, fields in enumerate( self.data ): + fields_hash = hash( self.separator.join( fields ) ) + if fields_hash in hash_list: + dup_lines.append( i ) + log.debug( 'Found duplicate entry in tool data table "%s", but duplicates are not allowed, removing additional entry for: "%s"', self.name, fields ) + else: + hash_list.append( fields_hash ) + for i in reversed( dup_lines ): + self.data.pop( i ) + @property def xml_string( self ): return util.xml_to_string( self.config_element ) diff --git a/lib/galaxy/tools/evaluation.py b/lib/galaxy/tools/evaluation.py index 05760d60a76..4903838097d 100644 --- a/lib/galaxy/tools/evaluation.py +++ b/lib/galaxy/tools/evaluation.py @@ -11,7 +11,6 @@ from galaxy.tools.wrappers import ( DatasetFilenameWrapper, DatasetListWrapper, DatasetCollectionWrapper, - LibraryDatasetValueWrapper, SelectToolParameterWrapper, InputValueWrapper, RawObjectWrapper @@ -19,7 +18,6 @@ from galaxy.tools.wrappers import ( from galaxy.tools.parameters.basic import ( DataToolParameter, DataCollectionToolParameter, - LibraryDatasetToolParameter, SelectToolParameter, ) from galaxy.tools.parameters.grouping import Conditional, Repeat, Section @@ -228,10 +226,6 @@ class ToolEvaluator( object ): elif isinstance( input, SelectToolParameter ): input_values[ input.name ] = SelectToolParameterWrapper( input, input_values[ input.name ], self.app, other_values=param_dict, path_rewriter=self.unstructured_path_rewriter ) - elif isinstance( input, LibraryDatasetToolParameter ): - # TODO: Handle input rewrites in here? How to test LibraryDatasetToolParameters? - input_values[ input.name ] = LibraryDatasetValueWrapper( - input, input_values[ input.name ], param_dict ) else: input_values[ input.name ] = InputValueWrapper( input, input_values[ input.name ], param_dict ) diff --git a/lib/galaxy/tools/execute.py b/lib/galaxy/tools/execute.py index 8b6d5ce8e41..9b5f79b326e 100644 --- a/lib/galaxy/tools/execute.py +++ b/lib/galaxy/tools/execute.py @@ -113,12 +113,13 @@ class ToolExecutionTracker( object ): outputs=outputs ) try: - output_collection_name = self.tool_action.get_output_name( + output_collection_name = self.tool.tool_action.get_output_name( output, dataset=None, tool=self.tool, on_text=on_text, trans=trans, + history=history, params=params, incoming=None, job_params=None, diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index 03cbcc31dcb..42ee20d23c7 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -587,6 +587,14 @@ class FTPFileToolParameter( ToolParameter ): """ input_source = ensure_input_source(input_source) ToolParameter.__init__( self, tool, input_source ) + self.multiple = input_source.get_bool( 'multiple', True ) + self.user_ftp_dir = '' + + def get_initial_value( self, trans, context, history=None ): + if not trans is None: + if not trans.user is None: + self.user_ftp_dir = "%s/" % trans.user_ftp_dir + return None @property def visible( self ): @@ -601,28 +609,45 @@ class FTPFileToolParameter( ToolParameter ): user_ftp_dir = trans.user_ftp_dir return form_builder.FTPFileField( self.name, user_ftp_dir, trans.app.config.ftp_upload_site, value=value ) + def to_param_dict_string( self, value, other_values={} ): + if value is '': + return 'None' + lst = [ '%s%s' % (self.user_ftp_dir, dataset) for dataset in value ] + if self.multiple: + return lst + else: + return lst[ 0 ] + def from_html( self, value, trans=None, other_values={} ): - try: - assert type( value ) is list - except: - value = [ value ] - return value + return self.to_python( value, trans.app, validate=True ) def to_string( self, value, app ): - if value in [ None, '' ]: - return None - elif isinstance( value, unicode ) or isinstance( value, str ) or isinstance( value, list ): - return value + return self.to_python( value, app ) - def to_python( self, value, app ): - if value is None: - return None - elif isinstance( value, unicode ) or isinstance( value, str ) or isinstance( value, list ): - return value - - def get_initial_value( self, trans, context, history=None ): - return None + def to_python( self, value, app, validate=False ): + if validate and self.tool.app.config.ftp_upload_dir is None: + raise ValueError( "The FTP directory is not configured." ) + if not isinstance( value, list ): + value = [ value ] + lst = [] + for val in value: + if val is None: + lst = [] + break + if isinstance( val, dict ): + lst.append( val[ 'name' ] ) + else: + lst.append( val ) + if len( lst ) == 0: + if not self.optional and validate: + raise ValueError( "Please select a valid FTP file." ) + return '' + return lst + def to_dict( self, trans, view='collection', value_mapper=None, other_values=None ): + d = super( FTPFileToolParameter, self ).to_dict( trans ) + d['multiple'] = self.multiple + return d class HiddenToolParameter( ToolParameter ): """ @@ -652,6 +677,7 @@ class HiddenToolParameter( ToolParameter ): def get_label( self ): return None + class ColorToolParameter( ToolParameter ): """ Parameter that stores a color. @@ -682,9 +708,23 @@ class BaseURLToolParameter( HiddenToolParameter ): super( BaseURLToolParameter, self ).__init__( tool, input_source ) self.value = input_source.get( 'value', '' ) + def get_initial_value( self, trans, context, history=None ): + return self._get_value() + + def get_html_field( self, trans=None, value=None, other_values={} ): + return form_builder.HiddenField( self.name, self._get_value() ) + def from_html( self, value=None, trans=None, context={} ): + return self._get_value() + + def _get_value( self ): return url_for( self.value, qualified=True ) + def to_dict( self, trans, view='collection', value_mapper=None, other_values={} ): + d = super( BaseURLToolParameter, self ).to_dict( trans ) + d[ 'value' ] = self._get_value() + return d + DEFAULT_VALUE_MAP = lambda x: x @@ -1638,7 +1678,7 @@ class BaseDataToolParameter( ToolParameter ): class_name = self.__class__.__name__ assert trans is not None, "%s requires a trans" % class_name if history is None: - history = trans.get_history( create=True ) + history = trans.get_history() assert history is not None, "%s requires a history" % class_name return history @@ -2360,8 +2400,10 @@ class LibraryDatasetToolParameter( ToolParameter ): Parameter that lets users select a LDDA from a modal window, then use it within the wrapper. """ - def __init__( self, tool, elem ): - ToolParameter.__init__( self, tool, elem ) + def __init__( self, tool, input_source, context=None ): + input_source = ensure_input_source( input_source ) + ToolParameter.__init__( self, tool, input_source ) + self.multiple = input_source.get_bool( 'multiple', True ) def get_html_field( self, trans=None, value=None, other_values={} ): return form_builder.LibraryField( self.name, value=value, trans=trans ) @@ -2370,28 +2412,82 @@ class LibraryDatasetToolParameter( ToolParameter ): return None def from_html( self, value, trans, other_values={} ): - if not value: - return None - elif isinstance( value, list ): - return value + return self.to_python( value, trans.app, other_values=other_values, validate=True ) + + def to_param_dict_string( self, value, other_values={} ): + if value is None: + return 'None' + elif self.multiple: + return [ dataset.get_file_name() for dataset in value ] else: - decoded_lst = [] - for encoded_id in value.split("||"): - decoded_lst.append( trans.sa_session.query( trans.app.model.LibraryDatasetDatasetAssociation ).get( trans.security.decode_id( encoded_id ) ) ) - return decoded_lst + return value[ 0 ].get_file_name() + # converts values to json representation: + # { id: LibraryDatasetDatasetAssociation.id, name: LibraryDatasetDatasetAssociation.name, src: 'lda' } def to_string( self, value, app ): - if not value: - return value - return [ldda.id for ldda in value] + if not isinstance( value, list ): + value = [value] + lst = [] + for item in value: + encoded_id = encoded_name = None + if isinstance (item, app.model.LibraryDatasetDatasetAssociation): + encoded_id = app.security.encode_id( item.id ) + encoded_name = item.name + elif isinstance (item, dict): + encoded_id = item.get('id') + encoded_name = item.get('name') + else: + lst = [] + break + if encoded_id is not None: + lst.append( { + 'id' : encoded_id, + 'name' : encoded_name, + 'src' : 'ldda' + } ) + if len( lst ) == 0: + return None + else: + return lst - def to_python( self, value, app ): - if not value: - return value - lddas = [] - for ldda_id in value: - lddas.append( app.model.context.query( app.model.LibraryDatasetDatasetAssociation ).get( ldda_id ) ) - return lddas + # converts values into python representation: + # LibraryDatasetDatasetAssociation + # valid input values (incl. arrays of mixed sets) are: + # 1. LibraryDatasetDatasetAssociation + # 2. LibraryDatasetDatasetAssociation.id + # 3. { id: LibraryDatasetDatasetAssociation.id, ... } + def to_python( self, value, app, other_values={}, validate=False ): + if not isinstance( value, list ): + value = [value] + lst = [] + for item in value: + if isinstance (item, app.model.LibraryDatasetDatasetAssociation): + lst.append(item) + else: + encoded_id = None + if isinstance (item, dict): + encoded_id = item.get('id') + elif isinstance (item, basestring): + encoded_id = item + else: + lst = [] + break + lda = app.model.context.query( app.model.LibraryDatasetDatasetAssociation ).get( app.security.decode_id( encoded_id ) ) + if lda is not None: + lst.append( lda ) + elif validate: + raise ValueError( "One of the selected library datasets is invalid or not available anymore." ) + if len( lst ) == 0: + if not self.optional and validate: + raise ValueError( "Please select a valid library dataset." ) + return None + else: + return lst + + def to_dict( self, trans, view='collection', value_mapper=None, other_values=None ): + d = super( LibraryDatasetToolParameter, self ).to_dict( trans ) + d['multiple'] = self.multiple + return d # class RawToolParameter( ToolParameter ): # """ diff --git a/lib/galaxy/tools/parameters/dynamic_options.py b/lib/galaxy/tools/parameters/dynamic_options.py index 5ec40230e23..b6f1b1b6974 100644 --- a/lib/galaxy/tools/parameters/dynamic_options.py +++ b/lib/galaxy/tools/parameters/dynamic_options.py @@ -116,7 +116,7 @@ class DataMetaFilter( Filter ): return file_value == dataset_value assert self.ref_name in other_values or ( trans is not None and trans.workflow_building_mode), "Required dependency '%s' not found in incoming values" % self.ref_name ref = other_values.get( self.ref_name, None ) - if not isinstance( ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ) and not ( isinstance( ref, galaxy.tools.DatasetFilenameWrapper ) ): + if not isinstance( ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ) and not ( isinstance( ref, galaxy.tools.wrappers.DatasetFilenameWrapper ) ): return [] #not a valid dataset meta_value = ref.metadata.get( self.key, None ) if meta_value is None: #assert meta_value is not None, "Required metadata value '%s' not found in referenced dataset" % self.key @@ -358,7 +358,7 @@ class RemoveValueFilter( Filter ): value = other_values.get( self.ref_name ) else: data_ref = other_values.get( self.meta_ref ) - if not isinstance( data_ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ) and not ( isinstance( data_ref, galaxy.tools.DatasetFilenameWrapper ) ): + if not isinstance( data_ref, self.dynamic_option.tool_param.tool.app.model.HistoryDatasetAssociation ) and not ( isinstance( data_ref, galaxy.tools.wrappers.DatasetFilenameWrapper ) ): return options #cannot modify options value = data_ref.metadata.get( self.metadata_key, None ) return [ ( disp_name, optval, selected ) for disp_name, optval, selected in options if not compare_value( optval, value ) ] diff --git a/lib/galaxy/tools/parameters/wrapped.py b/lib/galaxy/tools/parameters/wrapped.py index ea610b06976..5765e40cb7b 100644 --- a/lib/galaxy/tools/parameters/wrapped.py +++ b/lib/galaxy/tools/parameters/wrapped.py @@ -3,7 +3,14 @@ import galaxy.tools from galaxy.tools.parameters.basic import ( DataToolParameter, DataCollectionToolParameter, - SelectToolParameter, + SelectToolParameter +) +from galaxy.tools.wrappers import ( + InputValueWrapper, + SelectToolParameterWrapper, + DatasetFilenameWrapper, + DatasetListWrapper, + DatasetCollectionWrapper ) from galaxy.tools.parameters.grouping import ( Repeat, @@ -38,6 +45,7 @@ class WrappedParameters( object ): for input in inputs.itervalues(): if input.name not in input_values and skip_missing_values: continue + value = input_values[ input.name ] if isinstance( input, Repeat ): for d in input_values[ input.name ]: self.wrap_values( input.inputs, d, skip_missing_values=skip_missing_values ) @@ -50,27 +58,27 @@ class WrappedParameters( object ): self.wrap_values( input.inputs, values, skip_missing_values=skip_missing_values ) elif isinstance( input, DataToolParameter ) and input.multiple: input_values[ input.name ] = \ - galaxy.tools.DatasetListWrapper( input_values[ input.name ], + DatasetListWrapper( input_values[ input.name ], datatypes_registry=trans.app.datatypes_registry, tool=tool, name=input.name ) elif isinstance( input, DataToolParameter ): input_values[ input.name ] = \ - galaxy.tools.DatasetFilenameWrapper( input_values[ input.name ], + DatasetFilenameWrapper( input_values[ input.name ], datatypes_registry=trans.app.datatypes_registry, tool=tool, name=input.name ) elif isinstance( input, SelectToolParameter ): - input_values[ input.name ] = galaxy.tools.SelectToolParameterWrapper( input, input_values[ input.name ], tool.app, other_values=incoming ) + input_values[ input.name ] = SelectToolParameterWrapper( input, input_values[ input.name ], tool.app, other_values=incoming ) elif isinstance( input, DataCollectionToolParameter ): - input_values[ input.name ] = galaxy.tools.DatasetCollectionWrapper( + input_values[ input.name ] = DatasetCollectionWrapper( input_values[ input.name ], datatypes_registry=trans.app.datatypes_registry, tool=tool, name=input.name, ) else: - input_values[ input.name ] = galaxy.tools.InputValueWrapper( input, input_values[ input.name ], incoming ) + input_values[ input.name ] = InputValueWrapper( input, value, incoming ) def make_dict_copy( from_dict ): diff --git a/lib/galaxy/tools/parser/xml.py b/lib/galaxy/tools/parser/xml.py index 180b76db90b..66be0ff435f 100644 --- a/lib/galaxy/tools/parser/xml.py +++ b/lib/galaxy/tools/parser/xml.py @@ -158,6 +158,7 @@ class XmlToolSource(ToolSource): for collection_elem in out_elem.findall("collection"): name = collection_elem.get( "name" ) + label = xml_text( collection_elem, "label" ) default_format = collection_elem.get( "format", "data" ) collection_type = collection_elem.get( "type", None ) structured_like = collection_elem.get( "structured_like", None ) @@ -180,6 +181,7 @@ class XmlToolSource(ToolSource): output_collection = galaxy.tools.ToolOutputCollection( name, structure, + label=label, default_format=default_format, inherit_format=inherit_format, inherit_metadata=inherit_metadata, diff --git a/lib/galaxy/tools/wrappers.py b/lib/galaxy/tools/wrappers.py index 9282f446935..8cc29a6cfa7 100644 --- a/lib/galaxy/tools/wrappers.py +++ b/lib/galaxy/tools/wrappers.py @@ -57,32 +57,6 @@ class RawObjectWrapper( ToolParameterValueWrapper ): return getattr( self.obj, key ) -class LibraryDatasetValueWrapper( ToolParameterValueWrapper ): - """ - Wraps an input so that __str__ gives the "param_dict" representation. - """ - def __init__( self, input, value, other_values={} ): - self.input = input - self.value = value - self._other_values = other_values - self.counter = 0 - - def __str__( self ): - return self.value - - def __iter__( self ): - return self - - def next( self ): - if self.counter >= len(self.value): - raise StopIteration - self.counter += 1 - return self.value[ self.counter - 1 ] - - def __getattr__( self, key ): - return getattr( self.value, key ) - - class InputValueWrapper( ToolParameterValueWrapper ): """ Wraps an input so that __str__ gives the "param_dict" representation. @@ -93,7 +67,18 @@ class InputValueWrapper( ToolParameterValueWrapper ): self._other_values = other_values def __str__( self ): - return self.input.to_param_dict_string( self.value, self._other_values ) + to_param_dict_string = self.input.to_param_dict_string( self.value, self._other_values ) + if isinstance( to_param_dict_string, list ): + return ','.join( to_param_dict_string ) + else: + return to_param_dict_string + + def __iter__( self ): + to_param_dict_string = self.input.to_param_dict_string( self.value, self._other_values ) + if not isinstance( to_param_dict_string, list ): + return iter( [ to_param_dict_string ] ) + else: + return iter( to_param_dict_string ) def __getattr__( self, key ): return getattr( self.value, key ) diff --git a/lib/galaxy/web/base/interactive_environments.py b/lib/galaxy/web/base/interactive_environments.py index f14fc7174d2..5e12e166565 100644 --- a/lib/galaxy/web/base/interactive_environments.py +++ b/lib/galaxy/web/base/interactive_environments.py @@ -1,14 +1,12 @@ import ConfigParser -import hashlib import os import random +import tempfile +import subprocess from galaxy.util.bunch import Bunch from galaxy import web -from galaxy import eggs -eggs.require("PyYAML") -import yaml from galaxy.managers import api_keys import logging @@ -42,6 +40,13 @@ class InteractiveEnviornmentRequest(object): self.attr.HOST = trans.request.host.rsplit(':', 1)[0] self.attr.PORT = self.attr.proxy_request[ 'proxied_port' ] + # Generate per-request passwords the IE plugin can use to configure + # the destination container. + self.notebook_pw_salt = self.generate_password(length=12) + self.notebook_pw = self.generate_password(length=24) + + self.temp_dir = os.path.abspath( tempfile.mkdtemp() ) + def load_deploy_config(self, default_dict={}): # For backwards compat, any new variables added to the base .ini file # will need to be recorded here. The ConfigParser doesn't provide a @@ -68,9 +73,9 @@ class InteractiveEnviornmentRequest(object): self.attr.APACHE_URLS = _boolean_option("apache_urls") self.attr.SSL_URLS = _boolean_option("ssl") - def write_conf_file(self, output_directory, extra={}): + def get_conf_dict(self): """ - Build up a configuration file that is standard for ALL IEs. + Build up a configuration dictionary that is standard for ALL IEs. TODO: replace hashed password with plaintext. """ @@ -92,27 +97,11 @@ class InteractiveEnviornmentRequest(object): else: conf_file['galaxy_url'] = request.application_url.rstrip('/') + '/' web_port = self.attr.galaxy_config.galaxy_infrastructure_web_port - conf_file['galaxy_paster_port'] = web_port or self.attr.galaxy_config.guess_galaxy_port() + conf_file['galaxy_web_port'] = web_port or self.attr.galaxy_config.guess_galaxy_port() + # Galaxy paster port is deprecated + conf_file['galaxy_paster_port'] = conf_file['galaxy_web_port'] - if self.attr.PASSWORD_AUTH: - # Generate a random password + salt - notebook_pw_salt = self.generate_password(length=12) - notebook_pw = self.generate_password(length=24) - m = hashlib.sha1() - m.update( notebook_pw + notebook_pw_salt ) - conf_file['notebook_password'] = 'sha1:%s:%s' % (notebook_pw_salt, m.hexdigest()) - # Should we use password based connection or "default" connection style in galaxy - else: - notebook_pw = "None" - - # Some will need to pass extra data - for extra_key in extra: - conf_file[extra_key] = extra[extra_key] - - self.attr.notebook_pw = notebook_pw - # Write conf - with open( os.path.join( output_directory, 'conf.yaml' ), 'wb' ) as handle: - handle.write( yaml.dump(conf_file, default_flow_style=False) ) + return conf_file def generate_hex(self, length): return ''.join(random.choice('0123456789abcdef') for _ in range(length)) @@ -165,12 +154,26 @@ class InteractiveEnviornmentRequest(object): .replace('${PORT}', str(self.attr.PORT)) return url - def docker_cmd(self, temp_dir): + def docker_cmd(self, env_override={}): """ Generate and return the docker command to execute """ - return '%s run -d %s -p %s:%s -v "%s:/import/" %s' % \ + temp_dir = self.temp_dir + conf = self.get_conf_dict() + conf.update(env_override) + env_str = ' '.join(['-e "%s=%s"' % (key.upper(), item) for key, item in conf.items()]) + return '%s run %s -d %s -p %s:%s -v "%s:/import/" %s' % \ (self.attr.viz_config.get("docker", "command"), + env_str, self.attr.viz_config.get("docker", "command_inject"), self.attr.PORT, self.attr.docker_port, temp_dir, self.attr.viz_config.get("docker", "image")) + + def launch(self, raw_cmd=None, env_override={}): + if raw_cmd is None: + raw_cmd = self.docker_cmd(env_override=env_override) + log.info("Starting docker container for IE {0} with command [{1}]".format( + self.attr.viz_id, + raw_cmd + )) + subprocess.call(raw_cmd, shell=True) diff --git a/lib/galaxy/web/proxy/js/lib/proxy.js b/lib/galaxy/web/proxy/js/lib/proxy.js index 242c063713e..ad4276d90e3 100644 --- a/lib/galaxy/web/proxy/js/lib/proxy.js +++ b/lib/galaxy/web/proxy/js/lib/proxy.js @@ -36,6 +36,23 @@ var DynamicProxy = function(options) { }; DynamicProxy.prototype.rewriteRequest = function(request) { + if(request.url.indexOf('rstudio') != -1){ + var remap = { + 'content-type': 'Content-Type', + 'content-length': 'Content-Length', + } + // RStudio isn't spec compliant and pitches a fit on NodeJS's http module's lowercase HTTP headers + for(var i = 0; i 2: + message = argv[2] + elif not (ident.startswith("pr") or ident.startswith("issue")): + api_url = urlparse.urljoin(PROJECT_API, "commits/%s" % ident) + req = requests.get(api_url).json() + commit = req["commit"] + message = commit["message"] + message = get_first_sentence(message) + elif requests is not None and ident.startswith("pr"): + pull_request = ident[len("pr"):] + api_url = urlparse.urljoin(PROJECT_API, "pulls/%s" % pull_request) + req = requests.get(api_url).json() + message = req["title"] + elif requests is not None and ident.startswith("issue"): + issue = ident[len("issue"):] + api_url = urlparse.urljoin(PROJECT_API, "issues/%s" % pull_request) + req = requests.get(api_url).json() + message = req["title"] + else: + message = "" + + to_doc = message + " " + + if ident.startswith("pr"): + pull_request = ident[len("pr"):] + text = ".. _Pull Request {0}: {1}/pull/{0}".format(pull_request, PROJECT_URL) + history = extend(".. github_links", text) + to_doc += "`Pull Request {0}`_".format(pull_request) + elif ident.startswith("issue"): + issue = ident[len("issue"):] + text = ".. _Issue {0}: {1}/issues/{0}".format(issue, PROJECT_URL) + history = extend(".. github_links", text) + to_doc += "`Issue {0}`_".format(issue) + else: + short_rev = ident[:7] + text = ".. _{0}: {1}/commit/{0}".format(short_rev, PROJECT_URL) + history = extend(".. github_links", text) + to_doc += "{0}_".format(short_rev) + + to_doc = wrap(to_doc) + history = extend(".. to_doc", to_doc) + open(history_path, "w").write(history.encode("utf-8")) + + +def get_first_sentence(message): + first_line = message.split("\n")[0] + return first_line + + +def wrap(message): + wrapper = textwrap.TextWrapper(initial_indent="* ") + wrapper.subsequent_indent = ' ' + wrapper.width = 78 + return "\n".join(wrapper.wrap(message)) + +if __name__ == "__main__": + main(sys.argv) diff --git a/scripts/functional_tests.py b/scripts/functional_tests.py index de56a42b1c3..98d22f1f9c6 100644 --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -74,7 +74,10 @@ default_galaxy_test_port_max = 9999 default_galaxy_locales = 'en' default_galaxy_test_file_dir = "test-data,https://github.com/galaxyproject/galaxy-test-data.git" migrated_tool_panel_config = 'config/migrated_tools_conf.xml' -installed_tool_panel_configs = [ 'config/shed_tool_conf.xml' ] +installed_tool_panel_configs = [ + os.environ.get('GALAXY_TEST_SHED_TOOL_CONF', 'config/shed_tool_conf.xml') +] + # should this serve static resources (scripts, images, styles, etc.) STATIC_ENABLED = True diff --git a/static/maps/mvc/form/form-parameters.js.map b/static/maps/mvc/form/form-parameters.js.map index 93c6937a9c6..3f2f81e9e05 100644 --- a/static/maps/mvc/form/form-parameters.js.map +++ b/static/maps/mvc/form/form-parameters.js.map @@ -1 +1 @@ -{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","ColorPicker","Backbone","Model","extend","types","text","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","initialize","app","this","create","input_def","undefined","value","default_value","field","fieldClass","type","call","incompatible","options","_fieldSelect","_fieldText","console","debug","_fieldData","is_workflow","info","name","textify","extensions","toString","_fieldHidden","self","View","id","optional","multiple","onchange","trigger","length","error_text","i","option","push","label","SelectClass","Select","display","Checkbox","Radio","searchable","_fieldDrilldown","Drilldown","area","validate","$","isArray","str_value","String","Input","_fieldSlider","Slider","precise","min","max","Hidden","_fieldBoolean","RadioButton","_fieldColor","_fie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AAczB,EAAUyB,SACxBC,SAAc1B,EAAU0B,SACxBC,SAAc,WACVL,EAAKzB,IAAI+B,QAAQ"} \ No newline at end of file +{"version":3,"file":"form-parameters.js","sources":["../../../src/mvc/form/form-parameters.js"],"names":["define","Utils","Ui","SelectContent","SelectLibrary","SelectFtp","ColorPicker","Backbone","Model","extend","types","text","select","data_column","genomebuild","data","data_collection","integer","float","boolean","drill_down","color","hidden","hidden_data","baseurl","library_data","ftpfile","initialize","app","this","create","input_def","undefined","value","default_value","field","fieldClass","type","call","incompatible","options","_fieldSelect","_fieldText","console","debug","_fieldData","is_workflow","info","name","textify","extensions","toString","_fieldHidden","self","View","id","optional","multiple","onchange","trigger","length","error_text","i","option","push","label","SelectClass","Select","display","Checkbox","Radio","searchable","_fieldDrilldown","Drilldown","area","validate","$","isArray","str_value","String","Input","_fieldSlider","Slider","precise","min","max","Hidden","_fieldBoolean","RadioButton","_fieldColor","_fieldLibrary","_fieldFtp"],"mappings":"AAGAA,QAAQ,cACA,iBACA,+BACA,2BACA,uBACA,0BACJ,SAASC,EAAOC,EAAIC,EAAeC,EAAeC,EAAWC,GAG7D,MAAOC,UAASC,MAAMC,QAElBC,OACIC,KAAsB,aACtBC,OAAsB,eACtBC,YAAsB,eACtBC,YAAsB,eACtBC,KAAsB,aACtBC,gBAAsB,aACtBC,QAAsB,eACtBC,QAAsB,eACtBC,UAAsB,gBACtBC,WAAsB,kBACtBC,MAAsB,cACtBC,OAAsB,eACtBC,YAAsB,eACtBC,QAAsB,eACtBC,aAAsB,gBACtBC,QAAsB,aAI1BC,WAAY,SAASC,GACjBC,KAAKD,IAAMA,GAKfE,OAAQ,SAASC,GAEWC,SAApBD,EAAUE,QACVF,EAAUE,MAAQ,MAEUD,SAA5BD,EAAUG,gBACVH,EAAUG,cAAgBH,EAAUE,MAIxC,IAAIE,GAAQ,KAGRC,EAAaP,KAAKnB,MAAMqB,EAAUM,KA6BtC,OA5BID,IAA2C,kBAAtBP,MAAKO,KAC1BD,EA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c,WACVL,EAAKzB,IAAI+B,QAAQ,cAO7BP,aAAc,SAASrB,GACnB,MAAO,IAAI7B,GAAGoF,QACV/B,GAAc,SAAWxB,EAAUwB,GACnCR,KAAchB,EAAUgB,QAMhCwC,cAAe,SAASxD,GACpB,GAAIsB,GAAOxB,IACX,OAAO,IAAI3B,GAAGsF,YAAYlC,MACtBC,GAAc,SAAWxB,EAAUwB,GACnCxC,OAAkBkD,MAAQ,MAAOhC,MAAQ,SACvBgC,MAAQ,KAAOhC,MAAQ,UACzCyB,SAAc,WACVL,EAAKzB,IAAI+B,QAAQ,cAO7B8B,YAAa,SAAS1D,GAClB,GAAIsB,GAAOxB,IACX,OAAO,IAAIvB,IACPiD,GAAc,SAAWxB,EAAUwB,GACnCG,SAAc,WACVL,EAAKzB,IAAI+B,QAAQ,cAO7B+B,cAAe,SAAS3D,GACpB,GAAIsB,GAAOxB,IACX,OAAO,IAAIzB,GAAckD,MACrBC,GAAc,SAAWxB,EAAUwB,GACnCC,SAAczB,EAAUyB,SACxBC,SAAc1B,EAAU0B,SACxBC,SAAc,WACVL,EAAKzB,IAAI+B,QAAQ,cAO7BgC,UAAW,SAAS5D,GAChB,GAAIsB,GAAOxB,IACX,OAAO,IAAIxB,GAAUiD,MACjBC,GAAc,SAAWxB,EAAUwB,GACnCC,SAAczB,EAAUyB,SACxBC,SAAc1B,EAAU0B,SACxBC,SAAc,WACVL,EAAKzB,IAAI+B,QAAQ"} \ No newline at end of file diff --git a/static/maps/mvc/form/form-section.js.map b/static/maps/mvc/form/form-section.js.map index 0f70e94f54c..285fa3183b5 100644 --- a/static/maps/mvc/form/form-section.js.map +++ b/static/maps/mvc/form/form-section.js.map @@ -1 +1 @@ -{"version":3,"file":"form-section.js","sources":["../../../src/mvc/form/form-section.js"],"names":["define","Utils","Table","Ui","Portlet","Repeat","InputElement","Parameters","View","Backbone","extend","initialize","app","options","this","inputs","cls","cls_tr","table","parameters","setElement","$el","render","delAll","i","add","input","input_def","jQuery","id","uid","input_list","type","_addConditional","_addRepeat","_addSection","_addRow","self","test_param","field","onchange","value","selectedCase","data","matchCase","cases","case_def","section_id","section_row","get","nonhidden","j","hidden","fadeIn","hide","trigger","sub_section_id","sub_section","addClass","append","create","block_index","repeat","ondel","del","title","title_new","min","max","onnew","n_min","n_cache","_","size","cache","Math","input_element","label","help","button_visible","ButtonIcon","icon","tooltip","portlet","operations","$","html","visible","$content","$header","css","on","setIcon","expanded","field_list","name","default_value","collapsible","element_list"],"mappings":"AAGAA,QAAQ,cACA,kBACA,iBACA,oBACA,uBACA,sBACA,4BACJ,SAASC,EAAOC,EAAOC,EAAIC,EAASC,EAAQC,EAAcC,GAG1D,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAY,SAASC,EAAKC,GAEtBC,KAAKF,IAAMA,EAGXE,KAAKC,OAASF,EAAQE,OAGtBF,EAAQG,IAAM,iBAIdH,EAAQI,OAAS,cAGjBH,KAAKI,MAAQ,GAAIhB,GAAMM,KAAKK,GAG5BC,KAAKK,WAAa,GAAIZ,GAAWK,EAAKC,GAGtCC,KAAKM,WAAWN,KAAKI,MAAMG,KAG3BP,KAAKQ,UAKTA,OAAQ,WAEJR,KAAKI,MAAMK,QAGX,KAAK,GAAIC,KAAKV,MAAKC,OACfD,KAAKW,IAAIX,KAAKC,OAAOS,KAM7BC,IAAK,SAASC,GAEV,GAGIC,GAAYC,OAAOlB,QAAO,KAAUgB,EAGxCC,GAAUE,GAAKH,EAAMG,GAAK5B,EAAM6B,MAGhChB,KAAKF,IAAImB,WAAWJ,EAAUE,IAAMF,CAGpC,IAAIK,GAAOL,EAAUK,IACrB,QAAOA,GAEH,IAAK,cACDlB,KAAKmB,gBAAgBN,EACrB,MAEJ,KAAK,SACDb,KAAKoB,WAAWP,EAChB,MAEJ,KAAK,UACDb,KAAKqB,YAAYR,EACjB,MAEJ,SACIb,KAAKsB,QAAQT,KAMzBM,gBAAiB,SAASN,GAEtB,GAAIU,GAAOvB,IAGXa,GAAUW,WAAWT,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0D,EAAQ9D,KAGvBP,KAAKI,MAAMyC,OAAOhC,EAAUE,KAKhCO,QAAS,SAAST,GAEd,GAAIE,GAAKF,EAAUE,GAGfU,EAAQzB,KAAKK,WAAWyC,OAAOjC,EAGnCb,MAAKF,IAAIkF,WAAWjE,GAAMU,CAG1B,IAAIqC,GAAgB,GAAItE,GAAaQ,KAAKF,KACtCiE,MAAkBlD,EAAUkD,OAASlD,EAAUoE,KAC/CC,cAAkBrE,EAAUqE,cAC5BC,YAAkBtE,EAAUsE,YAC5BnB,KAAkBnD,EAAUmD,KAC5BvC,MAAkBA,GAkBtB,OAdAzB,MAAKF,IAAIsF,aAAarE,GAAM+C,EAG5B9D,KAAKI,MAAMO,IAAImD,EAAcvD,KAG7BP,KAAKI,MAAMyC,OAAO9B,GAGdF,EAAUyB,QACVtC,KAAKI,MAAM+B,IAAIpB,GAAIyB,OAIhBf,IAIf,QACI/B,KAAMA"} \ No newline at end of file +{"version":3,"file":"form-section.js","sources":["../../../src/mvc/form/form-section.js"],"names":["define","Utils","Table","Ui","Portlet","Repeat","InputElement","Parameters","View","Backbone","extend","initialize","app","options","this","inputs","cls","cls_tr","table","parameters","setElement","$el","render","delAll","i","add","input","input_def","jQuery","id","uid","input_list","type","_addConditional","_addRepeat","_addSection","_addRow","self","test_param","field","onchange","value","selectedCase","data","matchCase","cases","case_def","section_id","section_row","get","nonhidden","j","hidden","fadeIn","hide","trigger","sub_section_id","sub_section","addClass","append","create","block_index","repeat","ondel","del","title","title_new","min","max","onnew","n_min","n_cache","_","size","cache","Math","input_element","label","help","button_visible","ButtonIcon","icon","tooltip","portlet","operations","$","html","visible","$content","$header","css","on","setIcon","input_id","find","length","expanded","field_list","name","default_value","collapsible","element_list"],"mappings":"AAGAA,QAAQ,cACA,kBACA,iBACA,oBACA,uBACA,sBACA,4BACJ,SAASC,EAAOC,EAAOC,EAAIC,EAASC,EAAQC,EAAcC,GAG1D,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAY,SAAS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5BtB,KAAkBnD,EAAUmD,KAC5BvC,MAAkBA,GAkBtB,OAdAzB,MAAKF,IAAIyF,aAAaxE,GAAM+C,EAG5B9D,KAAKI,MAAMO,IAAImD,EAAcvD,KAG7BP,KAAKI,MAAMyC,OAAO9B,GAGdF,EAAUyB,QACVtC,KAAKI,MAAM+B,IAAIpB,GAAIyB,OAIhBf,IAIf,QACI/B,KAAMA"} \ No newline at end of file diff --git a/static/maps/mvc/form/form-view.js.map b/static/maps/mvc/form/form-view.js.map index 0945822af38..1da92f4bfbe 100644 --- a/static/maps/mvc/form/form-view.js.map +++ b/static/maps/mvc/form/form-view.js.map @@ -1 +1 @@ -{"version":3,"file":"form-view.js","sources":["../../../src/mvc/form/form-view.js"],"names":["define","Utils","Portlet","Ui","FormSection","FormData","Backbone","View","extend","initialize","options","this","optionsDefault","is_workflow","narrow","initial_errors","cls","merge","console","debug","galaxy","parent","Galaxy","modal","Modal","setElement","_build","update","new_model","self","data","matchModel","input_id","node","input","input_list","_","isEqual","field","field_list","new_options","indexOf","type","i","opt","length","push","label","value","trigger","wait","active","is_dynamic","unwait","reciept","$el","empty","append","highlight","message","silent","input_element","element_list","error","$","animate","scrollTop","offset","top","errors","error_messages","matchResponse","off","_renderForm","create","current_check","checksum","on","new_check","onchange","reset","Message","section","inputs","incompatible","hide","show","portlet","icon","title","operations","buttons","addClass","persistent","status"],"mappings":"AAGAA,QAAQ,cAAe,oBAAqB,iBACpC,wBAAyB,sBAC7B,SAASC,EAAOC,EAASC,EAAIC,EAAaC,GAG1C,MAAOC,UAASC,KAAKC,QAEjBC,WAAY,SAASC,GAEjBC,KAAKC,gBAEDC,aAAkB,EAElBC,QAAkB,EAElBC,gBAAkB,EAElBC,IAAkB,sBAItBL,KAAKD,QAAUT,EAAMgB,MAAMP,EAASC,KAAKC,gBAGzCM,QAAQC,MAAMR,KAAKD,QAGnB,IAAIU,GAASC,OAAOC,MAEhBX,MAAKY,MADLH,GAAUA,EAAOG,MACJH,EAAOG,MAE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G9CjF,KAAK4E,QAAQ9B,OAAO9C,KAAKuE,QAAQ3B,KAGjC5C,KAAK4C,IAAIC,QACT7C,KAAK4C,IAAIE,OAAO9C,KAAK4E,QAAQhC,KAGzB5C,KAAKD,QAAQiD,SACbhD,KAAKgD,QAAQhC,QACTkE,YAAc,EACdC,OAAc,UACdnC,QAAchD,KAAKD,QAAQiD,cAKnCzC,SAAQC,MAAM"} \ No newline at end of file +{"version":3,"file":"form-view.js","sources":["../../../src/mvc/form/form-view.js"],"names":["define","Utils","Portlet","Ui","FormSection","FormData","Backbone","View","extend","initialize","options","this","optionsDefault","is_workflow","narrow","initial_errors","cls","merge","console","debug","galaxy","parent","Galaxy","modal","Modal","setElement","_build","update","new_model","self","data","matchModel","input_id","node","input","input_list","_","isEqual","field","field_list","new_options","indexOf","type","i","opt","length","push","label","value","trigger","wait","active","is_dynamic","unwait","reciept","$el","empty","append","highlight","message","silent","input_element","element_list","error","$","animate","scrollTop","offset","top","errors","error_messages","matchResponse","off","_renderForm","create","current_check","checksum","on","new_check","onchange","reset","Message","section","inputs","incompatible","hide","show","portlet","icon","title","operations","buttons","addClass","persistent","status"],"mappings":"AAGAA,QAAQ,cAAe,oBAAqB,iBACpC,wBAAyB,sBAC7B,SAASC,EAAOC,EAASC,EAAIC,EAAaC,GAG1C,MAAOC,UAASC,KAAKC,QAEjBC,WAAY,SAASC,GAEjBC,KAAKC,gBAEDC,aAAkB,EAElBC,QAAkB,EAElBC,gBAAkB,EAElBC,IAAkB,sBAItBL,KAAKD,QAAUT,EAAMgB,MAAMP,EAASC,KAAKC,gBAGzCM,QAAQC,MAAMR,KAAKD,QAGnB,IAAIU,GAASC,OAAOC,MAEhBX,MAAKY,MADLH,GAAUA,EAAOG,MACJH,EAAOG,MAEP,GAAIpB,GAAGqB,MAAMjB,KAI9BI,KAAKc,WAAW,UAGhBd,KAAKe,UAITC,OAAQ,SAASC,GACb,GAAIC,GAAOlB,IACXA,MAAKmB,KAAKC,WAAWH,EAAW,SA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,KAAK4E,QAAQhC,KAGzB5C,KAAKD,QAAQiD,SACbhD,KAAKgD,QAAQhC,QACTkE,YAAc,EACdC,OAAc,UACdnC,QAAchD,KAAKD,QAAQiD,cAKnCzC,SAAQC,MAAM"} \ No newline at end of file diff --git a/static/maps/mvc/ui/ui-list.js.map b/static/maps/mvc/ui/ui-list.js.map new file mode 100644 index 00000000000..c881f781e2b --- /dev/null +++ b/static/maps/mvc/ui/ui-list.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ui-list.js","sources":["../../../src/mvc/ui/ui-list.js"],"names":["define","Utils","Portlet","Ui","View","Backbone","extend","initialize","options","self","this","name","multiple","message","Message","cls","portlet","select","Select","optional","button","ButtonIcon","icon","floating","tooltip","onclick","add","id","value","text","setElement","_template","$","append","$el","val","undefined","empty","isArray","i","v","v_id","v_name","type","_refresh","lst","each","push","prop","find","html","length","validate","_templateRow","on","remove","addClass","removeClass","update","status","disable","show","enable","hide","onchange"],"mappings":"AACAA,QAAQ,cAAe,oBAAqB,kBAAmB,SAASC,EAAOC,EAASC,GAGxF,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAa,SAASC,GAElB,GAAIC,GAAOC,IAGXA,MAAKF,QAAUA,EACfE,KAAKC,KAAOH,EAAQG,MAAQ,UAC5BD,KAAKE,SAAWJ,EAAQI,WAAY,EAGpCF,KAAKG,QAAU,GAAIV,GAAGW,SAAUC,IAAK,kBAGrCL,KAAKM,QAAU,GAAId,GAAQE,MAAOW,IAAK,uBAGvCL,KAAKO,OAAS,GAAId,GAAGe,OAAOd,MAAOe,SAAWX,EAAQW,WAGtDT,KAAKU,OAAS,GAAIjB,GAAGkB,YACjBC,KAAc,gBACdC,SAAc,OACdC,QAAc,cAAgBd,KAAKC,KACnCc,QAAc,WACVhB,EAAKiB,KACDC,GAAUlB,EAAKQ,OAAOW,QACtBjB,KAAUF,EAAKQ,OAAOY,YAMlCnB,KAAKoB,WAAWpB,KAAKqB,UAAUvB,IAC/BE,KAAKsB,EA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BAA2BH,KAAKC,KAAO,IAAKgD,OAAQ,eAGvFjD,MAAKG,QAAQ6C,QAAS7C,QAAS,QAAUH,KAAKC,KAAO,8BAK7D+C,OAAQ,SAASlD,GACbE,KAAKO,OAAOyC,OAAOlD,IAIvBoC,SAAU,WACFlC,KAAKsB,EAAE,eAAemB,OAAS,IAC9BzC,KAAKE,UAAYF,KAAKU,OAAOwC,UAC9BlD,KAAKsB,EAAE,oBAAoB6B,SAE3BnD,KAAKU,OAAO0C,SACZpD,KAAKsB,EAAE,oBAAoB+B,QAE/BrD,KAAKF,QAAQwD,UAAYtD,KAAKF,QAAQwD,YAI1CjC,UAAW,WACP,MAAQ,wLAWZsB,aAAc,SAAS7C,GACnB,MAAQ,YAAcA,EAAQmB,GAAK,6FAESnB,EAAQG,KAAO,kBAKnE,QACIP,KAAMA"} \ No newline at end of file diff --git a/static/maps/mvc/ui/ui-misc.js.map b/static/maps/mvc/ui/ui-misc.js.map index 959d74386da..56be4113766 100644 --- a/static/maps/mvc/ui/ui-misc.js.map +++ b/static/maps/mvc/ui/ui-misc.js.map @@ -1 +1 @@ -{"version":3,"file":"ui-misc.js","sources":["../../../src/mvc/ui/ui-misc.js"],"names":["define","Utils","Select","Slider","Options","Drilldown","ButtonMenu","ButtonCheck","Modal","Image","Backbone","View","extend","optionsDefault","url","cls","initialize","options","this","merge","setElement","_template","Label","title","new_title","$el","html","value","Icon","floating","icon","tooltip","placement","$","el","Button","id","uid","on","hide","onclick","wait","removeClass","addClass","prop","unwait","str","ButtonIcon","$button","find","self","disabled","disable","enable","setIcon","icon_cls","width","Anchor","Message","message","status","persistent","update","append","fadeIn","timeout","window","clearTimeout","setTimeout","is","fadeOut","Searchbox","searchword","search_field","val","Input","type","placeholder","visible","area","undefined","onchange","new_val","Hidden","tmpl","info","RadioButton","Checkbox","Radio"],"mappings":"AACAA,QAAQ,cACJ,2BACA,mBACA,oBACA,sBACA,wBACA,yBACA,mBACA,SAASC,EAAOC,EAAQC,EAAQC,EAAS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ACdiF,OAAcA,EACdhF,OAAcA,EACdE,UAAcA"} \ No newline at end of file +{"version":3,"file":"ui-misc.js","sources":["../../../src/mvc/ui/ui-misc.js"],"names":["define","Utils","Select","Slider","Options","Drilldown","ButtonMenu","ButtonCheck","Modal","Image","Backbone","View","extend","optionsDefault","url","cls","initialize","options","this","merge","setElement","_template","Label","title","new_title","$el","html","value","Icon","floating","icon","tooltip","placement","$","el","Button","id","uid","on","hide","onclick","wait","removeClass","addClass","prop","unwait","str","ButtonIcon","$button","find","self","disabled","disable","enable","setIcon","icon_cls","width","Anchor","Message","message","status","persistent","update","append","fadeIn","timeout","window","clearTimeout","setTimeout","is","fadeOut","Searchbox","searchword","search_field","val","Input","type","placeholder","visible","area","undefined","onchange","new_val","Hidden","tmpl","info","RadioButton","Checkbox","Radio"],"mappings":"AACAA,QAAQ,cACJ,2BACA,mBACA,oBACA,sBACA,wBACA,yBACA,mBACA,SAASC,EAAOC,EAAQC,EAAQC,EAASC,EAAWC,EAAYC,EAAaC,GAOjF,GAAIC,GAAQC,SAASC,KAAKC,QAEtBC,gBACIC,IAAO,GACPC,IAAO,IAIXC,WAAa,SAASC,GAElBC,KAAKD,QAAUhB,EAAMkB,MAAMF,EAASC,KAAKL,gBAGzCK,KAAKE,WAAWF,KAAKG,UAAUH,KAAKD,WAIxCI,UAAW,SAASJ,GAChB,MAAO,wBAA0BA,EAAQF,IAAM,UAAYE,EAAQH,IAAM,SAK7EQ,EAAQZ,SAASC,KAAKC,QAEtBC,gBACIU,MAAS,GACTR,IAAS,IAIbC,WAAa,SAASC,GAElBC,KAAKD,QAAUhB,EAAMkB,MAAMF,EAASC,KAAKL,gBAGzCK,KAAKE,WAAWF,KAAKG,UAAUH,KAAKD,WAIxCM,MAAO,SAASC,GACZN,KAAKO,IAAIC,KAAKF,IAIlBH,UAAW,SAASJ,GAChB,MAAO,0BAA4BA,EAAQF,IAAM,KAAOE,EAAQM,MAAQ,YAI5EI,MAAO,WACH,MAAOV,SAAQM,SAK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KAAKE,WAAWF,KAAKG,UAAUH,KAAKD,UAGT+D,SAAvB9D,KAAKD,QAAQU,OACbT,KAAKS,MAAMT,KAAKD,QAAQU,QAKhCA,MAAQ,SAAUuD,GAId,MAHgBF,UAAZE,GACAhE,KAAKe,EAAE,UAAUyC,IAAIQ,GAElBhE,KAAKe,EAAE,UAAUyC,OAI5BrD,UAAW,SAASJ,GAChB,GAAImE,GAAQ,YAAcnE,EAAQmB,GAAK,KAMvC,OALInB,GAAQoE,OACRD,GAAY,QAAUnE,EAAQoE,KAAO,UAEzCD,GAAgB,kBAAoBnE,EAAQU,MAAQ,cAO5D,QACI8B,OAAcA,EACdtB,OAAcA,EACdY,WAAcA,EACdxC,YAAcA,EACdD,WAAcA,EACdsB,KAAcA,EACdnB,MAAcA,EACdkE,MAAcA,EACdrD,MAAcA,EACdoC,QAAcA,EACdlD,MAAcA,EACd8E,YAAclF,EAAQkF,YACtBC,SAAcnF,EAAQmF,SACtBC,MAAcpF,EAAQoF,MACtBjB,UAAcA,EACdrE,OAAcA,EACdiF,OAAcA,EACdhF,OAAcA,EACdE,UAAcA"} \ No newline at end of file diff --git a/static/maps/mvc/ui/ui-portlet.js.map b/static/maps/mvc/ui/ui-portlet.js.map index 3aac2c81c61..a305cd5003e 100644 --- a/static/maps/mvc/ui/ui-portlet.js.map +++ b/static/maps/mvc/ui/ui-portlet.js.map @@ -1 +1 @@ -{"version":3,"file":"ui-portlet.js","sources":["../../../src/mvc/ui/ui-portlet.js"],"names":["define","Utils","View","Backbone","extend","visible","optionsDefault","id","uid","title","icon","buttons","body","scrollable","nopadding","operations","placement","cls","operations_flt","$title","$content","$buttons","$operations","$header","initialize","options","this","merge","setElement","_template","$el","find","$portlet_content","css","$","el","self","each","name","item","prop","append","remove","content","show","fadeIn","hide","fadeOut","enableButton","disableButton","hideOperation","showOperation","setOperation","callback","off","on","new_title","html","disable","enable","tmpl"],"mappings":"AACAA,QAAQ,eAAgB,SAASC,GAGjC,GAAIC,GAAOC,SA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file +{"version":3,"file":"ui-portlet.js","sources":["../../../src/mvc/ui/ui-portlet.js"],"names":["define","Utils","View","Backbone","extend","visible","optionsDefault","id","uid","title","icon","buttons","body","scrollable","nopadding","operations","placement","cls","operations_flt","$title","$content","$buttons","$operations","$header","initialize","options","this","merge","setElement","_template","$el","find","$portlet_content","css","$","el","self","each","name","item","prop","append","remove","empty","content","show","fadeIn","hide","fadeOut","enableButton","disableButton","hideOperation","showOperation","setOperation","callback","off","on","new_title","html","disable","enable","tmpl"],"mappings":"AACAA,QAAQ,eAAgB,SAASC,GAGjC,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,SAAS,EAGTC,gBACIC,GAAkBN,EAAMO,MACxBC,MAAkB,GAClBC,KAAkB,GAClBC,QAAkB,KAClBC,KAAkB,KAClBC,YAAkB,EAClBC,WAAkB,EAClBC,WAAkB,KAClBC,UAAkB,SAClBC,IAAkB,aAClBC,eAAkB,SAItBC,OAAS,KACTC,SAAW,KACXC,SAAW,KACXC,YAAc,KACdC,QAAU,KAGVC,WAAa,SAASC,GAElBC,KAAKD,QAAUxB,EAAM0B,MAAMF,EAASC,KAAKpB,gBAGzCoB,KAAKE,WAAWF,KAAKG,UAAUH,KAAKD,UAGpCC,KAAKN,SAAWM,KAAKI,IAAIC,KAAK,YAG9BL,KAAKP,OAASO,KAAKI,IAAIC,KAAK,uBAG5BL,KAAKH,QAAUG,KAAKI,IAAIC,KAAK,kBAG7B,IAAIC,GAAmBN,KAAKI,IAAIC,KAAK,mBAUrC,IAPIL,KAAKD,QAAQX,YACbkB,EAAiBC,IAAI,UAAW,OAChCP,KAAKN,SAASa,IAAI,UAAW,QAIjCP,KAAKL,SAAWa,EAAER,KAAKS,IAAIJ,KAAK,YAC5BL,KAAKD,QAAQd,QAAS,CAEtB,GAAIyB,GAAOV,IACXQ,GAAEG,KAAKX,KAAKD,QAAQd,QAAS,SAAS2B,EAAMC,GACxCA,EAAKT,IAAIU,KAAK,KAAMF,GACpBF,EAAKf,SAASoB,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QAIhClB,UAAW,SAASJ,GAChB,GAAIoC,GAAQ,YAAcpC,EAAQlB,GAAK,YAAckB,EAAQR,IAAM,IA6BnE,OA3BIQ,GAAQhB,QACRoD,GAAY,6EACuDpC,EAAQP,eAAiB,uCAGxFO,EAAQf,OACRmD,GAAgB,qBAAuBpC,EAAQf,KAAO,gBAE1DmD,GAAoB,oCAAsCpC,EAAQhB,MAAQ,uBAI9EoD,GAAgB,gCAES,OAArBpC,EAAQT,YACR6C,GAAgB,+BAGpBA,GAAoB,8BAEK,UAArBpC,EAAQT,YACR6C,GAAgB,+BAGpBA,GAAgB,gDAOxB,QACI3D,KAAOA"} \ No newline at end of file diff --git a/static/maps/mvc/ui/ui-select-ftp.js.map b/static/maps/mvc/ui/ui-select-ftp.js.map new file mode 100644 index 00000000000..31cb7c09e4c --- /dev/null +++ b/static/maps/mvc/ui/ui-select-ftp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ui-select-ftp.js","sources":["../../../src/mvc/ui/ui-select-ftp.js"],"names":["define","Utils","List","View","Backbone","extend","initialize","options","self","this","ftpfile_list","name","optional","multiple","onchange","value","setElement","$el","get","url","galaxy_config","root","success","response","data","i","push","label","update","val"],"mappings":"AACAA,QAAQ,cAAe,kBACf,SAASC,EAAOC,GAKxB,GAAIC,GAAOC,SAASD,KAAKE,QAErBC,WAAa,SAASC,GAElB,GAAIC,GAAOC,IAGXA,MAAKC,aAAe,GAAIR,GAAKC,MACzBQ,KAAc,OACdC,SAAcL,EAAQK,SACtBC,SAAcN,EAAQM,SACtBC,SAAc,WACVP,EAAQO,UAAYP,EAAQO,SAASN,EAAKO,YAKlDN,KAAKO,WAAWP,KAAKC,aAAaO,KAGlChB,EAAMiB,KACFC,IAAUC,cAAcC,KAAO,mBAC/BC,QAAU,SAASC,GACf,GAAIC,KACJ,KAAK,GAAIC,KAAKF,GACVC,EAAKE,MACDX,MAAUQ,EAASE,GAAS,KAC5BE,MAAUJ,EAASE,GAAS,MAGpCjB,GAAKE,aAAakB,OAAOJ,OAMrCT,MAAO,SAASc,GACZ,MAAOpB,MAAKC,aAAaK,MAAMc,KAIvC,QACI1B,KAAMA"} \ No newline at end of file diff --git a/static/maps/mvc/ui/ui-select-library.js.map b/static/maps/mvc/ui/ui-select-library.js.map index d1b53742e32..fa57eb3ba80 100644 --- a/static/maps/mvc/ui/ui-select-library.js.map +++ b/static/maps/mvc/ui/ui-select-library.js.map @@ -1 +1 @@ -{"version":3,"file":"ui-select-library.js","sources":["../../../src/mvc/ui/ui-select-library.js"],"names":["define","Utils","Ui","Libraries","Backbone","Collection","extend","url","galaxy_config","root","LibraryDatasets","initialize","self","this","config","Model","library_id","on","fetch","reset","get","View","options","libraries","datasets","library_select","Select","optional","onchange","value","set","dataset_select","multiple","trigger","data","each","model","push","id","label","update","library_current","text","setElement","_template","$","append","$el","success","undefined"],"mappings":"AACAA,QAAQ,cAAe,iBAAkB,iBAAkB,4BACnD,SAASC,EAAOC,GAGxB,GAAIC,GAAYC,SAASC,WAAWC,QAChCC,IAAKC,cAAcC,KAAO,kBAI1BC,EAAkBN,SAASC,WAAWC,QACtCK,WAAY,WACR,GAAIC,GAAOC,IACXA,MAAKC,OAAS,GAAIV,UAASW,OAAQC,WAAY,OAC/CH,KAAKC,OAAOG,GAAG,SAAU,WACrBL,EAAKM,OAAOC,OAAO,OAG3BZ,IAAK,WACD,MAAOC,eAAcC,KAAO,iBAAmBI,KAAKC,OAAOM,IAAI,cAAgB,eAKnFC,EAAOjB,SAASiB,KAAKf,QAErBK,WAAa,SAASW,GAElB,GAAIV,GAAOC,IAGXA,MAAKU,UAAa,GAAIpB,GACtBU,KAAKW,SAAa,GAAId,GAGtBG,KAAKS,QAAUA,EAGfT,KAAKY,eAAiB,GAAIvB,GAAGwB,OAAOL,MAChCM,SAAcL,EAAQK,SACtBC,SAAc,SAASC,GACnBjB,EAAKY,SAASV,OAAOgB,IAAI,aAAcD,MAK/ChB,KAAKkB,eAAiB,GAAI7B,GAAGwB,OAAOL,MAChCM,SAAcL,EAAQK,SACtBK,SAAcV,EAAQU,SACtBJ,SAAc,WACVhB,EAAKqB,QAAQ,aAKrBpB,KAAKU,UAAUN,GAAG,QAAS,WACvB,GAAIiB,KACJtB,GAAKW,UAAUY,KAAK,SAASC,GACzBF,EAAKG,MACDR,MAAUO,EAAME,GAChBC,MAAUH,EAAMhB,IAAI,YAG5BR,EAAKa,eAAee,OAAON,GAC3BtB,EAAKqB,QAAQ,YAIjBpB,KAAKW,SAASP,GAAG,QAAS,WACtB,GAAIiB,MACAO,EAAkB7B,EAAKa,eAAeiB,MAClB,QAApBD,GACA7B,EAAKY,SAASW,KAAK,SAASC,GACE,SAAtBA,EAAMhB,IAAI,SACVc,EAAKG,MACDR,MAAUO,EAAME,GAChBC,MAAUE,EAAkBL,EAAMhB,IAAI,YAKtDR,EAAKmB,eAAeS,OAAON,GAC3BtB,EAAKqB,QAAQ,YAIjBpB,KAAKI,GAAG,SAAU,WACdK,EAAQM,UAAYN,EAAQM,SAAShB,EAAKiB,WAI9ChB,KAAK8B,WAAW9B,KAAK+B,aACrB/B,KAAKgC,EAAE,mBAAmBC,OAAOjC,KAAKY,eAAesB,KACrDlC,KAAKgC,EAAE,mBAAmBC,OAAOjC,KAAKkB,eAAegB,KAGrDlC,KAAKU,UAAUL,OACXC,OAAO,EACP6B,QAAS,WACLpC,EAAKa,eAAeQ,QAAQ,UACDgB,SAAvBrC,EAAKU,QAAQO,OACbjB,EAAKiB,MAAMjB,EAAKU,QAAQO,WAOxCA,MAAO,WACH,MAAOhB,MAAKkB,eAAeF,SAI/Be,UAAW,WACP,MAAQ,+QAahB,QACIvB,KAAMA"} \ No newline at end of file +{"version":3,"file":"ui-select-library.js","sources":["../../../src/mvc/ui/ui-select-library.js"],"names":["define","Utils","Ui","Table","List","Libraries","Backbone","Collection","extend","url","galaxy_config","root","LibraryDatasets","initialize","self","this","config","Model","library_id","on","fetch","reset","get","View","options","libraries","datasets","library_select","Select","onchange","value","set","dataset_list","name","optional","multiple","trigger","data","each","model","push","id","label","update","library_current","text","setElement","_template","$","append","$el","success","undefined","val"],"mappings":"AACAA,QAAQ,cAAe,iBAAkB,kBAAmB,kBACpD,SAASC,EAAOC,EAAIC,EAAOC,GAGnC,GAAIC,GAAYC,SAASC,WAAWC,QAChCC,IAAKC,cAAcC,KAAO,kBAI1BC,EAAkBN,SAASC,WAAWC,QACtCK,WAAY,WACR,GAAIC,GAAOC,IACXA,MAAKC,OAAS,GAAIV,UAASW,OAAQC,WAAY,OAC/CH,KAAKC,OAAOG,GAAG,SAAU,WACrBL,EAAKM,OAAQC,OAAO,OAG5BZ,IAAK,WACD,MAAOC,eAAcC,KAAO,iBAAmBI,KAAKC,OAAOM,IAAI,cAAgB,eAKnFC,EAAOjB,SAASiB,KAAKf,QAErBK,WAAa,SAASW,GAElB,GAAIV,GAAOC,IAGXA,MAAKU,UAAa,GAAIpB,GACtBU,KAAKW,SAAa,GAAId,GAGtBG,KAAKS,QAAUA,EAIfT,KAAKY,eAAiB,GAAIzB,GAAG0B,OAAOL,MAChCM,SAAc,SAASC,GACnBhB,EAAKY,SAASV,OAAOe,IAAI,aAAcD,MAK/Cf,KAAKiB,aAAe,GAAI5B,GAAKmB,MACzBU,KAAc,UACdC,SAAcV,EAAQU,SACtBC,SAAcX,EAAQW,SACtBN,SAAc,WACVf,EAAKsB,QAAQ,aAKrBrB,KAAKU,UAAUN,GAAG,QAAS,WACvB,GAAIkB,KACJvB,GAAKW,UAAUa,KAAK,SAASC,GACzBF,EAAKG,MACDV,MAAUS,EAAME,GAChBC,MAAUH,EAAMjB,IAAI,YAG5BR,EAAKa,eAAegB,OAAON,KAI/BtB,KAAKW,SAASP,GAAG,QAAS,WACtB,GAAIkB,MACAO,EAAkB9B,EAAKa,eAAekB,MAClB,QAApBD,GACA9B,EAAKY,SAASY,KAAK,SAASC,GACE,SAAtBA,EAAMjB,IAAI,SACVe,EAAKG,MACDV,MAAUS,EAAME,GAChBC,MAAUH,EAAMjB,IAAI,YAKpCR,EAAKkB,aAAaW,OAAON,KAI7BtB,KAAKI,GAAG,SAAU,WACdK,EAAQK,UAAYL,EAAQK,SAASf,EAAKgB,WAI9Cf,KAAK+B,WAAW/B,KAAKgC,aACrBhC,KAAKiC,EAAE,mBAAmBC,OAAOlC,KAAKY,eAAeuB,KACrDnC,KAAKmC,IAAID,OAAOlC,KAAKiB,aAAakB,KAGlCnC,KAAKU,UAAUL,OACXC,OAAO,EACP8B,QAAS,WACLrC,EAAKa,eAAeS,QAAQ,UACDgB,SAAvBtC,EAAKU,QAAQM,OACbhB,EAAKgB,MAAMhB,EAAKU,QAAQM,WAOxCA,MAAO,SAASuB,GACZ,MAAOtC,MAAKiB,aAAaF,MAAMuB,IAInCN,UAAW,WACP,MAAQ,qKAShB,QACIxB,KAAMA"} \ No newline at end of file diff --git a/static/maps/utils/utils.js.map b/static/maps/utils/utils.js.map index b1ed897ee02..d84a0f42923 100644 --- a/static/maps/utils/utils.js.map +++ b/static/maps/utils/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sources":["../../src/utils/utils.js"],"names":["define","_","deepeach","dict","callback","i","d","sanitize","content","$","text","html","validate","value","Array","length","undefined","indexOf","textify","lst","toString","replace","pos","lastIndexOf","substr","get","options","top","__utils__get__","cache","url","success","console","debug","request","data","response","error","ajaxConfig","contentType","type","param","dataType","JSON","stringify","ajax","done","jQuery","parseJSON","e","fail","response_text","responseText","cssGetAttribute","classname","name","el","appendTo","css","remove","cssLoadFile","galaxy_config","root","merge","optionsDefault","defaults","bytesToString","size","normal_font","unit","rounded","Math","round","uid","__utils__uid__","time","Date","hours","getHours","minutes","getMinutes","datetime","getDate","getMonth","getFullYear"],"mappings":"AAMAA,QAAQ,mBAAoB,SAASC,GAIrC,QAASC,GAASC,EAAMC,GACpB,IAAK,GAAIC,KAAKF,GAAM,CAChB,GAAIG,GAAIH,EAAKE,EACTC,IAAkB,gBAAP,KACXF,EAASE,GACTJ,EAASI,EAAGF,KASxB,QAASG,GAASC,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KAEL,MADA9C,KAAI+C,eAAiB/C,IAAI+C,gBAAkB,EACpC,OAAS/C,IAAI+C,iBAMxB,QAASC,KAEL,GAAIrE,GAAI,GAAIsE,MAGRC,GAASvE,EAAEwE,WAAa,GAAK,IAAM,IAAMxE,EAAEwE,WAC3CC,GAAWzE,EAAE0E,aAAe,GAAK,IAAM,IAAM1E,EAAE0E,aAG/CC,EAAW3E,EAAE4E,UAAY,KACd5E,EAAE6E,WAAa,GAAM,IACtB7E,EAAE8E,cAAgB,KAClBP,EAAQ,IACRE,CACd,OAAOE,GAGX,OACIrB,YAAgBA,EAChBP,gBAAkBA,EAClB5B,IAAMA,EACNsC,MAAQA,EACRG,cAAeA,EACfO,IAAKA,EACLE,KAAMA,EACNzC,QAASA,EACT3B,SAAUA,EACVW,QAASA,EACTN,SAAUA,EACVV,SAAUA"} \ No newline at end of file +{"version":3,"file":"utils.js","sources":["../../src/utils/utils.js"],"names":["define","_","deepeach","dict","callback","i","d","sanitize","content","$","text","html","validate","value","Array","length","undefined","indexOf","textify","lst","toString","replace","pos","lastIndexOf","substr","get","options","top","__utils__get__","cache","url","success","console","debug","request","data","response","error","ajaxConfig","contentType","type","param","dataType","JSON","stringify","ajax","done","jQuery","parseJSON","e","fail","response_text","responseText","cssGetAttribute","classname","name","el","appendTo","css","remove","cssLoadFile","galaxy_config","root","merge","optionsDefault","defaults","bytesToString","size","normal_font","unit","rounded","Math","round","uid","__utils__uid__","time","Date","hours","getHours","minutes","getMinutes","datetime","getDate","getMonth","getFullYear"],"mappings":"AAMAA,QAAQ,mBAAoB,SAASC,GAIrC,QAASC,GAASC,EAAMC,GACpB,IAAK,GAAIC,KAAKF,GAAM,CAChB,GAAIG,GAAIH,EAAKE,EACTC,IAAkB,gBAAP,KACXF,EAASE,GACTJ,EAASI,EAAGF,KASxB,QAASG,GAASC,GACd,MAAOC,GAAE,UAAUC,KAAKF,GAASG,OAQrC,QAASC,GAAUC,GAIf,GAHMA,YAAiBC,SACnBD,GAASA,I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I,GAAIsE,MAGRC,GAASvE,EAAEwE,WAAa,GAAK,IAAM,IAAMxE,EAAEwE,WAC3CC,GAAWzE,EAAE0E,aAAe,GAAK,IAAM,IAAM1E,EAAE0E,aAG/CC,EAAW3E,EAAE4E,UAAY,KACd5E,EAAE6E,WAAa,GAAM,IACtB7E,EAAE8E,cAAgB,KAClBP,EAAQ,IACRE,CACd,OAAOE,GAGX,OACIrB,YAAgBA,EAChBP,gBAAkBA,EAClB5B,IAAMA,EACNsC,MAAQA,EACRG,cAAeA,EACfO,IAAKA,EACLE,KAAMA,EACNzC,QAASA,EACT3B,SAAUA,EACVW,QAASA,EACTN,SAAUA,EACVV,SAAUA"} \ No newline at end of file diff --git a/static/scripts/mvc/form/form-parameters.js b/static/scripts/mvc/form/form-parameters.js index c06442cc54e..dedf7bdee81 100644 --- a/static/scripts/mvc/form/form-parameters.js +++ b/static/scripts/mvc/form/form-parameters.js @@ -1,2 +1,2 @@ -define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-select-content","mvc/ui/ui-select-library","mvc/ui/ui-color-picker"],function(a,b,c,d,e){return Backbone.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary"},initialize:function(a){this.app=a},create:function(a){void 0===a.value&&(a.value=null),void 0===a.default_value&&(a.default_value=a.value);var b=null,c=this.types[a.type];return c&&"function"==typeof this[c]&&(b=this[c].call(this,a)),b||(this.app.incompatible=!0,b=a.options?this._fieldSelect(a):this._fieldText(a),console.debug("tools-form::_addRow() : Auto matched field type ("+a.type+").")),void 0!==a.value&&b.value(a.value),b},_fieldData:function(b){if(this.app.options.is_workflow)return b.info="Data input '"+b.name+"' ("+a.textify(b.extensions.toString())+")",b.value=null,this._fieldHidden(b);var d=this;return new c.View(this.app,{id:"field-"+b.id,extensions:b.extensions,optional:b.optional,multiple:b.multiple,type:b.type,data:b.options,onchange:function(){d.app.trigger("change")}})},_fieldSelect:function(a){if(0==a.options.length&&this.app.options.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=[];for(var d in a.options){var e=a.options[d];c.push({label:e[0],value:e[1]})}var f=b.Select;switch(a.display){case"checkboxes":f=b.Checkbox;break;case"radio":f=b.Radio}var g=this;return new f.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",optional:a.optional&&null===a.default_value,multiple:a.multiple,optional:a.optional,searchable:a.searchable,onchange:function(){g.app.trigger("change")}})},_fieldDrilldown:function(a){if(0==a.options.length&&this.app.options.is_workflow)return this._fieldText(a);var c=this;return new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,onchange:function(){c.app.trigger("change")}})},_fieldText:function(c){if(c.options)if(c.area=c.multiple,a.validate(c.value)){if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}}else c.value="";var f=this;return new b.Input({id:"field-"+c.id,area:c.area,onchange:function(){f.app.trigger("change")}})},_fieldSlider:function(a){var c=this;return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,min:a.min,max:a.max,onchange:function(){c.app.trigger("change")}})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){var c=this;return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){c.app.trigger("change")}})},_fieldColor:function(a){var b=this;return new e({id:"field-"+a.id,onchange:function(){b.app.trigger("change")}})},_fieldLibrary:function(a){var b=this;return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})}})}); +define(["utils/utils","mvc/ui/ui-misc","mvc/form/form-select-content","mvc/ui/ui-select-library","mvc/ui/ui-select-ftp","mvc/ui/ui-color-picker"],function(a,b,c,d,e,f){return Backbone.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(a){this.app=a},create:function(a){void 0===a.value&&(a.value=null),void 0===a.default_value&&(a.default_value=a.value);var b=null,c=this.types[a.type];return c&&"function"==typeof this[c]&&(b=this[c].call(this,a)),b||(this.app.incompatible=!0,b=a.options?this._fieldSelect(a):this._fieldText(a),console.debug("tools-form::_addRow() : Auto matched field type ("+a.type+").")),void 0!==a.value&&b.value(a.value),b},_fieldData:function(b){if(this.app.options.is_workflow)return b.info="Data input '"+b.name+"' ("+a.textify(b.extensions.toString())+")",b.value=null,this._fieldHidden(b);var d=this;return new c.View(this.app,{id:"field-"+b.id,extensions:b.extensions,optional:b.optional,multiple:b.multiple,type:b.type,data:b.options,onchange:function(){d.app.trigger("change")}})},_fieldSelect:function(a){if(0==a.options.length&&this.app.options.is_workflow)return this._fieldText(a);"data_column"==a.type&&(a.error_text="Missing columns in referenced dataset.");var c=[];for(var d in a.options){var e=a.options[d];c.push({label:e[0],value:e[1]})}var f=b.Select;switch(a.display){case"checkboxes":f=b.Checkbox;break;case"radio":f=b.Radio}var g=this;return new f.View({id:"field-"+a.id,data:c,error_text:a.error_text||"No options available",optional:a.optional&&null===a.default_value,multiple:a.multiple,optional:a.optional,searchable:a.searchable,onchange:function(){g.app.trigger("change")}})},_fieldDrilldown:function(a){if(0==a.options.length&&this.app.options.is_workflow)return this._fieldText(a);var c=this;return new b.Drilldown.View({id:"field-"+a.id,data:a.options,display:a.display,onchange:function(){c.app.trigger("change")}})},_fieldText:function(c){if(c.options)if(c.area=c.multiple,a.validate(c.value)){if($.isArray(c.value)){var d="";for(var e in c.value){if(d+=String(c.value[e]),!c.multiple)break;d+="\n"}c.value=d}}else c.value="";var f=this;return new b.Input({id:"field-"+c.id,area:c.area,onchange:function(){f.app.trigger("change")}})},_fieldSlider:function(a){var c=this;return new b.Slider.View({id:"field-"+a.id,precise:"float"==a.type,min:a.min,max:a.max,onchange:function(){c.app.trigger("change")}})},_fieldHidden:function(a){return new b.Hidden({id:"field-"+a.id,info:a.info})},_fieldBoolean:function(a){var c=this;return new b.RadioButton.View({id:"field-"+a.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){c.app.trigger("change")}})},_fieldColor:function(a){var b=this;return new f({id:"field-"+a.id,onchange:function(){b.app.trigger("change")}})},_fieldLibrary:function(a){var b=this;return new d.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})},_fieldFtp:function(a){var b=this;return new e.View({id:"field-"+a.id,optional:a.optional,multiple:a.multiple,onchange:function(){b.app.trigger("change")}})}})}); //# sourceMappingURL=../../../maps/mvc/form/form-parameters.js.map \ No newline at end of file diff --git a/static/scripts/mvc/form/form-section.js b/static/scripts/mvc/form/form-section.js index 53a88ae1888..d707dd0ad17 100644 --- a/static/scripts/mvc/form/form-section.js +++ b/static/scripts/mvc/form/form-section.js @@ -1,2 +1,2 @@ -define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/form/form-repeat","mvc/form/form-input","mvc/form/form-parameters"],function(a,b,c,d,e,f,g){var h=Backbone.View.extend({initialize:function(a,c){this.app=a,this.inputs=c.inputs,c.cls="ui-table-plain",c.cls_tr="section-row",this.table=new b.View(c),this.parameters=new g(a,c),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var a in this.inputs)this.add(this.inputs[a])},add:function(b){var c=jQuery.extend(!0,{},b);c.id=b.id=a.uid(),this.app.input_list[c.id]=c;var d=c.type;switch(d){case"conditional":this._addConditional(c);break;case"repeat":this._addRepeat(c);break;case"section":this._addSection(c);break;default:this._addRow(c)}},_addConditional:function(a){var b=this;a.test_param.id=a.id;var c=this._addRow(a.test_param);c.options.onchange=function(c){var d=b.app.data.matchCase(a,c);for(var e in a.cases){var f=a.cases[e],g=a.id+"-section-"+e,h=b.table.get(g),i=!1;for(var j in f.inputs)if(!f.inputs[j].hidden){i=!0;break}e==d&&i?h.fadeIn("fast"):h.hide()}b.app.trigger("change")};for(var d in a.cases){var e=a.id+"-section-"+d,f=new h(this.app,{inputs:a.cases[d].inputs});f.$el.addClass("ui-table-section"),this.table.add(f.$el),this.table.append(e)}c.trigger("change")},_addRepeat:function(a){function b(b){var e=a.id+"-section-"+d++,f=new h(c.app,{inputs:b});g.add({id:e,$el:f.$el,ondel:function(){g.del(e),c.app.trigger("change")}})}for(var c=this,d=0,g=new e.View({title:a.title,title_new:a.title,min:a.min,max:a.max,onnew:function(){b(a.inputs),c.app.trigger("change")}}),i=a.min,j=_.size(a.cache),k=0;kk?a.cache[k]:a.inputs,b(l)}var m=new f(this.app,{label:a.title,help:a.help,field:g});this.table.add(m.$el),this.table.append(a.id)},_addSection:function(a){var b=this,e=new h(b.app,{inputs:a.inputs}),f=new c.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),g=new d.View({title:a.title,cls:"ui-portlet-section",operations:{button_visible:f}});g.append(e.$el),g.append($("
").addClass("ui-table-form-info").html(a.help));var i=!1;g.$content.hide(),g.$header.css("cursor","pointer"),g.$header.on("click",function(){i?(i=!1,g.$content.hide(),f.setIcon("fa-eye-slash")):(i=!0,g.$content.fadeIn("fast"),f.setIcon("fa-eye"))}),a.expanded&&g.$header.trigger("click"),this.table.add(g.$el),this.table.append(a.id)},_addRow:function(a){var b=a.id,c=this.parameters.create(a);this.app.field_list[b]=c;var d=new f(this.app,{label:a.label||a.name,default_value:a.default_value,collapsible:a.collapsible,help:a.help,field:c});return this.app.element_list[b]=d,this.table.add(d.$el),this.table.append(b),a.hidden&&this.table.get(b).hide(),c}});return{View:h}}); +define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/ui/ui-portlet","mvc/form/form-repeat","mvc/form/form-input","mvc/form/form-parameters"],function(a,b,c,d,e,f,g){var h=Backbone.View.extend({initialize:function(a,c){this.app=a,this.inputs=c.inputs,c.cls="ui-table-plain",c.cls_tr="section-row",this.table=new b.View(c),this.parameters=new g(a,c),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var a in this.inputs)this.add(this.inputs[a])},add:function(b){var c=jQuery.extend(!0,{},b);c.id=b.id=a.uid(),this.app.input_list[c.id]=c;var d=c.type;switch(d){case"conditional":this._addConditional(c);break;case"repeat":this._addRepeat(c);break;case"section":this._addSection(c);break;default:this._addRow(c)}},_addConditional:function(a){var b=this;a.test_param.id=a.id;var c=this._addRow(a.test_param);c.options.onchange=function(c){var d=b.app.data.matchCase(a,c);for(var e in a.cases){var f=a.cases[e],g=a.id+"-section-"+e,h=b.table.get(g),i=!1;for(var j in f.inputs)if(!f.inputs[j].hidden){i=!0;break}e==d&&i?h.fadeIn("fast"):h.hide()}b.app.trigger("change")};for(var d in a.cases){var e=a.id+"-section-"+d,f=new h(this.app,{inputs:a.cases[d].inputs});f.$el.addClass("ui-table-section"),this.table.add(f.$el),this.table.append(e)}c.trigger("change")},_addRepeat:function(a){function b(b){var e=a.id+"-section-"+d++,f=new h(c.app,{inputs:b});g.add({id:e,$el:f.$el,ondel:function(){g.del(e),c.app.trigger("change")}})}for(var c=this,d=0,g=new e.View({title:a.title,title_new:a.title,min:a.min,max:a.max,onnew:function(){b(a.inputs),c.app.trigger("change")}}),i=a.min,j=_.size(a.cache),k=0;kk?a.cache[k]:a.inputs,b(l)}var m=new f(this.app,{label:a.title,help:a.help,field:g});this.table.add(m.$el),this.table.append(a.id)},_addSection:function(a){var b=this,e=new h(b.app,{inputs:a.inputs}),f=new c.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),g=new d.View({title:a.title,cls:"ui-portlet-section",operations:{button_visible:f}});g.append(e.$el),g.append($("
").addClass("ui-table-form-info").html(a.help));var i=!1;g.$content.hide(),g.$header.css("cursor","pointer"),g.$header.on("click",function(){i?(i=!1,g.$content.hide(),f.setIcon("fa-eye-slash")):(i=!0,g.$content.fadeIn("fast"),f.setIcon("fa-eye"))}),this.app.on("expand",function(a){g.$el.find("#"+a).length>0&&!i&&g.$header.trigger("click")}),a.expanded&&g.$header.trigger("click"),this.table.add(g.$el),this.table.append(a.id)},_addRow:function(a){var b=a.id,c=this.parameters.create(a);this.app.field_list[b]=c;var d=new f(this.app,{label:a.label||a.name,default_value:a.default_value,collapsible:a.collapsible,help:a.help,field:c});return this.app.element_list[b]=d,this.table.add(d.$el),this.table.append(b),a.hidden&&this.table.get(b).hide(),c}});return{View:h}}); //# sourceMappingURL=../../../maps/mvc/form/form-section.js.map \ No newline at end of file diff --git a/static/scripts/mvc/form/form-view.js b/static/scripts/mvc/form/form-view.js index e145f2683e2..f9194281381 100644 --- a/static/scripts/mvc/form/form-view.js +++ b/static/scripts/mvc/form/form-view.js @@ -1,2 +1,2 @@ -define(["utils/utils","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/form/form-section","mvc/form/form-data"],function(a,b,c,d,e){return Backbone.View.extend({initialize:function(b){this.optionsDefault={is_workflow:!1,narrow:!1,initial_errors:!1,cls:"ui-portlet-limited"},this.options=a.merge(b,this.optionsDefault),console.debug(this.options);var d=parent.Galaxy;this.modal=d&&d.modal?d.modal:new c.Modal.View,this.setElement("
"),this._build()},update:function(a){var b=this;this.data.matchModel(a,function(a,c){var d=b.input_list[a];if(d&&d.options&&!_.isEqual(d.options,c.options)){d.options=c.options;var e=b.field_list[a];if(e.update){var f=[];if(-1!=["data","data_collection","drill_down"].indexOf(d.type))f=d.options;else for(var g in c.options){var h=c.options[g];h.length>2&&f.push({label:h[0],value:h[1]})}e.update(f),e.trigger("change"),console.debug("Updating options for "+a)}}})},wait:function(a){for(var b in this.input_list){var c=this.field_list[b],d=this.input_list[b];d.is_dynamic&&c.wait&&c.unwait&&(a?c.wait():c.unwait())}},reciept:function(a){this.$el.empty(),this.$el.append(a)},highlight:function(a,b,c){var d=this.element_list[a];d&&(d.error(b||"Please verify this parameter."),c||$("html, body").animate({scrollTop:d.$el.offset().top-20},500))},errors:function(a){if(this.trigger("reset"),a&&a.errors){var b=this.data.matchResponse(a.errors);for(var c in this.element_list){{this.element_list[c]}b[c]&&this.highlight(c,b[c],!0)}}},_build:function(){var a=this;this.off("change"),this.off("reset"),this.field_list={},this.input_list={},this.element_list={},this.data=new e(this),this._renderForm(),this.data.create(),this.options.initial_errors&&this.errors(this.options);var b=this.data.checksum();this.on("change",function(){var c=a.data.checksum();c!=b&&(b=c,a.options.onchange&&a.options.onchange())}),this.on("reset",function(){for(var a in this.element_list)this.element_list[a].reset()})},_renderForm:function(){return this.message=new c.Message,this.section=new d.View(this,{inputs:this.options.inputs}),this.incompatible?(this.$el.hide(),void $("#tool-form-classic").show()):(this.portlet=new b.View({icon:"fa-wrench",title:this.options.title,cls:this.options.cls,operations:this.options.operations,buttons:this.options.buttons}),this.portlet.append(this.message.$el.addClass("ui-margin-top")),this.portlet.append(this.section.$el),this.$el.empty(),this.$el.append(this.portlet.$el),this.options.message&&this.message.update({persistent:!0,status:"warning",message:this.options.message}),void console.debug("tools-form-base::initialize() - Completed."))}})}); +define(["utils/utils","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/form/form-section","mvc/form/form-data"],function(a,b,c,d,e){return Backbone.View.extend({initialize:function(b){this.optionsDefault={is_workflow:!1,narrow:!1,initial_errors:!1,cls:"ui-portlet-limited"},this.options=a.merge(b,this.optionsDefault),console.debug(this.options);var d=parent.Galaxy;this.modal=d&&d.modal?d.modal:new c.Modal.View,this.setElement("
"),this._build()},update:function(a){var b=this;this.data.matchModel(a,function(a,c){var d=b.input_list[a];if(d&&d.options&&!_.isEqual(d.options,c.options)){d.options=c.options;var e=b.field_list[a];if(e.update){var f=[];if(-1!=["data","data_collection","drill_down"].indexOf(d.type))f=d.options;else for(var g in c.options){var h=c.options[g];h.length>2&&f.push({label:h[0],value:h[1]})}e.update(f),e.trigger("change"),console.debug("Updating options for "+a)}}})},wait:function(a){for(var b in this.input_list){var c=this.field_list[b],d=this.input_list[b];d.is_dynamic&&c.wait&&c.unwait&&(a?c.wait():c.unwait())}},reciept:function(a){this.$el.empty(),this.$el.append(a)},highlight:function(a,b,c){var d=this.element_list[a];d&&(d.error(b||"Please verify this parameter."),this.trigger("expand",a),c||$("html, body").animate({scrollTop:d.$el.offset().top-20},500))},errors:function(a){if(this.trigger("reset"),a&&a.errors){var b=this.data.matchResponse(a.errors);for(var c in this.element_list){{this.element_list[c]}b[c]&&this.highlight(c,b[c],!0)}}},_build:function(){var a=this;this.off("change"),this.off("reset"),this.field_list={},this.input_list={},this.element_list={},this.data=new e(this),this._renderForm(),this.data.create(),this.options.initial_errors&&this.errors(this.options);var b=this.data.checksum();this.on("change",function(){var c=a.data.checksum();c!=b&&(b=c,a.options.onchange&&a.options.onchange())}),this.on("reset",function(){for(var a in this.element_list)this.element_list[a].reset()})},_renderForm:function(){return this.message=new c.Message,this.section=new d.View(this,{inputs:this.options.inputs}),this.incompatible?(this.$el.hide(),void $("#tool-form-classic").show()):(this.portlet=new b.View({icon:"fa-wrench",title:this.options.title,cls:this.options.cls,operations:this.options.operations,buttons:this.options.buttons}),this.portlet.append(this.message.$el.addClass("ui-margin-top")),this.portlet.append(this.section.$el),this.$el.empty(),this.$el.append(this.portlet.$el),this.options.message&&this.message.update({persistent:!0,status:"warning",message:this.options.message}),void console.debug("tools-form-base::initialize() - Completed."))}})}); //# sourceMappingURL=../../../maps/mvc/form/form-view.js.map \ No newline at end of file diff --git a/static/scripts/mvc/ui/ui-list.js b/static/scripts/mvc/ui/ui-list.js new file mode 100644 index 00000000000..5ba8893a25a --- /dev/null +++ b/static/scripts/mvc/ui/ui-list.js @@ -0,0 +1,2 @@ +define(["utils/utils","mvc/ui/ui-portlet","mvc/ui/ui-misc"],function(a,b,c){var d=Backbone.View.extend({initialize:function(a){var d=this;this.options=a,this.name=a.name||"element",this.multiple=a.multiple||!1,this.message=new c.Message({cls:"ui-margin-top"}),this.portlet=new b.View({cls:"ui-portlet-section"}),this.select=new c.Select.View({optional:a.optional}),this.button=new c.ButtonIcon({icon:"fa fa-sign-in",floating:"left",tooltip:"Insert new "+this.name,onclick:function(){d.add({id:d.select.value(),name:d.select.text()})}}),this.setElement(this._template(a)),this.$(".ui-list-message").append(this.message.$el),this.$(".ui-list-portlet").append(this.portlet.$el),this.$(".ui-list-button").append(this.button.$el),this.$(".ui-list-select").append(this.select.$el)},value:function(a){if(void 0!==a){if(this.portlet.empty(),$.isArray(a))for(var b in a){var c=a[b],d=null,e=null;"string"!=$.type(c)?(d=c.id,e=c.name):d=e=c,null!=d&&this.add({id:d,name:e})}this._refresh()}var f=[];return this.$(".ui-list-id").each(function(){f.push({id:$(this).prop("id"),name:$(this).find(".ui-list-name").html()})}),0==f.length?null:f},add:function(b){var c=this;if(0===this.$('[id="'+b.id+'"]').length)if(a.validate(b.id)){var d=$(this._templateRow({id:b.id,name:b.name}));d.on("click",function(){d.remove(),c._refresh()}),d.on("mouseover",function(){d.addClass("portlet-highlight")}),d.on("mouseout",function(){d.removeClass("portlet-highlight")}),this.portlet.append(d),this._refresh()}else this.message.update({message:"Please select a valid "+this.name+".",status:"danger"});else this.message.update({message:"This "+this.name+" is already in the list."})},update:function(a){this.select.update(a)},_refresh:function(){this.$(".ui-list-id").length>0?(!this.multiple&&this.button.disable(),this.$(".ui-list-portlet").show()):(this.button.enable(),this.$(".ui-list-portlet").hide()),this.options.onchange&&this.options.onchange()},_template:function(){return'
'},_templateRow:function(a){return'
'+a.name+"
"}});return{View:d}}); +//# sourceMappingURL=../../../maps/mvc/ui/ui-list.js.map \ No newline at end of file diff --git a/static/scripts/mvc/ui/ui-misc.js b/static/scripts/mvc/ui/ui-misc.js index 29dce28f607..9ac3d8ab1a3 100644 --- a/static/scripts/mvc/ui/ui-misc.js +++ b/static/scripts/mvc/ui/ui-misc.js @@ -1,2 +1,2 @@ -define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-button-check","mvc/ui/ui-modal"],function(a,b,c,d,e,f,g,h){var i=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options))},_template:function(a){return''}}),j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options))},title:function(a){this.$el.html(a)},_template:function(a){return'"},value:function(){return options.title}}),k=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).tooltip({title:b.tooltip,placement:"bottom"})},_template:function(a){return'
 '+a.title+"
"}}),l=Backbone.View.extend({optionsDefault:{id:a.uid(),title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",function(){$(".tooltip").hide(),b.onclick&&b.onclick()}),$(this.el).tooltip({title:b.tooltip,placement:"bottom"})},wait:function(){this.$el.removeClass(this.options.cls).addClass("btn btn-info").prop("disabled",!0),this.$(".icon").removeClass(this.options.icon).addClass("fa-spinner fa-spin"),this.$(".title").html("Sending...")},unwait:function(){this.$el.removeClass("btn btn-info").addClass(this.options.cls).prop("disabled",!1),this.$(".icon").removeClass("fa-spinner fa-spin").addClass(this.options.icon),this.$(".title").html(this.options.title)},_template:function(a){var b='"}}),m=Backbone.View.extend({optionsDefault:{id:a.uid(),title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),this.$button=this.$el.find(".button");var c=this;$(this.el).on("click",function(){$(".tooltip").hide(),b.onclick&&!c.disabled&&b.onclick()}),$(this.el).tooltip({title:b.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled"),this.disabled=!0},enable:function(){this.$button.removeClass("disabled"),this.disabled=!1},setIcon:function(a){this.$("i").removeClass(this.options.icon).addClass(a),this.options.icon=a},_template:function(a){var b="";a.title&&(b="width: auto;");var c='
';return c+=a.title?'
 '+a.title+"
":'',c+="
"}}),n=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",b.onclick)},_template:function(a){return'"}}),o=Backbone.View.extend({optionsDefault:{message:null,status:"info",persistent:!1},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement("
"),this.options.message&&this.update(this.options)},update:function(b){if(this.options=a.merge(b,this.optionsDefault),""!=b.message){if(this.$el.html(this._template(this.options)),this.$el.find(".alert").append(b.message),this.$el.fadeIn(),this.timeout&&window.clearTimeout(this.timeout),!b.persistent){var c=this;this.timeout=window.setTimeout(function(){c.$el.is(":visible")?c.$el.fadeOut():c.$el.hide()},3e3)}}else this.$el.fadeOut()},_template:function(a){return'
'}}),p=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options));var c=this;this.options.onclick&&this.$el.on("submit",function(){var a=c.$el.find("#search");c.options.onclick(a.val())})},_template:function(a){return''}}),q=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:!1,visible:!0,cls:"",area:!1},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),void 0!==this.options.value&&this.value(this.options.value),this.options.disabled&&this.$el.prop("disabled",!0),this.options.visible||this.$el.hide();var c=this;this.$el.on("input",function(){c.options.onchange&&c.options.onchange(c.$el.val())})},value:function(a){return void 0!==a&&this.$el.val(a),this.$el.val()},_template:function(a){return a.area?'':''}}),r=Backbone.View.extend({initialize:function(a){this.options=a,this.setElement(this._template(this.options)),void 0!==this.options.value&&this.value(this.options.value)},value:function(a){return void 0!==a&&this.$("hidden").val(a),this.$("hidden").val()},_template:function(a){var b='
';return a.info&&(b+="
"+a.info+"
"),b+='
'}});return{Anchor:n,Button:l,ButtonIcon:m,ButtonCheck:g,ButtonMenu:f,Icon:k,Image:i,Input:q,Label:j,Message:o,Modal:h,RadioButton:d.RadioButton,Checkbox:d.Checkbox,Radio:d.Radio,Searchbox:p,Select:b,Hidden:r,Slider:c,Drilldown:e}}); +define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-button-check","mvc/ui/ui-modal"],function(a,b,c,d,e,f,g,h){var i=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options))},_template:function(a){return''}}),j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options))},title:function(a){this.$el.html(a)},_template:function(a){return'"},value:function(){return options.title}}),k=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).tooltip({title:b.tooltip,placement:"bottom"})},_template:function(a){return'
 '+a.title+"
"}}),l=Backbone.View.extend({optionsDefault:{id:a.uid(),title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",function(){$(".tooltip").hide(),b.onclick&&b.onclick()}),$(this.el).tooltip({title:b.tooltip,placement:"bottom"})},wait:function(){this.$el.removeClass(this.options.cls).addClass("btn btn-info").prop("disabled",!0),this.$(".icon").removeClass(this.options.icon).addClass("fa-spinner fa-spin"),this.$(".title").html("Sending...")},unwait:function(){this.$el.removeClass("btn btn-info").addClass(this.options.cls).prop("disabled",!1),this.$(".icon").removeClass("fa-spinner fa-spin").addClass(this.options.icon),this.$(".title").html(this.options.title)},_template:function(a){var b='"}}),m=Backbone.View.extend({optionsDefault:{id:a.uid(),title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),this.$button=this.$el.find(".button");var c=this;$(this.el).on("click",function(){$(".tooltip").hide(),b.onclick&&!c.disabled&&b.onclick()}),this.$button.tooltip({title:b.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled"),this.disabled=!0},enable:function(){this.$button.removeClass("disabled"),this.disabled=!1},setIcon:function(a){this.$("i").removeClass(this.options.icon).addClass(a),this.options.icon=a},_template:function(a){var b="";a.title&&(b="width: auto;");var c='
';return c+=a.title?' '+a.title+"":'',c+="
"}}),n=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",b.onclick)},_template:function(a){return'"}}),o=Backbone.View.extend({optionsDefault:{message:null,status:"info",cls:"",persistent:!1},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement('
'),this.options.message&&this.update(this.options)},update:function(b){if(this.options=a.merge(b,this.optionsDefault),""!=b.message){if(this.$el.html(this._template(this.options)),this.$el.find(".alert").append(b.message),this.$el.fadeIn(),this.timeout&&window.clearTimeout(this.timeout),!b.persistent){var c=this;this.timeout=window.setTimeout(function(){c.$el.is(":visible")?c.$el.fadeOut():c.$el.hide()},3e3)}}else this.$el.fadeOut()},_template:function(a){return'
'}}),p=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options));var c=this;this.options.onclick&&this.$el.on("submit",function(){var a=c.$el.find("#search");c.options.onclick(a.val())})},_template:function(a){return''}}),q=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:!1,visible:!0,cls:"",area:!1},initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),void 0!==this.options.value&&this.value(this.options.value),this.options.disabled&&this.$el.prop("disabled",!0),this.options.visible||this.$el.hide();var c=this;this.$el.on("input",function(){c.options.onchange&&c.options.onchange(c.$el.val())})},value:function(a){return void 0!==a&&this.$el.val(a),this.$el.val()},_template:function(a){return a.area?'':''}}),r=Backbone.View.extend({initialize:function(a){this.options=a,this.setElement(this._template(this.options)),void 0!==this.options.value&&this.value(this.options.value)},value:function(a){return void 0!==a&&this.$("hidden").val(a),this.$("hidden").val()},_template:function(a){var b='
';return a.info&&(b+="
"+a.info+"
"),b+='
'}});return{Anchor:n,Button:l,ButtonIcon:m,ButtonCheck:g,ButtonMenu:f,Icon:k,Image:i,Input:q,Label:j,Message:o,Modal:h,RadioButton:d.RadioButton,Checkbox:d.Checkbox,Radio:d.Radio,Searchbox:p,Select:b,Hidden:r,Slider:c,Drilldown:e}}); //# sourceMappingURL=../../../maps/mvc/ui/ui-misc.js.map \ No newline at end of file diff --git a/static/scripts/mvc/ui/ui-portlet.js b/static/scripts/mvc/ui/ui-portlet.js index 5e4adafdcee..616881a6c84 100644 --- a/static/scripts/mvc/ui/ui-portlet.js +++ b/static/scripts/mvc/ui/ui-portlet.js @@ -1,2 +1,2 @@ -define(["utils/utils"],function(a){var b=Backbone.View.extend({visible:!1,optionsDefault:{id:a.uid(),title:"",icon:"",buttons:null,body:null,scrollable:!0,nopadding:!1,operations:null,placement:"bottom",cls:"ui-portlet",operations_flt:"right"},$title:null,$content:null,$buttons:null,$operations:null,$header:null,initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),this.$content=this.$el.find(".content"),this.$title=this.$el.find(".portlet-title-text"),this.$header=this.$el.find(".portlet-header");var c=this.$el.find(".portlet-content");if(this.options.nopadding&&(c.css("padding","0px"),this.$content.css("padding","0px")),this.$buttons=$(this.el).find(".buttons"),this.options.buttons){var d=this;$.each(this.options.buttons,function(a,b){b.$el.prop("id",a),d.$buttons.append(b.$el)})}else this.$buttons.remove();if(this.$operations=$(this.el).find(".portlet-operations"),this.options.operations){var d=this;$.each(this.options.operations,function(a,b){b.$el.prop("id",a),d.$operations.append(b.$el)})}this.options.body&&this.append(this.options.body)},append:function(a){this.$content.append(a)},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},enableButton:function(a){this.$buttons.find("#"+a).prop("disabled",!1)},disableButton:function(a){this.$buttons.find("#"+a).prop("disabled",!0)},hideOperation:function(a){this.$operations.find("#"+a).hide()},showOperation:function(a){this.$operations.find("#"+a).show()},setOperation:function(a,b){var c=this.$operations.find("#"+a);c.off("click"),c.on("click",b)},title:function(a){var b=this.$title;return a&&b.html(a),b.html()},disable:function(){this.$(".portlet-backdrop").show()},enable:function(){this.$(".portlet-backdrop").hide()},_template:function(a){var b='
';return a.title&&(b+='
',a.icon&&(b+=' '),b+=''+a.title+"
"),b+='
',"top"==a.placement&&(b+='
'),b+='
',"bottom"==a.placement&&(b+='
'),b+='
'}});return{View:b}}); +define(["utils/utils"],function(a){var b=Backbone.View.extend({visible:!1,optionsDefault:{id:a.uid(),title:"",icon:"",buttons:null,body:null,scrollable:!0,nopadding:!1,operations:null,placement:"bottom",cls:"ui-portlet",operations_flt:"right"},$title:null,$content:null,$buttons:null,$operations:null,$header:null,initialize:function(b){this.options=a.merge(b,this.optionsDefault),this.setElement(this._template(this.options)),this.$content=this.$el.find(".content"),this.$title=this.$el.find(".portlet-title-text"),this.$header=this.$el.find(".portlet-header");var c=this.$el.find(".portlet-content");if(this.options.nopadding&&(c.css("padding","0px"),this.$content.css("padding","0px")),this.$buttons=$(this.el).find(".buttons"),this.options.buttons){var d=this;$.each(this.options.buttons,function(a,b){b.$el.prop("id",a),d.$buttons.append(b.$el)})}else this.$buttons.remove();if(this.$operations=$(this.el).find(".portlet-operations"),this.options.operations){var d=this;$.each(this.options.operations,function(a,b){b.$el.prop("id",a),d.$operations.append(b.$el)})}this.options.body&&this.append(this.options.body)},append:function(a){this.$content.append(a)},empty:function(){this.$content.empty()},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},enableButton:function(a){this.$buttons.find("#"+a).prop("disabled",!1)},disableButton:function(a){this.$buttons.find("#"+a).prop("disabled",!0)},hideOperation:function(a){this.$operations.find("#"+a).hide()},showOperation:function(a){this.$operations.find("#"+a).show()},setOperation:function(a,b){var c=this.$operations.find("#"+a);c.off("click"),c.on("click",b)},title:function(a){var b=this.$title;return a&&b.html(a),b.html()},disable:function(){this.$(".portlet-backdrop").show()},enable:function(){this.$(".portlet-backdrop").hide()},_template:function(a){var b='
';return a.title&&(b+='
',a.icon&&(b+=' '),b+=''+a.title+"
"),b+='
',"top"==a.placement&&(b+='
'),b+='
',"bottom"==a.placement&&(b+='
'),b+='
'}});return{View:b}}); //# sourceMappingURL=../../../maps/mvc/ui/ui-portlet.js.map \ No newline at end of file diff --git a/static/scripts/mvc/ui/ui-select-ftp.js b/static/scripts/mvc/ui/ui-select-ftp.js new file mode 100644 index 00000000000..aa09cc7fcc3 --- /dev/null +++ b/static/scripts/mvc/ui/ui-select-ftp.js @@ -0,0 +1,2 @@ +define(["utils/utils","mvc/ui/ui-list"],function(a,b){var c=Backbone.View.extend({initialize:function(c){var d=this;this.ftpfile_list=new b.View({name:"file",optional:c.optional,multiple:c.multiple,onchange:function(){c.onchange&&c.onchange(d.value())}}),this.setElement(this.ftpfile_list.$el),a.get({url:galaxy_config.root+"api/remote_files",success:function(a){var b=[];for(var c in a)b.push({value:a[c].path,label:a[c].path});d.ftpfile_list.update(b)}})},value:function(a){return this.ftpfile_list.value(a)}});return{View:c}}); +//# sourceMappingURL=../../../maps/mvc/ui/ui-select-ftp.js.map \ No newline at end of file diff --git a/static/scripts/mvc/ui/ui-select-library.js b/static/scripts/mvc/ui/ui-select-library.js index 888e1d6cb54..1248278a370 100644 --- a/static/scripts/mvc/ui/ui-select-library.js +++ b/static/scripts/mvc/ui/ui-select-library.js @@ -1,2 +1,2 @@ -define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(a,b){var c=Backbone.Collection.extend({url:galaxy_config.root+"api/libraries"}),d=Backbone.Collection.extend({initialize:function(){var a=this;this.config=new Backbone.Model({library_id:null}),this.config.on("change",function(){a.fetch({reset:!0})})},url:function(){return galaxy_config.root+"api/libraries/"+this.config.get("library_id")+"/contents"}}),e=Backbone.View.extend({initialize:function(a){var e=this;this.libraries=new c,this.datasets=new d,this.options=a,this.library_select=new b.Select.View({optional:a.optional,onchange:function(a){e.datasets.config.set("library_id",a)}}),this.dataset_select=new b.Select.View({optional:a.optional,multiple:a.multiple,onchange:function(){e.trigger("change")}}),this.libraries.on("reset",function(){var a=[];e.libraries.each(function(b){a.push({value:b.id,label:b.get("name")})}),e.library_select.update(a),e.trigger("change")}),this.datasets.on("reset",function(){var a=[],b=e.library_select.text();null!==b&&e.datasets.each(function(c){"file"===c.get("type")&&a.push({value:c.id,label:b+c.get("name")})}),e.dataset_select.update(a),e.trigger("change")}),this.on("change",function(){a.onchange&&a.onchange(e.value())}),this.setElement(this._template()),this.$(".library-select").append(this.library_select.$el),this.$(".dataset-select").append(this.dataset_select.$el),this.libraries.fetch({reset:!0,success:function(){e.library_select.trigger("change"),void 0!==e.options.value&&e.value(e.options.value)}})},value:function(){return this.dataset_select.value()},_template:function(){return'
Select Library
Select Dataset
'}});return{View:e}}); +define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-table","mvc/ui/ui-list"],function(a,b,c,d){var e=Backbone.Collection.extend({url:galaxy_config.root+"api/libraries"}),f=Backbone.Collection.extend({initialize:function(){var a=this;this.config=new Backbone.Model({library_id:null}),this.config.on("change",function(){a.fetch({reset:!0})})},url:function(){return galaxy_config.root+"api/libraries/"+this.config.get("library_id")+"/contents"}}),g=Backbone.View.extend({initialize:function(a){var c=this;this.libraries=new e,this.datasets=new f,this.options=a,this.library_select=new b.Select.View({onchange:function(a){c.datasets.config.set("library_id",a)}}),this.dataset_list=new d.View({name:"dataset",optional:a.optional,multiple:a.multiple,onchange:function(){c.trigger("change")}}),this.libraries.on("reset",function(){var a=[];c.libraries.each(function(b){a.push({value:b.id,label:b.get("name")})}),c.library_select.update(a)}),this.datasets.on("reset",function(){var a=[],b=c.library_select.text();null!==b&&c.datasets.each(function(b){"file"===b.get("type")&&a.push({value:b.id,label:b.get("name")})}),c.dataset_list.update(a)}),this.on("change",function(){a.onchange&&a.onchange(c.value())}),this.setElement(this._template()),this.$(".library-select").append(this.library_select.$el),this.$el.append(this.dataset_list.$el),this.libraries.fetch({reset:!0,success:function(){c.library_select.trigger("change"),void 0!==c.options.value&&c.value(c.options.value)}})},value:function(a){return this.dataset_list.value(a)},_template:function(){return'
Select Library
'}});return{View:g}}); //# sourceMappingURL=../../../maps/mvc/ui/ui-select-library.js.map \ No newline at end of file diff --git a/static/scripts/utils/utils.js b/static/scripts/utils/utils.js index d3d7397d897..e1c565c4f15 100644 --- a/static/scripts/utils/utils.js +++ b/static/scripts/utils/utils.js @@ -1,2 +1,2 @@ -define(["libs/underscore"],function(a){function b(a,c){for(var d in a){var e=a[d];e&&"object"==typeof e&&(c(e),b(e,c))}}function c(a){return $("
").text(a).html()}function d(a){if(a instanceof Array||(a=[a]),0===a.length)return!1;for(var b in a)if(["__null__","__undefined__","None",null,void 0].indexOf(a[b])>-1)return!1;return!0}function e(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function f(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):g({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function g(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url=b.url+$.param(b.data,!0),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)})}function h(a,b){var c=$('
');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function i(a){$('link[href^="'+a+'"]').length||$('').appendTo("head")}function j(b,c){return b?a.defaults(b,c):c}function k(a,b){var c="";if(a>=1e11)a/=1e11,c="TB";else if(a>=1e8)a/=1e8,c="GB";else if(a>=1e5)a/=1e5,c="MB";else if(a>=100)a/=100,c="KB";else{if(!(a>0))return"-";a=10*a,c="b"}var d=Math.round(a)/10;return b?d+" "+c:""+d+" "+c}function l(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function m(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes(),d=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c;return d}return{cssLoadFile:i,cssGetAttribute:h,get:f,merge:j,bytesToString:k,uid:l,time:m,request:g,sanitize:c,textify:e,validate:d,deepeach:b}}); +define(["libs/underscore"],function(a){function b(a,c){for(var d in a){var e=a[d];e&&"object"==typeof e&&(c(e),b(e,c))}}function c(a){return $("
").text(a).html()}function d(a){if(a instanceof Array||(a=[a]),0===a.length)return!1;for(var b in a)if(["__null__","__undefined__",null,void 0].indexOf(a[b])>-1)return!1;return!0}function e(a){var a=a.toString();if(a){a=a.replace(/,/g,", ");var b=a.lastIndexOf(", ");return-1!=b&&(a=a.substr(0,b)+" or "+a.substr(b+1)),a}return""}function f(a){top.__utils__get__=top.__utils__get__||{},a.cache&&top.__utils__get__[a.url]?(a.success&&a.success(top.__utils__get__[a.url]),console.debug("utils.js::get() - Fetching from cache ["+a.url+"].")):g({url:a.url,data:a.data,success:function(b){top.__utils__get__[a.url]=b,a.success&&a.success(b)},error:function(b){a.error&&a.error(b)}})}function g(a){var b={contentType:"application/json",type:a.type||"GET",data:a.data||{},url:a.url};"GET"==b.type||"DELETE"==b.type?(b.url+=-1==b.url.indexOf("?")?"?":"&",b.url=b.url+$.param(b.data,!0),b.data=null):(b.dataType="json",b.url=b.url,b.data=JSON.stringify(b.data)),$.ajax(b).done(function(b){if("string"==typeof b)try{b=b.replace("Infinity,",'"Infinity",'),b=jQuery.parseJSON(b)}catch(c){console.debug(c)}a.success&&a.success(b)}).fail(function(b){var c=null;try{c=jQuery.parseJSON(b.responseText)}catch(d){c=b.responseText}a.error&&a.error(c,b)})}function h(a,b){var c=$('
');c.appendTo(":eq(0)");var d=c.css(b);return c.remove(),d}function i(a){$('link[href^="'+a+'"]').length||$('').appendTo("head")}function j(b,c){return b?a.defaults(b,c):c}function k(a,b){var c="";if(a>=1e11)a/=1e11,c="TB";else if(a>=1e8)a/=1e8,c="GB";else if(a>=1e5)a/=1e5,c="MB";else if(a>=100)a/=100,c="KB";else{if(!(a>0))return"-";a=10*a,c="b"}var d=Math.round(a)/10;return b?d+" "+c:""+d+" "+c}function l(){return top.__utils__uid__=top.__utils__uid__||0,"uid-"+top.__utils__uid__++}function m(){var a=new Date,b=(a.getHours()<10?"0":"")+a.getHours(),c=(a.getMinutes()<10?"0":"")+a.getMinutes(),d=a.getDate()+"/"+(a.getMonth()+1)+"/"+a.getFullYear()+", "+b+":"+c;return d}return{cssLoadFile:i,cssGetAttribute:h,get:f,merge:j,bytesToString:k,uid:l,time:m,request:g,sanitize:c,textify:e,validate:d,deepeach:b}}); //# sourceMappingURL=../../maps/utils/utils.js.map \ No newline at end of file diff --git a/static/style/blue/base.css b/static/style/blue/base.css index bd057298576..6aab8aef859 100644 --- a/static/style/blue/base.css +++ b/static/style/blue/base.css @@ -1443,6 +1443,7 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close{left:auto; .ui-portlet-repeat,.ui-portlet-section,.ui-portlet-section{border:none;border-left:solid 3px #ebd9b2;border-radius:5px;margin-bottom:5px}.ui-portlet-repeat .portlet-header,.ui-portlet-section .portlet-header{background:#ebd9b2;border-radius:5px;border-bottom-left-radius:0px;border-top-left-radius:0px;padding:0px 2px}.ui-portlet-repeat .portlet-header .portlet-title-text,.ui-portlet-section .portlet-header .portlet-title-text{vertical-align:middle;line-height:20px !important} .ui-portlet-repeat .portlet-content,.ui-portlet-section .portlet-content{padding-right:0px} .ui-portlet-section{margin-top:5px;border-left:solid 3px #dfe5f9}.ui-portlet-section .portlet-header{background:#dfe5f9;border-bottom:solid #b4c2f1 1px} +.ui-portlet-section .portlet-highlight{text-decoration:underline} .ui-portlet-narrow{border:none}.ui-portlet-narrow .portlet-header{border-radius:3px}.ui-portlet-narrow .portlet-header .portlet-operations .ui-button-icon{margin-left:3px} .ui-portlet-narrow .ui-portlet-repeat .portlet-header,.ui-portlet-narrow .ui-portlet-section .portlet-header{border-radius:5px;border-bottom-left-radius:0px;border-top-left-radius:0px} .ui-portlet-narrow .portlet-content{padding:0px} @@ -1470,6 +1471,10 @@ html[dir="rtl"] .select2-container-multi .select2-search-choice-close{left:auto; .ui-color-picker .ui-color-picker-label{float:left;line-height:1.2em} .ui-color-picker .ui-color-picker-view{height:100%;overflow:auto;display:none;float:left;margin-top:5px}.ui-color-picker .ui-color-picker-view .ui-color-picker-panel{width:210px}.ui-color-picker .ui-color-picker-view .ui-color-picker-panel .ui-color-picker-content{margin-bottom:15px}.ui-color-picker .ui-color-picker-view .ui-color-picker-panel .ui-color-picker-content .label{padding-bottom:2px} .ui-color-picker .ui-color-picker-view .ui-color-picker-panel .ui-color-picker-content .line .ui-color-picker-box{cursor:pointer;float:left;margin-right:5px;border:solid 1px #c0c0c0;width:15px;height:15px;border-radius:2px}.ui-color-picker .ui-color-picker-view .ui-color-picker-panel .ui-color-picker-content .line .ui-color-picker-box .ui-color-picker-check{color:black;font-size:1.2em;position:relative;left:1px} +.ui-list .ui-list-select{float:left;width:calc(100% - 27px)} +.ui-list .ui-list-button .ui-button-icon{margin-top:3px;margin-right:5px} +.ui-list .ui-list-message,.ui-list .ui-list-portlet{clear:both} +.ui-list .ui-list-id{cursor:pointer;margin-top:5px}.ui-list .ui-list-id .ui-list-delete{font-size:1.2em;margin-right:5px} .ui-select{position:relative}.ui-select .button{position:absolute;top:5px;right:5px} .ui-select select{position:relative;top:0px;height:27px;width:100%;padding-right:20px;cursor:pointer;padding-left:5px} .ui-select .select2-container{width:100%}.ui-select .select2-container .select2-choice{height:27px;padding-left:5px}.ui-select .select2-container .select2-choice .select2-arrow{display:none} diff --git a/templates/webapps/galaxy/workflow/run.mako b/templates/webapps/galaxy/workflow/run.mako index 8d780be2f94..4e60faad487 100644 --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -583,9 +583,10 @@ if wf_parms: <% pja_ss_all = [] for pja_ss in [ActionBox.get_short_str(pja) for pja in step.post_job_actions]: - pja_ss = h.escape( pja_ss ) for rematch in re.findall('\$\{.+?\}', pja_ss): - pja_ss = pja_ss.replace(rematch, '%s' % (wf_parms[rematch[2:-1]], rematch[2:-1], rematch[2:-1])) + pja_ss = pja_ss.replace(rematch, '%s' % (wf_parms[rematch[2:-1]], + rematch[2:-1], + rematch[2:-1])) pja_ss_all.append(pja_ss) %> ${'
'.join(pja_ss_all)} diff --git a/test/api/test_tools.py b/test/api/test_tools.py index fe93e6cd436..b7507c37414 100644 --- a/test/api/test_tools.py +++ b/test/api/test_tools.py @@ -3,6 +3,7 @@ from base import api from operator import itemgetter from .helpers import DatasetPopulator from .helpers import DatasetCollectionPopulator +from .helpers import LibraryPopulator from .helpers import skip_without_tool @@ -120,6 +121,21 @@ class ToolsTestCase( api.ApiTestCase ): assert output1_content.strip() == "--ex1" assert output2_content.strip() == "None", output2_content + @skip_without_tool( "library_data" ) + def test_library_data_param( self ): + history_id = self.dataset_populator.new_history() + ld = LibraryPopulator( self ).new_library_dataset( "lda_test_library" ) + inputs = { + "library_dataset": ld[ "ldda_id" ], + "library_dataset_multiple": [ld[ "ldda_id" ], ld[ "ldda_id" ]] + } + response = self._run( "library_data", history_id, inputs, assert_ok=True ) + output = response[ "outputs" ] + output_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output[ 0 ] ) + assert output_content == "TestData", output_content + output_multiple_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output[ 1 ] ) + assert output_multiple_content == "TestDataTestData", output_multiple_content + @skip_without_tool( "multi_data_param" ) def test_multidata_param( self ): history_id = self.dataset_populator.new_history() @@ -302,7 +318,7 @@ class ToolsTestCase( api.ApiTestCase ): self._assert_has_keys( output_collection, "id", "name", "elements", "populated" ) assert not output_collection[ "populated" ] assert len( output_collection[ "elements" ] ) == 0 - + self.assertEquals( output_collection[ "name" ], "Table split on first column" ) self.dataset_populator.wait_for_job( create["jobs"][0]["id"], assert_ok=True ) get_collection_response = self._get( "dataset_collections/%s" % output_collection[ "id" ], data={"instance_type": "history"} ) @@ -312,6 +328,8 @@ class ToolsTestCase( api.ApiTestCase ): self._assert_has_keys( output_collection, "id", "name", "elements", "populated" ) assert output_collection[ "populated" ] assert len( output_collection[ "elements" ] ) == 2 + self.assertEquals( output_collection[ "name" ], "Table split on first column" ) + # TODO: verify element identifiers @skip_without_tool( "cat1" ) diff --git a/test/base/twilltestcase.py b/test/base/twilltestcase.py index 32983f024ef..bced8471ffa 100644 --- a/test/base/twilltestcase.py +++ b/test/base/twilltestcase.py @@ -1516,7 +1516,7 @@ class TwillTestCase( unittest.TestCase ): # HACK: don't use panels because late_javascripts() messes up the twill browser and it # can't find form fields (and hence user can't be logged in). self.visit_url( "/user/login?use_panels=False" ) - self.submit_form( 'login', 'login_button', email=email, redirect=redirect, password=password ) + self.submit_form( 'login', 'login_button', login=email, redirect=redirect, password=password ) def logout( self ): self.visit_url( "%s/user/logout" % self.url ) diff --git a/test/functional/test_toolbox.py b/test/functional/test_toolbox.py index d707690c4c3..99d7c78d9f4 100644 --- a/test/functional/test_toolbox.py +++ b/test/functional/test_toolbox.py @@ -263,13 +263,18 @@ def build_tests( app=None, testing_shed_tools=False, master_api_key=None, user_a baseclasses = ( ToolTestCase, ) namespace = dict() for j, testdef in enumerate( tool.tests ): + test_function_name = 'test_tool_%06d' % j + def make_test_method( td ): def test_tool( self ): self.do_it( td ) + test_tool.__name__ = test_function_name + return test_tool + test_method = make_test_method( testdef ) test_method.__doc__ = "%s ( %s ) > %s" % ( tool.name, tool.id, testdef.name ) - namespace[ 'test_tool_%06d' % j ] = test_method + namespace[ test_function_name ] = test_method namespace[ 'shed_tool_id' ] = shed_tool_id namespace[ 'master_api_key' ] = master_api_key namespace[ 'user_api_key' ] = user_api_key diff --git a/test/functional/tools/library_data.xml b/test/functional/tools/library_data.xml new file mode 100644 index 00000000000..8fd1a147f49 --- /dev/null +++ b/test/functional/tools/library_data.xml @@ -0,0 +1,19 @@ + + + cat $library_dataset >> $output; + #for $input in $library_dataset_multiple + cat $input >> $output_multiple; + #end for + + + + + + + + + + + + + diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml index 143e9043a3f..deabd1d0062 100644 --- a/test/functional/tools/samples_tool_conf.xml +++ b/test/functional/tools/samples_tool_conf.xml @@ -9,6 +9,7 @@ + diff --git a/test/tool_shed/base/twilltestcase.py b/test/tool_shed/base/twilltestcase.py index 9138212692d..3b77a38d924 100644 --- a/test/tool_shed/base/twilltestcase.py +++ b/test/tool_shed/base/twilltestcase.py @@ -539,6 +539,12 @@ class ShedTwillTestCase( TwillTestCase ): string = string.replace( character, replacement ) return string + def expect_repo_created_strings( self, name ): + return [ + 'Repository %s' % name, + 'Repository %s has been created' % name, + ] + def export_capsule( self, repository ): url = '/repository/export?repository_id=%s&changeset_revision=%s' % \ ( self.security.encode_id( repository.id ), self.get_repository_tip( repository ) ) @@ -573,7 +579,7 @@ class ShedTwillTestCase( TwillTestCase ): self.create_user_in_galaxy( email=email, password=password, username=username, redirect=redirect ) if previously_created: self.visit_galaxy_url( "/user/login?use_panels=False" ) - self.submit_form( '1', 'login_button', email=email, redirect=redirect, password=password ) + self.submit_form( '1', 'login_button', login=email, redirect=redirect, password=password ) def galaxy_logout( self ): self.visit_galaxy_url( "/user/logout" ) diff --git a/test/tool_shed/functional/test_0000_basic_repository_features.py b/test/tool_shed/functional/test_0000_basic_repository_features.py index 036e3232335..072c0d89237 100644 --- a/test/tool_shed/functional/test_0000_basic_repository_features.py +++ b/test/tool_shed/functional/test_0000_basic_repository_features.py @@ -42,8 +42,7 @@ class TestBasicRepositoryFeatures( ShedTwillTestCase ): self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) category = self.test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' ) - strings_displayed = [ 'Repository %s' % "'%s'" % repository_name, - 'Repository %s has been created' % "%s" % repository_name ] + strings_displayed = self.expect_repo_created_strings(repository_name) self.get_or_create_repository( name=repository_name, description=repository_description, long_description=repository_long_description, diff --git a/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py b/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py index f092c439031..abf7c21aa70 100644 --- a/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py +++ b/test/tool_shed/functional/test_0120_simple_repository_dependency_multiple_owners.py @@ -54,8 +54,7 @@ class TestRepositoryMultipleOwners( ShedTwillTestCase ): category = self.create_category( name='Test 0120', description='Description of test 0120' ) self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % datatypes_repository_name, - 'Repository %s has been created' % "%s" % datatypes_repository_name ] + strings_displayed = self.expect_repo_created_strings(datatypes_repository_name) repository = self.get_or_create_repository( name=datatypes_repository_name, description=datatypes_repository_description, long_description=datatypes_repository_long_description, @@ -94,8 +93,7 @@ class TestRepositoryMultipleOwners( ShedTwillTestCase ): category = self.create_category( name='Test 0120', description='Description of test 0120' ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % tool_repository_name, - 'Repository %s has been created' % "%s" % tool_repository_name ] + strings_displayed = self.expect_repo_created_strings(tool_repository_name) repository = self.get_or_create_repository( name=tool_repository_name, description=tool_repository_description, long_description=tool_repository_long_description, diff --git a/test/tool_shed/functional/test_0400_repository_component_reviews.py b/test/tool_shed/functional/test_0400_repository_component_reviews.py index 08ba29b9679..b91a534d18d 100644 --- a/test/tool_shed/functional/test_0400_repository_component_reviews.py +++ b/test/tool_shed/functional/test_0400_repository_component_reviews.py @@ -91,8 +91,7 @@ class TestRepositoryComponentReviews( ShedTwillTestCase ): category = self.create_category( name='Test 0400 Repository Component Reviews', description='Test 0400 Repository Component Reviews' ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % repository_name, - 'Repository %s has been created' % "%s" % repository_name ] + strings_displayed = self.expect_repo_created_strings(repository_name) repository = self.get_or_create_repository( name=repository_name, description=repository_description, long_description=repository_long_description, diff --git a/test/tool_shed/functional/test_0410_repository_component_review_access_control.py b/test/tool_shed/functional/test_0410_repository_component_review_access_control.py index 68701a59e5b..4369c70313a 100644 --- a/test/tool_shed/functional/test_0410_repository_component_review_access_control.py +++ b/test/tool_shed/functional/test_0410_repository_component_review_access_control.py @@ -70,8 +70,7 @@ class TestRepositoryComponentReviews( ShedTwillTestCase ): category = self.create_category( name='Test 0400 Repository Component Reviews', description='Test 0400 Repository Component Reviews' ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % repository_name, - 'Repository %s has been created' % "%s" % repository_name ] + strings_displayed = self.expect_repo_created_strings(repository_name) repository = self.get_or_create_repository( name=repository_name, description=repository_description, long_description=repository_long_description, diff --git a/test/tool_shed/functional/test_0420_citable_urls_for_repositories.py b/test/tool_shed/functional/test_0420_citable_urls_for_repositories.py index 4c4e0709167..df2efa15755 100644 --- a/test/tool_shed/functional/test_0420_citable_urls_for_repositories.py +++ b/test/tool_shed/functional/test_0420_citable_urls_for_repositories.py @@ -53,8 +53,7 @@ class TestRepositoryCitableURLs( ShedTwillTestCase ): description='Test 0400 Repository Citable URLs category' ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % repository_name, - 'Repository %s has been created' % "%s" % repository_name ] + strings_displayed = self.expect_repo_created_strings(repository_name) repository = self.get_or_create_repository( name=repository_name, description=repository_description, long_description=repository_long_description, @@ -128,7 +127,7 @@ class TestRepositoryCitableURLs( ShedTwillTestCase ): strings_displayed = [ '/repository', 'view_repository', 'id=', encoded_repository_id ] strings_displayed_in_iframe = [ 'user1', 'filtering_0420', 'Galaxy filtering tool for test 0420' ] strings_displayed_in_iframe.append( self.get_repository_tip( repository ) ) - strings_displayed_in_iframe.append( 'Sharable link to this repository:' ) + strings_displayed_in_iframe.append( 'Link to this repository:' ) strings_displayed_in_iframe.append( '%s/view/user1/filtering_0420' % self.url ) self.load_citable_url( username='user1', repository_name='filtering_0420', @@ -154,7 +153,7 @@ class TestRepositoryCitableURLs( ShedTwillTestCase ): # The iframe should point to /repository/view_repository?id= strings_displayed = [ '/repository', 'view_repository', 'id=' + encoded_repository_id ] strings_displayed_in_iframe = [ 'user1', 'filtering_0420', 'Galaxy filtering tool for test 0420', first_changeset_hash ] - strings_displayed_in_iframe.append( 'Sharable link to this repository revision:' ) + strings_displayed_in_iframe.append( 'Link to this repository revision:' ) strings_displayed_in_iframe.append( '%s/view/user1/filtering_0420/%s' % ( self.url, first_changeset_hash ) ) strings_not_displayed_in_iframe = [] self.load_citable_url( username='user1', @@ -179,7 +178,7 @@ class TestRepositoryCitableURLs( ShedTwillTestCase ): strings_displayed = [ '/repository', 'view_repository', 'id=' + encoded_repository_id ] strings_displayed.extend( [ 'The+change+log', 'does+not+include+revision', invalid_changeset_hash, 'status=error' ] ) strings_displayed_in_iframe = [ 'user1', 'filtering_0420', 'Galaxy filtering tool for test 0420' ] - strings_displayed_in_iframe.append( 'Sharable link to this repository revision:' ) + strings_displayed_in_iframe.append( 'Link to this repository revision:' ) strings_displayed_in_iframe.append( '%s/view/user1/filtering_0420/%s' % ( self.url, invalid_changeset_hash ) ) strings_not_displayed_in_iframe = [] self.load_citable_url( username='user1', diff --git a/test/tool_shed/functional/test_0430_browse_utilities.py b/test/tool_shed/functional/test_0430_browse_utilities.py index d5ce96e037f..1c26668dcd3 100644 --- a/test/tool_shed/functional/test_0430_browse_utilities.py +++ b/test/tool_shed/functional/test_0430_browse_utilities.py @@ -54,8 +54,7 @@ class TestToolShedBrowseUtilities( ShedTwillTestCase ): description='Description of Test 0430 Galaxy Utilities category' ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % datatypes_repository_name, - 'Repository %s has been created' % "%s" % datatypes_repository_name ] + strings_displayed = self.expect_repo_created_strings(datatypes_repository_name) repository = self.get_or_create_repository( name=datatypes_repository_name, description=datatypes_repository_description, long_description=datatypes_repository_long_description, @@ -82,8 +81,7 @@ class TestToolShedBrowseUtilities( ShedTwillTestCase ): description='Description of Test 0430 Galaxy Utilities category' ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % emboss_repository_name, - 'Repository %s has been created' % "%s" % emboss_repository_name ] + strings_displayed = self.expect_repo_created_strings(emboss_repository_name) emboss_repository = self.get_or_create_repository( name=emboss_repository_name, description=emboss_repository_description, long_description=emboss_repository_long_description, @@ -119,8 +117,7 @@ class TestToolShedBrowseUtilities( ShedTwillTestCase ): description='Description of Test 0430 Galaxy Utilities category' ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % freebayes_repository_name, - 'Repository %s has been created' % "%s" % freebayes_repository_name ] + strings_displayed = self.expect_repo_created_strings(freebayes_repository_name) repository = self.get_or_create_repository( name=freebayes_repository_name, description=freebayes_repository_description, long_description=freebayes_repository_long_description, diff --git a/test/tool_shed/functional/test_0450_skip_tool_tests.py b/test/tool_shed/functional/test_0450_skip_tool_tests.py index a5d60e6f9f1..ceb3f3821e8 100644 --- a/test/tool_shed/functional/test_0450_skip_tool_tests.py +++ b/test/tool_shed/functional/test_0450_skip_tool_tests.py @@ -75,8 +75,7 @@ class TestSkipToolTestFeature( ShedTwillTestCase ): self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) category = self.test_db_util.get_category_by_name( category_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % repository_name, - 'Repository %s has been created' % "%s" % repository_name ] + strings_displayed = self.expect_repo_created_strings(repository_name) repository = self.get_or_create_repository( name=repository_name, description=repository_description, long_description=repository_long_description, diff --git a/test/tool_shed/functional/test_1120_simple_repository_dependency_multiple_owners.py b/test/tool_shed/functional/test_1120_simple_repository_dependency_multiple_owners.py index 5eb19662bce..15167026c2c 100644 --- a/test/tool_shed/functional/test_1120_simple_repository_dependency_multiple_owners.py +++ b/test/tool_shed/functional/test_1120_simple_repository_dependency_multiple_owners.py @@ -57,8 +57,7 @@ class TestInstallRepositoryMultipleOwners( ShedTwillTestCase ): category = self.create_category( name='Test 0120', description='Description of test 0120' ) self.logout() self.login( email=common.test_user_2_email, username=common.test_user_2_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % datatypes_repository_name, - 'Repository %s has been created' % "%s" % datatypes_repository_name ] + strings_displayed = self.expect_repo_created_strings(datatypes_repository_name) repository = self.get_or_create_repository( name=datatypes_repository_name, description=datatypes_repository_description, long_description=datatypes_repository_long_description, @@ -99,8 +98,7 @@ class TestInstallRepositoryMultipleOwners( ShedTwillTestCase ): category = self.create_category( name='Test 0120', description='Description of test 0120' ) self.logout() self.login( email=common.test_user_1_email, username=common.test_user_1_name ) - strings_displayed = [ 'Repository %s' % "'%s'" % tool_repository_name, - 'Repository %s has been created' % "%s" % tool_repository_name ] + strings_displayed = self.expect_repo_created_strings(tool_repository_name) repository = self.get_or_create_repository( name=tool_repository_name, description=tool_repository_description, long_description=tool_repository_long_description, diff --git a/test/unit/managers/test_HistoryManager.py b/test/unit/managers/test_HistoryManager.py index c55c25e4f0e..7b3a1818c6f 100644 --- a/test/unit/managers/test_HistoryManager.py +++ b/test/unit/managers/test_HistoryManager.py @@ -441,6 +441,78 @@ class HistorySerializerTestCase( BaseTestCase ): self.log( 'serialized should jsonify well' ) self.assertIsJsonifyable( serialized ) + def _history_state_from_states_and_deleted( self, user, hda_state_and_deleted_tuples ): + history = self.history_manager.create( name='name', user=user ) + for state, deleted in hda_state_and_deleted_tuples: + hda = self.hda_manager.create( history=history ) + hda = self.hda_manager.update( hda, dict( state=state, deleted=deleted ) ) + history_state = self.history_serializer.serialize( history, [ 'state' ] )[ 'state' ] + return history_state + + def test_state( self ): + dataset_states = model.Dataset.states + user2 = self.user_manager.create( **user2_data ) + + ready_states = [ ( state, False ) for state in [ dataset_states.OK, dataset_states.OK ] ] + + self.log( 'a history\'s serialized state should be running if any of its datasets are running' ) + self.assertEqual( 'running', self._history_state_from_states_and_deleted( user2, + ready_states + [( dataset_states.RUNNING, False )] )) + self.assertEqual( 'running', self._history_state_from_states_and_deleted( user2, + ready_states + [( dataset_states.SETTING_METADATA, False )] )) + self.assertEqual( 'running', self._history_state_from_states_and_deleted( user2, + ready_states + [( dataset_states.UPLOAD, False )] )) + + self.log( 'a history\'s serialized state should be queued if any of its datasets are queued' ) + self.assertEqual( 'queued', self._history_state_from_states_and_deleted( user2, + ready_states + [( dataset_states.QUEUED, False )] )) + + self.log( 'a history\'s serialized state should be error if any of its datasets are errored' ) + self.assertEqual( 'error', self._history_state_from_states_and_deleted( user2, + ready_states + [( dataset_states.ERROR, False )] )) + self.assertEqual( 'error', self._history_state_from_states_and_deleted( user2, + ready_states + [( dataset_states.FAILED_METADATA, False )] )) + + self.log( 'a history\'s serialized state should be ok if *all* of its datasets are ok' ) + self.assertEqual( 'ok', self._history_state_from_states_and_deleted( user2, ready_states )) + + self.log( 'a history\'s serialized state should be not be affected by deleted datasets' ) + self.assertEqual( 'ok', self._history_state_from_states_and_deleted( user2, + ready_states + [( dataset_states.RUNNING, True )] )) + + def test_contents( self ): + user2 = self.user_manager.create( **user2_data ) + history1 = self.history_manager.create( name='history1', user=user2 ) + + self.log( 'a history with no contents should be properly reflected in empty, etc.' ) + keys = [ 'empty', 'count', 'state_ids', 'state_details', 'state', 'hdas' ] + serialized = self.history_serializer.serialize( history1, keys ) + self.assertEqual( serialized[ 'state' ], 'new' ) + self.assertEqual( serialized[ 'empty' ], True ) + self.assertEqual( serialized[ 'count' ], 0 ) + self.assertEqual( sum( serialized[ 'state_details' ].values() ), 0 ) + self.assertEqual( serialized[ 'state_ids' ][ 'ok' ], [] ) + self.assertIsInstance( serialized[ 'hdas' ], list ) + + self.log( 'a history with contents should be properly reflected in empty, etc.' ) + hda1 = self.hda_manager.create( history=history1, hid=1 ) + self.hda_manager.update( hda1, dict( state='ok' ) ) + + serialized = self.history_serializer.serialize( history1, keys ) + self.assertEqual( serialized[ 'state' ], 'ok' ) + self.assertEqual( serialized[ 'empty' ], False ) + self.assertEqual( serialized[ 'count' ], 1 ) + self.assertEqual( serialized[ 'state_details' ][ 'ok' ], 1 ) + self.assertIsInstance( serialized[ 'state_ids' ][ 'ok' ], list ) + self.assertIsInstance( serialized[ 'hdas' ], list ) + self.assertIsInstance( serialized[ 'hdas' ][0], basestring ) + + serialized = self.history_serializer.serialize( history1, [ 'contents' ] ) + self.assertHasKeys( serialized[ 'contents' ][0], [ 'id', 'name', 'peek', 'create_time' ]) + + self.log( 'serialized should jsonify well' ) + self.assertIsJsonifyable( serialized ) + # # ============================================================================= # class HistoryDeserializerTestCase( BaseTestCase ): diff --git a/tools/data_source/bed_convert.xml b/tools/data_source/bed_convert.xml index c7cdd93d126..eb414066926 100644 --- a/tools/data_source/bed_convert.xml +++ b/tools/data_source/bed_convert.xml @@ -1,14 +1,14 @@ - - creates a bed or xbed file containing from text query - noop - - creates a bed or xbed file containing user assigned input of $input - - - - - - - User specifies delimiter, header information, and column assignments and the file will be converted to BED or xBED. - + + creates a bed or xbed file containing from text query + noop + + creates a bed or xbed file containing user assigned input of $input + + + + + + + User specifies delimiter, header information, and column assignments and the file will be converted to BED or xBED. + \ No newline at end of file diff --git a/tools/data_source/genbank.xml b/tools/data_source/genbank.xml index b4755d4f19f..65bd9c79f8d 100644 --- a/tools/data_source/genbank.xml +++ b/tools/data_source/genbank.xml @@ -1,25 +1,25 @@ - - - genbank.py $mode "$text" $output - - - - - - - - - - - - - - -At the moment this tool allows the following simple searches: - -- by GI: **51594135** -- by accession: **CF622840** -- using text: **human hbb1** (this feature is experimental) - - - \ No newline at end of file + + + genbank.py $mode "$text" $output + + + + + + + + + + + + + + +At the moment this tool allows the following simple searches: + +- by GI: **51594135** +- by accession: **CF622840** +- using text: **human hbb1** (this feature is experimental) + + + diff --git a/tools/data_source/import.xml b/tools/data_source/import.xml index 7121128194a..99d04506c8a 100644 --- a/tools/data_source/import.xml +++ b/tools/data_source/import.xml @@ -1,27 +1,27 @@ - - (PSU prepared queries) - import.py $data $output - - $data - - - - - - - - - - - - - - - - - - - - - - + + (PSU prepared queries) + import.py $data $output + + $data + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/data_source/microbial_import.xml b/tools/data_source/microbial_import.xml index 44950b7761e..b07f557cb7e 100644 --- a/tools/data_source/microbial_import.xml +++ b/tools/data_source/microbial_import.xml @@ -1,114 +1,114 @@ - - microbial_import.py $CDS,$tRNA,$rRNA,$sequence,$GeneMark,$GeneMarkHMM,$Glimmer3 $output ${GALAXY_DATA_INDEX_DIR}/microbial_data.loc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -This tool will allow you to obtain various genomic datasets for any completed Microbial Genome Project as listed at NCBI_. - -.. _NCBI: http://www.ncbi.nlm.nih.gov/genomes/lproks.cgi?view=1 - -Current datasets available include - 1. CDS - 2. tRNA - 3. rRNA - 4. FASTA Sequences - 5. GeneMark Annotations - 6. GeneMarkHMM Annotations - 7. Glimmer3 Annotations - ------ - -Organisms in **bold** are available at the UCSC Browser. - ------ - -.. class:: infomark - -**Note:** Having trouble locating your organism? Click here_ for a list of available species and their location. - -.. _here: https://wiki.galaxyproject.org/Main/Data%20Libraries/Microbes - - + + microbial_import.py $CDS,$tRNA,$rRNA,$sequence,$GeneMark,$GeneMarkHMM,$Glimmer3 $output ${GALAXY_DATA_INDEX_DIR}/microbial_data.loc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +This tool will allow you to obtain various genomic datasets for any completed Microbial Genome Project as listed at NCBI_. + +.. _NCBI: http://www.ncbi.nlm.nih.gov/genomes/lproks.cgi?view=1 + +Current datasets available include + 1. CDS + 2. tRNA + 3. rRNA + 4. FASTA Sequences + 5. GeneMark Annotations + 6. GeneMarkHMM Annotations + 7. Glimmer3 Annotations + +----- + +Organisms in **bold** are available at the UCSC Browser. + +----- + +.. class:: infomark + +**Note:** Having trouble locating your organism? Click here_ for a list of available species and their location. + +.. _here: https://wiki.galaxyproject.org/Main/Data%20Libraries/Microbes + + diff --git a/tools/data_source/ucsc_tablebrowser_archaea.xml b/tools/data_source/ucsc_tablebrowser_archaea.xml index 5aa6916e559..3a352034b41 100644 --- a/tools/data_source/ucsc_tablebrowser_archaea.xml +++ b/tools/data_source/ucsc_tablebrowser_archaea.xml @@ -1,42 +1,42 @@ - - - - table browser - data_source.py $output $__app__.config.output_size_limit - - go to UCSC Table Browser $GALAXY_URL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + table browser + data_source.py $output $__app__.config.output_size_limit + + go to UCSC Table Browser $GALAXY_URL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/data_source/ucsc_tablebrowser_test.xml b/tools/data_source/ucsc_tablebrowser_test.xml index eb8fe2a9a29..43eacdcf083 100644 --- a/tools/data_source/ucsc_tablebrowser_test.xml +++ b/tools/data_source/ucsc_tablebrowser_test.xml @@ -1,42 +1,42 @@ - - - - table browser - data_source.py $output $__app__.config.output_size_limit - - go to UCSC Table Browser $GALAXY_URL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + table browser + data_source.py $output $__app__.config.output_size_limit + + go to UCSC Table Browser $GALAXY_URL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/evolution/codingSnps.xml b/tools/evolution/codingSnps.xml index bd9e346fe10..345a9932ef9 100644 --- a/tools/evolution/codingSnps.xml +++ b/tools/evolution/codingSnps.xml @@ -46,8 +46,7 @@ - cat - sort + gnu_coreutils ucsc_tools diff --git a/tools/extract/liftOver_wrapper.xml b/tools/extract/liftOver_wrapper.xml index b5709a65e3a..a6c9caa8f85 100644 --- a/tools/extract/liftOver_wrapper.xml +++ b/tools/extract/liftOver_wrapper.xml @@ -1,147 +1,147 @@ - - between assemblies and genomes - - liftOver_wrapper.py - $input - "$out_file1" - "$out_file2" - $dbkey - $to_dbkey - #if isinstance( $input.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__) or isinstance( $input.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gtf').__class__): - "gff" - #else: - "interval" - #end if - $minMatch ${multiple.choice} ${multiple.minChainT} ${multiple.minChainQ} ${multiple.minSizeQ} - - - + + between assemblies and genomes + + liftOver_wrapper.py + $input + "$out_file1" + "$out_file2" + $dbkey + $to_dbkey + #if isinstance( $input.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__) or isinstance( $input.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gtf').__class__): + "gff" + #else: + "interval" + #end if + $minMatch ${multiple.choice} ${multiple.minChainT} ${multiple.minChainQ} ${multiple.minSizeQ} + + + - + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ucsc_tools - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ucsc_tools + + - - -.. class:: warningmark - -Make sure that the genome build of the input dataset is specified (click the pencil icon in the history item to set it if necessary). - -.. class:: warningmark - + + +.. class:: warningmark + +Make sure that the genome build of the input dataset is specified (click the pencil icon in the history item to set it if necessary). + +.. class:: warningmark + This tool can work with interval, GFF, and GTF datasets. It requires the interval datasets to have chromosome in column 1, start co-ordinate in column 2 and end co-ordinate in column 3. BED comments and track and browser lines will be ignored, but if other non-interval lines -are present the tool will return empty output datasets. - ------ - -.. class:: infomark - -**What it does** - -This tool is based on the LiftOver utility and Chain track from `the UC Santa Cruz Genome Browser`__. - -It converts coordinates and annotations between assemblies and genomes. It produces 2 files, one containing all the mapped coordinates and the other containing the unmapped coordinates, if any. - - .. __: http://genome.ucsc.edu/ - ------ - -**Example** - -Converting the following hg16 intervals to hg18 intervals:: - - chrX 85170 112199 AK002185 0 + - chrX 110458 112199 AK097346 0 + - chrX 112203 121212 AK074528 0 - - -will produce the following hg18 intervals:: - - chrX 132991 160020 AK002185 0 + - chrX 158279 160020 AK097346 0 + - chrX 160024 169033 AK074528 0 - - - - +are present the tool will return empty output datasets. + +----- + +.. class:: infomark + +**What it does** + +This tool is based on the LiftOver utility and Chain track from `the UC Santa Cruz Genome Browser`__. + +It converts coordinates and annotations between assemblies and genomes. It produces 2 files, one containing all the mapped coordinates and the other containing the unmapped coordinates, if any. + + .. __: http://genome.ucsc.edu/ + +----- + +**Example** + +Converting the following hg16 intervals to hg18 intervals:: + + chrX 85170 112199 AK002185 0 + + chrX 110458 112199 AK097346 0 + + chrX 112203 121212 AK074528 0 - + +will produce the following hg18 intervals:: + + chrX 132991 160020 AK002185 0 + + chrX 158279 160020 AK097346 0 + + chrX 160024 169033 AK074528 0 - + + + diff --git a/tools/filters/axt_to_lav.xml b/tools/filters/axt_to_lav.xml index abc4a501b41..1d7fe85cc8e 100644 --- a/tools/filters/axt_to_lav.xml +++ b/tools/filters/axt_to_lav.xml @@ -1,94 +1,94 @@ - - Converts an AXT formatted file to LAV format - axt_to_lav.py /galaxy/data/$dbkey_1/seq/%s.nib:$dbkey_1:${GALAXY_DATA_INDEX_DIR}/shared/ucsc/chrom/${dbkey_1}.len /galaxy/data/$dbkey_2/seq/%s.nib:$dbkey_2:${GALAXY_DATA_INDEX_DIR}/shared/ucsc/chrom/${dbkey_2}.len $align_input $lav_file $seq_file1 $seq_file2 - - - - - - - - - - - - -.. class:: warningmark - -**IMPORTANT**: AXT formatted alignments will be phased out from Galaxy in the coming weeks. They will be replaced with pairwise MAF alignments, which are already available. To try pairwise MAF alignments use "Extract Pairwise MAF blocks" tool in *Fetch Sequences and Alignments* section. - --------- - - -**Syntax** - -This tool converts an AXT formatted file to the LAV format. - -- **AXT format** The alignments are produced from Blastz, an alignment tool available from Webb Miller's lab at Penn State University. The lav format Blastz output, which does not include the sequence, was converted to AXT format with lavToAxt. Each alignment block in an AXT file contains three lines: a summary line and 2 sequence lines. Blocks are separated from one another by blank lines. - -- **LAV format** LAV is an alignment format developed by Webb Miller's group. It is the primary output format for BLASTZ. - -- **FASTA format** a text-based format for representing both nucleic and protein sequences, in which base pairs or proteins are represented using a single-letter code. - - - This format contains an one line header. It starts with a ">" symbol. The first word on this line is the name of the sequence. The rest of the line is a description of the sequence. - - The remaining lines contain the sequence itself. - - Blank lines in a FASTA file are ignored, and so are spaces or other gap symbols (dashes, underscores, periods) in a sequence. - - Fasta files containing multiple sequences are just the same, with one sequence listed right after another. This format is accepted for many multiple sequence alignment programs. - ------ - -**Example** - -- AXT format:: - - 0 chr19 3001012 3001075 chr11 70568380 70568443 - 3500 - TCAGCTCATAAATCACCTCCTGCCACAAGCCTGGCCTGGTCCCAGGAGAGTGTCCAGGCTCAGA - TCTGTTCATAAACCACCTGCCATGACAAGCCTGGCCTGTTCCCAAGACAATGTCCAGGCTCAGA - - 1 chr19 3008279 3008357 chr11 70573976 70574054 - 3900 - CACAATCTTCACATTGAGATCCTGAGTTGCTGATCAGAATGGAAGGCTGAGCTAAGATGAGCGACGAGGCAATGTCACA - CACAGTCTTCACATTGAGGTACCAAGTTGTGGATCAGAATGGAAAGCTAGGCTATGATGAGGGACAGTGCGCTGTCACA - -- Convert the above file to LAV format:: - - #:lav - s { - "/galaxy/data/hg16/seq/chr19.nib" 1 63811651 0 1 - "/galaxy/data/mm5/seq/chr11.nib-" 1 121648857 0 1 - } - h { - "> hg16.chr19" - "> mm5.chr11 (reverse complement)" - } - a { - s 3500 - b 3001012 70568380 - e 3001075 70568443 - l 3001012 70568380 3001075 70568443 81 - } - a { - s 3900 - b 3008279 70573976 - e 3008357 70574054 - l 3008279 70573976 3008357 70574054 78 - } - #:eof - -- With two files in the FASTA format:: - - >hg16.chr19_-_3001011_3001075 - TCAGCTCATAAATCACCTCCTGCCACAAGCCTGGCCTGGTCCCAGGAGAGTGTCCAGGCTCAGA - - >hg16.chr19_-_3008278_3008357 - CACAATCTTCACATTGAGATCCTGAGTTGCTGATCAGAATGGAAGGCTGAGCTAAGATGAGCGACGAGGCAATGTCACA - - **and**:: - - >mm5.chr11_-_70568379_70568443 - TCTGTTCATAAACCACCTGCCATGACAAGCCTGGCCTGTTCCCAAGACAATGTCCAGGCTCAGA - - >mm5.chr11_-_70573975_70574054 - CACAGTCTTCACATTGAGGTACCAAGTTGTGGATCAGAATGGAAAGCTAGGCTATGATGAGGGACAGTGCGCTGTCACA - - - + + Converts an AXT formatted file to LAV format + axt_to_lav.py /galaxy/data/$dbkey_1/seq/%s.nib:$dbkey_1:${GALAXY_DATA_INDEX_DIR}/shared/ucsc/chrom/${dbkey_1}.len /galaxy/data/$dbkey_2/seq/%s.nib:$dbkey_2:${GALAXY_DATA_INDEX_DIR}/shared/ucsc/chrom/${dbkey_2}.len $align_input $lav_file $seq_file1 $seq_file2 + + + + + + + + + + + + +.. class:: warningmark + +**IMPORTANT**: AXT formatted alignments will be phased out from Galaxy in the coming weeks. They will be replaced with pairwise MAF alignments, which are already available. To try pairwise MAF alignments use "Extract Pairwise MAF blocks" tool in *Fetch Sequences and Alignments* section. + +-------- + + +**Syntax** + +This tool converts an AXT formatted file to the LAV format. + +- **AXT format** The alignments are produced from Blastz, an alignment tool available from Webb Miller's lab at Penn State University. The lav format Blastz output, which does not include the sequence, was converted to AXT format with lavToAxt. Each alignment block in an AXT file contains three lines: a summary line and 2 sequence lines. Blocks are separated from one another by blank lines. + +- **LAV format** LAV is an alignment format developed by Webb Miller's group. It is the primary output format for BLASTZ. + +- **FASTA format** a text-based format for representing both nucleic and protein sequences, in which base pairs or proteins are represented using a single-letter code. + + - This format contains an one line header. It starts with a ">" symbol. The first word on this line is the name of the sequence. The rest of the line is a description of the sequence. + - The remaining lines contain the sequence itself. + - Blank lines in a FASTA file are ignored, and so are spaces or other gap symbols (dashes, underscores, periods) in a sequence. + - Fasta files containing multiple sequences are just the same, with one sequence listed right after another. This format is accepted for many multiple sequence alignment programs. + +----- + +**Example** + +- AXT format:: + + 0 chr19 3001012 3001075 chr11 70568380 70568443 - 3500 + TCAGCTCATAAATCACCTCCTGCCACAAGCCTGGCCTGGTCCCAGGAGAGTGTCCAGGCTCAGA + TCTGTTCATAAACCACCTGCCATGACAAGCCTGGCCTGTTCCCAAGACAATGTCCAGGCTCAGA + + 1 chr19 3008279 3008357 chr11 70573976 70574054 - 3900 + CACAATCTTCACATTGAGATCCTGAGTTGCTGATCAGAATGGAAGGCTGAGCTAAGATGAGCGACGAGGCAATGTCACA + CACAGTCTTCACATTGAGGTACCAAGTTGTGGATCAGAATGGAAAGCTAGGCTATGATGAGGGACAGTGCGCTGTCACA + +- Convert the above file to LAV format:: + + #:lav + s { + "/galaxy/data/hg16/seq/chr19.nib" 1 63811651 0 1 + "/galaxy/data/mm5/seq/chr11.nib-" 1 121648857 0 1 + } + h { + "> hg16.chr19" + "> mm5.chr11 (reverse complement)" + } + a { + s 3500 + b 3001012 70568380 + e 3001075 70568443 + l 3001012 70568380 3001075 70568443 81 + } + a { + s 3900 + b 3008279 70573976 + e 3008357 70574054 + l 3008279 70573976 3008357 70574054 78 + } + #:eof + +- With two files in the FASTA format:: + + >hg16.chr19_-_3001011_3001075 + TCAGCTCATAAATCACCTCCTGCCACAAGCCTGGCCTGGTCCCAGGAGAGTGTCCAGGCTCAGA + + >hg16.chr19_-_3008278_3008357 + CACAATCTTCACATTGAGATCCTGAGTTGCTGATCAGAATGGAAGGCTGAGCTAAGATGAGCGACGAGGCAATGTCACA + + **and**:: + + >mm5.chr11_-_70568379_70568443 + TCTGTTCATAAACCACCTGCCATGACAAGCCTGGCCTGTTCCCAAGACAATGTCCAGGCTCAGA + + >mm5.chr11_-_70573975_70574054 + CACAGTCTTCACATTGAGGTACCAAGTTGTGGATCAGAATGGAAAGCTAGGCTATGATGAGGGACAGTGCGCTGTCACA + + + diff --git a/tools/filters/axt_to_lav_code.py b/tools/filters/axt_to_lav_code.py index 02b35ea764d..9c08c971f0b 100644 --- a/tools/filters/axt_to_lav_code.py +++ b/tools/filters/axt_to_lav_code.py @@ -1,8 +1,8 @@ - -def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr): - for name,data in out_data.items(): - if name == "seq_file2": - data.dbkey = param_dict['dbkey_2'] - app.model.context.add( data ) - app.model.context.flush() + +def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr): + for name,data in out_data.items(): + if name == "seq_file2": + data.dbkey = param_dict['dbkey_2'] + app.model.context.add( data ) + app.model.context.flush() break \ No newline at end of file diff --git a/tools/filters/catWrapper.xml b/tools/filters/catWrapper.xml index 5524825e8c6..33e67e1e5a4 100644 --- a/tools/filters/catWrapper.xml +++ b/tools/filters/catWrapper.xml @@ -1,79 +1,79 @@ - - tail-to-head - - catWrapper.py - $out_file1 - $input1 - #for $q in $queries - ${q.input2} - #end for - - - - - - - - - - - - - - - - - - - - -.. class:: warningmark - -**WARNING:** Be careful not to concatenate datasets of different kinds (e.g., sequences with intervals). This tool does not check if the datasets being concatenated are in the same format. - ------ - -**What it does** - -Concatenates datasets - ------ - -**Example** - -Concatenating Dataset:: - - chrX 151087187 151087355 A 0 - - chrX 151572400 151572481 B 0 + - -with Dataset1:: - - chr1 151242630 151242955 X 0 + - chr1 151271715 151271999 Y 0 + - chr1 151278832 151279227 Z 0 - - -and with Dataset2:: - - chr2 100000030 200000955 P 0 + - chr2 100000015 200000999 Q 0 + - -will result in the following:: - - chrX 151087187 151087355 A 0 - - chrX 151572400 151572481 B 0 + - chr1 151242630 151242955 X 0 + - chr1 151271715 151271999 Y 0 + - chr1 151278832 151279227 Z 0 - - chr2 100000030 200000955 P 0 + - chr2 100000015 200000999 Q 0 + - - - + + tail-to-head + + catWrapper.py + $out_file1 + $input1 + #for $q in $queries + ${q.input2} + #end for + + + + + + + + + + + + + + + + + + + + +.. class:: warningmark + +**WARNING:** Be careful not to concatenate datasets of different kinds (e.g., sequences with intervals). This tool does not check if the datasets being concatenated are in the same format. + +----- + +**What it does** + +Concatenates datasets + +----- + +**Example** + +Concatenating Dataset:: + + chrX 151087187 151087355 A 0 - + chrX 151572400 151572481 B 0 + + +with Dataset1:: + + chr1 151242630 151242955 X 0 + + chr1 151271715 151271999 Y 0 + + chr1 151278832 151279227 Z 0 - + +and with Dataset2:: + + chr2 100000030 200000955 P 0 + + chr2 100000015 200000999 Q 0 + + +will result in the following:: + + chrX 151087187 151087355 A 0 - + chrX 151572400 151572481 B 0 + + chr1 151242630 151242955 X 0 + + chr1 151271715 151271999 Y 0 + + chr1 151278832 151279227 Z 0 - + chr2 100000030 200000955 P 0 + + chr2 100000015 200000999 Q 0 + + + + diff --git a/tools/filters/changeCase.xml b/tools/filters/changeCase.xml index 251654a7ea8..6912bdd18f8 100644 --- a/tools/filters/changeCase.xml +++ b/tools/filters/changeCase.xml @@ -1,77 +1,77 @@ - - of selected columns - - - - changeCase.pl $input "$cols" $delimiter $casing $out_file1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.. class:: warningmark - -**This tool breaks column assignments.** To re-establish column assignments run the tool and click on the pencil icon in the resulting history item. - -.. class:: warningmark - -The format of the resulting dataset from this tool is always tabular. - ------ - -**What it does** - -This tool selects specified columns from a dataset and converts the values of those columns to upper or lower case. - -- Columns are specified as **c1**, **c2**, and so on. -- Columns can be specified in any order (e.g., **c2,c1,c6**) - ------ - -**Example** - -Changing columns 1 and 3 ( delimited by Comma ) to upper case in:: - - apple,is,good - windows,is,bad - -will result in:: - - APPLE is GOOD - WINDOWS is BAD - - - + + of selected columns + + + + changeCase.pl $input "$cols" $delimiter $casing $out_file1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.. class:: warningmark + +**This tool breaks column assignments.** To re-establish column assignments run the tool and click on the pencil icon in the resulting history item. + +.. class:: warningmark + +The format of the resulting dataset from this tool is always tabular. + +----- + +**What it does** + +This tool selects specified columns from a dataset and converts the values of those columns to upper or lower case. + +- Columns are specified as **c1**, **c2**, and so on. +- Columns can be specified in any order (e.g., **c2,c1,c6**) + +----- + +**Example** + +Changing columns 1 and 3 ( delimited by Comma ) to upper case in:: + + apple,is,good + windows,is,bad + +will result in:: + + APPLE is GOOD + WINDOWS is BAD + + + diff --git a/tools/filters/condense_characters.xml b/tools/filters/condense_characters.xml index 41d75cdb445..f792851a502 100644 --- a/tools/filters/condense_characters.xml +++ b/tools/filters/condense_characters.xml @@ -1,48 +1,48 @@ - - consecutive characters - condense_characters.pl $input $character $out_file1 - - - - - - - - - - - - - - - - - - - - - - - - - -**What it does** - -This tool condenses all consecutive characters of a specified type. - ------ - -**Example** - -- Input file:: - - geneX,,,10,,,,,20 - geneY,,5,,,,,12,15,9, - -- Condense all consecutive commas. The above file will be converted into:: - - geneX,10,20 - geneY,5,12,15,9 - - - + + consecutive characters + condense_characters.pl $input $character $out_file1 + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool condenses all consecutive characters of a specified type. + +----- + +**Example** + +- Input file:: + + geneX,,,10,,,,,20 + geneY,,5,,,,,12,15,9, + +- Condense all consecutive commas. The above file will be converted into:: + + geneX,10,20 + geneY,5,12,15,9 + + + diff --git a/tools/filters/cutWrapper.xml b/tools/filters/cutWrapper.xml index ab2365b6459..b7fed5ba9e1 100644 --- a/tools/filters/cutWrapper.xml +++ b/tools/filters/cutWrapper.xml @@ -1,213 +1,211 @@ - - columns from a table - cutWrapper.pl $input "$columnList" $delimiter $out_file1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.. class:: warningmark - -**WARNING: This tool breaks column assignments.** To re-establish column assignments run the tools and click on the pencil icon in the latest history item. - -.. class:: infomark - -The output of this tool is always in tabular format (e.g., if your original delimiters are commas, they will be replaced with tabs). For example: - - Cutting columns 1 and 3 from:: - - apple,is,good - windows,is,bad - - will give:: - - apple good - windows bad - ------ - -**What it does** - -This tool selects (cuts out) specified columns from the dataset. - -- Columns are specified as **c1**, **c2**, and so on. Column count begins with **1** -- Columns can be specified in any order (e.g., **c2,c1,c6**) -- If you specify more columns than actually present - empty spaces will be filled with dots - ------ - -**Example** - -Input dataset (six columns: c1, c2, c3, c4, c5, and c6):: - - chr1 10 1000 gene1 0 + - chr2 100 1500 gene2 0 + - -**cut** on columns "**c1,c4,c6**" will return:: - - chr1 gene1 + - chr2 gene2 + - -**cut** on columns "**c6,c5,c4,c1**" will return:: - - + 0 gene1 chr1 - + 0 gene2 chr2 - -**cut** on columns "**c1-c3**" will return:: - - chr1 10 1000 - chr2 100 1500 - - -**cut** on columns "**c8,c7,c4**" will return:: - - . . gene1 - . . gene2 - - - - + + columns from a table + cutWrapper.pl $input "$columnList" $delimiter $out_file1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.. class:: warningmark + +**WARNING: This tool breaks column assignments.** To re-establish column assignments run the tools and click on the pencil icon in the latest history item. + +.. class:: infomark + +The output of this tool is always in tabular format (e.g., if your original delimiters are commas, they will be replaced with tabs). For example: + + Cutting columns 1 and 3 from:: + + apple,is,good + windows,is,bad + + will give:: + + apple good + windows bad + +----- + +**What it does** + +This tool selects (cuts out) specified columns from the dataset. + +- Columns are specified as **c1**, **c2**, and so on. Column count begins with **1** +- Columns can be specified in any order (e.g., **c2,c1,c6**) +- If you specify more columns than actually present - empty spaces will be filled with dots + +----- + +**Example** + +Input dataset (six columns: c1, c2, c3, c4, c5, and c6):: + + chr1 10 1000 gene1 0 + + chr2 100 1500 gene2 0 + + +**cut** on columns "**c1,c4,c6**" will return:: + + chr1 gene1 + + chr2 gene2 + + +**cut** on columns "**c6,c5,c4,c1**" will return:: + + + 0 gene1 chr1 + + 0 gene2 chr2 + +**cut** on columns "**c1-c3**" will return:: + + chr1 10 1000 + chr2 100 1500 + + +**cut** on columns "**c8,c7,c4**" will return:: + + . . gene1 + . . gene2 + + diff --git a/tools/filters/gff/extract_GFF_Features.xml b/tools/filters/gff/extract_GFF_Features.xml index d664d667447..69c62c3498b 100644 --- a/tools/filters/gff/extract_GFF_Features.xml +++ b/tools/filters/gff/extract_GFF_Features.xml @@ -1,114 +1,114 @@ - - from GFF data - extract_GFF_Features.py $input1 $out_file1 ${column_choice.col} ${column_choice.feature} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -**What it does** - -This tool extracts selected features from GFF data. - ------ - -**Example** - -Selecting **promoter** from the following GFF data:: - - chr22 GeneA enhancer 10000000 10001000 500 + . TGA - chr22 GeneA promoter 10010000 10010100 900 + . TGA - chr22 GeneB promoter 10020000 10025000 400 - . TGB - chr22 GeneB CCDS2220 10030000 10065000 800 - . TGB - -will produce the following output:: - - chr22 GeneA promoter 10010000 10010100 900 + . TGA - chr22 GeneB promoter 10020000 10025000 400 - . TGB - ----- - -.. class:: infomark - -**About formats** - -**GFF format** General Feature Format is a format for describing genes and other features associated with DNA, RNA and Protein sequences. GFF lines have nine tab-separated fields:: - - 1. seqname - Must be a chromosome or scaffold. - 2. source - The program that generated this feature. - 3. feature - The name of this type of feature. Some examples of standard feature types are "CDS", "start_codon", "stop_codon", and "exon". - 4. start - The starting position of the feature in the sequence. The first base is numbered 1. - 5. end - The ending position of the feature (inclusive). - 6. score - A score between 0 and 1000. If there is no score value, enter ".". - 7. strand - Valid entries include '+', '-', or '.' (for don't know/care). - 8. frame - If the feature is a coding exon, frame should be a number between 0-2 that represents the reading frame of the first base. If the feature is not a coding exon, the value should be '.'. - 9. group - All lines with the same group are linked together into a single item. - - - - + + from GFF data + extract_GFF_Features.py $input1 $out_file1 ${column_choice.col} ${column_choice.feature} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool extracts selected features from GFF data. + +----- + +**Example** + +Selecting **promoter** from the following GFF data:: + + chr22 GeneA enhancer 10000000 10001000 500 + . TGA + chr22 GeneA promoter 10010000 10010100 900 + . TGA + chr22 GeneB promoter 10020000 10025000 400 - . TGB + chr22 GeneB CCDS2220 10030000 10065000 800 - . TGB + +will produce the following output:: + + chr22 GeneA promoter 10010000 10010100 900 + . TGA + chr22 GeneB promoter 10020000 10025000 400 - . TGB + +---- + +.. class:: infomark + +**About formats** + +**GFF format** General Feature Format is a format for describing genes and other features associated with DNA, RNA and Protein sequences. GFF lines have nine tab-separated fields:: + + 1. seqname - Must be a chromosome or scaffold. + 2. source - The program that generated this feature. + 3. feature - The name of this type of feature. Some examples of standard feature types are "CDS", "start_codon", "stop_codon", and "exon". + 4. start - The starting position of the feature in the sequence. The first base is numbered 1. + 5. end - The ending position of the feature (inclusive). + 6. score - A score between 0 and 1000. If there is no score value, enter ".". + 7. strand - Valid entries include '+', '-', or '.' (for don't know/care). + 8. frame - If the feature is a coding exon, frame should be a number between 0-2 that represents the reading frame of the first base. If the feature is not a coding exon, the value should be '.'. + 9. group - All lines with the same group are linked together into a single item. + + + + diff --git a/tools/filters/gff/gff_filter_by_attribute.xml b/tools/filters/gff/gff_filter_by_attribute.xml index 4e64b84126e..475c3f55ffa 100644 --- a/tools/filters/gff/gff_filter_by_attribute.xml +++ b/tools/filters/gff/gff_filter_by_attribute.xml @@ -1,53 +1,53 @@ - - using simple expressions - - gff_filter_by_attribute.py $input $out_file1 "$cond" '${input.metadata.attribute_types}' - - - - - - - - - - - - - - - - - - - - - - - - - -.. class:: warningmark - -Double equal signs, ==, must be used as *"equal to"* (e.g., **c1 == 'chr22'**) - -.. class:: infomark - -**TIP:** Attempting to apply a filtering condition may throw exceptions if the data type (e.g., string, integer) in every line of the attribute being filtered is not appropriate for the condition (e.g., attempting certain numerical calculations on strings). If an exception is thrown when applying the condition to a line, that line is skipped as invalid for the filter condition. The number of invalid skipped lines is documented in the resulting history item as a "Condition/data issue". - -.. class:: infomark - -**TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* - ------ - -**Syntax** - -The filter tool allows you to restrict the dataset using simple conditional statements. - -- Make sure that multi-character operators contain no white space ( e.g., **<=** is valid while **< =** is not valid ) -- When using 'equal-to' operator **double equal sign '==' must be used** ( e.g., **attribute_name=='chr1'** ) -- Non-numerical values must be included in single or double quotes ( e.g., **attribute_name=='XX22'** ) - - - + + using simple expressions + + gff_filter_by_attribute.py $input $out_file1 "$cond" '${input.metadata.attribute_types}' + + + + + + + + + + + + + + + + + + + + + + + + + +.. class:: warningmark + +Double equal signs, ==, must be used as *"equal to"* (e.g., **c1 == 'chr22'**) + +.. class:: infomark + +**TIP:** Attempting to apply a filtering condition may throw exceptions if the data type (e.g., string, integer) in every line of the attribute being filtered is not appropriate for the condition (e.g., attempting certain numerical calculations on strings). If an exception is thrown when applying the condition to a line, that line is skipped as invalid for the filter condition. The number of invalid skipped lines is documented in the resulting history item as a "Condition/data issue". + +.. class:: infomark + +**TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* + +----- + +**Syntax** + +The filter tool allows you to restrict the dataset using simple conditional statements. + +- Make sure that multi-character operators contain no white space ( e.g., **<=** is valid while **< =** is not valid ) +- When using 'equal-to' operator **double equal sign '==' must be used** ( e.g., **attribute_name=='chr1'** ) +- Non-numerical values must be included in single or double quotes ( e.g., **attribute_name=='XX22'** ) + + + diff --git a/tools/filters/gff/gff_filter_by_feature_count.xml b/tools/filters/gff/gff_filter_by_feature_count.xml index 90fbd87c12f..75886432fb9 100644 --- a/tools/filters/gff/gff_filter_by_feature_count.xml +++ b/tools/filters/gff/gff_filter_by_feature_count.xml @@ -1,53 +1,53 @@ - - using simple expressions - - gff_filter_by_feature_count.py $input_file1 $out_file1 "$feature_name" "$cond" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.. class:: infomark - -Valid comparison operators are: > < >=, <=, !=, and == - ------ - -**Syntax** - -The filter tool allows you to restrict the dataset based on transcripts' feature counts. - - - + + using simple expressions + + gff_filter_by_feature_count.py $input_file1 $out_file1 "$feature_name" "$cond" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.. class:: infomark + +Valid comparison operators are: > < >=, <=, !=, and == + +----- + +**Syntax** + +The filter tool allows you to restrict the dataset based on transcripts' feature counts. + + + diff --git a/tools/filters/gff/gtf_filter_by_attribute_values_list.xml b/tools/filters/gff/gtf_filter_by_attribute_values_list.xml index 5ac16d20c13..0f5d0dadabc 100644 --- a/tools/filters/gff/gtf_filter_by_attribute_values_list.xml +++ b/tools/filters/gff/gtf_filter_by_attribute_values_list.xml @@ -1,42 +1,42 @@ - - - - gtf_filter_by_attribute_values_list.py $input $attribute_name $ids $output - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -This tool filters a GTF file using a list of attribute values. The attribute values are -taken from the first column in the file; additional columns in the file are ignored. An example -use of this tool is to filter a GTF file using a list of transcript_ids or gene_ids obtained from Cuffdiff. - - - + + + + gtf_filter_by_attribute_values_list.py $input $attribute_name $ids $output + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +This tool filters a GTF file using a list of attribute values. The attribute values are +taken from the first column in the file; additional columns in the file are ignored. An example +use of this tool is to filter a GTF file using a list of transcript_ids or gene_ids obtained from Cuffdiff. + + + diff --git a/tools/filters/headWrapper.xml b/tools/filters/headWrapper.xml index 0c67a2d4bca..53451c44067 100644 --- a/tools/filters/headWrapper.xml +++ b/tools/filters/headWrapper.xml @@ -1,42 +1,42 @@ - - lines from a dataset - headWrapper.pl $input $lineNum $out_file1 - - - - - - - - - - - - - - - - -**What it does** - -This tool outputs specified number of lines from the **beginning** of a dataset - ------ - -**Example** - -Selecting 2 lines from this:: - - chr7 56632 56652 D17003_CTCF_R6 310 + - chr7 56736 56756 D17003_CTCF_R7 354 + - chr7 56761 56781 D17003_CTCF_R4 220 + - chr7 56772 56792 D17003_CTCF_R7 372 + - chr7 56775 56795 D17003_CTCF_R4 207 + - -will produce:: - - chr7 56632 56652 D17003_CTCF_R6 310 + - chr7 56736 56756 D17003_CTCF_R7 354 + - - - + + lines from a dataset + headWrapper.pl $input $lineNum $out_file1 + + + + + + + + + + + + + + + + +**What it does** + +This tool outputs specified number of lines from the **beginning** of a dataset + +----- + +**Example** + +Selecting 2 lines from this:: + + chr7 56632 56652 D17003_CTCF_R6 310 + + chr7 56736 56756 D17003_CTCF_R7 354 + + chr7 56761 56781 D17003_CTCF_R4 220 + + chr7 56772 56792 D17003_CTCF_R7 372 + + chr7 56775 56795 D17003_CTCF_R4 207 + + +will produce:: + + chr7 56632 56652 D17003_CTCF_R6 310 + + chr7 56736 56756 D17003_CTCF_R7 354 + + + + diff --git a/tools/filters/joiner2.xml b/tools/filters/joiner2.xml index a3061e8919b..93cc920efd5 100644 --- a/tools/filters/joiner2.xml +++ b/tools/filters/joiner2.xml @@ -1,13 +1,13 @@ - - two datasets a specific column of which has the same value - sort -k $col1 $input1 > $input1.tmp; sort -k $col2 $input2 > $input2.tmp; join -1 $col1 -2 $col2 $input1.tmp $input2.tmp | tr " " "\t" > $out_file1; rm -rf $input1.tmp $input2.tmp - - - - - - - - - - + + two datasets a specific column of which has the same value + sort -k $col1 $input1 > $input1.tmp; sort -k $col2 $input2 > $input2.tmp; join -1 $col1 -2 $col2 $input1.tmp $input2.tmp | tr " " "\t" > $out_file1; rm -rf $input1.tmp $input2.tmp + + + + + + + + + + diff --git a/tools/filters/lav_to_bed.py b/tools/filters/lav_to_bed.py index 6b1e067884d..c9ab8f13984 100644 --- a/tools/filters/lav_to_bed.py +++ b/tools/filters/lav_to_bed.py @@ -1,54 +1,55 @@ -#!/usr/bin/env python -#Reads a LAV file and writes two BED files. -import sys -from galaxy import eggs -import pkg_resources -pkg_resources.require( "bx-python" ) -import bx.align.lav - -assert sys.version_info[:2] >= ( 2, 4 ) - -def stop_err( msg ): - sys.stderr.write( msg ) - sys.exit() - -def main(): - try: - lav_file = open(sys.argv[1],'r') - bed_file1 = open(sys.argv[2],'w') - bed_file2 = open(sys.argv[3],'w') - except Exception, e: - stop_err( str( e ) ) - - lavsRead = 0 - bedsWritten = 0 - species = {} - # TODO: this is really bad since everything is read into memory. Can we eliminate this tool? - for lavBlock in bx.align.lav.Reader( lav_file ): - lavsRead += 1 - for c in lavBlock.components: - spec, chrom = bx.align.lav.src_split( c.src ) - if bedsWritten < 1: - if len( species )==0: - species[spec]=bed_file1 - elif len( species )==1: - species[spec]=bed_file2 - else: - continue #this is a pairwise alignment... - if spec in species: - species[spec].write( "%s\t%i\t%i\t%s_%s\t%i\t%s\n" % ( chrom, c.start, c.end, spec, str( bedsWritten ), 0, c.strand ) ) - bedsWritten += 1 - - - for spec,file in species.items(): - print "#FILE\t%s\t%s" % (file.name, spec) - - lav_file.close() - bed_file1.close() - bed_file2.close() - - print "%d lav blocks read, %d regions written\n" % (lavsRead,bedsWritten) - - - -if __name__ == "__main__": main() \ No newline at end of file +#!/usr/bin/env python +#Reads a LAV file and writes two BED files. +import sys +from galaxy import eggs +import pkg_resources +pkg_resources.require( "bx-python" ) +import bx.align.lav + +assert sys.version_info[:2] >= ( 2, 4 ) + + +def stop_err( msg ): + sys.stderr.write( msg ) + sys.exit() + + +def main(): + try: + lav_file = open(sys.argv[1], 'r') + bed_file1 = open(sys.argv[2], 'w') + bed_file2 = open(sys.argv[3], 'w') + except Exception, e: + stop_err( str( e ) ) + + lavsRead = 0 + bedsWritten = 0 + species = {} + # TODO: this is really bad since everything is read into memory. Can we eliminate this tool? + for lavBlock in bx.align.lav.Reader( lav_file ): + lavsRead += 1 + for c in lavBlock.components: + spec, chrom = bx.align.lav.src_split( c.src ) + if bedsWritten < 1: + if len( species ) == 0: + species[spec] = bed_file1 + elif len( species ) == 1: + species[spec] = bed_file2 + else: + continue # this is a pairwise alignment... + if spec in species: + species[spec].write( "%s\t%i\t%i\t%s_%s\t%i\t%s\n" % ( chrom, c.start, c.end, spec, str( bedsWritten ), 0, c.strand ) ) + bedsWritten += 1 + + for spec, file in species.items(): + print "#FILE\t%s\t%s" % (file.name, spec) + + lav_file.close() + bed_file1.close() + bed_file2.close() + + print "%d lav blocks read, %d regions written\n" % (lavsRead, bedsWritten) + + +if __name__ == "__main__": + main() diff --git a/tools/filters/lav_to_bed.xml b/tools/filters/lav_to_bed.xml index 30af59c369d..369a0e59618 100644 --- a/tools/filters/lav_to_bed.xml +++ b/tools/filters/lav_to_bed.xml @@ -1,68 +1,68 @@ - - Converts a LAV formatted file to BED format - lav_to_bed.py $lav_file $bed_file1 $bed_file2 - - - - - - - - - - - - - - - - -**Syntax** - -This tool converts a LAV formatted file to the BED format. - -- **LAV format** LAV is an alignment format developed by Webb Miller's group at Penn State University. It is the primary output format for BLASTZ. - -- **BED format** Browser Extensible Data format was designed at UCSC for displaying data tracks in the Genome Browser. - ------ - -**Example** - -- Convert LAV format:: - - #:lav - s { - "/galaxy/data/hg16/seq/chr19.nib" 1 63811651 0 1 - "/galaxy/data/mm5/seq/chr11.nib" 1 121648857 0 1 - } - h { - "> hg16.chr19" - "> mm5.chr11 (reverse complement)" - } - a { - s 3500 - b 3001012 70568380 - e 3001075 70568443 - l 3001012 70568380 3001075 70568443 81 - } - a { - s 3900 - b 3008279 70573976 - e 3008357 70574054 - l 3008279 70573976 3008357 70574054 78 - } - #:eof - -- To two BED formatted files:: - - chr19 3001011 3001075 hg16_0 0 + - chr19 3008278 3008357 hg16_1 0 + - - **and**:: - - chr11 70568379 70568443 mm5_0 0 + - chr11 70573975 70574054 mm5_1 0 + - - - + + Converts a LAV formatted file to BED format + lav_to_bed.py $lav_file $bed_file1 $bed_file2 + + + + + + + + + + + + + + + + +**Syntax** + +This tool converts a LAV formatted file to the BED format. + +- **LAV format** LAV is an alignment format developed by Webb Miller's group at Penn State University. It is the primary output format for BLASTZ. + +- **BED format** Browser Extensible Data format was designed at UCSC for displaying data tracks in the Genome Browser. + +----- + +**Example** + +- Convert LAV format:: + + #:lav + s { + "/galaxy/data/hg16/seq/chr19.nib" 1 63811651 0 1 + "/galaxy/data/mm5/seq/chr11.nib" 1 121648857 0 1 + } + h { + "> hg16.chr19" + "> mm5.chr11 (reverse complement)" + } + a { + s 3500 + b 3001012 70568380 + e 3001075 70568443 + l 3001012 70568380 3001075 70568443 81 + } + a { + s 3900 + b 3008279 70573976 + e 3008357 70574054 + l 3008279 70573976 3008357 70574054 78 + } + #:eof + +- To two BED formatted files:: + + chr19 3001011 3001075 hg16_0 0 + + chr19 3008278 3008357 hg16_1 0 + + + **and**:: + + chr11 70568379 70568443 mm5_0 0 + + chr11 70573975 70574054 mm5_1 0 + + + + diff --git a/tools/filters/lav_to_bed_code.py b/tools/filters/lav_to_bed_code.py index 80f47a7d076..a996301f1c9 100644 --- a/tools/filters/lav_to_bed_code.py +++ b/tools/filters/lav_to_bed_code.py @@ -1,19 +1,19 @@ -#Set build, name, and info for each output BED file -def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr): - new_stdout = "" - filename_to_build = {} - for line in stdout.split("\n"): - if line.startswith("#FILE"): - fields = line.split("\t") - filename_to_build[fields[1]]=fields[2].strip() - else: - new_stdout = "%s%s" % ( new_stdout, line ) - for name,data in out_data.items(): - try: - data.info = "%s\n%s" % ( new_stdout, stderr ) - data.dbkey = filename_to_build[data.file_name] - data.name = "%s (%s)" % ( data.name, data.dbkey ) - app.model.context.add( data ) - app.model.context.flush() - except: - continue +#Set build, name, and info for each output BED file +def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr): + new_stdout = "" + filename_to_build = {} + for line in stdout.split("\n"): + if line.startswith("#FILE"): + fields = line.split("\t") + filename_to_build[fields[1]]=fields[2].strip() + else: + new_stdout = "%s%s" % ( new_stdout, line ) + for name,data in out_data.items(): + try: + data.info = "%s\n%s" % ( new_stdout, stderr ) + data.dbkey = filename_to_build[data.file_name] + data.name = "%s (%s)" % ( data.name, data.dbkey ) + app.model.context.add( data ) + app.model.context.flush() + except: + continue diff --git a/tools/filters/pasteWrapper.xml b/tools/filters/pasteWrapper.xml index 8da6e48d95a..e853d6147a4 100644 --- a/tools/filters/pasteWrapper.xml +++ b/tools/filters/pasteWrapper.xml @@ -1,68 +1,68 @@ - - two files side by side - pasteWrapper.pl $input1 $input2 $delimiter $out_file1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.. class:: infomark - -Paste preserves column assignments of the first dataset. - ------ - -**What it does** - -This tool merges two datasets side by side. If the first (left) dataset contains column assignments such as chromosome, start, end and strand, these will be preserved. However, if you would like to change column assignments, click the pencil icon in the history item. - ------ - -**Example** - -First dataset:: - - a 1 - a 2 - a 3 - -Second dataset:: - - 20 - 30 - 40 - -Pasting them together will produce:: - - a 1 20 - a 2 30 - a 3 40 - - - + + two files side by side + pasteWrapper.pl $input1 $input2 $delimiter $out_file1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.. class:: infomark + +Paste preserves column assignments of the first dataset. + +----- + +**What it does** + +This tool merges two datasets side by side. If the first (left) dataset contains column assignments such as chromosome, start, end and strand, these will be preserved. However, if you would like to change column assignments, click the pencil icon in the history item. + +----- + +**Example** + +First dataset:: + + a 1 + a 2 + a 3 + +Second dataset:: + + 20 + 30 + 40 + +Pasting them together will produce:: + + a 1 20 + a 2 30 + a 3 40 + + + diff --git a/tools/filters/remove_beginning.xml b/tools/filters/remove_beginning.xml index 909b0073a42..a929e483d83 100644 --- a/tools/filters/remove_beginning.xml +++ b/tools/filters/remove_beginning.xml @@ -1,42 +1,42 @@ - - of a file - remove_beginning.pl $input $num_lines $out_file1 - - - - - - - - - - - - - - - - -**What it does** - -This tool removes a specified number of lines from the beginning of a dataset. - ------ - -**Example** - -Input File:: - - chr7 56632 56652 D17003_CTCF_R6 310 + - chr7 56736 56756 D17003_CTCF_R7 354 + - chr7 56761 56781 D17003_CTCF_R4 220 + - chr7 56772 56792 D17003_CTCF_R7 372 + - chr7 56775 56795 D17003_CTCF_R4 207 + - -After removing the first 3 lines the dataset will look like this:: - - chr7 56772 56792 D17003_CTCF_R7 372 + - chr7 56775 56795 D17003_CTCF_R4 207 + - - - + + of a file + remove_beginning.pl $input $num_lines $out_file1 + + + + + + + + + + + + + + + + +**What it does** + +This tool removes a specified number of lines from the beginning of a dataset. + +----- + +**Example** + +Input File:: + + chr7 56632 56652 D17003_CTCF_R6 310 + + chr7 56736 56756 D17003_CTCF_R7 354 + + chr7 56761 56781 D17003_CTCF_R4 220 + + chr7 56772 56792 D17003_CTCF_R7 372 + + chr7 56775 56795 D17003_CTCF_R4 207 + + +After removing the first 3 lines the dataset will look like this:: + + chr7 56772 56792 D17003_CTCF_R7 372 + + chr7 56775 56795 D17003_CTCF_R4 207 + + + + diff --git a/tools/filters/tailWrapper.xml b/tools/filters/tailWrapper.xml index f302f0aa378..1a7d7789ad5 100644 --- a/tools/filters/tailWrapper.xml +++ b/tools/filters/tailWrapper.xml @@ -1,42 +1,42 @@ - - lines from a dataset - tailWrapper.pl $input $lineNum $out_file1 - - - - - - - - - - - - - - - - -**What it does** - -This tool outputs specified number of lines from the **end** of a dataset - ------ - -**Example** - -- Input File:: - - chr7 57134 57154 D17003_CTCF_R7 356 - - chr7 57247 57267 D17003_CTCF_R4 207 + - chr7 57314 57334 D17003_CTCF_R5 269 + - chr7 57341 57361 D17003_CTCF_R7 375 + - chr7 57457 57477 D17003_CTCF_R3 188 + - -- Show last two lines of above file. The result is:: - - chr7 57341 57361 D17003_CTCF_R7 375 + - chr7 57457 57477 D17003_CTCF_R3 188 + - - - + + lines from a dataset + tailWrapper.pl $input $lineNum $out_file1 + + + + + + + + + + + + + + + + +**What it does** + +This tool outputs specified number of lines from the **end** of a dataset + +----- + +**Example** + +- Input File:: + + chr7 57134 57154 D17003_CTCF_R7 356 - + chr7 57247 57267 D17003_CTCF_R4 207 + + chr7 57314 57334 D17003_CTCF_R5 269 + + chr7 57341 57361 D17003_CTCF_R7 375 + + chr7 57457 57477 D17003_CTCF_R3 188 + + +- Show last two lines of above file. The result is:: + + chr7 57341 57361 D17003_CTCF_R7 375 + + chr7 57457 57477 D17003_CTCF_R3 188 + + + + diff --git a/tools/filters/ucsc_gene_table_to_intervals.xml b/tools/filters/ucsc_gene_table_to_intervals.xml index d0232a28042..8e382f8e58f 100644 --- a/tools/filters/ucsc_gene_table_to_intervals.xml +++ b/tools/filters/ucsc_gene_table_to_intervals.xml @@ -1,25 +1,25 @@ - -Parse a UCSC Gene Table dump - ucsc_gene_table_to_intervals.py --input=$input1 --output=$out_file1 --region=$region $exon - - - - - - - - - - - - - - - - - - - -Read a table dump in the UCSC gene table format and create a BED file corresponding to the requested feature of each gene. - + +Parse a UCSC Gene Table dump + ucsc_gene_table_to_intervals.py --input=$input1 --output=$out_file1 --region=$region $exon + + + + + + + + + + + + + + + + + + + +Read a table dump in the UCSC gene table format and create a BED file corresponding to the requested feature of each gene. + \ No newline at end of file diff --git a/tools/maf/genebed_maf_to_fasta.xml b/tools/maf/genebed_maf_to_fasta.xml index 44673e63986..42c0473d511 100644 --- a/tools/maf/genebed_maf_to_fasta.xml +++ b/tools/maf/genebed_maf_to_fasta.xml @@ -1,96 +1,95 @@ - - given a set of coding exon intervals - - macros.xml - - - #if $maf_source_type.maf_source == "user" #interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_file --mafIndex=$maf_source_type.maf_file.metadata.maf_index --interval_file=$input1 --output_file=$out_file1 --mafSourceType=$maf_source_type.maf_source --geneBED --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} - #else #interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_identifier --interval_file=$input1 --output_file=$out_file1 --mafSourceType=$maf_source_type.maf_source --geneBED --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} - #end if# --overwrite_with_gaps=$overwrite_with_gaps - - - - - value.metadata.columns >= 12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - in aligning species - - - - - - - - - - - - - - - - -**What it does** - -The coding sequence of genes are usually composed of several coding exons. Each of these coding exons is an individual genomic region, which when concatenated with each other constitutes the coding sequence. A single genomic region can be covered by multiple alignment blocks. In many cases it is desirable to stitch these alignment blocks together. This tool accepts a list of gene-based intervals, in the Gene BED format. For every interval it performs the following: - - * finds all MAF blocks that overlap the coding regions; - * sorts MAF blocks by alignment score; - * stitches blocks together and resolves overlaps based on alignment score; - * outputs alignments in FASTA format. - -@HELP_CITATIONS@ - - - + + given a set of coding exon intervals + + macros.xml + + + #if $maf_source_type.maf_source == "user" #interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_file --mafIndex=$maf_source_type.maf_file.metadata.maf_index --interval_file=$input1 --output_file=$out_file1 --mafSourceType=$maf_source_type.maf_source --geneBED --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} + #else #interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_identifier --interval_file=$input1 --output_file=$out_file1 --mafSourceType=$maf_source_type.maf_source --geneBED --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} + #end if# --overwrite_with_gaps=$overwrite_with_gaps + + + + + value.metadata.columns >= 12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + in aligning species + + + + + + + + + + + + + + + +**What it does** + +The coding sequence of genes are usually composed of several coding exons. Each of these coding exons is an individual genomic region, which when concatenated with each other constitutes the coding sequence. A single genomic region can be covered by multiple alignment blocks. In many cases it is desirable to stitch these alignment blocks together. This tool accepts a list of gene-based intervals, in the Gene BED format. For every interval it performs the following: + + * finds all MAF blocks that overlap the coding regions; + * sorts MAF blocks by alignment score; + * stitches blocks together and resolves overlaps based on alignment score; + * outputs alignments in FASTA format. + +@HELP_CITATIONS@ + + + diff --git a/tools/maf/interval2maf.xml b/tools/maf/interval2maf.xml index 13b8f809e2a..d243690a938 100644 --- a/tools/maf/interval2maf.xml +++ b/tools/maf/interval2maf.xml @@ -1,292 +1,292 @@ - - given a set of genomic intervals - - macros.xml - - - #if $maf_source_type.maf_source == "user" #interval2maf.py --dbkey=${input1.dbkey} --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafFile=$maf_source_type.mafFile --mafIndex=$maf_source_type.mafFile.metadata.maf_index --interval_file=$input1 --output_file=$out_file1 --mafIndexFile=${GALAXY_DATA_INDEX_DIR}/maf_index.loc --species=$maf_source_type.species - #else #interval2maf.py --dbkey=${input1.dbkey} --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafType=$maf_source_type.mafType --interval_file=$input1 --output_file=$out_file1 --mafIndexFile=${GALAXY_DATA_INDEX_DIR}/maf_index.loc --species=$maf_source_type.species - #end if# --split_blocks_by_species=$split_blocks_by_species_selector.split_blocks_by_species - #if $split_blocks_by_species_selector.split_blocks_by_species == "split_blocks_by_species"# - --remove_all_gap_columns=$split_blocks_by_species_selector.remove_all_gap_columns - #end if - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -**What it does** - -This tool takes genomic coordinates, superimposes them on multiple alignments (in MAF format) stored on the Galaxy site or from your history, and excises alignment blocks corresponding to each set of coordinates. Alignment blocks that extend past START and/or END positions of an interval are trimmed. Note that a single genomic interval may correspond to two or more alignment blocks. - ------ - -**Example** - -Here a single interval is superimposed on three MAF blocks. Blocks 1 and 3 are trimmed because they extend beyond boundaries of the interval: - -.. image:: ${static_path}/images/maf_icons/interval2maf.png - -------- - -**Split blocks by species** - -This option examines each MAF block for multiple occurrences of a species in a single block. When this occurs, a block is split into multiple blocks where every combination of one sequence per species per block is represented. - -The interface for this option has two inputs: - - * **MAF file to split**. Choose multiple alignments from history to be split by species. - * **Collapse empty alignment columns**. Should alignment columns containing only gaps in the new blocks be removed. - - - -**Example 1**: **Collapse empty alignment columns is Yes**: - -For the following alignment:: - - ##maf version=1 - a score=2047408.0 - s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG - s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - -the tool will create **a single** history item containing 12 alignment blocks (notice that no columns contain only gaps):: - - ##maf version=1 - a score=2047408.0 - s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT-GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT-GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC--GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC-GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC-GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTAG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGCAG - - a score=2047408.0 - s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCAG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC---AG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC---AG - - - -**Example 2**: **Collapse empty alignment columns is No**: - -For the following alignment:: - - ##maf version=1 - a score=2047408.0 - s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG - s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - -the tool will create **a single** history item containing 12 alignment blocks (notice that some columns contain only gaps):: - - ##maf version=1 - a score=2047408.0 - s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG - s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG - s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - - a score=2047408.0 - s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG - s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG - s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG - -@HELP_CITATIONS@ - - - + + given a set of genomic intervals + + macros.xml + + + #if $maf_source_type.maf_source == "user" #interval2maf.py --dbkey=${input1.dbkey} --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafFile=$maf_source_type.mafFile --mafIndex=$maf_source_type.mafFile.metadata.maf_index --interval_file=$input1 --output_file=$out_file1 --mafIndexFile=${GALAXY_DATA_INDEX_DIR}/maf_index.loc --species=$maf_source_type.species + #else #interval2maf.py --dbkey=${input1.dbkey} --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafType=$maf_source_type.mafType --interval_file=$input1 --output_file=$out_file1 --mafIndexFile=${GALAXY_DATA_INDEX_DIR}/maf_index.loc --species=$maf_source_type.species + #end if# --split_blocks_by_species=$split_blocks_by_species_selector.split_blocks_by_species + #if $split_blocks_by_species_selector.split_blocks_by_species == "split_blocks_by_species"# + --remove_all_gap_columns=$split_blocks_by_species_selector.remove_all_gap_columns + #end if + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool takes genomic coordinates, superimposes them on multiple alignments (in MAF format) stored on the Galaxy site or from your history, and excises alignment blocks corresponding to each set of coordinates. Alignment blocks that extend past START and/or END positions of an interval are trimmed. Note that a single genomic interval may correspond to two or more alignment blocks. + +----- + +**Example** + +Here a single interval is superimposed on three MAF blocks. Blocks 1 and 3 are trimmed because they extend beyond boundaries of the interval: + +.. image:: ${static_path}/images/maf_icons/interval2maf.png + +------- + +**Split blocks by species** + +This option examines each MAF block for multiple occurrences of a species in a single block. When this occurs, a block is split into multiple blocks where every combination of one sequence per species per block is represented. + +The interface for this option has two inputs: + + * **MAF file to split**. Choose multiple alignments from history to be split by species. + * **Collapse empty alignment columns**. Should alignment columns containing only gaps in the new blocks be removed. + + + +**Example 1**: **Collapse empty alignment columns is Yes**: + +For the following alignment:: + + ##maf version=1 + a score=2047408.0 + s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG + s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + +the tool will create **a single** history item containing 12 alignment blocks (notice that no columns contain only gaps):: + + ##maf version=1 + a score=2047408.0 + s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT-GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT-GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC--GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC-GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC-GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTAG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGCAG + + a score=2047408.0 + s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCAG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC---AG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC---AG + + + +**Example 2**: **Collapse empty alignment columns is No**: + +For the following alignment:: + + ##maf version=1 + a score=2047408.0 + s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG + s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + +the tool will create **a single** history item containing 12 alignment blocks (notice that some columns contain only gaps):: + + ##maf version=1 + a score=2047408.0 + s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG + s species2.chr1 129723125 85 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG + s species2.chr1 129723125 83 - 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCT--GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTCGTCCTCAG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 85 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984545 83 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTT--GTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTCCTCAG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 + 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTT------AG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + + a score=2047408.0 + s species1.chr1 147984645 79 - 245522847 ATGGCGTCGGCCTCCTCCGGGCCGTCGTC---GGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTTGTC---AG + s species2.chr1 129723925 79 + 229575298 ATGGCGTCGGCCTCCTCCGGGCCGTCGTCTTCGGTCGGTTTTTCATCCTTTGATCCCGCGGTCCCTTCCTGTACCTC------AG + s species3.chr3 68255714 76 - 258222147 ATGGCGTCCGCCTCCTCAGGGCCAGCGGC---GGCGGGGTTTTCACCCCTTGATTCCGGGGTCCCTGCCGGTACCGC------AG + +@HELP_CITATIONS@ + + + diff --git a/tools/maf/interval2maf_pairwise.xml b/tools/maf/interval2maf_pairwise.xml index 786fa2ac29e..99916f4edc0 100644 --- a/tools/maf/interval2maf_pairwise.xml +++ b/tools/maf/interval2maf_pairwise.xml @@ -1,48 +1,48 @@ - - given a set of genomic intervals - - macros.xml - - interval2maf.py --dbkey=${input1.dbkey} --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafType=$mafType --interval_file=$input1 --output_file=$out_file1 --indexLocation=${GALAXY_DATA_INDEX_DIR}/maf_pairwise.loc - - - - - - - - - - - - - - - - - - - - - - - - - - -**What it does** - -This tool takes genomic coordinates, superimposes them on pairwise alignments (in MAF format) stored on the Galaxy site, and excises alignment blocks corresponding to each set of coordinates. Alignment blocks that extend past START and/or END positions of an interval are trimmed. Note that a single genomic interval may correspond to two or more alignment blocks. - ------ - -**Example** - -Here a single interval is superimposed on three MAF blocks. Blocks 1 and 3 are trimmed because they extend beyond boundaries of the interval: - -.. image:: ${static_path}/images/maf_icons/interval2maf.png - -@HELP_CITATIONS@ - - - + + given a set of genomic intervals + + macros.xml + + interval2maf.py --dbkey=${input1.dbkey} --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafType=$mafType --interval_file=$input1 --output_file=$out_file1 --indexLocation=${GALAXY_DATA_INDEX_DIR}/maf_pairwise.loc + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool takes genomic coordinates, superimposes them on pairwise alignments (in MAF format) stored on the Galaxy site, and excises alignment blocks corresponding to each set of coordinates. Alignment blocks that extend past START and/or END positions of an interval are trimmed. Note that a single genomic interval may correspond to two or more alignment blocks. + +----- + +**Example** + +Here a single interval is superimposed on three MAF blocks. Blocks 1 and 3 are trimmed because they extend beyond boundaries of the interval: + +.. image:: ${static_path}/images/maf_icons/interval2maf.png + +@HELP_CITATIONS@ + + + diff --git a/tools/maf/interval_maf_to_merged_fasta.xml b/tools/maf/interval_maf_to_merged_fasta.xml index 053b3c45d90..25d9d91e7f5 100644 --- a/tools/maf/interval_maf_to_merged_fasta.xml +++ b/tools/maf/interval_maf_to_merged_fasta.xml @@ -1,112 +1,112 @@ - - given a set of genomic intervals - - macros.xml - - - #if $maf_source_type.maf_source == "user" #interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_file --mafIndex=$maf_source_type.maf_file.metadata.maf_index --interval_file=$input1 --output_file=$out_file1 --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafSourceType=$maf_source_type.maf_source --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} - #else #interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_identifier --interval_file=$input1 --output_file=$out_file1 --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafSourceType=$maf_source_type.maf_source --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} - #end if# --overwrite_with_gaps=$overwrite_with_gaps - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -**What it does** - -A single genomic region can be covered by multiple alignment blocks. In many cases it is desirable to stitch these alignment blocks together. This tool accepts a list of genomic intervals. For every interval it performs the following: - - * finds all MAF blocks that overlap the interval; - * sorts MAF blocks by alignment score; - * stitches blocks together and resolves overlaps based on alignment score; - * outputs alignments in FASTA format. - ------- - -**Example** - -Here three MAF blocks overlapping a single interval are stitched together. Space between blocks 2 and 3 is filled with gaps: - -.. image:: ${static_path}/images/maf_icons/stitchMaf.png - -@HELP_CITATIONS@ - - - + + given a set of genomic intervals + + macros.xml + + + #if $maf_source_type.maf_source == "user" #interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_file --mafIndex=$maf_source_type.maf_file.metadata.maf_index --interval_file=$input1 --output_file=$out_file1 --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafSourceType=$maf_source_type.maf_source --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} + #else #interval_maf_to_merged_fasta.py --dbkey=$dbkey --species=$maf_source_type.species --mafSource=$maf_source_type.maf_identifier --interval_file=$input1 --output_file=$out_file1 --chromCol=${input1.metadata.chromCol} --startCol=${input1.metadata.startCol} --endCol=${input1.metadata.endCol} --strandCol=${input1.metadata.strandCol} --mafSourceType=$maf_source_type.maf_source --mafIndexFileDir=${GALAXY_DATA_INDEX_DIR} + #end if# --overwrite_with_gaps=$overwrite_with_gaps + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +A single genomic region can be covered by multiple alignment blocks. In many cases it is desirable to stitch these alignment blocks together. This tool accepts a list of genomic intervals. For every interval it performs the following: + + * finds all MAF blocks that overlap the interval; + * sorts MAF blocks by alignment score; + * stitches blocks together and resolves overlaps based on alignment score; + * outputs alignments in FASTA format. + +------ + +**Example** + +Here three MAF blocks overlapping a single interval are stitched together. Space between blocks 2 and 3 is filled with gaps: + +.. image:: ${static_path}/images/maf_icons/stitchMaf.png + +@HELP_CITATIONS@ + + + diff --git a/tools/maf/maf_by_block_number.xml b/tools/maf/maf_by_block_number.xml index 3b9b578a130..474e461f0cf 100644 --- a/tools/maf/maf_by_block_number.xml +++ b/tools/maf/maf_by_block_number.xml @@ -1,38 +1,38 @@ - - given a set of block numbers and a MAF file - - macros.xml - - maf_by_block_number.py $input1 $input2 $out_file1 $block_col $species - - - - - - - - - - - - - - - - - - - - - - - - -**What it does** - -This tool takes a list of block numbers, one per line, and extracts the corresponding MAF blocks from the provided file. Block numbers start at 0. - -@HELP_CITATIONS@ - - - + + given a set of block numbers and a MAF file + + macros.xml + + maf_by_block_number.py $input1 $input2 $out_file1 $block_col $species + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool takes a list of block numbers, one per line, and extracts the corresponding MAF blocks from the provided file. Block numbers start at 0. + +@HELP_CITATIONS@ + + + diff --git a/tools/maf/maf_filter.py b/tools/maf/maf_filter.py index c223f2912ff..d1e4ab089fd 100644 --- a/tools/maf/maf_filter.py +++ b/tools/maf/maf_filter.py @@ -1,65 +1,72 @@ -#Dan Blankenberg -#Filters a MAF file according to the provided code file, which is generated in maf_filter.xml -#Also allows filtering by number of columns in a block, and limiting output species -import sys, os, shutil -from galaxy import eggs -import pkg_resources; pkg_resources.require( "bx-python" ) -import bx.align.maf -from galaxy.tools.util import maf_utilities - -def main(): - #Read command line arguments - try: - script_file = sys.argv.pop( 1 ) - maf_file = sys.argv.pop( 1 ) - out_file = sys.argv.pop( 1 ) - additional_files_path = sys.argv.pop( 1 ) - species = maf_utilities.parse_species_option( sys.argv.pop( 1 ) ) - min_size = int( sys.argv.pop( 1 ) ) - max_size = int( sys.argv.pop( 1 ) ) - if max_size < 1: max_size = sys.maxint - min_species_per_block = int( sys.argv.pop( 1 ) ) - exclude_incomplete_blocks = int( sys.argv.pop( 1 ) ) - if species: - num_species = len( species ) - else: - num_species = len( sys.argv.pop( 1 ).split( ',') ) - except: - print >>sys.stderr, "One or more arguments is missing.\nUsage: maf_filter.py maf_filter_file input_maf output_maf path_to_save_debug species_to_keep" - sys.exit() - - #Open input and output MAF files - try: - maf_reader = bx.align.maf.Reader( open( maf_file,'r' ) ) - maf_writer = bx.align.maf.Writer( open( out_file,'w' ) ) - except: - print >>sys.stderr, "Your MAF file appears to be malformed." - sys.exit() - - #Save script file for debuging/verification info later - os.mkdir( additional_files_path ) - shutil.copy( script_file, os.path.join( additional_files_path, 'debug.txt' ) ) - - #Loop through blocks, running filter on each - #'maf_block' and 'ret_val' are used/shared in the provided code file - #'ret_val' should be set to True if the block is to be kept - i = 0 - blocks_kept = 0 - for i, maf_block in enumerate( maf_reader ): - if min_size <= maf_block.text_size <= max_size: - local = {'maf_block':maf_block, 'ret_val':False} - execfile( script_file, {}, local ) - if local['ret_val']: - #Species limiting must be done after filters as filters could be run on non-requested output species - if species: - maf_block = maf_block.limit_to_species( species ) - if len( maf_block.components ) >= min_species_per_block and ( not exclude_incomplete_blocks or len( maf_block.components ) >= num_species ): - maf_writer.write( maf_block ) - blocks_kept += 1 - maf_writer.close() - maf_reader.close() - if i == 0: print "Your file contains no valid maf_blocks." - else: print 'Kept %s of %s blocks (%.2f%%).' % ( blocks_kept, i + 1, float( blocks_kept ) / float( i + 1 ) * 100.0 ) - -if __name__ == "__main__": - main() +#Dan Blankenberg +#Filters a MAF file according to the provided code file, which is generated in maf_filter.xml +#Also allows filtering by number of columns in a block, and limiting output species +import os +import sys +import shutil +from galaxy import eggs +import pkg_resources +pkg_resources.require( "bx-python" ) +import bx.align.maf +from galaxy.tools.util import maf_utilities + + +def main(): + #Read command line arguments + try: + script_file = sys.argv.pop( 1 ) + maf_file = sys.argv.pop( 1 ) + out_file = sys.argv.pop( 1 ) + additional_files_path = sys.argv.pop( 1 ) + species = maf_utilities.parse_species_option( sys.argv.pop( 1 ) ) + min_size = int( sys.argv.pop( 1 ) ) + max_size = int( sys.argv.pop( 1 ) ) + if max_size < 1: + max_size = sys.maxint + min_species_per_block = int( sys.argv.pop( 1 ) ) + exclude_incomplete_blocks = int( sys.argv.pop( 1 ) ) + if species: + num_species = len( species ) + else: + num_species = len( sys.argv.pop( 1 ).split( ',') ) + except: + print >>sys.stderr, "One or more arguments is missing.\nUsage: maf_filter.py maf_filter_file input_maf output_maf path_to_save_debug species_to_keep" + sys.exit() + + #Open input and output MAF files + try: + maf_reader = bx.align.maf.Reader( open( maf_file, 'r' ) ) + maf_writer = bx.align.maf.Writer( open( out_file, 'w' ) ) + except: + print >>sys.stderr, "Your MAF file appears to be malformed." + sys.exit() + + #Save script file for debuging/verification info later + os.mkdir( additional_files_path ) + shutil.copy( script_file, os.path.join( additional_files_path, 'debug.txt' ) ) + + #Loop through blocks, running filter on each + #'maf_block' and 'ret_val' are used/shared in the provided code file + #'ret_val' should be set to True if the block is to be kept + i = 0 + blocks_kept = 0 + for i, maf_block in enumerate( maf_reader ): + if min_size <= maf_block.text_size <= max_size: + local = {'maf_block': maf_block, 'ret_val': False} + execfile( script_file, {}, local ) + if local['ret_val']: + #Species limiting must be done after filters as filters could be run on non-requested output species + if species: + maf_block = maf_block.limit_to_species( species ) + if len( maf_block.components ) >= min_species_per_block and ( not exclude_incomplete_blocks or len( maf_block.components ) >= num_species ): + maf_writer.write( maf_block ) + blocks_kept += 1 + maf_writer.close() + maf_reader.close() + if i == 0: + print "Your file contains no valid maf_blocks." + else: + print 'Kept %s of %s blocks (%.2f%%).' % ( blocks_kept, i + 1, float( blocks_kept ) / float( i + 1 ) * 100.0 ) + +if __name__ == "__main__": + main() diff --git a/tools/maf/maf_filter.xml b/tools/maf/maf_filter.xml index a69cdc681a7..7b33837c163 100644 --- a/tools/maf/maf_filter.xml +++ b/tools/maf/maf_filter.xml @@ -1,200 +1,199 @@ - - by specified attributes - - macros.xml - - maf_filter.py $maf_filter_file $input1 $out_file1 $out_file1.files_path $species $min_size $max_size $min_species_per_block $exclude_incomplete_blocks ${input1.metadata.species} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#set $is_isnot_valid = {"==":"==", "!=":"!=", "in":"in", "not in":"not in"} -def maf_block_pass_filter( maf_block ): -#for $maf_filter in $maf_filters: -#if $len( $maf_filter['species1_attributes']['filter_condition'] ) == 0: -#continue -#end if - primary_component = maf_block.get_component_by_src_start( """$maf_filter['species1'].value.encode( 'string_escape' )""".decode( 'string_escape' ) ) - if primary_component is not None: -#if $maf_filter['species1_attributes']['species1_attribute_type'] == 'attribute_chr': - if primary_component.src.split( "." )[-1] $is_isnot_valid.get( $maf_filter['species1_attributes']['species1_is_isnot'].value.strip(), 'is in' ) """$maf_filter['species1_attributes']['species1_attribute'].value.encode( 'string_escape' )""".decode( 'string_escape' ).split( "," ): -#else - if primary_component.strand $is_isnot_valid.get( $maf_filter['species1_attributes']['species1_is_isnot'].value.strip(), '==' ) """$maf_filter['species1_attributes']['species1_attribute'].value.encode( 'string_escape' )""".decode( 'string_escape' ): -#end if -#for $filter_condition in $maf_filter['species1_attributes']['filter_condition']: - secondary_component = maf_block.get_component_by_src_start( """$filter_condition['species2'].value.encode( 'string_escape' )""".decode( 'string_escape' ) ) -#if $filter_condition['species2_attributes']['species2_attribute_type'] == 'attribute_chr': - if secondary_component is not None: - if not ( secondary_component.src.split( "." )[-1] $is_isnot_valid.get( $filter_condition['species2_attributes']['species2_is_isnot'].value.strip(), 'is in' ) """$filter_condition['species2_attributes']['species2_attribute'].value.encode( 'string_escape' )""".decode( 'string_escape' ).split( "," ) ): - return False -#else: - if secondary_component is not None: - if not ( secondary_component.strand $is_isnot_valid.get( $filter_condition['species2_attributes']['species2_is_isnot'].value.strip(), '==' ) """$filter_condition['species2_attributes']['species2_attribute'].value.encode( 'string_escape' )""".decode( 'string_escape' ) ): - return False -#end if -#end for -#end for - return True -ret_val = maf_block_pass_filter( maf_block ) - - - - - - - -This tool allows you to build complex filters to be applied to each alignment block of a MAF file. You can define restraints on species based upon chromosome and strand. You can specify comma separated lists of chromosomes where appropriate. - -.. class:: infomark - -For example, this tool is useful to restrict a set of alignments to only those blocks which contain alignments between chromosomes that are considered homologous. - ------ - -.. class:: warningmark - -If a species is not found in a particular block, all filters on that species are ignored. - ------ - -This tool allows the user to remove any undesired species from a MAF file. If no species are specified then all species will be kept. If species are specified, columns which contain only gaps are removed. The options for this are: - - * **Exclude blocks which have missing species** - suppose you want to restrict an 8-way alignment to human, mouse, and rat. The tool will first remove all other species. Next, if this option is set to **YES** the tool WILL NOT return MAF blocks, which do not include human, mouse, or rat. This means that all alignment blocks returned by the tool will have exactly three sequences in this example. - - * **Exclude blocks which have only one species** - if this option is set to **YES** all single sequence alignment blocks WILL NOT be returned. - ------ - -You can also provide a size range and limit your output to the MAF blocks which fall within the specified range. - -@HELP_CITATIONS@ - - - + + by specified attributes + + macros.xml + + maf_filter.py $maf_filter_file $input1 $out_file1 $out_file1.files_path $species $min_size $max_size $min_species_per_block $exclude_incomplete_blocks ${input1.metadata.species} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#set $is_isnot_valid = {"==":"==", "!=":"!=", "in":"in", "not in":"not in"} +def maf_block_pass_filter( maf_block ): +#for $maf_filter in $maf_filters: +#if $len( $maf_filter['species1_attributes']['filter_condition'] ) == 0: +#continue +#end if + primary_component = maf_block.get_component_by_src_start( """$maf_filter['species1'].value.encode( 'string_escape' )""".decode( 'string_escape' ) ) + if primary_component is not None: +#if $maf_filter['species1_attributes']['species1_attribute_type'] == 'attribute_chr': + if primary_component.src.split( "." )[-1] $is_isnot_valid.get( $maf_filter['species1_attributes']['species1_is_isnot'].value.strip(), 'is in' ) """$maf_filter['species1_attributes']['species1_attribute'].value.encode( 'string_escape' )""".decode( 'string_escape' ).split( "," ): +#else + if primary_component.strand $is_isnot_valid.get( $maf_filter['species1_attributes']['species1_is_isnot'].value.strip(), '==' ) """$maf_filter['species1_attributes']['species1_attribute'].value.encode( 'string_escape' )""".decode( 'string_escape' ): +#end if +#for $filter_condition in $maf_filter['species1_attributes']['filter_condition']: + secondary_component = maf_block.get_component_by_src_start( """$filter_condition['species2'].value.encode( 'string_escape' )""".decode( 'string_escape' ) ) +#if $filter_condition['species2_attributes']['species2_attribute_type'] == 'attribute_chr': + if secondary_component is not None: + if not ( secondary_component.src.split( "." )[-1] $is_isnot_valid.get( $filter_condition['species2_attributes']['species2_is_isnot'].value.strip(), 'is in' ) """$filter_condition['species2_attributes']['species2_attribute'].value.encode( 'string_escape' )""".decode( 'string_escape' ).split( "," ) ): + return False +#else: + if secondary_component is not None: + if not ( secondary_component.strand $is_isnot_valid.get( $filter_condition['species2_attributes']['species2_is_isnot'].value.strip(), '==' ) """$filter_condition['species2_attributes']['species2_attribute'].value.encode( 'string_escape' )""".decode( 'string_escape' ) ): + return False +#end if +#end for +#end for + return True +ret_val = maf_block_pass_filter( maf_block ) + + + + + + + +This tool allows you to build complex filters to be applied to each alignment block of a MAF file. You can define restraints on species based upon chromosome and strand. You can specify comma separated lists of chromosomes where appropriate. + +.. class:: infomark + +For example, this tool is useful to restrict a set of alignments to only those blocks which contain alignments between chromosomes that are considered homologous. + +----- + +.. class:: warningmark + +If a species is not found in a particular block, all filters on that species are ignored. + +----- + +This tool allows the user to remove any undesired species from a MAF file. If no species are specified then all species will be kept. If species are specified, columns which contain only gaps are removed. The options for this are: + + * **Exclude blocks which have missing species** - suppose you want to restrict an 8-way alignment to human, mouse, and rat. The tool will first remove all other species. Next, if this option is set to **YES** the tool WILL NOT return MAF blocks, which do not include human, mouse, or rat. This means that all alignment blocks returned by the tool will have exactly three sequences in this example. + + * **Exclude blocks which have only one species** - if this option is set to **YES** all single sequence alignment blocks WILL NOT be returned. + +----- + +You can also provide a size range and limit your output to the MAF blocks which fall within the specified range. + +@HELP_CITATIONS@ + + + diff --git a/tools/maf/maf_limit_size.xml b/tools/maf/maf_limit_size.xml index 51feb29d4ef..207628a9054 100644 --- a/tools/maf/maf_limit_size.xml +++ b/tools/maf/maf_limit_size.xml @@ -1,34 +1,34 @@ - - by Size - - macros.xml - - maf_limit_size.py $input1 $out_file1 $min_size $max_size - - - - - - - - - - - - - - - - - - - - -**What it does** - -This tool takes a MAF file and a size range and extracts the MAF blocks which fall within the specified range. - -@HELP_CITATIONS@ - - - + + by Size + + macros.xml + + maf_limit_size.py $input1 $out_file1 $min_size $max_size + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool takes a MAF file and a size range and extracts the MAF blocks which fall within the specified range. + +@HELP_CITATIONS@ + + + diff --git a/tools/maf/maf_reverse_complement.py b/tools/maf/maf_reverse_complement.py index 14417041eee..8228b599805 100644 --- a/tools/maf/maf_reverse_complement.py +++ b/tools/maf/maf_reverse_complement.py @@ -1,42 +1,45 @@ -#!/usr/bin/env python - -""" -Reads a MAF file. Produces a MAF file containing -the reverse complement for each block in the source file. - -usage: %prog input_maf_file output_maf_file -""" -#Dan Blankenberg -from galaxy import eggs -import pkg_resources; pkg_resources.require( "bx-python" ) -import bx.align.maf -from galaxy.tools.util import maf_utilities -import sys - -assert sys.version_info[:2] >= ( 2, 4 ) - -def __main__(): - #Parse Command Line - input_file = sys.argv.pop( 1 ) - output_file = sys.argv.pop( 1 ) - species = maf_utilities.parse_species_option( sys.argv.pop( 1 ) ) - - try: - maf_writer = bx.align.maf.Writer( open( output_file, 'w' ) ) - except: - print sys.stderr, "Unable to open output file" - sys.exit() - try: - count = 0 - for count, maf in enumerate( bx.align.maf.Reader( open( input_file ) ) ): - maf = maf.reverse_complement() - if species: - maf = maf.limit_to_species( species ) - maf_writer.write( maf ) - except: - print >>sys.stderr, "Your MAF file appears to be malformed." - sys.exit() - print "%i regions were reverse complemented." % count - maf_writer.close() - -if __name__ == "__main__": __main__() +#!/usr/bin/env python + +""" +Reads a MAF file. Produces a MAF file containing +the reverse complement for each block in the source file. + +usage: %prog input_maf_file output_maf_file +""" +#Dan Blankenberg +from galaxy import eggs +import pkg_resources +pkg_resources.require( "bx-python" ) +import bx.align.maf +from galaxy.tools.util import maf_utilities +import sys + +assert sys.version_info[:2] >= ( 2, 4 ) + + +def __main__(): + #Parse Command Line + input_file = sys.argv.pop( 1 ) + output_file = sys.argv.pop( 1 ) + species = maf_utilities.parse_species_option( sys.argv.pop( 1 ) ) + + try: + maf_writer = bx.align.maf.Writer( open( output_file, 'w' ) ) + except: + print sys.stderr, "Unable to open output file" + sys.exit() + try: + count = 0 + for count, maf in enumerate( bx.align.maf.Reader( open( input_file ) ) ): + maf = maf.reverse_complement() + if species: + maf = maf.limit_to_species( species ) + maf_writer.write( maf ) + except: + print >>sys.stderr, "Your MAF file appears to be malformed." + sys.exit() + print "%i regions were reverse complemented." % count + maf_writer.close() + +if __name__ == "__main__": + __main__() diff --git a/tools/maf/maf_reverse_complement.xml b/tools/maf/maf_reverse_complement.xml index a35b72ffced..ce62d0db7a5 100644 --- a/tools/maf/maf_reverse_complement.xml +++ b/tools/maf/maf_reverse_complement.xml @@ -1,51 +1,51 @@ - - a MAF file - - macros.xml - - maf_reverse_complement.py $input1 $out_file1 $species - - - - - - - - - - - - - - - - - - - - - -**What it does** - -This tool takes a MAF file and creates a new MAF file, where each block has been reversed complemented. - -**Example** - -This MAF Block:: - - a score=8157.000000 - s hg17.chr7 127471526 58 + 158628139 AATTTGTGGTTTATTCATTTTTCATTATTTTGTTTAAGGAGGTCTATAGTGGAAGAGG - s panTro1.chr6 129885407 58 + 161576975 AATTTGTGGTTTATTCGTTTTTCATTATTTTGTTTAAGGAGGTCTATAGTGGAAGAGG - s mm5.chr6 28904928 54 + 149721531 AA----CGTTTCATTGATTGCTCATCATTTAAAAAAAGAAATTCCTCAGTGGAAGAGG - -becomes:: - - a score=8157.000000 - s hg17.chr7 31156555 58 - 158628139 CCTCTTCCACTATAGACCTCCTTAAACAAAATAATGAAAAATGAATAAACCACAAATT - s panTro1.chr6 31691510 58 - 161576975 CCTCTTCCACTATAGACCTCCTTAAACAAAATAATGAAAAACGAATAAACCACAAATT - s mm5.chr6 120816549 54 - 149721531 CCTCTTCCACTGAGGAATTTCTTTTTTTAAATGATGAGCAATCAATGAAACG----TT - -@HELP_CITATIONS@ - - - + + a MAF file + + macros.xml + + maf_reverse_complement.py $input1 $out_file1 $species + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool takes a MAF file and creates a new MAF file, where each block has been reversed complemented. + +**Example** + +This MAF Block:: + + a score=8157.000000 + s hg17.chr7 127471526 58 + 158628139 AATTTGTGGTTTATTCATTTTTCATTATTTTGTTTAAGGAGGTCTATAGTGGAAGAGG + s panTro1.chr6 129885407 58 + 161576975 AATTTGTGGTTTATTCGTTTTTCATTATTTTGTTTAAGGAGGTCTATAGTGGAAGAGG + s mm5.chr6 28904928 54 + 149721531 AA----CGTTTCATTGATTGCTCATCATTTAAAAAAAGAAATTCCTCAGTGGAAGAGG + +becomes:: + + a score=8157.000000 + s hg17.chr7 31156555 58 - 158628139 CCTCTTCCACTATAGACCTCCTTAAACAAAATAATGAAAAATGAATAAACCACAAATT + s panTro1.chr6 31691510 58 - 161576975 CCTCTTCCACTATAGACCTCCTTAAACAAAATAATGAAAAACGAATAAACCACAAATT + s mm5.chr6 120816549 54 - 149721531 CCTCTTCCACTGAGGAATTTCTTTTTTTAAATGATGAGCAATCAATGAAACG----TT + +@HELP_CITATIONS@ + + + diff --git a/tools/maf/maf_split_by_species.xml b/tools/maf/maf_split_by_species.xml index d1efd45075c..b33a029ffaa 100644 --- a/tools/maf/maf_split_by_species.xml +++ b/tools/maf/maf_split_by_species.xml @@ -6,9 +6,9 @@ maf_split_by_species.py $input1 $out_file1 $collapse_columns - - - + + + diff --git a/tools/maf/maf_stats.xml b/tools/maf/maf_stats.xml index 4dec43968a9..39be20291fb 100644 --- a/tools/maf/maf_stats.xml +++ b/tools/maf/maf_stats.xml @@ -1,118 +1,115 @@ - - Alignment coverage information - - macros.xml - - - maf_stats.py - #if $maf_source_type.maf_source == "user": - $maf_source_type.maf_source $input2 $input1 $out_file1 $dbkey ${input1.metadata.chromCol} ${input1.metadata.startCol} ${input1.metadata.endCol} $summary - #else: - $maf_source_type.maf_source $maf_source_type.mafType $input1 $out_file1 $dbkey ${input1.metadata.chromCol} ${input1.metadata.startCol} ${input1.metadata.endCol} $summary - #end if + + Alignment coverage information + + macros.xml + + + maf_stats.py + #if $maf_source_type.maf_source == "user": + $maf_source_type.maf_source $input2 $input1 $out_file1 $dbkey ${input1.metadata.chromCol} ${input1.metadata.startCol} ${input1.metadata.endCol} $summary + #else: + $maf_source_type.maf_source $maf_source_type.mafType $input1 $out_file1 $dbkey ${input1.metadata.chromCol} ${input1.metadata.startCol} ${input1.metadata.endCol} $summary + #end if ${GALAXY_DATA_INDEX_DIR} #if $maf_source_type.maf_source == "user": $input2.metadata.maf_index - #end if - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - numpy - - - - - - - - + #end if + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - -**What it does** - -This tool takes a MAF file and an interval file and relates coverage information by interval for each species. -If a column does not exist in the reference genome, it is not included in the output. - -Consider the interval: "chrX 1000 1100 myInterval" - Let's suppose we want to do stats on three way alignments for H, M, and R. The result look like this: - - chrX 1000 1100 myInterval H XXX YYY - - chrX 1000 1100 myInterval M XXX YYY - - chrX 1000 1100 myInterval R XXX YYY - - - where XXX and YYY are: - - XXX = number of nucleotides - - YYY = number of gaps - ----- - -Alternatively, you can request only summary information for a set of intervals: - - ======== =========== ======== - #species nucleotides coverage - ======== =========== ======== - hg18 30639 0.2372 - rheMac2 7524 0.0582 - panTro2 30390 0.2353 - ======== =========== ======== - - where **coverage** is the number of nucleotides divided by the total length of the provided intervals. - -@HELP_CITATIONS@ - - - + + + + + + + + + + +**What it does** + +This tool takes a MAF file and an interval file and relates coverage information by interval for each species. +If a column does not exist in the reference genome, it is not included in the output. + +Consider the interval: "chrX 1000 1100 myInterval" + Let's suppose we want to do stats on three way alignments for H, M, and R. The result look like this: + + chrX 1000 1100 myInterval H XXX YYY + + chrX 1000 1100 myInterval M XXX YYY + + chrX 1000 1100 myInterval R XXX YYY + + + where XXX and YYY are: + + XXX = number of nucleotides + + YYY = number of gaps + +---- + +Alternatively, you can request only summary information for a set of intervals: + + ======== =========== ======== + #species nucleotides coverage + ======== =========== ======== + hg18 30639 0.2372 + rheMac2 7524 0.0582 + panTro2 30390 0.2353 + ======== =========== ======== + + where **coverage** is the number of nucleotides divided by the total length of the provided intervals. + +@HELP_CITATIONS@ + + + diff --git a/tools/maf/maf_to_fasta.xml b/tools/maf/maf_to_fasta.xml index bddba3c8d9d..ec2abfaa464 100644 --- a/tools/maf/maf_to_fasta.xml +++ b/tools/maf/maf_to_fasta.xml @@ -1,197 +1,197 @@ - - Converts a MAF formatted file to FASTA format - - macros.xml - - - #if $fasta_target_type.fasta_type == "multiple" #maf_to_fasta_multiple_sets.py $input1 $out_file1 $fasta_target_type.species $fasta_target_type.complete_blocks - #else #maf_to_fasta_concat.py $fasta_target_type.species $input1 $out_file1 - #end if# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -**Types of MAF to FASTA conversion** - - * **Multiple Blocks** converts a single MAF block to a single FASTA block. For example, if you have 6 MAF blocks, they will be converted to 6 FASTA blocks. - * **One Sequence per Species** converts MAF blocks to a single aggregated FASTA block. For example, if you have 6 MAF blocks, they will be converted and concatenated into a single FASTA block. - -------- - -**What it does** - -This tool converts MAF blocks to FASTA format and concatenates them into a single FASTA block or outputs multiple FASTA blocks separated by empty lines. - -The interface for this tool contains two pages (steps): - - * **Step 1 of 2**. Choose multiple alignments from history to be converted to FASTA format. - * **Step 2 of 2**. Choose the type of output as well as the species from the alignment to be included in the output. - - Multiple Block output has additional options: - - * **Choose species** - the tool reads the alignment provided during Step 1 and generates a list of species contained within that alignment. Using checkboxes you can specify taxa to be included in the output (all species are selected by default). - * **Choose to include/exclude blocks with missing species** - if an alignment block does not contain any one of the species you selected within **Choose species** menu and this option is set to **exclude blocks with missing species**, then such a block **will not** be included in the output (see **Example 2** below). For example, if you want to extract human, mouse, and rat from a series of alignments and one of the blocks does not contain mouse sequence, then this block will not be converted to FASTA and will not be returned. - - ------ - -**Example 1**: - -In the concatenated approach, the following alignment:: - - ##maf version=1 - a score=68686.000000 - s hg18.chr20 56827368 75 + 62435964 GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- - s panTro2.chr20 56528685 75 + 62293572 GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- - s rheMac2.chr10 89144112 69 - 94855758 GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- - s mm8.chr2 173910832 61 + 181976762 AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- - s canFam2.chr24 46551822 67 + 50763139 CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C - - a score=10289.000000 - s hg18.chr20 56827443 37 + 62435964 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - s panTro2.chr20 56528760 37 + 62293572 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - s rheMac2.chr10 89144181 37 - 94855758 ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG - -will be converted to (**note** that because mm8 (mouse) and canFam2 (dog) are absent from the second block, they are replaced with gaps after concatenation):: - - >canFam2 - CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C------------------------------------- - >hg18 - GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC-ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - >mm8 - AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC-------------------------------------------- - >panTro2 - GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC-ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - >rheMac2 - GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA-------ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG - ------- - -**Example 2a**: Multiple Block Approach **Include all species** and **include blocks with missing species**: - -The following alignment:: - - ##maf version=1 - a score=68686.000000 - s hg18.chr20 56827368 75 + 62435964 GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- - s panTro2.chr20 56528685 75 + 62293572 GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- - s rheMac2.chr10 89144112 69 - 94855758 GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- - s mm8.chr2 173910832 61 + 181976762 AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- - s canFam2.chr24 46551822 67 + 50763139 CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C - - a score=10289.000000 - s hg18.chr20 56827443 37 + 62435964 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - s panTro2.chr20 56528760 37 + 62293572 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - s rheMac2.chr10 89144181 37 - 94855758 ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG - -will be converted to:: - - >hg18.chr20(+):56827368-56827443|hg18_0 - GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- - >panTro2.chr20(+):56528685-56528760|panTro2_0 - GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- - >rheMac2.chr10(-):89144112-89144181|rheMac2_0 - GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- - >mm8.chr2(+):173910832-173910893|mm8_0 - AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- - >canFam2.chr24(+):46551822-46551889|canFam2_0 - CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C - - >hg18.chr20(+):56827443-56827480|hg18_1 - ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - >panTro2.chr20(+):56528760-56528797|panTro2_1 - ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - >rheMac2.chr10(-):89144181-89144218|rheMac2_1 - ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG - ------ - -**Example 2b**: Multiple Block Approach **Include hg18 and mm8** and **exclude blocks with missing species**: - -The following alignment:: - - ##maf version=1 - a score=68686.000000 - s hg18.chr20 56827368 75 + 62435964 GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- - s panTro2.chr20 56528685 75 + 62293572 GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- - s rheMac2.chr10 89144112 69 - 94855758 GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- - s mm8.chr2 173910832 61 + 181976762 AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- - s canFam2.chr24 46551822 67 + 50763139 CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C - - a score=10289.000000 - s hg18.chr20 56827443 37 + 62435964 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - s panTro2.chr20 56528760 37 + 62293572 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG - s rheMac2.chr10 89144181 37 - 94855758 ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG - -will be converted to (**note** that the second MAF block, which does not have mm8, is not included in the output):: - - >hg18.chr20(+):56827368-56827443|hg18_0 - GACAGGGTGCATCTGGGAGGGCCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC - >mm8.chr2(+):173910832-173910893|mm8_0 - AGAAGGATCCACCT---------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------ - ------- - -.. class:: infomark - -**About formats** - - **MAF format** multiple alignment format file. This format stores multiple alignments at the DNA level between entire genomes. - - - The .maf format is line-oriented. Each multiple alignment ends with a blank line. - - Each sequence in an alignment is on a single line. - - Lines starting with # are considered to be comments. - - Each multiple alignment is in a separate paragraph that begins with an "a" line and contains an "s" line for each sequence in the multiple alignment. - - Some MAF files may contain two optional line types: - - - An "i" line containing information about what is in the aligned species DNA before and after the immediately preceding "s" line; - - An "e" line containing information about the size of the gap between the alignments that span the current block. - -@HELP_CITATIONS@ - - - + + Converts a MAF formatted file to FASTA format + + macros.xml + + + #if $fasta_target_type.fasta_type == "multiple" #maf_to_fasta_multiple_sets.py $input1 $out_file1 $fasta_target_type.species $fasta_target_type.complete_blocks + #else #maf_to_fasta_concat.py $fasta_target_type.species $input1 $out_file1 + #end if# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**Types of MAF to FASTA conversion** + + * **Multiple Blocks** converts a single MAF block to a single FASTA block. For example, if you have 6 MAF blocks, they will be converted to 6 FASTA blocks. + * **One Sequence per Species** converts MAF blocks to a single aggregated FASTA block. For example, if you have 6 MAF blocks, they will be converted and concatenated into a single FASTA block. + +------- + +**What it does** + +This tool converts MAF blocks to FASTA format and concatenates them into a single FASTA block or outputs multiple FASTA blocks separated by empty lines. + +The interface for this tool contains two pages (steps): + + * **Step 1 of 2**. Choose multiple alignments from history to be converted to FASTA format. + * **Step 2 of 2**. Choose the type of output as well as the species from the alignment to be included in the output. + + Multiple Block output has additional options: + + * **Choose species** - the tool reads the alignment provided during Step 1 and generates a list of species contained within that alignment. Using checkboxes you can specify taxa to be included in the output (all species are selected by default). + * **Choose to include/exclude blocks with missing species** - if an alignment block does not contain any one of the species you selected within **Choose species** menu and this option is set to **exclude blocks with missing species**, then such a block **will not** be included in the output (see **Example 2** below). For example, if you want to extract human, mouse, and rat from a series of alignments and one of the blocks does not contain mouse sequence, then this block will not be converted to FASTA and will not be returned. + + +----- + +**Example 1**: + +In the concatenated approach, the following alignment:: + + ##maf version=1 + a score=68686.000000 + s hg18.chr20 56827368 75 + 62435964 GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- + s panTro2.chr20 56528685 75 + 62293572 GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- + s rheMac2.chr10 89144112 69 - 94855758 GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- + s mm8.chr2 173910832 61 + 181976762 AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- + s canFam2.chr24 46551822 67 + 50763139 CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C + + a score=10289.000000 + s hg18.chr20 56827443 37 + 62435964 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + s panTro2.chr20 56528760 37 + 62293572 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + s rheMac2.chr10 89144181 37 - 94855758 ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG + +will be converted to (**note** that because mm8 (mouse) and canFam2 (dog) are absent from the second block, they are replaced with gaps after concatenation):: + + >canFam2 + CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C------------------------------------- + >hg18 + GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC-ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + >mm8 + AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC-------------------------------------------- + >panTro2 + GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC-ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + >rheMac2 + GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA-------ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG + +------ + +**Example 2a**: Multiple Block Approach **Include all species** and **include blocks with missing species**: + +The following alignment:: + + ##maf version=1 + a score=68686.000000 + s hg18.chr20 56827368 75 + 62435964 GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- + s panTro2.chr20 56528685 75 + 62293572 GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- + s rheMac2.chr10 89144112 69 - 94855758 GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- + s mm8.chr2 173910832 61 + 181976762 AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- + s canFam2.chr24 46551822 67 + 50763139 CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C + + a score=10289.000000 + s hg18.chr20 56827443 37 + 62435964 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + s panTro2.chr20 56528760 37 + 62293572 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + s rheMac2.chr10 89144181 37 - 94855758 ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG + +will be converted to:: + + >hg18.chr20(+):56827368-56827443|hg18_0 + GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- + >panTro2.chr20(+):56528685-56528760|panTro2_0 + GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- + >rheMac2.chr10(-):89144112-89144181|rheMac2_0 + GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- + >mm8.chr2(+):173910832-173910893|mm8_0 + AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- + >canFam2.chr24(+):46551822-46551889|canFam2_0 + CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C + + >hg18.chr20(+):56827443-56827480|hg18_1 + ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + >panTro2.chr20(+):56528760-56528797|panTro2_1 + ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + >rheMac2.chr10(-):89144181-89144218|rheMac2_1 + ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG + +----- + +**Example 2b**: Multiple Block Approach **Include hg18 and mm8** and **exclude blocks with missing species**: + +The following alignment:: + + ##maf version=1 + a score=68686.000000 + s hg18.chr20 56827368 75 + 62435964 GACAGGGTGCATCTGGGAGGG---CCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- + s panTro2.chr20 56528685 75 + 62293572 GACAGGGTGCATCTGAGAGGG---CCTGCCAGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC- + s rheMac2.chr10 89144112 69 - 94855758 GACAGGGTGCATCTGAGAGGG---CCTGCTGGGCCTTTG-TTCAAAACTAGATATGCCCCAACTCCAATTCTA------- + s mm8.chr2 173910832 61 + 181976762 AGAAGGATCCACCT------------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------- + s canFam2.chr24 46551822 67 + 50763139 CG------GCGTCTGTAAGGGGCCACCGCCCGGCCTGTG-CTCAAAGCTACAAATGACTCAACTCCCAACCGA------C + + a score=10289.000000 + s hg18.chr20 56827443 37 + 62435964 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + s panTro2.chr20 56528760 37 + 62293572 ATGTGCAGAAAATGTGATACAGAAACCTGCAGAGCAG + s rheMac2.chr10 89144181 37 - 94855758 ATGTGCGGAAAATGTGATACAGAAACCTGCAGAGCAG + +will be converted to (**note** that the second MAF block, which does not have mm8, is not included in the output):: + + >hg18.chr20(+):56827368-56827443|hg18_0 + GACAGGGTGCATCTGGGAGGGCCTGCCGGGCCTTTA-TTCAACACTAGATACGCCCCATCTCCAATTCTAATGGAC + >mm8.chr2(+):173910832-173910893|mm8_0 + AGAAGGATCCACCT---------TGCTGGGCCTCTGCTCCAGCAAGACCCACCTCCCAACTCAAATGCCC------ + +------ + +.. class:: infomark + +**About formats** + + **MAF format** multiple alignment format file. This format stores multiple alignments at the DNA level between entire genomes. + + - The .maf format is line-oriented. Each multiple alignment ends with a blank line. + - Each sequence in an alignment is on a single line. + - Lines starting with # are considered to be comments. + - Each multiple alignment is in a separate paragraph that begins with an "a" line and contains an "s" line for each sequence in the multiple alignment. + - Some MAF files may contain two optional line types: + + - An "i" line containing information about what is in the aligned species DNA before and after the immediately preceding "s" line; + - An "e" line containing information about the size of the gap between the alignments that span the current block. + +@HELP_CITATIONS@ + + + diff --git a/tools/plotting/bar_chart.xml b/tools/plotting/bar_chart.xml index 229ba4157ec..d5f86bcc18d 100644 --- a/tools/plotting/bar_chart.xml +++ b/tools/plotting/bar_chart.xml @@ -1,60 +1,58 @@ - - for multiple columns - - #if $xtic.userSpecified == "Yes" #bar_chart.py $input $xtic.xticColumn $colList "$title" "$ylabel" $ymin $ymax $out_file1 "$pdf_size" - #else #bar_chart.py $input 0 $colList "$title" "$ylabel" $ymin $ymax $out_file1 "$pdf_size" - #end if - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gnuplot - Numeric - - - -**What it does** - -This tool builds a bar chart on one or more columns. Suppose you have dataset like this one:: - - Gene1 10 15 - Gene2 20 14 - Gene3 67 45 - Gene4 55 12 - -Graphing columns 2 and 3 while using column 1 for X Tick Labels will produce the following plot: - -.. image:: ${static_path}/images/bar_chart.png - :height: 324 - :width: 540 - - - + + for multiple columns + + #if $xtic.userSpecified == "Yes" #bar_chart.py $input $xtic.xticColumn $colList "$title" "$ylabel" $ymin $ymax $out_file1 "$pdf_size" + #else #bar_chart.py $input 0 $colList "$title" "$ylabel" $ymin $ymax $out_file1 "$pdf_size" + #end if + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gnuplot + Numeric + + +**What it does** + +This tool builds a bar chart on one or more columns. Suppose you have dataset like this one:: + + Gene1 10 15 + Gene2 20 14 + Gene3 67 45 + Gene4 55 12 + +Graphing columns 2 and 3 while using column 1 for X Tick Labels will produce the following plot: + +.. image:: ${static_path}/images/bar_chart.png + :height: 324 + :width: 540 + + diff --git a/tools/plotting/boxplot.xml b/tools/plotting/boxplot.xml index 8a6a77e3109..38fc474b8bb 100644 --- a/tools/plotting/boxplot.xml +++ b/tools/plotting/boxplot.xml @@ -2,7 +2,7 @@ of quality statistics gnuplot < '$gnuplot_commands' 2>&1 || echo "Error running gnuplot." >&2 - gnuplot + gnuplot diff --git a/tools/solid_tools/maq_cs_wrapper_code.py b/tools/solid_tools/maq_cs_wrapper_code.py index c5b7e390841..7a0a7e7f108 100644 --- a/tools/solid_tools/maq_cs_wrapper_code.py +++ b/tools/solid_tools/maq_cs_wrapper_code.py @@ -1,5 +1,4 @@ -def exec_before_job(app, inp_data, out_data, param_dict, tool): - out_data['output1'].name = out_data['output1'].name + " [ ALIGNMENT INFO ]" - out_data['output2'].name = out_data['output2'].name + " [ PILEUP ]" - out_data['output3'].name = out_data['output3'].name + " [ CUSTOM TRACK ]" - +def exec_before_job(app, inp_data, out_data, param_dict, tool): + out_data['output1'].name = out_data['output1'].name + " [ ALIGNMENT INFO ]" + out_data['output2'].name = out_data['output2'].name + " [ PILEUP ]" + out_data['output3'].name = out_data['output3'].name + " [ CUSTOM TRACK ]" diff --git a/tools/stats/filtering.xml b/tools/stats/filtering.xml index a71481fb473..d6b446787a5 100644 --- a/tools/stats/filtering.xml +++ b/tools/stats/filtering.xml @@ -1,87 +1,87 @@ - - data on any column using simple expressions - - filtering.py $input $out_file1 "$cond" ${input.metadata.columns} "${input.metadata.column_types}" $header_lines - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -.. class:: warningmark - -Double equal signs, ==, must be used as *"equal to"* (e.g., **c1 == 'chr22'**) - -.. class:: infomark - -**TIP:** Attempting to apply a filtering condition may throw exceptions if the data type (e.g., string, integer) in every line of the columns being filtered is not appropriate for the condition (e.g., attempting certain numerical calculations on strings). If an exception is thrown when applying the condition to a line, that line is skipped as invalid for the filter condition. The number of invalid skipped lines is documented in the resulting history item as a "Condition/data issue". - -.. class:: infomark - -**TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* - ------ - -**Syntax** - -The filter tool allows you to restrict the dataset using simple conditional statements. - -- Columns are referenced with **c** and a **number**. For example, **c1** refers to the first column of a tab-delimited file -- Make sure that multi-character operators contain no white space ( e.g., **<=** is valid while **< =** is not valid ) -- When using 'equal-to' operator **double equal sign '==' must be used** ( e.g., **c1=='chr1'** ) -- Non-numerical values must be included in single or double quotes ( e.g., **c6=='+'** ) -- Filtering condition can include logical operators, but **make sure operators are all lower case** ( e.g., **(c1!='chrX' and c1!='chrY') or not c6=='+'** ) - ------ - -**Example** - -- **c1=='chr1'** selects lines in which the first column is chr1 -- **c3-c2<100*c4** selects lines where subtracting column 3 from column 2 is less than the value of column 4 times 100 -- **len(c2.split(',')) < 4** will select lines where the second column has less than four comma separated elements -- **c2>=1** selects lines in which the value of column 2 is greater than or equal to 1 -- Numbers should not contain commas - **c2<=44,554,350** will not work, but **c2<=44554350** will -- Some words in the data can be used, but must be single or double quoted ( e.g., **c3=='exon'** ) - - - + + data on any column using simple expressions + + filtering.py $input $out_file1 "$cond" ${input.metadata.columns} "${input.metadata.column_types}" $header_lines + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.. class:: warningmark + +Double equal signs, ==, must be used as *"equal to"* (e.g., **c1 == 'chr22'**) + +.. class:: infomark + +**TIP:** Attempting to apply a filtering condition may throw exceptions if the data type (e.g., string, integer) in every line of the columns being filtered is not appropriate for the condition (e.g., attempting certain numerical calculations on strings). If an exception is thrown when applying the condition to a line, that line is skipped as invalid for the filter condition. The number of invalid skipped lines is documented in the resulting history item as a "Condition/data issue". + +.. class:: infomark + +**TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* + +----- + +**Syntax** + +The filter tool allows you to restrict the dataset using simple conditional statements. + +- Columns are referenced with **c** and a **number**. For example, **c1** refers to the first column of a tab-delimited file +- Make sure that multi-character operators contain no white space ( e.g., **<=** is valid while **< =** is not valid ) +- When using 'equal-to' operator **double equal sign '==' must be used** ( e.g., **c1=='chr1'** ) +- Non-numerical values must be included in single or double quotes ( e.g., **c6=='+'** ) +- Filtering condition can include logical operators, but **make sure operators are all lower case** ( e.g., **(c1!='chrX' and c1!='chrY') or not c6=='+'** ) + +----- + +**Example** + +- **c1=='chr1'** selects lines in which the first column is chr1 +- **c3-c2<100*c4** selects lines where subtracting column 3 from column 2 is less than the value of column 4 times 100 +- **len(c2.split(',')) < 4** will select lines where the second column has less than four comma separated elements +- **c2>=1** selects lines in which the value of column 2 is greater than or equal to 1 +- Numbers should not contain commas - **c2<=44,554,350** will not work, but **c2<=44554350** will +- Some words in the data can be used, but must be single or double quoted ( e.g., **c3=='exon'** ) + + + diff --git a/tools/stats/gsummary.xml.groups b/tools/stats/gsummary.xml.groups index 8e625040e3c..218ab31aa38 100644 --- a/tools/stats/gsummary.xml.groups +++ b/tools/stats/gsummary.xml.groups @@ -1,62 +1,62 @@ - - of a column in a tab delimited file according to an expression - gsummary.py $input $out_file1 "$cond" "$groups" - - - - - - - - - - - -.. class:: warningmark - -This tool expects input datasets to consist of tab-delimited columns (blank or comment lines beginning with a # character are automatically skipped). - -.. class:: infomark - -**TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* - -.. class:: infomark - -**TIP:** Computing summary statistics may throw exceptions if the data value in every line of the columns being summarized is not numerical. If a line is missing a value or contains a non-numerical value in the column being summarized, that line is skipped and the value is not included in the statistical computation. The number of invalid skipped lines is documented in the resulting history item. - -**Syntax** - -This tool computes basic summary statistics on a given column, or on an expression containing those columns - -- Columns are referenced with **c** and a **number**. For example, **c1** refers to the first column of a tab-delimited file -- To group the summary by the values in a column or columns, specify in the **group terms** box... - + **c1** *group by the values in column 1* - + **c1,c4** *group by the values in column 1, then by the values in column 4* - - ------ - -**Expression examples** - -- **log(c5)** calculates the summary statistics for the natural log of column 5 -- **(c5 + c6 + c7) / 3** calculates the summary statistics on the average of columns 5-7 -- **log(c5,10)** summary statistics of the base 10 log of column 5 -- **sqrt(c5+c9)** summary statistics of the square root of column 5 + column 9 - -**Group examples** - -- **c1** group by the values in column 1 -- **c1,c4** group by the values in column 1, then by the values in column 4 - ------ - -.. class:: infomark - -**TIP:** Most functions (like *abs*) take only a single expression. *log* can take one or two parameters, like *log(expression,base)* - -Currently, these R functions are supported: *abs, sign, sqrt, floor, ceiling, trunc, round, signif, exp, log, cos, sin, tan, acos, asin, atan, cosh, sinh, tanh, acosh, asinh, atanh, lgamma, gamma, gammaCody, digamma, trigamma, cumsum, cumprod, cummax, cummin* - -.. |INFO| image:: ./static/images/icon_info_sml.gif - - - + + of a column in a tab delimited file according to an expression + gsummary.py $input $out_file1 "$cond" "$groups" + + + + + + + + + + + +.. class:: warningmark + +This tool expects input datasets to consist of tab-delimited columns (blank or comment lines beginning with a # character are automatically skipped). + +.. class:: infomark + +**TIP:** If your data is not TAB delimited, use *Text Manipulation->Convert* + +.. class:: infomark + +**TIP:** Computing summary statistics may throw exceptions if the data value in every line of the columns being summarized is not numerical. If a line is missing a value or contains a non-numerical value in the column being summarized, that line is skipped and the value is not included in the statistical computation. The number of invalid skipped lines is documented in the resulting history item. + +**Syntax** + +This tool computes basic summary statistics on a given column, or on an expression containing those columns + +- Columns are referenced with **c** and a **number**. For example, **c1** refers to the first column of a tab-delimited file +- To group the summary by the values in a column or columns, specify in the **group terms** box... + + **c1** *group by the values in column 1* + + **c1,c4** *group by the values in column 1, then by the values in column 4* + + +----- + +**Expression examples** + +- **log(c5)** calculates the summary statistics for the natural log of column 5 +- **(c5 + c6 + c7) / 3** calculates the summary statistics on the average of columns 5-7 +- **log(c5,10)** summary statistics of the base 10 log of column 5 +- **sqrt(c5+c9)** summary statistics of the square root of column 5 + column 9 + +**Group examples** + +- **c1** group by the values in column 1 +- **c1,c4** group by the values in column 1, then by the values in column 4 + +----- + +.. class:: infomark + +**TIP:** Most functions (like *abs*) take only a single expression. *log* can take one or two parameters, like *log(expression,base)* + +Currently, these R functions are supported: *abs, sign, sqrt, floor, ceiling, trunc, round, signif, exp, log, cos, sin, tan, acos, asin, atan, cosh, sinh, tanh, acosh, asinh, atanh, lgamma, gamma, gammaCody, digamma, trigamma, cumsum, cumprod, cummax, cummin* + +.. |INFO| image:: ./static/images/icon_info_sml.gif + + + diff --git a/tools/visualization/LAJ.xml b/tools/visualization/LAJ.xml index 9e2879e7e21..b5fa2c06609 100644 --- a/tools/visualization/LAJ.xml +++ b/tools/visualization/LAJ.xml @@ -1,32 +1,32 @@ - -Pairwise Alignment Viewer - LAJ.py $maf_input $out_file1 - - - - - - - - - - - - - - -You can use this tool to view a set of LAV alignments. You may include FASTA formatted sequences for both species. - -For detailed information on LAJ, click here_. - -.. _here: http://globin.cse.psu.edu/dist/laj/ - -Laj is a tool for viewing and manipulating the output from pairwise alignment programs such as blastz. It can display interactive dotplot, pip, and text representations of the alignments, a diagram showing the locations of exons and repeats, and annotation links to other web sites containing additional information about particular regions. - -.. class:: infomark - -**Note:** If you save output from the applet, you will need to manually refresh your history. - - - - \ No newline at end of file + +Pairwise Alignment Viewer + LAJ.py $maf_input $out_file1 + + + + + + + + + + + + + + +You can use this tool to view a set of LAV alignments. You may include FASTA formatted sequences for both species. + +For detailed information on LAJ, click here_. + +.. _here: http://globin.cse.psu.edu/dist/laj/ + +Laj is a tool for viewing and manipulating the output from pairwise alignment programs such as blastz. It can display interactive dotplot, pip, and text representations of the alignments, a diagram showing the locations of exons and repeats, and annotation links to other web sites containing additional information about particular regions. + +.. class:: infomark + +**Note:** If you save output from the applet, you will need to manually refresh your history. + + + + diff --git a/tools/visualization/LAJ_code.py b/tools/visualization/LAJ_code.py index f96b3d2af29..9a083d268f6 100644 --- a/tools/visualization/LAJ_code.py +++ b/tools/visualization/LAJ_code.py @@ -1,40 +1,41 @@ -#post processing, add sequence and additional annoation info if available -from urllib import urlencode -from galaxy.datatypes.images import create_applet_tag_peek - -def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr): - primary_data = out_data.items()[0][1] - - #default params for LAJ type - params = { - "alignfile1": "display?id=%s" % primary_data.id, - "buttonlabel": "Launch LAJ", - "title": "LAJ in Galaxy", - "posturl": "history_add_to?%s" % urlencode( { 'history_id': primary_data.history_id, 'ext': 'lav', 'name': 'LAJ Output', 'info': 'Added by LAJ', 'dbkey': primary_data.dbkey } ) - } - for name,data in inp_data.items(): - if name == "maf_input": - params["alignfile1"] = "display?id=%s" % data.id - elif name == "seq_file1" and data.state == data.states.OK and data.has_data(): - params["file1seq1"] = "display?id=%s" % data.id - elif name == "seq_file2" and data.state == data.states.OK and data.has_data(): - params["file1seq2"] = "display?id=%s" % data.id - elif name == "exonfile" and data.state == data.states.OK and data.has_data(): - params["exonfile"] = "display?id=%s" % data.id - elif name == "repeatfile" and data.state == data.states.OK and data.has_data(): - params["repeatfile"] = "display?id=%s" % data.id - elif name == "annotationfile" and data.state == data.states.OK and data.has_data(): - params["annotationfile"] = "display?id=%s" % data.id - elif name == "underlayfile" and data.state == data.states.OK and data.has_data(): - params["underlayfile"] = "display?id=%s" % data.id - elif name == "highlightfile" and data.state == data.states.OK and data.has_data(): - params["highlightfile"] = "display?id=%s" % data.id - - if "file1seq1" not in params and "file1seq2" not in params: - params["noseq"] = "true" - - class_name = "edu.psu.cse.bio.laj.LajApplet.class" - archive = "/static/laj/laj.jar" - primary_data.peek = create_applet_tag_peek( class_name, archive, params ) - app.model.context.add( primary_data ) - app.model.context.flush() +#post processing, add sequence and additional annoation info if available +from urllib import urlencode +from galaxy.datatypes.images import create_applet_tag_peek + + +def exec_after_process(app, inp_data, out_data, param_dict, tool, stdout, stderr): + primary_data = out_data.items()[0][1] + + #default params for LAJ type + params = { + "alignfile1": "display?id=%s" % primary_data.id, + "buttonlabel": "Launch LAJ", + "title": "LAJ in Galaxy", + "posturl": "history_add_to?%s" % urlencode( { 'history_id': primary_data.history_id, 'ext': 'lav', 'name': 'LAJ Output', 'info': 'Added by LAJ', 'dbkey': primary_data.dbkey } ) + } + for name, data in inp_data.items(): + if name == "maf_input": + params["alignfile1"] = "display?id=%s" % data.id + elif name == "seq_file1" and data.state == data.states.OK and data.has_data(): + params["file1seq1"] = "display?id=%s" % data.id + elif name == "seq_file2" and data.state == data.states.OK and data.has_data(): + params["file1seq2"] = "display?id=%s" % data.id + elif name == "exonfile" and data.state == data.states.OK and data.has_data(): + params["exonfile"] = "display?id=%s" % data.id + elif name == "repeatfile" and data.state == data.states.OK and data.has_data(): + params["repeatfile"] = "display?id=%s" % data.id + elif name == "annotationfile" and data.state == data.states.OK and data.has_data(): + params["annotationfile"] = "display?id=%s" % data.id + elif name == "underlayfile" and data.state == data.states.OK and data.has_data(): + params["underlayfile"] = "display?id=%s" % data.id + elif name == "highlightfile" and data.state == data.states.OK and data.has_data(): + params["highlightfile"] = "display?id=%s" % data.id + + if "file1seq1" not in params and "file1seq2" not in params: + params["noseq"] = "true" + + class_name = "edu.psu.cse.bio.laj.LajApplet.class" + archive = "/static/laj/laj.jar" + primary_data.peek = create_applet_tag_peek( class_name, archive, params ) + app.model.context.add( primary_data ) + app.model.context.flush()