- Loading job data for ${
- collectionTypeDescription
- }...
+ Loading job data for ${collectionTypeDescription}...
`;
} else {
diff --git a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js
index 113523bcbfe..5e0f92a68bb 100644
--- a/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js
+++ b/client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js
@@ -910,9 +910,9 @@ var FolderToolbarView = Backbone.View.extend({
}
var promise = $.when(
$.post(
- `${Galaxy.root}api/libraries/datasets?encoded_folder_id=${that.id}&source=${options.source}&path=${
- popped_item
- }&file_type=${options.file_type}&link_data=${options.link_data}&space_to_tab=${
+ `${Galaxy.root}api/libraries/datasets?encoded_folder_id=${that.id}&source=${
+ options.source
+ }&path=${popped_item}&file_type=${options.file_type}&link_data=${options.link_data}&space_to_tab=${
options.space_to_tab
}&to_posix_lines=${options.to_posix_lines}&dbkey=${options.dbkey}&tag_using_filenames=${
options.tag_using_filenames
@@ -959,13 +959,13 @@ var FolderToolbarView = Backbone.View.extend({
}
var promise = $.when(
$.post(
- `${Galaxy.root}api/libraries/datasets?encoded_folder_id=${that.id}&source=${options.source}&path=${
- popped_item
- }&preserve_dirs=${options.preserve_dirs}&link_data=${options.link_data}&to_posix_lines=${
- options.to_posix_lines
- }&space_to_tab=${options.space_to_tab}&file_type=${options.file_type}&dbkey=${
- options.dbkey
- }&tag_using_filenames=${options.tag_using_filenames}`
+ `${Galaxy.root}api/libraries/datasets?encoded_folder_id=${that.id}&source=${
+ options.source
+ }&path=${popped_item}&preserve_dirs=${options.preserve_dirs}&link_data=${
+ options.link_data
+ }&to_posix_lines=${options.to_posix_lines}&space_to_tab=${options.space_to_tab}&file_type=${
+ options.file_type
+ }&dbkey=${options.dbkey}&tag_using_filenames=${options.tag_using_filenames}`
)
);
promise
diff --git a/client/galaxy/scripts/mvc/library/library-library-view.js b/client/galaxy/scripts/mvc/library/library-library-view.js
index 483fc83f8fe..79006bab987 100644
--- a/client/galaxy/scripts/mvc/library/library-library-view.js
+++ b/client/galaxy/scripts/mvc/library/library-library-view.js
@@ -124,9 +124,9 @@ var LibraryView = Backbone.View.extend({
placeholder: "Click to select a role",
container: self.$el.find(`#${id}`),
ajax: {
- url: `${Galaxy.root}api/libraries/${self.id}/permissions?scope=available&is_library_access=${
- is_library_access
- }`,
+ url: `${Galaxy.root}api/libraries/${
+ self.id
+ }/permissions?scope=available&is_library_access=${is_library_access}`,
dataType: "json",
quietMillis: 100,
data: function(term, page) {
diff --git a/client/galaxy/scripts/mvc/tool/tool-form-base.js b/client/galaxy/scripts/mvc/tool/tool-form-base.js
index 1d4a92693f7..058ba302c4e 100644
--- a/client/galaxy/scripts/mvc/tool/tool-form-base.js
+++ b/client/galaxy/scripts/mvc/tool/tool-form-base.js
@@ -7,7 +7,7 @@ import Deferred from "utils/deferred";
import Ui from "mvc/ui/ui-misc";
import FormBase from "mvc/form/form-view";
import Citations from "components/Citations.vue";
-import Vue from "libs/vue";
+import Vue from "vue";
export default FormBase.extend({
initialize: function(options) {
var self = this;
diff --git a/client/galaxy/scripts/mvc/tool/tool-form.js b/client/galaxy/scripts/mvc/tool/tool-form.js
index 17af52ce046..6e0d5132d3d 100644
--- a/client/galaxy/scripts/mvc/tool/tool-form.js
+++ b/client/galaxy/scripts/mvc/tool/tool-form.js
@@ -269,9 +269,7 @@ var View = Backbone.View.extend({
} else if (batch_n !== n) {
this.form.highlight(
input_id,
- `Please make sure that you select the same number of inputs for all batch mode fields. This field contains ${
- n
- } selection(s) while a previous field contains ${batch_n}.`
+ `Please make sure that you select the same number of inputs for all batch mode fields. This field contains ${n} selection(s) while a previous field contains ${batch_n}.`
);
return false;
}
diff --git a/client/galaxy/scripts/mvc/workflow/workflow-manager.js b/client/galaxy/scripts/mvc/workflow/workflow-manager.js
index 35b8d79890d..8ea13a65345 100644
--- a/client/galaxy/scripts/mvc/workflow/workflow-manager.js
+++ b/client/galaxy/scripts/mvc/workflow/workflow-manager.js
@@ -35,9 +35,7 @@ $.extend(Workflow.prototype, {
}
if (!this.canLabelOutputWith(toLabel)) {
Toastr.warning(
- `Workflow contains duplicate workflow output labels ${
- toLabel
- }. This must be fixed before it can be saved.`
+ `Workflow contains duplicate workflow output labels ${toLabel}. This must be fixed before it can be saved.`
);
}
if (toLabel) {
diff --git a/client/galaxy/scripts/mvc/workflow/workflow-view.js b/client/galaxy/scripts/mvc/workflow/workflow-view.js
index 5ec76a86262..d352f0f31c2 100644
--- a/client/galaxy/scripts/mvc/workflow/workflow-view.js
+++ b/client/galaxy/scripts/mvc/workflow/workflow-view.js
@@ -277,9 +277,7 @@ export default Backbone.View.extend({
if (upgrade_message) {
window.show_modal(
"Issues loading this workflow",
- `Please review the following issues, possibly resulting from tool upgrades or changes.
${
- upgrade_message
- }
`,
+ `Please review the following issues, possibly resulting from tool upgrades or changes.
${upgrade_message}
`,
{ Continue: hide_modal }
);
} else {
@@ -560,9 +558,7 @@ export default Backbone.View.extend({
if (upgrade_message) {
window.show_modal(
"Subworkflow embedded with changes",
- `Problems were encountered loading this workflow (possibly a result of tool upgrades). Please review the following parameters and then save.
${
- upgrade_message
- }
`,
+ `Problems were encountered loading this workflow (possibly a result of tool upgrades). Please review the following parameters and then save.
`;
},
/** Main template */
diff --git a/client/gulpfile.js b/client/gulpfile.js
index 06eebf5605a..6dc0d36af96 100644
--- a/client/gulpfile.js
+++ b/client/gulpfile.js
@@ -34,8 +34,7 @@ var paths = {
'jquery-mousewheel': [ 'jquery.mousewheel.js', 'jquery/jquery.mousewheel.js' ],
'raven-js': ['dist/raven.js', 'raven.js'],
'requirejs': [ 'require.js', 'require.js' ],
- 'underscore': [ 'underscore.js', 'underscore.js' ],
- 'vue': [ 'dist/vue.js', 'vue.js' ]
+ 'underscore': [ 'underscore.js', 'underscore.js' ]
},
libs: ['galaxy/scripts/libs/**/*.js']
};
diff --git a/client/package.json b/client/package.json
index efac95cbb96..6c175c0423f 100644
--- a/client/package.json
+++ b/client/package.json
@@ -28,7 +28,7 @@
"raven-js": "^3.17.0",
"requirejs": "2",
"underscore": "^1.8.3",
- "vue": "^2.5.3"
+ "vue": "^2.5.9"
},
"scripts": {
"watch": "gulp stage-libs && concurrently \"yarn run webpack-watch\" \"yarn run gulp watch\" \"yarn run style-watch\"",
@@ -55,11 +55,11 @@
"devDependencies": {
"babel-core": "^6.24.0",
"babel-loader": "^7.1.1",
- "babel-preset-env": "^1.3.2",
- "concurrently": "^3.4.0",
+ "babel-preset-env": "^1.6.1",
+ "concurrently": "^3.5.1",
"css-loader": "^0.28.7",
"del": "^3.0.0",
- "expose-loader": "^0.7.3",
+ "expose-loader": "^0.7.4",
"grunt": "^0.4.5",
"grunt-bower-install-simple": "^1.1.0",
"grunt-cli": "^0.1.13",
@@ -87,11 +87,11 @@
"karma-webpack": "^2.0.6",
"phantomjs-polyfill": "0.0.2",
"phantomjs-prebuilt": "^2.1.7",
- "prettier": "^1.7.4",
+ "prettier": "^1.9.1",
"qunitjs": "^2.4.1",
"sinon": "^4.1.2",
"vue-loader": "^13.5.0",
- "vue-template-compiler": "^2.5.3",
- "webpack": "^3.6.0"
+ "vue-template-compiler": "^2.5.9",
+ "webpack": "^3.10.0"
}
}
diff --git a/client/webpack.config.js b/client/webpack.config.js
index 4d7431bcb03..8b44ab7d12c 100644
--- a/client/webpack.config.js
+++ b/client/webpack.config.js
@@ -25,7 +25,7 @@ var commonLibs = [
"libs/farbtastic",
"libs/bootstrap",
"libs/bootstrap-tour",
- "libs/vue",
+ "vue",
// mvc
"libs/underscore",
"libs/backbone",
diff --git a/client/yarn.lock b/client/yarn.lock
index f206aa1f837..1550f2e6acc 100644
--- a/client/yarn.lock
+++ b/client/yarn.lock
@@ -887,9 +887,9 @@ babel-plugin-transform-strict-mode@^6.24.1:
babel-runtime "^6.22.0"
babel-types "^6.24.1"
-babel-preset-env@^1.3.2:
- version "1.6.0"
- resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.0.tgz#2de1c782a780a0a5d605d199c957596da43c44e4"
+babel-preset-env@^1.6.1:
+ version "1.6.1"
+ resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48"
dependencies:
babel-plugin-check-es2015-constants "^6.22.0"
babel-plugin-syntax-trailing-function-commas "^6.22.0"
@@ -1659,9 +1659,9 @@ concat-stream@~1.4.6:
readable-stream "~1.1.9"
typedarray "~0.0.5"
-concurrently@^3.4.0:
- version "3.5.0"
- resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.5.0.tgz#8cf1b7707a6916a78a4ff5b77bb04dec54b379b2"
+concurrently@^3.5.1:
+ version "3.5.1"
+ resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.5.1.tgz#ee8b60018bbe86b02df13e5249453c6ececd2521"
dependencies:
chalk "0.5.1"
commander "2.6.0"
@@ -2616,9 +2616,9 @@ expand-tilde@^2.0.2:
dependencies:
homedir-polyfill "^1.0.1"
-expose-loader@^0.7.3:
- version "0.7.3"
- resolved "https://registry.yarnpkg.com/expose-loader/-/expose-loader-0.7.3.tgz#35fbd3659789e4faa81f59de8b7e9fc39e466d51"
+expose-loader@^0.7.4:
+ version "0.7.4"
+ resolved "https://registry.yarnpkg.com/expose-loader/-/expose-loader-0.7.4.tgz#9bcdd3878b5da9107930b55a03f65afe90b3314a"
extend@^3.0.0, extend@~3.0.0, extend@~3.0.1:
version "3.0.1"
@@ -5894,10 +5894,14 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
-prettier@^1.7.0, prettier@^1.7.4:
+prettier@^1.7.0:
version "1.8.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.2.tgz#bff83e7fd573933c607875e5ba3abbdffb96aeb8"
+prettier@^1.9.1:
+ version "1.9.1"
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.1.tgz#41638a0d47c1efbd1b7d5a742aaa5548eab86d70"
+
pretty-bytes@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84"
@@ -7495,9 +7499,9 @@ vue-style-loader@^3.0.0:
hash-sum "^1.0.2"
loader-utils "^1.0.2"
-vue-template-compiler@^2.5.3:
- version "2.5.3"
- resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.3.tgz#ab631b0694e211a6aaf0d800102b37836aae36a4"
+vue-template-compiler@^2.5.9:
+ version "2.5.9"
+ resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.9.tgz#7fabc73c8d3d12d32340cd86c5fc33e00e86d686"
dependencies:
de-indent "^1.0.2"
he "^1.1.0"
@@ -7506,9 +7510,9 @@ vue-template-es2015-compiler@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.6.0.tgz#dc42697133302ce3017524356a6c61b7b69b4a18"
-vue@^2.5.3:
- version "2.5.3"
- resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.3.tgz#e1a3b1f49b6e93e574ce040b95cbc873912fecc1"
+vue@^2.5.9:
+ version "2.5.9"
+ resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.9.tgz#b2380cd040915dca69881dafd121d760952e65f7"
walk-sync@0.3.1:
version "0.3.1"
@@ -7577,9 +7581,9 @@ webpack@^1.14.0:
watchpack "^0.2.1"
webpack-core "~0.6.9"
-webpack@^3.6.0:
- version "3.7.0"
- resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.7.0.tgz#9081d0b1ba4950e34ddc54195721eba4bf205e83"
+webpack@^3.10.0:
+ version "3.10.0"
+ resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.10.0.tgz#5291b875078cf2abf42bdd23afe3f8f96c17d725"
dependencies:
acorn "^5.0.0"
acorn-dynamic-import "^2.0.0"
diff --git a/config/plugins/webhooks/demo/tour_generator/helper/__init__.py b/config/plugins/webhooks/demo/tour_generator/helper/__init__.py
index 932997f4a10..3d0c6e11c38 100644
--- a/config/plugins/webhooks/demo/tour_generator/helper/__init__.py
+++ b/config/plugins/webhooks/demo/tour_generator/helper/__init__.py
@@ -174,7 +174,7 @@ class TourGenerator(object):
elif input.type == 'select':
params = []
if name in test_inputs:
- for option in self._tool.inputs[name].static_options:
+ for option in input.static_options:
for test_option in self._test.inputs[name]:
if test_option == option[1]:
params.append(option[0])
diff --git a/lib/galaxy/containers/docker_swarm_manager.py b/lib/galaxy/containers/docker_swarm_manager.py
index 9a937377f16..2cd6c64e522 100644
--- a/lib/galaxy/containers/docker_swarm_manager.py
+++ b/lib/galaxy/containers/docker_swarm_manager.py
@@ -46,7 +46,7 @@ SWARM_MANAGER_CONF_DEFAULTS = {
'service_wait_count_limit': 0,
'service_wait_time_limit': 5,
'slots_min_limit': 0,
- 'slots_max_limit': sys.maxint,
+ 'slots_max_limit': sys.maxsize,
'slots_min_spare': 0,
'node_idle_limit': 120,
'limits': [],
@@ -137,7 +137,7 @@ class SwarmManager(object):
state = node_state['state']
if not nodes:
nodes = self._docker_interface.nodes()
- node = (filter(lambda x: x.name == name, nodes) + [None])[0]
+ node = ([x for x in nodes if x.name == name] + [None])[0]
if not node:
if elapsed > self._conf.spawn_wait_time:
log.warning("spawning node '%s' not found in `docker node ls` and spawn_wait_time exceeded! %d seconds have elapsed", name, elapsed)
diff --git a/lib/galaxy/datatypes/proteomics.py b/lib/galaxy/datatypes/proteomics.py
index a50afb720dd..2ca7ff891f3 100644
--- a/lib/galaxy/datatypes/proteomics.py
+++ b/lib/galaxy/datatypes/proteomics.py
@@ -449,7 +449,7 @@ class ImzML(Binary):
def generate_primary_file(self, dataset=None):
rval = ['imzML Composite Dataset ']
rval.append('
This composite dataset is composed of the following files:
')
- for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems():
+ for composite_name, composite_file in self.get_composite_files(dataset=dataset).items():
fn = composite_name
opt_text = ''
if composite_file.get('description'):
@@ -493,7 +493,7 @@ class Analyze75(Binary):
def generate_primary_file(self, dataset=None):
rval = ['Analyze75 Composite Dataset.']
rval.append('
This composite dataset is composed of the following files:
')
- for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems():
+ for composite_name, composite_file in self.get_composite_files(dataset=dataset).items():
fn = composite_name
opt_text = ''
if composite_file.optional:
diff --git a/lib/galaxy/dependencies/pinned-hashed-requirements.txt b/lib/galaxy/dependencies/pinned-hashed-requirements.txt
index 38f136bad1e..4ed98468988 100644
--- a/lib/galaxy/dependencies/pinned-hashed-requirements.txt
+++ b/lib/galaxy/dependencies/pinned-hashed-requirements.txt
@@ -35,7 +35,7 @@ SQLAlchemy==1.0.15 --hash:sha256=7cbac295f87d2af82aac08346b52f72d0b0c00712290495
--hash:sha256=f819742f33ae543ca2c48bc43e35bd75372f7c3e379e4881f9040549d3df94b6 \
--hash:sha256=fce29753f720f8a6920185bd5a4d1670fa6b6936819475197b2bce7644243766 \
--hash:sha256=aa8843df6869f6c999400ae32de5480fba1b7711fe535c168a14225ffd1d3de4
-mercurial==3.7.3 --hash:sha256=49f596820f005ac6f94266b89a0dbd815c0ee0aacd3aa86545dc39fb349ea4bf \
+mercurial==3.7.3; python_version < '3.0' --hash:sha256=49f596820f005ac6f94266b89a0dbd815c0ee0aacd3aa86545dc39fb349ea4bf \
--hash:sha256=75f5b6b708bec2d6e0e68ec8912725a5dcac42df00b122fa73a8c4bd21495039 \
--hash:sha256=8c07cb3404d26641d8829099bd1047582b76def49eca067ba6bea9a73d261775 \
--hash:sha256=6a05bf22101b79b5f56421f7a1c6d301000f759f0114827f37cc9f847c1ab352 \
diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt
index 428728e5899..adddb8247b9 100644
--- a/lib/galaxy/dependencies/pinned-requirements.txt
+++ b/lib/galaxy/dependencies/pinned-requirements.txt
@@ -7,7 +7,7 @@ MarkupSafe==1.0
PyYAML==3.12
SQLAlchemy==1.0.15
sqlalchemy-utils==0.32.19
-mercurial==3.7.3
+mercurial==3.7.3; python_version < '3.0'
pycrypto==2.6.1
uWSGI==2.0.15
# Flexible BAM index naming is new to core pysam
diff --git a/lib/galaxy/dependencies/requirements.txt b/lib/galaxy/dependencies/requirements.txt
index 6dafe091a65..f22fb4e8193 100644
--- a/lib/galaxy/dependencies/requirements.txt
+++ b/lib/galaxy/dependencies/requirements.txt
@@ -5,7 +5,7 @@ bx-python
MarkupSafe
PyYAML
SQLAlchemy
-mercurial
+mercurial; python_version < '3.0'
pycrypto
# Flexible BAM index naming is new to main pysam
pysam>=0.13
diff --git a/lib/galaxy/jobs/handler.py b/lib/galaxy/jobs/handler.py
index 86cdd868870..80585c103d6 100644
--- a/lib/galaxy/jobs/handler.py
+++ b/lib/galaxy/jobs/handler.py
@@ -5,11 +5,11 @@ import datetime
import logging
import os
import time
-from Queue import (
+
+from six.moves.queue import (
Empty,
Queue
)
-
from sqlalchemy.sql.expression import (
and_,
func,
@@ -343,7 +343,7 @@ class JobHandlerQueue(Monitors, object):
if not self.track_jobs_in_database:
self.waiting_jobs = new_waiting_jobs
# Remove cached wrappers for any jobs that are no longer being tracked
- for id in self.job_wrappers.keys():
+ for id in list(self.job_wrappers.keys()):
if id not in new_waiting_jobs:
del self.job_wrappers[id]
# Flush, if we updated the state
@@ -896,7 +896,7 @@ class DefaultJobDispatcher(object):
job_wrapper.fail(DEFAULT_JOB_PUT_FAILURE_MESSAGE)
def shutdown(self):
- for runner in self.job_runners.itervalues():
+ for runner in self.job_runners.values():
try:
runner.shutdown()
except Exception:
diff --git a/lib/galaxy/jobs/runners/chronos.py b/lib/galaxy/jobs/runners/chronos.py
index e7450bd222b..900658a4057 100644
--- a/lib/galaxy/jobs/runners/chronos.py
+++ b/lib/galaxy/jobs/runners/chronos.py
@@ -232,7 +232,7 @@ class ChronosJobRunner(AsynchronousJobRunner):
def parse_destination_params(self, params):
parsed_params = {}
- for k, spec in self.DESTINATION_PARAMS_SPEC.iteritems():
+ for k, spec in self.DESTINATION_PARAMS_SPEC.items():
value = params.get(k, spec.get('default'))
map_to = spec.get('map_name')
mapper = spec.get('map')
@@ -264,7 +264,7 @@ class ChronosJobRunner(AsynchronousJobRunner):
def _retrieve_job(self, job_id):
jobs = self._chronos_client.list()
- job = filter((lambda x: x['name'] == job_id), jobs)
+ job = [x for x in jobs if x['name'] == job_id]
if len(job) > 1:
msg = 'Multiple jobs found with name {name!r}'.format(name=job_id)
LOGGER.error(msg)
diff --git a/lib/galaxy/managers/hdas.py b/lib/galaxy/managers/hdas.py
index d17b5424e61..29ccd342b24 100644
--- a/lib/galaxy/managers/hdas.py
+++ b/lib/galaxy/managers/hdas.py
@@ -373,10 +373,10 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
Return dictionary containing new-style display app urls.
"""
display_apps = []
- for display_app in hda.get_display_applications(trans).itervalues():
+ for display_app in hda.get_display_applications(trans).values():
app_links = []
- for link_app in display_app.links.itervalues():
+ for link_app in display_app.links.values():
app_links.append({
'target': link_app.url.get('target_frame', '_blank'),
'href': link_app.get_display_url(hda, trans),
diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py
index 8c9b98b5047..5ae865ae0b3 100644
--- a/lib/galaxy/managers/workflows.py
+++ b/lib/galaxy/managers/workflows.py
@@ -413,7 +413,7 @@ class WorkflowContentsManager(UsesAnnotations):
else:
inputs = step.module.get_runtime_inputs(connections=step.output_connections)
step_model = {
- 'inputs' : [input.to_dict(trans) for input in inputs.itervalues()]
+ 'inputs' : [input.to_dict(trans) for input in inputs.values()]
}
step_model['step_type'] = step.type
step_model['step_label'] = step.label
@@ -713,7 +713,7 @@ class WorkflowContentsManager(UsesAnnotations):
# tools. This should be removed at some point. Mirrored
# hack in _workflow_from_dict should never be removed so
# existing workflow exports continue to function.
- for input_name, input_conn in dict(input_conn_dict).iteritems():
+ for input_name, input_conn in dict(input_conn_dict).items():
if len(input_conn) == 1:
input_conn_dict[input_name] = input_conn[0]
step_dict['input_connections'] = input_conn_dict
@@ -790,7 +790,7 @@ class WorkflowContentsManager(UsesAnnotations):
supplied_steps = data['steps']
# Try to iterate through imported workflow in such a way as to
# preserve step order.
- step_indices = supplied_steps.keys()
+ step_indices = list(supplied_steps.keys())
try:
step_indices = sorted(step_indices, key=int)
except ValueError:
@@ -927,7 +927,7 @@ class WorkflowContentsManager(UsesAnnotations):
"""
for step in steps:
# Input connections
- for input_name, conn_list in step.temp_input_connections.iteritems():
+ for input_name, conn_list in step.temp_input_connections.items():
if not conn_list:
continue
if not isinstance(conn_list, list): # Older style singleton connection
diff --git a/lib/galaxy/openid/providers.py b/lib/galaxy/openid/providers.py
index 5885167a095..39e51a0275f 100644
--- a/lib/galaxy/openid/providers.py
+++ b/lib/galaxy/openid/providers.py
@@ -4,6 +4,8 @@ Contains OpenID provider functionality
import logging
import os
+import six
+
from galaxy.util import parse_xml, string_as_bool
from galaxy.util.odict import odict
@@ -87,7 +89,7 @@ class OpenIDProvider(object):
def post_authentication(self, trans, openid_manager, info):
sreg_attributes = openid_manager.get_sreg(info)
- for store_pref_name, store_pref_value_name in self.store_user_preference.iteritems():
+ for store_pref_name, store_pref_value_name in self.store_user_preference.items():
if store_pref_value_name in (self.sreg_optional + self.sreg_required):
trans.user.preferences[store_pref_name] = sreg_attributes.get(store_pref_value_name)
else:
@@ -129,10 +131,10 @@ class OpenIDProviders(object):
self.providers = providers
else:
self.providers = odict()
- self._banned_identifiers = [provider.op_endpoint_url for provider in self.providers.itervalues() if provider.never_associate_with_user]
+ self._banned_identifiers = [provider.op_endpoint_url for provider in self.providers.values() if provider.never_associate_with_user]
def __iter__(self):
- for provider in self.providers.itervalues():
+ for provider in six.itervalues(self.providers):
yield provider
def get(self, name, default=None):
diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py
index 660f4786963..52b42f94fdf 100755
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -339,7 +339,7 @@ class DefaultToolState(object):
"""
self.inputs = {}
context = ExpressionContext(self.inputs)
- for input in tool.inputs.itervalues():
+ for input in tool.inputs.values():
self.inputs[input.name] = input.get_initial_value(trans, context)
def encode(self, tool, app, nested=False):
diff --git a/lib/galaxy/tools/actions/upload_common.py b/lib/galaxy/tools/actions/upload_common.py
index c612cddec80..ae70cae17de 100644
--- a/lib/galaxy/tools/actions/upload_common.py
+++ b/lib/galaxy/tools/actions/upload_common.py
@@ -448,7 +448,7 @@ def create_paramfile(trans, uploaded_datasets):
auto_decompress=getattr(uploaded_dataset, "auto_decompress", True),
purge_source=purge_source,
space_to_tab=uploaded_dataset.space_to_tab,
- in_place=trans.app.config.external_chown_script is None,
+ run_as_real_user=trans.app.config.external_chown_script is None,
check_content=trans.app.config.check_upload_content,
path=uploaded_dataset.path)
# TODO: This will have to change when we start bundling inputs.
diff --git a/lib/galaxy/tools/cwl/representation.py b/lib/galaxy/tools/cwl/representation.py
index a67574cac7a..36b16003258 100644
--- a/lib/galaxy/tools/cwl/representation.py
+++ b/lib/galaxy/tools/cwl/representation.py
@@ -78,9 +78,9 @@ def to_cwl_job(tool, param_dict, local_working_directory):
else:
return str(param_dict_value)
- for input_name, input in inputs.iteritems():
+ for input_name, input in inputs.items():
if input.type == "repeat":
- only_input = input.inputs.values()[0]
+ only_input = next(iter(input.inputs.values()))
array_value = []
for instance in param_dict[input_name]:
array_value.append(simple_value(only_input, instance[input_name[:-len("_repeat")]]))
@@ -112,7 +112,7 @@ def to_galaxy_parameters(tool, as_dict):
else:
return param_dict_value
- for input_name, input in inputs.iteritems():
+ for input_name, input in inputs.items():
as_dict_value = as_dict.get(input_name, NOT_PRESENT)
galaxy_input_type = input.type
@@ -120,7 +120,7 @@ def to_galaxy_parameters(tool, as_dict):
if input_name not in as_dict:
continue
- only_input = input.inputs.values()[0]
+ only_input = next(iter(input.inputs.values()))
for index, value in enumerate(as_dict_value):
key = "%s_repeat_0|%s" % (input_name, only_input.name)
galaxy_value = from_simple_value(only_input, value)
diff --git a/lib/galaxy/tools/imp_exp/__init__.py b/lib/galaxy/tools/imp_exp/__init__.py
index cf7bbfc0946..d6e91ea6af1 100644
--- a/lib/galaxy/tools/imp_exp/__init__.py
+++ b/lib/galaxy/tools/imp_exp/__init__.py
@@ -240,7 +240,7 @@ class JobImportHistoryArchiveWrapper(object, UsesAnnotations):
# Set parameters. May be useful to look at metadata.py for creating parameters.
# TODO: there may be a better way to set parameters, e.g.:
- # for name, value in tool.params_to_strings( incoming, trans.app ).iteritems():
+ # for name, value in tool.params_to_strings( incoming, trans.app ).items():
# job.add_parameter( name, value )
# to make this work, we'd need to flesh out the HDA objects. The code below is
# relatively similar.
diff --git a/lib/galaxy/util/permutations.py b/lib/galaxy/util/permutations.py
index b153bc2f0dd..c69061afba3 100644
--- a/lib/galaxy/util/permutations.py
+++ b/lib/galaxy/util/permutations.py
@@ -39,13 +39,12 @@ def expand_multi_inputs(inputs, classifier, key_filter=None):
def __split_inputs(inputs, classifier, key_filter):
key_filter = key_filter or (lambda x: True)
- input_keys = filter(key_filter, inputs)
single_inputs = {}
matched_multi_inputs = {}
multiplied_multi_inputs = {}
- for input_key in input_keys:
+ for input_key in filter(key_filter, inputs):
input_type, expanded_val = classifier(input_key)
if input_type == input_classification.SINGLE:
single_inputs[input_key] = expanded_val
@@ -73,14 +72,14 @@ def __extend_with_matched_combos(single_inputs, multi_inputs):
matched_multi_inputs = []
- first_multi_input_key = multi_inputs.keys()[0]
+ first_multi_input_key = next(iter(multi_inputs.keys()))
first_multi_value = multi_inputs.get(first_multi_input_key)
for value in first_multi_value:
new_inputs = __copy_and_extend_inputs(single_inputs, first_multi_input_key, value)
matched_multi_inputs.append(new_inputs)
- for multi_input_key, multi_input_values in multi_inputs.iteritems():
+ for multi_input_key, multi_input_values in multi_inputs.items():
if multi_input_key == first_multi_input_key:
continue
if len(multi_input_values) != len(first_multi_value):
@@ -95,7 +94,7 @@ def __extend_with_matched_combos(single_inputs, multi_inputs):
def __extend_with_multiplied_combos(input_combos, multi_inputs):
combos = input_combos
- for multi_input_key, multi_input_value in multi_inputs.iteritems():
+ for multi_input_key, multi_input_value in multi_inputs.items():
iter_combos = []
for combo in combos:
diff --git a/lib/galaxy/util/script.py b/lib/galaxy/util/script.py
index 4e72a0cf67e..b227cff8344 100644
--- a/lib/galaxy/util/script.py
+++ b/lib/galaxy/util/script.py
@@ -42,7 +42,7 @@ def _app_properties(args):
def _arg_parser():
parser = argparse.ArgumentParser(description=DESCRIPTION)
parser.add_argument('action', metavar='ACTION', type=str,
- choices=ACTIONS.keys(),
+ choices=list(ACTIONS.keys()),
default=DEFAULT_ACTION,
nargs='?' if DEFAULT_ACTION is not None else None,
help='action to perform')
diff --git a/lib/galaxy/visualization/data_providers/basic.py b/lib/galaxy/visualization/data_providers/basic.py
index 15a3106c5a0..728b448a617 100644
--- a/lib/galaxy/visualization/data_providers/basic.py
+++ b/lib/galaxy/visualization/data_providers/basic.py
@@ -37,7 +37,7 @@ class BaseDataProvider(object):
"""
raise Exception("Unimplemented Function")
- def get_data(self, chrom, start, end, start_val=0, max_vals=sys.maxint, **kwargs):
+ def get_data(self, chrom, start, end, start_val=0, max_vals=sys.maxsize, **kwargs):
"""
Returns data as specified by kwargs. start_val is the first element to
return and max_vals indicates the number of values to return.
diff --git a/lib/galaxy/visualization/data_providers/genome.py b/lib/galaxy/visualization/data_providers/genome.py
index d78fbccadc5..7bdae81b3ec 100644
--- a/lib/galaxy/visualization/data_providers/genome.py
+++ b/lib/galaxy/visualization/data_providers/genome.py
@@ -44,8 +44,8 @@ def get_bounds(reads, start_pos_index, end_pos_index):
'''
Returns the minimum and maximum position for a set of reads.
'''
- max_low = sys.maxint
- max_high = -sys.maxint
+ max_low = sys.maxsize
+ max_high = -sys.maxsize
for read in reads:
if read[start_pos_index] < max_low:
max_low = read[start_pos_index]
@@ -182,7 +182,7 @@ class GenomeDataProvider(BaseDataProvider):
"""
raise Exception("Unimplemented Function")
- def get_data(self, chrom=None, low=None, high=None, start_val=0, max_vals=sys.maxint, **kwargs):
+ def get_data(self, chrom=None, low=None, high=None, start_val=0, max_vals=sys.maxsize, **kwargs):
"""
Returns data in region defined by chrom, start, and end. start_val and
max_vals are used to denote the data to return: start_val is the first element to
@@ -233,7 +233,7 @@ class GenomeDataProvider(BaseDataProvider):
column_names = self.original_dataset.datatype.column_names
except AttributeError:
try:
- column_names = range(self.original_dataset.metadata.columns)
+ column_names = list(range(self.original_dataset.metadata.columns))
except Exception: # Give up
return []
@@ -511,7 +511,7 @@ class BedDataProvider(GenomeDataProvider):
if length >= 12:
block_sizes = [int(n) for n in feature[10].split(',') if n != '']
block_starts = [int(n) for n in feature[11].split(',') if n != '']
- blocks = zip(block_sizes, block_starts)
+ blocks = list(zip(block_sizes, block_starts))
payload.append([(int(feature[1]) + block[1], int(feature[1]) + block[1] + block[0]) for block in blocks])
# Score (filter data)
@@ -1022,7 +1022,7 @@ class BamDataProvider(GenomeDataProvider, FilterableMixin):
count += 1
# Take care of reads whose mates are out of range.
- for qname, read in paired_pending.iteritems():
+ for qname, read in paired_pending.items():
if read['mate_start'] < read['start']:
# Mate is before read.
read_start = read['mate_start']
@@ -1286,7 +1286,7 @@ class IntervalIndexDataProvider(FilterableMixin, GenomeDataProvider):
out.write(line)
else:
reader = GFFReaderWrapper(source, fix_strand=True)
- feature = reader.next()
+ feature = next(reader)
for interval in feature.intervals:
out.write('\t'.join(interval.fields) + '\n')
@@ -1328,7 +1328,7 @@ class IntervalIndexDataProvider(FilterableMixin, GenomeDataProvider):
# GFF dataset.
reader = GFFReaderWrapper(source, fix_strand=True)
- feature = reader.next()
+ feature = next(reader)
payload = package_gff_feature(feature, no_detail, filter_cols)
payload.insert(0, offset)
@@ -1604,7 +1604,7 @@ class ChromatinInteractionsDataProvider(GenomeDataProvider):
class ChromatinInteractionsTabixDataProvider(TabixDataProvider, ChromatinInteractionsDataProvider):
- def get_iterator(self, data_file, chrom, start=0, end=sys.maxint, interchromosomal=False, **kwargs):
+ def get_iterator(self, data_file, chrom, start=0, end=sys.maxsize, interchromosomal=False, **kwargs):
"""
"""
# Modify start as needed to get earlier interactions with start region.
@@ -1661,7 +1661,7 @@ def package_gff_feature(feature, no_detail=False, filter_cols=[]):
# Add blocks.
block_sizes = [(interval.end - interval.start) for interval in feature_intervals]
block_starts = [(interval.start - feature.start) for interval in feature_intervals]
- blocks = zip(block_sizes, block_starts)
+ blocks = list(zip(block_sizes, block_starts))
payload.append([(feature.start + block[1], feature.start + block[1] + block[0]) for block in blocks])
# Add filter data to payload.
diff --git a/lib/galaxy/webapps/config_manage.py b/lib/galaxy/webapps/config_manage.py
index 695500a9cff..fd66ed2b99c 100644
--- a/lib/galaxy/webapps/config_manage.py
+++ b/lib/galaxy/webapps/config_manage.py
@@ -1,5 +1,4 @@
-from __future__ import absolute_import
-from __future__ import print_function
+from __future__ import absolute_import, print_function
import argparse
import copy
@@ -268,7 +267,7 @@ def main(argv=None):
def _arg_parser():
parser = argparse.ArgumentParser(description=DESCRIPTION)
parser.add_argument('action', metavar='ACTION', type=str,
- choices=ACTIONS.keys(),
+ choices=list(ACTIONS.keys()),
help='action to perform')
parser.add_argument('app', metavar='APP', type=str, nargs="?",
help=APP_DESCRIPTION)
@@ -691,7 +690,7 @@ def _ordered_dump(data, stream=None, Dumper=yaml.Dumper, **kwds):
def _dict_representer(dumper, data):
return dumper.represent_mapping(
yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
- data.items())
+ list(data.items()))
OrderedDumper.add_representer(OrderedDict, _dict_representer)
return yaml.dump(data, stream, OrderedDumper, **kwds)
diff --git a/lib/galaxy/webapps/galaxy/api/authenticate.py b/lib/galaxy/webapps/galaxy/api/authenticate.py
index 59995ef91e6..0129000457a 100644
--- a/lib/galaxy/webapps/galaxy/api/authenticate.py
+++ b/lib/galaxy/webapps/galaxy/api/authenticate.py
@@ -12,7 +12,8 @@ Returns:
"""
import logging
from base64 import b64decode
-from urllib import unquote
+
+from six.moves.urllib.parse import unquote
from galaxy import exceptions
from galaxy.managers import api_keys
diff --git a/lib/galaxy/webapps/galaxy/api/configuration.py b/lib/galaxy/webapps/galaxy/api/configuration.py
index 25f4f8d9e96..0568254b3c8 100644
--- a/lib/galaxy/webapps/galaxy/api/configuration.py
+++ b/lib/galaxy/webapps/galaxy/api/configuration.py
@@ -88,7 +88,7 @@ class ConfigurationController(BaseAPIController):
@require_admin
def dynamic_tool_confs(self, trans):
confs = self.app.toolbox.dynamic_confs(include_migrated_tool_conf=True)
- return map(_tool_conf_to_dict, confs)
+ return list(map(_tool_conf_to_dict, confs))
@expose_api
@require_admin
diff --git a/lib/galaxy/webapps/galaxy/api/datasets.py b/lib/galaxy/webapps/galaxy/api/datasets.py
index f4e03132947..42db54f37c0 100644
--- a/lib/galaxy/webapps/galaxy/api/datasets.py
+++ b/lib/galaxy/webapps/galaxy/api/datasets.py
@@ -383,5 +383,5 @@ class DatasetsController(BaseAPIController, UsesVisualizationMixin):
return converted
except model.NoConverterException:
- exc_data = dict(source=original.ext, target=target_ext, available=original.get_converter_types().keys())
+ exc_data = dict(source=original.ext, target=target_ext, available=list(original.get_converter_types().keys()))
raise galaxy_exceptions.RequestParameterInvalidException('Conversion not possible', **exc_data)
diff --git a/lib/galaxy/webapps/galaxy/api/datatypes.py b/lib/galaxy/webapps/galaxy/api/datatypes.py
index 2bb8ab6c849..7de90de0b1d 100644
--- a/lib/galaxy/webapps/galaxy/api/datatypes.py
+++ b/lib/galaxy/webapps/galaxy/api/datatypes.py
@@ -42,7 +42,7 @@ class DatatypesController(BaseAPIController):
if extension in datatypes_registry.datatypes_by_extension:
composite_files = datatypes_registry.datatypes_by_extension[extension].composite_files
if composite_files:
- dictionary['composite_files'] = [_.dict() for _ in composite_files.itervalues()]
+ dictionary['composite_files'] = [_.dict() for _ in composite_files.values()]
rval.append(dictionary)
return rval
except Exception as exception:
@@ -61,7 +61,7 @@ class DatatypesController(BaseAPIController):
try:
ext_to_class_name = dict()
classes = []
- for k, v in self._datatypes_registry.datatypes_by_extension.iteritems():
+ for k, v in self._datatypes_registry.datatypes_by_extension.items():
c = v.__class__
ext_to_class_name[k] = c.__module__ + "." + c.__name__
classes.append(c)
@@ -109,7 +109,7 @@ class DatatypesController(BaseAPIController):
@expose_api_anonymous_and_sessionless
def converters(self, trans, **kwd):
converters = []
- for (source_type, targets) in self._datatypes_registry.datatype_converters.iteritems():
+ for (source_type, targets) in self._datatypes_registry.datatype_converters.items():
for target_type in targets:
converters.append({
'source': source_type,
diff --git a/lib/galaxy/webapps/galaxy/api/folder_contents.py b/lib/galaxy/webapps/galaxy/api/folder_contents.py
index 22bcbbb3c82..041892c726b 100644
--- a/lib/galaxy/webapps/galaxy/api/folder_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/folder_contents.py
@@ -92,7 +92,7 @@ class FolderContentsController(BaseAPIController, UsesLibraryMixin, UsesLibraryM
if content_item.description:
return_item.update(dict(description=content_item.description))
- if content_item.api_type == 'file':
+ elif content_item.api_type == 'file':
# Is the dataset public or private?
# When both are False the dataset is 'restricted'
# Access rights are checked on the dataset level, not on the ld or ldda level to maintain consistency
diff --git a/lib/galaxy/webapps/galaxy/api/history_contents.py b/lib/galaxy/webapps/galaxy/api/history_contents.py
index 9b11f561780..ef73f4fffe3 100644
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -96,7 +96,7 @@ class HistoryContentsController(BaseAPIController, UsesLibraryMixin, UsesLibrary
contents_kwds = {'types': types}
if ids:
- ids = map(lambda id: self.decode_id(id), ids.split(','))
+ ids = [self.decode_id(id) for id in ids.split(',')]
contents_kwds['ids'] = ids
# If explicit ids given, always used detailed result.
details = 'all'
@@ -209,7 +209,7 @@ class HistoryContentsController(BaseAPIController, UsesLibraryMixin, UsesLibrary
else:
ids = util.listify(ids)
types = util.listify(types)
- return map(lambda s: self.encode_all_ids(trans, s), fetch_job_states(self.app, trans.sa_session, ids, types))
+ return [self.encode_all_ids(trans, s) for s in fetch_job_states(self.app, trans.sa_session, ids, types)]
@expose_api_anonymous
def show_jobs_summary(self, trans, id, history_id, **kwd):
diff --git a/lib/galaxy/webapps/galaxy/api/jobs.py b/lib/galaxy/webapps/galaxy/api/jobs.py
index 75af1d5d5fb..e92dd35c402 100644
--- a/lib/galaxy/webapps/galaxy/api/jobs.py
+++ b/lib/galaxy/webapps/galaxy/api/jobs.py
@@ -231,7 +231,7 @@ class JobController(BaseAPIController, UsesLibraryMixinItems):
def __dictify_associations(self, trans, *association_lists):
rval = []
for association_list in association_lists:
- rval.extend(map(lambda a: self.__dictify_association(trans, a), association_list))
+ rval.extend(self.__dictify_association(trans, a) for a in association_list)
return rval
def __dictify_association(self, trans, job_dataset_association):
@@ -293,7 +293,7 @@ class JobController(BaseAPIController, UsesLibraryMixinItems):
raise exceptions.ObjectAttributeMissingException("No inputs defined")
inputs = payload.get('inputs', {})
# Find files coming in as multipart file data and add to inputs.
- for k, v in payload.iteritems():
+ for k, v in payload.items():
if k.startswith('files_') or k.startswith('__files_'):
inputs[k] = v
request_context = WorkRequestContext(app=trans.app, user=trans.user, history=trans.history)
diff --git a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
index 60f6e4833af..5b9d43bb134 100644
--- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
+++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
@@ -253,8 +253,8 @@ class ToolShedRepositoriesController(BaseAPIController):
# this is ever not the case, this code will need to be updated.
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry(self.app, tool_ids[0].split('/')[0])
found_repository = json.loads(util.url_get(tool_shed_url, params=dict(tool_ids=','.join(tool_ids)), pathspec=['api', 'repositories']))
- fr_keys = found_repository.keys()
- tsr_id = found_repository[fr_keys[0]]['repository_id']
+ fr_first_key = next(iter(found_repository.keys()))
+ tsr_id = found_repository[fr_first_key]['repository_id']
repository_data['current_changeset'] = found_repository['current_changeset']
repository_data['repository'] = json.loads(util.url_get(tool_shed_url, pathspec=['api', 'repositories', tsr_id]))
del found_repository['current_changeset']
@@ -537,7 +537,7 @@ class ToolShedRepositoriesController(BaseAPIController):
id=trans.security.encode_id(tool_shed_repository.id))
return tool_shed_repository_dict
if installed_tool_shed_repositories:
- return map(to_dict, installed_tool_shed_repositories)
+ return list(map(to_dict, installed_tool_shed_repositories))
message = "No repositories were installed, possibly because the selected repository has already been installed."
return dict(status="ok", message=message)
diff --git a/lib/galaxy/webapps/galaxy/api/tools.py b/lib/galaxy/webapps/galaxy/api/tools.py
index 691531d3c92..41578548888 100644
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -1,7 +1,8 @@
import logging
-import urllib
from json import dumps
+from six.moves.urllib.parse import unquote_plus
+
import galaxy.queue_worker
from galaxy import exceptions, managers, util, web
from galaxy.managers.collections_util import dictify_dataset_collection_instance
@@ -201,7 +202,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
lineage_dict = None
tool_shed_dependencies = tool.installed_tool_dependencies
if tool_shed_dependencies:
- tool_shed_dependencies_dict = map(to_dict, tool_shed_dependencies)
+ tool_shed_dependencies_dict = list(map(to_dict, tool_shed_dependencies))
else:
tool_shed_dependencies_dict = None
return {
@@ -209,7 +210,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
"tool_version": tool.version,
"dependency_shell_commands": tool.build_dependency_shell_commands(),
"lineage": lineage_dict,
- "requirements": map(to_dict, tool.requirements),
+ "requirements": list(map(to_dict, tool.requirements)),
"installed_tool_shed_dependencies": tool_shed_dependencies_dict,
"tool_dir": tool.tool_dir,
"tool_shed": tool.tool_shed,
@@ -326,19 +327,19 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
# Set up inputs.
inputs = payload.get('inputs', {})
# Find files coming in as multipart file data and add to inputs.
- for k, v in payload.iteritems():
+ for k, v in payload.items():
if k.startswith('files_') or k.startswith('__files_'):
inputs[k] = v
# for inputs that are coming from the Library, copy them into the history
input_patch = {}
- for k, v in inputs.iteritems():
+ for k, v in inputs.items():
if isinstance(v, dict) and v.get('src', '') == 'ldda' and 'id' in v:
ldda = trans.sa_session.query(trans.app.model.LibraryDatasetDatasetAssociation).get(self.decode_id(v['id']))
if trans.user_is_admin() or trans.app.security_agent.can_access_dataset(trans.get_current_user_roles(), ldda.dataset):
input_patch[k] = ldda.to_history_dataset_association(target_history, add_to_history=True)
- for k, v in input_patch.iteritems():
+ for k, v in input_patch.items():
inputs[k] = v
# TODO: encode data ids and decode ids.
@@ -375,7 +376,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
output_dict['output_name'] = output_name
rval['output_collections'].append(output_dict)
- for output_name, collection_instance in vars.get('implicit_collections', {}).iteritems():
+ for output_name, collection_instance in vars.get('implicit_collections', {}).items():
history = target_history or trans.history
output_dict = dictify_dataset_collection_instance(collection_instance, security=trans.security, parent=history)
output_dict['output_name'] = output_name
@@ -387,7 +388,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
# -- Helper methods --
#
def _get_tool(self, id, tool_version=None, user=None):
- id = urllib.unquote_plus(id)
+ id = unquote_plus(id)
tool = self.app.toolbox.get_tool(id, tool_version)
if not tool:
raise exceptions.ObjectNotFound("Could not find tool with id '%s'." % id)
@@ -466,7 +467,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
# TODO: need to handle updates to conditional parameters; conditional
# params are stored in dicts (and dicts within dicts).
new_inputs = payload['inputs']
- tool_params.update(dict([(key, dumps(value)) for key, value in new_inputs.items() if key in tool.inputs and new_inputs[key] is not None]))
+ tool_params.update(dict([(key, dumps(value)) for key, value in new_inputs.items() if key in tool.inputs and value is not None]))
tool_params = tool.params_from_strings(tool_params, self.app)
#
diff --git a/lib/galaxy/webapps/galaxy/api/toolshed.py b/lib/galaxy/webapps/galaxy/api/toolshed.py
index 2ecb92a5a99..b1ced878706 100644
--- a/lib/galaxy/webapps/galaxy/api/toolshed.py
+++ b/lib/galaxy/webapps/galaxy/api/toolshed.py
@@ -243,8 +243,8 @@ class ToolShedController(BaseAPIController):
# this is ever not the case, this code will need to be updated.
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry(self.app, tool_ids[0].split('/')[0])
found_repository = json.loads(util.url_get(tool_shed_url, params=dict(tool_ids=','.join(tool_ids)), pathspec=['api', 'repositories']))
- fr_keys = found_repository.keys()
- repository_id = found_repository[fr_keys[0]]['repository_id']
+ fr_first_key = next(iter(found_repository.keys()))
+ repository_id = found_repository[fr_first_key]['repository_id']
repository_data['current_changeset'] = found_repository['current_changeset']
repository_data['repository'] = json.loads(util.url_get(tool_shed_url, pathspec=['api', 'repositories', repository_id]))
del found_repository['current_changeset']
diff --git a/lib/galaxy/webapps/galaxy/controllers/admin.py b/lib/galaxy/webapps/galaxy/controllers/admin.py
index 417cbdeed36..4941f9941a9 100644
--- a/lib/galaxy/webapps/galaxy/controllers/admin.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin.py
@@ -1358,7 +1358,7 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP
if users:
if trans.request.method == 'GET':
return {
- 'message': 'Changes password(s) for: %s.' % ', '.join([user.email for user in users.itervalues()]),
+ 'message': 'Changes password(s) for: %s.' % ', '.join(user.email for user in users.values()),
'status' : 'info',
'inputs' : [{'name' : 'password', 'label' : 'New password', 'type' : 'password'},
{'name' : 'confirm', 'label' : 'Confirm password', 'type' : 'password'}]
@@ -1370,7 +1370,7 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP
return self.message_exception(trans, 'Use a password of at least 6 characters.')
elif password != confirm:
return self.message_exception(trans, 'Passwords do not match.')
- for user in users.itervalues():
+ for user in users.values():
user.set_password_cleartext(password)
trans.sa_session.add(user)
trans.sa_session.flush()
diff --git a/lib/galaxy/webapps/galaxy/controllers/async.py b/lib/galaxy/webapps/galaxy/controllers/async.py
index f002e29a553..bc9ff54a222 100644
--- a/lib/galaxy/webapps/galaxy/controllers/async.py
+++ b/lib/galaxy/webapps/galaxy/controllers/async.py
@@ -5,9 +5,9 @@ Upload class
from __future__ import absolute_import
import logging
-import urllib
import requests
+from six.moves.urllib.parse import urlencode
from galaxy import jobs, web
from galaxy.util import Params
@@ -75,10 +75,10 @@ class ASync(BaseUIController):
# Assume there is exactly one output file possible
TOOL_OUTPUT_TYPE = None
- for idx, obj in enumerate(tool.outputs.values()):
+ for key, obj in tool.outputs.items():
try:
TOOL_OUTPUT_TYPE = obj.format
- params[tool.outputs.keys()[idx]] = data.id
+ params[key] = data.id
break
except Exception:
# exclude outputs different from ToolOutput (e.g. collections) from the previous assumption
@@ -163,7 +163,7 @@ class ASync(BaseUIController):
url_join_char = '&'
else:
url_join_char = '?'
- url = "%s%s%s" % (url, url_join_char, urllib.urlencode(params.flatten()))
+ url = "%s%s%s" % (url, url_join_char, urlencode(params.flatten()))
log.debug("connecting to -> %s" % url)
trans.log_event("Async connecting to -> %s" % url)
text = requests.get(url).text.strip()
diff --git a/lib/galaxy/webapps/galaxy/controllers/data_manager.py b/lib/galaxy/webapps/galaxy/controllers/data_manager.py
index 9229842d289..95b65e4ce45 100644
--- a/lib/galaxy/webapps/galaxy/controllers/data_manager.py
+++ b/lib/galaxy/webapps/galaxy/controllers/data_manager.py
@@ -65,7 +65,7 @@ class DataManager(BaseUIController):
data_manager_json = {}
error_messages.append(escape("Unable to obtain data_table info for hda (%s): %s" % (hda.id, e)))
values = []
- for key, value in data_manager_json.get('data_tables', {}).iteritems():
+ for key, value in data_manager_json.get('data_tables', {}).items():
values.append((key, value))
data_manager_output.append(values)
return trans.fill_template("data_manager/view_job.mako", data_manager=data_manager, job=job, view_only=not_is_admin, hdas=hdas, data_manager_output=data_manager_output, message=message, status=status, error_messages=error_messages)
diff --git a/lib/galaxy/webapps/galaxy/controllers/dataset.py b/lib/galaxy/webapps/galaxy/controllers/dataset.py
index 15b0c1865db..c21cee44b9a 100644
--- a/lib/galaxy/webapps/galaxy/controllers/dataset.py
+++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py
@@ -1,10 +1,13 @@
import logging
import os
-import urllib
import paste.httpexceptions
from markupsafe import escape
from six import string_types, text_type
+from six.moves.urllib.parse import (
+ quote_plus,
+ unquote_plus
+)
from sqlalchemy import false, true
from galaxy import (
@@ -274,7 +277,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
return self.message_exception(trans, 'Please wait until this dataset finishes uploading before attempting to edit its metadata.')
# let's not overwrite the imported datatypes module with the variable datatypes?
# the built-in 'id' is overwritten in lots of places as well
- ldatatypes = [(dtype_name, dtype_name) for dtype_name, dtype_value in trans.app.datatypes_registry.datatypes_by_extension.iteritems() if dtype_value.allow_datatype_change]
+ ldatatypes = [(dtype_name, dtype_name) for dtype_name, dtype_value in trans.app.datatypes_registry.datatypes_by_extension.items() if dtype_value.allow_datatype_change]
ldatatypes.sort()
all_roles = [(r.name, trans.security.encode_id(r.id)) for r in trans.app.security_agent.get_legitimate_roles(trans, data.dataset, 'root')]
data_metadata = [(name, spec) for name, spec in data.metadata.spec.items()]
@@ -350,11 +353,10 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
permission_inputs = list()
if trans.user:
if data.dataset.actions:
- permitted_actions = trans.app.model.Dataset.permitted_actions.items()
in_roles = {}
for action, roles in trans.app.security_agent.get_permissions(data.dataset).items():
in_roles[action.action] = [trans.security.encode_id(role.id) for role in roles]
- for index, action in permitted_actions:
+ for index, action in trans.app.model.Dataset.permitted_actions.items():
if action == trans.app.security_agent.permitted_actions.DATASET_ACCESS:
help_text = action.description + ' NOTE: Users must have every role associated with this dataset in order to access it.'
else:
@@ -413,6 +415,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
if job_to_dataset_association.job.state not in [job_to_dataset_association.job.states.OK, job_to_dataset_association.job.states.ERROR, job_to_dataset_association.job.states.DELETED]:
return False
return True
+
message = None
status = 'success'
dataset_id = payload.get('dataset_id')
@@ -481,9 +484,8 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
if not trans.user:
return self.message_exception(trans, 'You must be logged in if you want to change permissions.')
if trans.app.security_agent.can_manage_dataset(trans.get_current_user_roles(), data.dataset):
- permitted_actions = trans.app.model.Dataset.permitted_actions.items()
payload_permissions = {}
- for action, key in permitted_actions:
+ for action in trans.app.model.Dataset.permitted_actions.keys():
payload_permissions[action] = [trans.security.decode_id(role_id) for role_id in util.listify(payload.get(action))]
# The user associated the DATASET_ACCESS permission on the dataset with 1 or more roles. We
# need to ensure that they did not associate roles that would cause accessibility problems.
@@ -727,7 +729,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
if 'display_url' not in kwd or 'redirect_url' not in kwd:
return trans.show_error_message('Invalid parameters specified for "display at" link, please contact a Galaxy administrator')
try:
- redirect_url = kwd['redirect_url'] % urllib.quote_plus(kwd['display_url'])
+ redirect_url = kwd['redirect_url'] % quote_plus(kwd['display_url'])
except Exception:
redirect_url = kwd['redirect_url'] # not all will need custom text
if trans.app.security_agent.dataset_is_public(data.dataset):
@@ -743,7 +745,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
"""Access to external display applications"""
# Build list of parameters to pass in to display application logic (app_kwds)
app_kwds = {}
- for name, value in dict(kwds).iteritems(): # clone kwds because we remove stuff as we go.
+ for name, value in dict(kwds).items(): # clone kwds because we remove stuff as we go.
if name.startswith("app_"):
app_kwds[name[len("app_"):]] = value
del kwds[name]
@@ -760,8 +762,8 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
else:
user_roles = []
# Decode application name and link name
- app_name = urllib.unquote_plus(app_name)
- link_name = urllib.unquote_plus(link_name)
+ app_name = unquote_plus(app_name)
+ link_name = unquote_plus(link_name)
if None in [app_name, link_name]:
return trans.show_error_message("A display application name and link name must be provided.")
if self._can_access_dataset(trans, data, additional_roles=user_roles):
@@ -1140,7 +1142,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
target_histories = [history]
if len(target_histories) != len(target_history_ids):
error_msg = error_msg + "You do not have permission to add datasets to %i requested histories. " % (len(target_history_ids) - len(target_histories))
- source_contents = map(trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get, decoded_dataset_ids)
+ source_contents = list(map(trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get, decoded_dataset_ids))
source_contents.extend(map(trans.sa_session.query(trans.app.model.HistoryDatasetCollectionAssociation).get, decoded_dataset_collection_ids))
source_contents.sort(key=lambda content: content.hid)
for content in source_contents:
diff --git a/lib/galaxy/webapps/galaxy/controllers/root.py b/lib/galaxy/webapps/galaxy/controllers/root.py
index 497e8b4ccb8..ca727ea6889 100644
--- a/lib/galaxy/webapps/galaxy/controllers/root.py
+++ b/lib/galaxy/webapps/galaxy/controllers/root.py
@@ -152,7 +152,7 @@ class RootController(controller.JSAppLauncher, UsesAnnotations):
if len(query) > 2:
search_results = trans.app.toolbox_search.search(query)
if 'tags[]' in kwd:
- results = filter(lambda x: x in results, search_results)
+ results = [x for x in search_results if x in results]
else:
results = search_results
return results
diff --git a/lib/galaxy/webapps/galaxy/controllers/user.py b/lib/galaxy/webapps/galaxy/controllers/user.py
index 4eafcbec22b..5d2a0eae80d 100644
--- a/lib/galaxy/webapps/galaxy/controllers/user.py
+++ b/lib/galaxy/webapps/galaxy/controllers/user.py
@@ -5,10 +5,10 @@ Contains the user interface in the Universe class
import logging
import random
import socket
-import urllib
from datetime import datetime, timedelta
from markupsafe import escape
+from six.moves.urllib.parse import unquote
from sqlalchemy import (
and_,
func,
@@ -853,7 +853,7 @@ class User(BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, Create
Check whether token fits the user and then activate the user's account.
"""
params = util.Params(kwd, sanitize=False)
- email = urllib.unquote(params.get('email', None))
+ email = unquote(params.get('email', None))
activation_token = params.get('activation_token', None)
if email is None or activation_token is None:
diff --git a/lib/galaxy/webapps/galaxy/controllers/workflow.py b/lib/galaxy/webapps/galaxy/controllers/workflow.py
index 6dc2965c3ad..e5b9ba020f6 100644
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -1,7 +1,6 @@
from __future__ import absolute_import
import base64
-import httplib
import json
import logging
import os
@@ -9,6 +8,7 @@ import sgmllib
import requests
from markupsafe import escape
+from six.moves.http_client import HTTPConnection
from sqlalchemy import and_
from sqlalchemy.orm import joinedload
from sqlalchemy.sql import expression
@@ -678,7 +678,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
auth_header = base64.b64encode('%s:%s' % (myexp_username, myexp_password))
headers = {"Content-type": "text/xml", "Accept": "text/xml", "Authorization": "Basic %s" % auth_header}
myexp_url = trans.app.config.get("myexperiment_url", self.__myexp_url)
- conn = httplib.HTTPConnection(myexp_url)
+ conn = HTTPConnection(myexp_url)
# NOTE: blocks web thread.
conn.request("POST", "/workflow.xml", request, headers)
response = conn.getresponse()
@@ -987,7 +987,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
# Extract just the output flags for this step.
p = "%s|otag|" % step.id
l = len(p)
- outputs = [k[l:] for (k, v) in kwargs.iteritems() if k.startswith(p)]
+ outputs = [k[l:] for (k, v) in kwargs.items() if k.startswith(p)]
if step.workflow_outputs:
for existing_output in step.workflow_outputs:
if existing_output.output_name not in outputs:
@@ -1058,10 +1058,10 @@ def _expand_multiple_inputs(kwargs):
input_combos = _extend_with_multiplied_combos(input_combos, multiplied_multi_inputs)
# Input name that are multiply specified
- multi_input_keys = matched_multi_inputs.keys() + multiplied_multi_inputs.keys()
+ multi_input_keys = list(matched_multi_inputs.keys()) + list(multiplied_multi_inputs.keys())
for input_combo in input_combos:
- for key, value in input_combo.iteritems():
+ for key, value in input_combo.items():
kwargs[key] = value
yield (kwargs, multi_input_keys)
@@ -1072,14 +1072,14 @@ def _extend_with_matched_combos(single_inputs, multi_inputs):
matched_multi_inputs = []
- first_multi_input_key = multi_inputs.keys()[0]
+ first_multi_input_key = next(iter(multi_inputs.keys()))
first_multi_value = multi_inputs.get(first_multi_input_key)
for value in first_multi_value:
new_inputs = _copy_and_extend_inputs(single_inputs, first_multi_input_key, value)
matched_multi_inputs.append(new_inputs)
- for multi_input_key, multi_input_values in multi_inputs.iteritems():
+ for multi_input_key, multi_input_values in multi_inputs.items():
if multi_input_key == first_multi_input_key:
continue
if len(multi_input_values) != len(first_multi_value):
@@ -1092,7 +1092,7 @@ def _extend_with_matched_combos(single_inputs, multi_inputs):
def _extend_with_multiplied_combos(input_combos, multi_inputs):
combos = input_combos
- for multi_input_key, multi_input_value in multi_inputs.iteritems():
+ for multi_input_key, multi_input_value in multi_inputs.items():
iter_combos = []
for combo in combos:
@@ -1112,7 +1112,7 @@ def _copy_and_extend_inputs(inputs, key, value):
def _split_inputs(kwargs):
"""
"""
- input_keys = filter(lambda a: a.endswith('|input'), kwargs)
+ input_keys = [a for a in kwargs if a.endswith('|input')]
single_inputs = {}
matched_multi_inputs = {}
multiplied_multi_inputs = {}
diff --git a/lib/galaxy/webapps/tool_shed/api/repositories.py b/lib/galaxy/webapps/tool_shed/api/repositories.py
index 916a02795a8..ae47508a7c4 100644
--- a/lib/galaxy/webapps/tool_shed/api/repositories.py
+++ b/lib/galaxy/webapps/tool_shed/api/repositories.py
@@ -1,12 +1,12 @@
import json
import logging
import os
-import StringIO
import tarfile
from cgi import FieldStorage
from collections import namedtuple
from time import strftime
+from six import StringIO
from sqlalchemy import and_, false
from galaxy import (
@@ -1075,7 +1075,7 @@ class RepositoriesController(BaseAPIController):
file_data = payload.get('file')
# Code stolen from gx's upload_common.py
if isinstance(file_data, FieldStorage):
- assert not isinstance(file_data.file, StringIO.StringIO)
+ assert not isinstance(file_data.file, StringIO)
assert file_data.file.name != ''
local_filename = util.mkstemp_ln(file_data.file.name, 'upload_file_data_')
file_data.file.close()
diff --git a/lib/galaxy/webapps/tool_shed/controllers/admin.py b/lib/galaxy/webapps/tool_shed/controllers/admin.py
index 96a571e7afd..e57b65c62c6 100644
--- a/lib/galaxy/webapps/tool_shed/controllers/admin.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/admin.py
@@ -46,7 +46,7 @@ class AdminController(BaseUIController, Admin):
**kwd))
elif operation == "repositories_by_user":
# Eliminate the current filters if any exist.
- for k, v in kwd.items():
+ for k, v in list(kwd.items()):
if k.startswith('f-'):
del kwd[k]
if 'user_id' in kwd:
@@ -61,7 +61,7 @@ class AdminController(BaseUIController, Admin):
kwd['f-email'] = repository.user.email
elif operation == "repositories_by_category":
# Eliminate the current filters if any exist.
- for k, v in kwd.items():
+ for k, v in list(kwd.items()):
if k.startswith('f-'):
del kwd[k]
category_id = kwd.get('id', None)
diff --git a/lib/galaxy/webapps/tool_shed/controllers/repository.py b/lib/galaxy/webapps/tool_shed/controllers/repository.py
index 1e27e8dbbab..04bc147abe0 100644
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -120,7 +120,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
operation = kwd['operation'].lower()
if operation in ["repositories_by_category", "repositories_by_user"]:
# Eliminate the current filters if any exist.
- for k, v in kwd.items():
+ for k, v in list(kwd.items()):
if k.startswith('f-'):
del kwd[k]
return trans.response.send_redirect(web.url_for(controller='repository',
@@ -274,7 +274,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
def browse_repositories_by_user(self, trans, **kwd):
"""Display the list of repositories owned by a specified user."""
# Eliminate the current search filters if any exist.
- for k, v in kwd.items():
+ for k, v in list(kwd.items()):
if k.startswith('f-'):
del kwd[k]
if 'operation' in kwd:
@@ -522,7 +522,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
operation = kwd['operation'].lower()
if operation in ["valid_repositories_by_category", "valid_repositories_by_user"]:
# Eliminate the current filters if any exist.
- for k, v in kwd.items():
+ for k, v in list(kwd.items()):
if k.startswith('f-'):
del kwd[k]
return trans.response.send_redirect(web.url_for(controller='repository',
@@ -560,7 +560,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
changeset_revision=latest_installable_changeset_revision))
elif operation == "valid_repositories_by_category":
# Eliminate the current filters if any exist.
- for k, v in kwd.items():
+ for k, v in list(kwd.items()):
if k.startswith('f-'):
del kwd[k]
category_id = kwd.get('id', None)
diff --git a/lib/galaxy/webapps/tool_shed/security/__init__.py b/lib/galaxy/webapps/tool_shed/security/__init__.py
index f67168e6a64..dfe719dcbbb 100644
--- a/lib/galaxy/webapps/tool_shed/security/__init__.py
+++ b/lib/galaxy/webapps/tool_shed/security/__init__.py
@@ -32,7 +32,7 @@ class RBACAgent:
When getting permitted actions from an untrusted source like a
form, ensure that they match our actual permitted actions.
"""
- return filter(lambda x: x is not None, [self.permitted_actions.get(action_string) for action_string in permitted_action_strings])
+ return [x for x in [self.permitted_actions.get(action_string) for action_string in permitted_action_strings] if x is not None]
def create_private_user_role(self, user):
raise Exception("Unimplemented Method")
@@ -46,7 +46,7 @@ class RBACAgent:
def get_actions(self):
"""Get all permitted actions as a list of Action objects"""
- return self.permitted_actions.__dict__.values()
+ return list(self.permitted_actions.__dict__.values())
def get_item_actions(self, action, item):
raise Exception('No valid method of retrieving action (%s) for item %s.' % (action, item))
diff --git a/lib/galaxy/webapps/tool_shed/util/hgweb_config.py b/lib/galaxy/webapps/tool_shed/util/hgweb_config.py
index b45bf887b20..5a52d423c78 100644
--- a/lib/galaxy/webapps/tool_shed/util/hgweb_config.py
+++ b/lib/galaxy/webapps/tool_shed/util/hgweb_config.py
@@ -1,10 +1,11 @@
-import ConfigParser
import logging
import os
import shutil
import threading
from datetime import date
+from six.moves import configparser
+
log = logging.getLogger(__name__)
new_hgweb_config_template = """
@@ -60,12 +61,12 @@ class HgWebConfigManager(object):
self.read_config()
try:
entry = self.in_memory_config.get('paths', lhs)
- except ConfigParser.NoOptionError:
+ except configparser.NoOptionError:
try:
# We have a multi-threaded front-end, so one of the threads may not have the latest version of the hgweb.config file.
self.read_config(force_read=True)
entry = self.in_memory_config.get('paths', lhs)
- except ConfigParser.NoOptionError:
+ except configparser.NoOptionError:
raise Exception("Entry for repository %s missing in file %s." % (lhs, self.hgweb_config))
return entry
@@ -92,7 +93,7 @@ class HgWebConfigManager(object):
def read_config(self, force_read=False):
if force_read or self.in_memory_config is None:
- config = ConfigParser.ConfigParser()
+ config = configparser.ConfigParser()
config.read(self.hgweb_config)
self.in_memory_config = config
diff --git a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
index 196a0178607..f8dc0ee5cd7 100644
--- a/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/recipe/step_handler.py
@@ -22,7 +22,7 @@ from tool_shed.util import basic_util, tool_dependency_util
log = logging.getLogger(__name__)
-VIRTUALENV_URL = 'https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.1.tar.gz'
+VIRTUALENV_URL = 'https://pypi.python.org/packages/d4/0c/9840c08189e030873387a73b90ada981885010dd9aea134d6de30cd24cb8/virtualenv-15.1.0.tar.gz'
class CompressedFile(object):
diff --git a/scripts/build_universe_config.py b/scripts/build_universe_config.py
index da54f11b10d..44c15be7c29 100644
--- a/scripts/build_universe_config.py
+++ b/scripts/build_universe_config.py
@@ -1,9 +1,10 @@
-from ConfigParser import ConfigParser
from os import listdir
from os.path import join
from re import match
from sys import argv
+from six.moves.configparser import ConfigParser
+
def merge():
"""
diff --git a/scripts/data_libraries/build_lucene_index.py b/scripts/data_libraries/build_lucene_index.py
index b3f787e8b02..d3464b8ec1e 100644
--- a/scripts/data_libraries/build_lucene_index.py
+++ b/scripts/data_libraries/build_lucene_index.py
@@ -9,13 +9,13 @@ details.
Run from the ~/scripts/data_libraries directory:
%sh build_lucene_index.sh
"""
-import ConfigParser
import csv
import os
import sys
-import urllib
import requests
+from six.moves.configparser import ConfigParser
+from six.moves.urllib.parse import urlencode
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'lib')))
@@ -39,7 +39,7 @@ def main(ini_file):
def build_index(search_url, dataset_file):
- url = "%s/index?%s" % (search_url, urllib.urlencode({"docfile": dataset_file}))
+ url = "%s/index?%s" % (search_url, urlencode({"docfile": dataset_file}))
requests.put(url)
@@ -89,7 +89,7 @@ def _get_folder_info(folder):
def get_sa_session(ini_file):
- conf_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
+ conf_parser = ConfigParser({'here': os.getcwd()})
conf_parser.read(ini_file)
kwds = dict()
for key, value in conf_parser.items("app:main"):
diff --git a/scripts/galaxy-main b/scripts/galaxy-main
index 9cb5b7da345..34ee54edaef 100755
--- a/scripts/galaxy-main
+++ b/scripts/galaxy-main
@@ -31,10 +31,7 @@ import threading
from argparse import ArgumentParser
from logging.config import fileConfig
-try:
- import ConfigParser as configparser
-except ImportError:
- import configparser
+from six.moves.configparser import ConfigParser
try:
from daemonize import Daemonize
@@ -219,7 +216,7 @@ class GalaxyConfigBuilder(object):
if not self.config_file:
return
if self.config_is_ini:
- raw_config = configparser.ConfigParser()
+ raw_config = ConfigParser()
raw_config.read([self.config_file])
if raw_config.has_section('loggers'):
config_file = os.path.abspath(self.config_file)
diff --git a/scripts/helper.py b/scripts/helper.py
index e05f4e8a457..af7150f7320 100644
--- a/scripts/helper.py
+++ b/scripts/helper.py
@@ -8,9 +8,10 @@ from __future__ import print_function
import os
import sys
-from ConfigParser import ConfigParser
from optparse import OptionParser
+from six.moves.configparser import ConfigParser
+
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, 'lib'))
from galaxy.model import mapping
diff --git a/scripts/loc_files/create_all_fasta_loc.py b/scripts/loc_files/create_all_fasta_loc.py
index 300813abf3b..3feefd17927 100644
--- a/scripts/loc_files/create_all_fasta_loc.py
+++ b/scripts/loc_files/create_all_fasta_loc.py
@@ -149,18 +149,6 @@ VARIANT_MAP = {'canon': 'Canonical',
'male': 'Male'}
-# alphabetize ignoring case
-def caseless_compare(a, b):
- au = a.upper()
- bu = b.upper()
- if au > bu:
- return 1
- elif au == bu:
- return 0
- elif au < bu:
- return -1
-
-
def __main__():
# command line variables
parser = optparse.OptionParser()
@@ -257,14 +245,13 @@ def __main__():
else:
unmatching_fasta_paths.append(os.path.join(dirpath, fn))
# remove redundant fasta files
- if variant_exclusions.keys():
- for k in variant_exclusions.keys():
- leave_in = '%s%s' % (genome_subdir, k)
- if leave_in in fasta_locs:
- to_remove = ['%s%s' % (genome_subdir, k) for k in variant_exclusions[k]]
- for tr in to_remove:
- if tr in fasta_locs:
- del fasta_locs[tr]
+ for k, v in variant_exclusions.items():
+ leave_in = '%s%s' % (genome_subdir, k)
+ if leave_in in fasta_locs:
+ to_remove = ['%s%s' % (genome_subdir, _) for _ in v]
+ for tr in to_remove:
+ if tr in fasta_locs:
+ del fasta_locs[tr]
# output results
print('\nThere were %s fasta files found that were not included because they did not have the expected file names.' % len(unmatching_fasta_paths))
@@ -286,8 +273,8 @@ def __main__():
else:
all_fasta_loc.write('%s\n' % open('%s.sample' % loc_path, 'rb').read().strip())
# output list of fasta files in alphabetical order
- fasta_bases = fasta_locs.keys()
- fasta_bases.sort(caseless_compare)
+ fasta_bases = list(fasta_locs.keys())
+ fasta_bases.sort(key=str.upper)
for fb in fasta_bases:
out_line = []
for col in col_values:
diff --git a/scripts/microbes/create_bacteria_loc_file.py b/scripts/microbes/create_bacteria_loc_file.py
index e3bdffc8408..2a352307997 100644
--- a/scripts/microbes/create_bacteria_loc_file.py
+++ b/scripts/microbes/create_bacteria_loc_file.py
@@ -20,25 +20,25 @@ def __main__():
this_base_dir, sub_dirs, files = result
for file in files:
if file[-5:] == ".info":
- dict = {}
+ tmp_dict = {}
info_file = open(os.path.join(this_base_dir, file), 'r')
info = info_file.readlines()
info_file.close()
for line in info:
fields = line.replace("\n", "").split("=")
- dict[fields[0]] = "=".join(fields[1:])
- if 'genome project id' in dict.keys():
- name = dict['genome project id']
- if 'build' in dict.keys():
- name = dict['build']
+ tmp_dict[fields[0]] = "=".join(fields[1:])
+ if 'genome project id' in tmp_dict.keys():
+ name = tmp_dict['genome project id']
+ if 'build' in tmp_dict.keys():
+ name = tmp_dict['build']
if name not in organisms.keys():
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
- for key in dict.keys():
- organisms[name][key] = dict[key]
+ for key in tmp_dict.keys():
+ organisms[name][key] = tmp_dict[key]
else:
- if dict['organism'] not in organisms.keys():
- organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
- organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
+ if tmp_dict['organism'] not in organisms.keys():
+ organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
+ organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
for org in organisms:
org = organisms[org]
# if no gpi, then must be a ncbi chr which corresponds to a UCSC org, w/o matching UCSC designation
diff --git a/scripts/microbes/create_bacteria_table.py b/scripts/microbes/create_bacteria_table.py
index 232bdfc9deb..20b6891b9b7 100644
--- a/scripts/microbes/create_bacteria_table.py
+++ b/scripts/microbes/create_bacteria_table.py
@@ -20,32 +20,31 @@ def __main__():
this_base_dir, sub_dirs, files = result
for file in files:
if file[-5:] == ".info":
- dict = {}
+ tmp_dict = {}
info_file = open(os.path.join(this_base_dir, file), 'r')
info = info_file.readlines()
info_file.close()
for line in info:
fields = line.replace("\n", "").split("=")
- dict[fields[0]] = "=".join(fields[1:])
- if 'genome project id' in dict.keys():
- name = dict['genome project id']
- if 'build' in dict.keys():
- name = dict['build']
+ tmp_dict[fields[0]] = "=".join(fields[1:])
+ if 'genome project id' in tmp_dict.keys():
+ name = tmp_dict['genome project id']
+ if 'build' in tmp_dict.keys():
+ name = tmp_dict['build']
if name not in organisms.keys():
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
- for key in dict.keys():
- organisms[name][key] = dict[key]
+ for key in tmp_dict.keys():
+ organisms[name][key] = tmp_dict[key]
else:
- if dict['organism'] not in organisms.keys():
- organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
- organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
+ if tmp_dict['organism'] not in organisms.keys():
+ organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
+ organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
- orgs = organisms.keys()
- for org in orgs:
- if 'name' not in organisms[org]:
- del organisms[org]
+ for org_name, org in list(organisms.items()):
+ if 'name' not in org:
+ del organisms[org_name]
- orgs = organisms.keys()
+ orgs = list(organisms.keys())
# need to sort by name
swap_test = False
for i in range(0, len(orgs) - 1):
@@ -58,8 +57,7 @@ def __main__():
print("||'''Organism'''||'''Kingdom'''||'''Group'''||'''Links to UCSC Archaea Browser'''||")
- for org in orgs:
- org = organisms[org]
+ for org in organisms.values():
at_ucsc = False
# if no gpi, then must be a ncbi chr which corresponds to a UCSC org, w/o matching UCSC designation
try:
diff --git a/scripts/microbes/create_nib_seq_loc_file.py b/scripts/microbes/create_nib_seq_loc_file.py
index a06446dd81d..bbb7a0e50c3 100644
--- a/scripts/microbes/create_nib_seq_loc_file.py
+++ b/scripts/microbes/create_nib_seq_loc_file.py
@@ -29,25 +29,25 @@ def __main__():
this_base_dir, sub_dirs, files = result
for file in files:
if file[-5:] == ".info":
- dict = {}
+ tmp_dict = {}
info_file = open(os.path.join(this_base_dir, file), 'r')
info = info_file.readlines()
info_file.close()
for line in info:
fields = line.replace("\n", "").split("=")
- dict[fields[0]] = "=".join(fields[1:])
- if 'genome project id' in dict.keys():
- name = dict['genome project id']
- if 'build' in dict.keys():
- name = dict['build']
+ tmp_dict[fields[0]] = "=".join(fields[1:])
+ if 'genome project id' in tmp_dict.keys():
+ name = tmp_dict['genome project id']
+ if 'build' in tmp_dict.keys():
+ name = tmp_dict['build']
if name not in organisms.keys():
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
- for key in dict.keys():
- organisms[name][key] = dict[key]
+ for key in tmp_dict.keys():
+ organisms[name][key] = tmp_dict[key]
else:
- if dict['organism'] not in organisms.keys():
- organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
- organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
+ if tmp_dict['organism'] not in organisms.keys():
+ organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
+ organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
for org in organisms:
org = organisms[org]
diff --git a/scripts/microbes/get_builds_lengths.py b/scripts/microbes/get_builds_lengths.py
index ee96cfebc3d..3f7fc93161a 100644
--- a/scripts/microbes/get_builds_lengths.py
+++ b/scripts/microbes/get_builds_lengths.py
@@ -20,25 +20,25 @@ def __main__():
this_base_dir, sub_dirs, files = result
for file in files:
if file[-5:] == ".info":
- dict = {}
+ tmp_dict = {}
info_file = open(os.path.join(this_base_dir, file), 'r')
info = info_file.readlines()
info_file.close()
for line in info:
fields = line.replace("\n", "").split("=")
- dict[fields[0]] = "=".join(fields[1:])
- if 'genome project id' in dict.keys():
- name = dict['genome project id']
- if 'build' in dict.keys():
- name = dict['build']
+ tmp_dict[fields[0]] = "=".join(fields[1:])
+ if 'genome project id' in tmp_dict.keys():
+ name = tmp_dict['genome project id']
+ if 'build' in tmp_dict.keys():
+ name = tmp_dict['build']
if name not in organisms.keys():
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
- for key in dict.keys():
- organisms[name][key] = dict[key]
+ for key in tmp_dict.keys():
+ organisms[name][key] = tmp_dict[key]
else:
- if dict['organism'] not in organisms.keys():
- organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
- organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
+ if tmp_dict['organism'] not in organisms.keys():
+ organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
+ organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
for org in organisms:
org = organisms[org]
# if no gpi, then must be a ncbi chr which corresponds to a UCSC org, w/o matching UCSC designation
diff --git a/scripts/microbes/harvest_bacteria.py b/scripts/microbes/harvest_bacteria.py
index 34418adcdf0..0eca08792bd 100644
--- a/scripts/microbes/harvest_bacteria.py
+++ b/scripts/microbes/harvest_bacteria.py
@@ -12,10 +12,10 @@ import time
from ftplib import FTP
import requests
-from BeautifulSoup import BeautifulSoup
from six.moves.urllib.request import urlretrieve
-from util import ( # noqa: I202
+from BeautifulSoup import BeautifulSoup # noqa: I100, I202
+from util import (
get_bed_from_genbank,
get_bed_from_GeneMark,
get_bed_from_GeneMarkHMM,
diff --git a/scripts/microbes/ncbi_to_ucsc.py b/scripts/microbes/ncbi_to_ucsc.py
index 522216df178..d4b81500f54 100644
--- a/scripts/microbes/ncbi_to_ucsc.py
+++ b/scripts/microbes/ncbi_to_ucsc.py
@@ -7,10 +7,11 @@ from __future__ import print_function
import os
import sys
-import urllib
from shutil import move
from xml.etree import ElementTree
+from six.moves.urllib.request import urlopen
+
def __main__():
base_dir = os.path.join(os.getcwd(), "bacteria")
@@ -24,29 +25,29 @@ def __main__():
this_base_dir, sub_dirs, files = result
for file in files:
if file[-5:] == ".info":
- dict = {}
+ tmp_dict = {}
info_file = open(os.path.join(this_base_dir, file), 'r')
info = info_file.readlines()
info_file.close()
for line in info:
fields = line.replace("\n", "").split("=")
- dict[fields[0]] = "=".join(fields[1:])
- if 'genome project id' in dict.keys():
- if dict['genome project id'] not in organisms.keys():
- organisms[dict['genome project id']] = {'chrs': {}, 'base_dir': this_base_dir}
- for key in dict.keys():
- organisms[dict['genome project id']][key] = dict[key]
+ tmp_dict[fields[0]] = "=".join(fields[1:])
+ if 'genome project id' in tmp_dict.keys():
+ if tmp_dict['genome project id'] not in organisms.keys():
+ organisms[tmp_dict['genome project id']] = {'chrs': {}, 'base_dir': this_base_dir}
+ for key in tmp_dict.keys():
+ organisms[tmp_dict['genome project id']][key] = tmp_dict[key]
else:
- if dict['organism'] not in organisms.keys():
- organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
- organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
+ if tmp_dict['organism'] not in organisms.keys():
+ organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
+ organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
# get UCSC data
URL = "http://archaea.ucsc.edu/cgi-bin/das/dsn"
try:
- page = urllib.urlopen(URL)
+ page = urlopen(URL)
except Exception:
print("#Unable to open " + URL)
print("?\tunspecified (?)")
@@ -65,7 +66,7 @@ def __main__():
for dsn in tree:
build = dsn.find("SOURCE").attrib['id']
try:
- org_page = urllib.urlopen("http://archaea.ucsc.edu/cgi-bin/hgGateway?db=" + build).read().replace("\n", "").split("
").append(t.title)))}),this.$cover[this.model.get("enabled")&&"hide"||"show"]()}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){Object.defineProperty(t,"__esModule",{value:!0});var a=i(4),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=e.View.extend({initialize:function(t){this.model=new e.Model({cls:"upload-ftp",class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o",class_partial:"upload-icon-button fa fa-minus-square-o",help_enabled:!0,help_text:"This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at "+t.ftp_upload_site+" using your Galaxy credentials.",collection:null,onchange:function(){},onadd:function(){},onremove:function(){}}).set(t),this.collection=this.model.get("collection"),this.setElement(this._template()),this.$content=this.$(".upload-ftp-content"),this.$wait=this.$(".upload-ftp-wait"),this.$help=this.$(".upload-ftp-help"),this.$number=this.$(".upload-ftp-number"),this.$disk=this.$(".upload-ftp-disk"),this.$body=this.$(".upload-ftp-body"),this.$warning=this.$(".upload-ftp-warning"),this.$select=this.$(".upload-ftp-select-all"),this.render()},render:function(){var e=this;this.$wait.show(),this.$content.hide(),this.$warning.hide(),this.$help.hide(),n.ajax({url:Galaxy.root+"api/remote_files",method:"GET",success:function(t){e.model.set("ftp_files",t),e._index(),e._renderTable()},error:function(){e._renderTable()}})},_renderTable:function(){var e=this,t=this.model.get("ftp_files");if(this.rows=[],t&&t.length>0){this.$body.empty();var i=0;s.each(t,function(t){e.rows.push(e._renderRow(t)),i+=t.size}),this.$number.html(t.length+" files"),this.$disk.html(o.default.bytesToString(i,!0)),this.collection&&(this.$("._has_collection").show(),this.$select.addClass(this.model.get("class_add")).off().on("click",function(){e._all()}),this._refresh()),this.$content.show()}else this.$warning.show();this.model.get("help_enabled")&&this.$help.show(),this.$wait.hide()},_renderRow:function(e){var t=this,i=this.model.attributes,s=n(this._templateRow(e)),a=s.find(".icon");if(this.$body.append(s),this.collection){var o=this.ftp_index[e.path];a.addClass(void 0===o?i.class_add:i.class_remove),s.on("click",function(){t._switch(a,e),t._refresh()})}else s.on("click",function(){i.onchange(e)});return a},_index:function(){var e=this;this.ftp_index={},this.collection&&this.collection.each(function(t){"ftp"==t.get("file_mode")&&(e.ftp_index[t.get("file_path")]=t.id)})},_all:function(){var e=this.model.attributes,t=this.model.get("ftp_files"),i=this.$select.hasClass(e.class_add);for(var n in t){var s=t[n],a=this.ftp_index[s.path];(void 0===a&&i||void 0!==a&&!i)&&this._switch(this.rows[n],s)}this._refresh()},_switch:function(e,t){e.removeClass();var i=this.model.attributes,n=this.ftp_index[t.path];if(void 0===n){var s=i.onadd(t);e.addClass(i.class_remove),this.ftp_index[t.path]=s}else i.onremove(n),e.addClass(i.class_add),this.ftp_index[t.path]=void 0},_refresh:function(){var e=s.reduce(this.ftp_index,function(e,t){return void 0!==t&&e++,e},0);this.$select.removeClass(),0==e?this.$select.addClass(this.model.get("class_add")):this.$select.addClass(e==this.rows.length?this.model.get("class_remove"):this.model.get("class_partial"))},_templateRow:function(e){return'
'+s.escape(e.path)+'
'+o.default.bytesToString(e.size)+'
'+e.ctime+"
"},_template:function(){return'
'+this.model.get("help_text")+'
Available files:
Name
Size
Created
Your FTP directory does not contain any files.
'}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(4),o=(s(a),i(15)),l=s(o);t.default=e.View.extend({initialize:function(t){this.model=new e.Model(t),this.setElement(""),this.render()},render:function(){var e=this.model.attributes,t=n.findWhere(e.list,{id:e.extension});this.extension_popup&&this.extension_popup.remove(),this.extension_popup=new l.default.View({placement:e.placement||"bottom",container:e.$el}),this.extension_popup.title(e.title),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(t)),this.extension_popup.show()},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (read more)'),t}return"There is no description available for this file extension."}})}).call(t,i(2),i(1))},function(e,t,i){"use strict";(function(e,t){!function(i){e.event.props.push("dataTransfer"),i.uploadpost=function(t){var n=i.extend({},{data:{},success:function(){},error:function(){},progress:function(){},url:null,maxfilesize:2048,error_filesize:"File exceeds 2GB. Please use a FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in."},t),s=n.data;if(s.error_message)return void n.error(s.error_message);var a=new FormData;for(var o in s.payload)a.append(o,s.payload[o]);var l=0;for(var o in s.files){var r=s.files[o];a.append(r.name,r.file,r.file.name),l+=r.file.size}if(l>1048576*n.maxfilesize)return void n.error(n.error_filesize);var d=new XMLHttpRequest;d.open("POST",n.url,!0),d.setRequestHeader("Accept","application/json"),d.setRequestHeader("Cache-Control","no-cache"),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.onreadystatechange=function(){if(d.readyState==d.DONE){var t=null,i="";if(d.responseText)try{t=e.parseJSON(d.responseText),i=t.err_msg}catch(e){t=d.responseText,i=t}if(d.status<200||d.status>299){var s=d.statusText;403==d.status?s=n.error_login:0==d.status?s=n.error_server:s||(s=n.error_default),n.error(s+" ("+d.status+"). "+i)}else n.success(t)}},d.upload.addEventListener("progress",function(e){e.lengthComputable&&n.progress(Math.round(100*e.loaded/e.total))},!1),Galaxy.emit.debug("uploadbox::uploadpost()","Posting following data.",n),d.send(a)},i.fn.uploadinput=function(e){var t=this,n=i.extend({},{ondragover:function(){},ondragleave:function(){},onchange:function(){},multiple:!1},e),s=i('");return t.append(s.change(function(e){n.onchange(e.target.files),i(this).val("")})),t.on("drop",function(e){n.ondragleave(e),e.dataTransfer&&(n.onchange(e.dataTransfer.files),e.preventDefault())}),t.on("dragover",function(e){e.preventDefault(),n.ondragover(e)}),t.on("dragleave",function(e){e.stopPropagation(),n.ondragleave(e)}),{dialog:function(){s.trigger("click")}}},i.fn.uploadbox=function(e){function n(e){if(e&&e.length&&!g){var i=void 0;return t.each(e,function(e,i){"new"!==e.mode&&t.filter(f,function(t){return t.name===e.name&&t.size===e.size}).length&&(e.duplicate=!0)}),t.each(e,function(e){e.duplicate||(i=String(p++),f[i]=e,h.announce(i,f[i]),m++)}),i}}function s(e){f[e]&&(delete f[e],m--)}function a(){if(0==m||_)return _=!1,g=!1,void h.complete();g=!0;var e=-1;for(var t in f){e=t;break}f[e];s(e),i.uploadpost({url:h.url,data:h.initialize(e),success:function(t){h.success(e,t),a()},error:function(t){h.error(e,t),a()},progress:function(t){h.progress(e,t)}})}function o(){v.dialog()}function l(e){for(e in f)s(e)}function r(){g||(g=!0,a())}function d(){_=!0}function c(e){return h=i.extend({},h,e)}function u(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}var h=i.extend({},{dragover:function(){},dragleave:function(){},announce:function(e){},initialize:function(e){},progress:function(e,t){},success:function(e,t){},error:function(e,t){alert(t)},complete:function(){}},e),f={},p=0,m=0,g=!1,_=!1,v=i(this).uploadinput({multiple:!0,onchange:function(e){n(e)},ondragover:e.ondragover,ondragleave:e.ondragleave});return{select:o,add:n,remove:s,start:r,stop:d,reset:l,configure:c,compatible:u}}}(e)}).call(t,i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var i=e.toJSON();return $(i,{defaultHideSourceItems:t,creationFn:function(t,i,n){return t=t.map(function(e){return{id:e.id,name:e.name,src:"dataset"===e.history_content_type?"hda":"hdca"}}),e.createHDCA(t,"list",i,n)}})}Object.defineProperty(t,"__esModule",{value:!0});var r=i(59),d=o(r),c=i(16),u=o(c),h=i(5),f=o(h),p=i(108),m=o(p),g=i(8),_=o(g),v=i(109),y=(o(v),i(3)),w=o(y);i(110);var b=e.View.extend(f.default.LoggableMixin).extend({_logNamespace:"collections",tagName:"li",className:"collection-element",initialize:function(e){this.element=e.element||{},this.selected=e.selected||!1},render:function(){this.dragStartHandler=n.bind(this._dragstart,this),this.dragEndHandler=n.bind(this._dragend,this);var e=this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})).get(0);return e.addEventListener("dragstart",this.dragStartHandler,!1),e.addEventListener("dragend",this.dragEndHandler,!1),this.selected&&this.$el.addClass("selected"),this},template:n.template(['',"<%- element.name %>","",'"].join("")),select:function(e){this.$el.toggleClass("selected",e),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var e=this,t=this.$el.parent().width();this.$el.animate({"margin-right":t},"fast",function(){e.trigger("discard",{source:e}),e.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(e){e.stopPropagation(),this.select(e)},_clickName:function(e){e.stopPropagation(),e.preventDefault();var t=([(0,w.default)("Enter a new name for the element"),":\n(",(0,w.default)("Note that changing the name here will not rename the dataset"),")"].join(""),prompt((0,w.default)("Enter a new name for the element")+":",this.element.name));t&&(this.element.name=t,this.render())},_clickDiscard:function(e){e.stopPropagation(),this.discard()},_dragstart:function(e){e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(e){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"DatasetCollectionElementView()"}}),x=e.View.extend(f.default.LoggableMixin).extend(m.default.CollectionCreatorMixin).extend({_logNamespace:"collections",elementViewClass:b,collectionClass:d.default.HistoryDatasetCollection,className:"list-collection-creator collection-creator flex-row-container",minElements:1,defaultAttributes:{creationFn:function(){throw new TypeError("no creation fn for creator")},oncreate:function(){},oncancel:function(){},autoscrollDist:24,highlightClr:"rgba( 64, 255, 255, 1.0 )"},footerSettings:{".hide-originals":"hideOriginals"},initialize:function(e){this.metric("ListCollectionCreator.initialize",e);var t=this;n.each(this.defaultAttributes,function(i,n){i=e[n]||i,t[n]=i}),t.initialElements=e.elements||[],this._setUpCommonSettings(e),this._instanceSetUp(),this._elementsSetUp(),this._setUpBehaviors()},_instanceSetUp:function(){this.selectedIds={},this.$dragging=null,this.blocking=!1},_elementsSetUp:function(){this.invalidElements=[],this.workingElements=[],this.elementViews=[],this.workingElements=this.initialElements.slice(0),this._ensureElementIds(),this._validateElements(),this._mangleDuplicateNames(),this._sortElements()},_ensureElementIds:function(){return this.workingElements.forEach(function(e){e.hasOwnProperty("id")||(e.id=n.uniqueId())}),this.workingElements},_validateElements:function(){var e=this;return e.invalidElements=[],this.workingElements=this.workingElements.filter(function(t){var i=e._isElementInvalid(t);return i&&e.invalidElements.push({element:t,text:i}),!i}),this.workingElements},_isElementInvalid:function(e){return"dataset"!==e.history_content_type?(0,w.default)("is not a dataset"):e.state===u.default.OK||n.contains(u.default.NOT_READY_STATES,e.state)?e.deleted||e.purged?(0,w.default)("has been deleted or purged"):null:(0,w.default)("has errored, is paused, or is not accessible")},_mangleDuplicateNames:function(){var e=1,t={};this.workingElements.forEach(function(i){for(var n=i.name;t.hasOwnProperty(n);)if(n=i.name+" ("+e+")",(e+=1)>=900)throw new Error("Safety hit in while loop - thats impressive");i.name=n,t[i.name]=!0})},_sortElements:function(e){},render:function(e,t){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(e,t){var i=this,s=a(""),o=i.$list();n.each(this.elementViews,function(e){e.destroy(),i.removeElementView(e)}),i.workingElements.forEach(function(e){var t=i._createElementView(e);s.append(t.$el)}),i._renderClearSelected(),o.empty().append(s.children()),n.invoke(i.elementViews,"render"),o.height()>o.css("max-height")?o.css("border-width","1px 0px 1px 0px"):o.css("border-width","0px")},_createElementView:function(e){var t=new this.elementViewClass({element:e,selected:n.has(this.selectedIds,e.id)});return this.elementViews.push(t),this._listenToElementView(t),t},_listenToElementView:function(e){var t=this;t.listenTo(e,{select:function(e){var i=e.source.element;e.selected?t.selectedIds[i.id]=!0:delete t.selectedIds[i.id],t.trigger("elements:select",e)},discard:function(e){t.trigger("elements:discard",e)}})},addElementView:function(e){},removeElementView:function(e){delete this.selectedIds[e.element.id],this._renderClearSelected(),this.elementViews=n.without(this.elementViews,e),this.stopListening(e)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(e){return e},createList:function(e){if(!this.workingElements.length){var t=(0,w.default)("No valid elements for final list")+". ";return t+=''+(0,w.default)("Cancel")+" ",t+=(0,w.default)("or"),t+=' '+(0,w.default)("start over")+".",void this._showAlert(t)}var i=this,n=this.workingElements.map(function(e){return i._elementToJSON(e)});return i.blocking=!0,i.creationFn(n,e,i.hideOriginals).always(function(){i.blocking=!1}).fail(function(e,t,n){i.trigger("error",{xhr:e,status:t,message:(0,w.default)("An error occurred while creating this collection")})}).done(function(e,t,n){i.trigger("collection:created",e,t,n),i.metric("collection:created",e),"function"==typeof i.oncreate&&i.oncreate.call(this,e,t,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(e){this._renderClearSelected()}),this.on("elements:discard",function(e){var t=e.source.element;this.removeElementView(e.source),this.workingElements=n.without(this.workingElements,t),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(e){this.error(e);var t=this,i=e.message||(0,w.default)("An error occurred");if(e.xhr){var n=e.xhr,s=e.message;0===n.readyState&&0===n.status?i+=": "+(0,w.default)("Galaxy could not be reached and may be updating.")+(0,w.default)(" Try again in a few minutes."):n.responseJSON?i+=":
",(0,w.default)(["Collections of datasets are permanent, ordered lists of datasets that can be passed to tools and ","workflows in order to have analyses done on each member of the entire group. This interface allows ","you to create a collection and re-order the final collection."].join("")),"
","
","
",(0,w.default)(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
","
",(0,w.default)(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
","
",(0,w.default)(["Reorder the list by clicking and dragging elements. Select multiple elements by clicking on ",'them and you can then move those selected by dragging the ',"entire group. Deselect them by clicking them again or by clicking the ",'the "Clear selected" link.'].join("")),"
","
",(0,w.default)(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
","
",(0,w.default)(['Click the "Cancel" button to exit the interface.'].join("")),"
","
","
",(0,w.default)(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"
"].join("")),invalidElements:n.template([(0,w.default)("The following selections could not be included due to problems:"),"
','',"<% if( _.size( problems ) ){ %>",(0,w.default)("The following selections could not be included due to problems"),":","
<% _.each( problems, function( problem ){ %>","
<%- problem.element.name %>: <%- problem.text %>
","<% }); %>
","<% } else if( _.size( elements ) < 1 ){ %>",(0,w.default)("No datasets were selected"),".","<% } %>"," ",(0,w.default)("At least one element is needed for the collection"),". ",(0,w.default)("You may need to "),'',(0,w.default)("cancel")," ",(0,w.default)("and reselect new elements"),".","","
"],"element");return e.extend({},d.default.DatasetListItemView.prototype.templates,{titleBar:t})}();var y=g.extend({className:g.prototype.className+" dataset-collection-element",_swapNewRender:function(e){g.prototype._swapNewRender.call(this,e);var t=this.model.get("state")||"ok";return this.$el.addClass("state-"+t),this.$el},toString:function(){return"NestedDCDCEListItemView("+(this.model?""+this.model:"(no model)")+")"}});t.default={DCListItemView:g,DCEListItemView:_,DatasetDCEListItemView:v,NestedDCDCEListItemView:y}}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(11),o=s(a),l=i(6),r=s(l),d=e.View.extend({initialize:function(t){this.model=new e.Model(t),this.url=this.model.get("url"),this.redirect=this.model.get("redirect"),this.setElement(""),this.render()},render:function(){var e=this;n.ajax({url:Galaxy.root+this.url,type:"GET"}).done(function(t){var i=n.extend({},e.model.attributes,t),s=new o.default({title:i.title,message:i.message,status:i.status||"warning",icon:i.icon,initial_errors:!0,errors:i.errors,inputs:i.inputs,buttons:{submit:new r.default.Button({tooltip:i.submit_tooltip,title:i.submit_title||"Save",icon:i.submit_icon||"fa-save",cls:"btn btn-primary ui-clear-float",onclick:function(){e._submit(s)}})}});e.$el.empty().append(s.$el)}).fail(function(t){e.$el.empty().append(new r.default.Message({message:"Failed to load resource "+e.url+".",status:"danger",persistent:!0}).$el)})},_submit:function(e){var t=this;n.ajax({url:Galaxy.root+t.url,data:JSON.stringify(e.data.create()),type:"PUT",contentType:"application/json"}).done(function(i){var s={};i.id?s.id=i.id:s={message:i.message,status:"success",persistent:!1},t.redirect?window.location=Galaxy.root+t.redirect+"?"+n.param(s):(e.data.matchModel(i,function(t,i){e.field_list[i].value(t.value)}),t._showMessage(e,success_message))}).fail(function(i){t._showMessage(e,{message:i.responseJSON.err_msg,status:"danger",persistent:!1})})},_showMessage:function(e,t){e.$el.parents().filter(function(){return-1!=["auto","scroll"].indexOf(n(this).css("overflow"))}).first().animate({scrollTop:0},500),e.message.update(t)}});t.default={View:d}}).call(t,i(2),i(0))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(16),l=a(o),r=i(5),d=a(r),c=i(3),u=a(c),h=d.default.SearchableModelMixin,f=e.Model.extend(d.default.LoggableMixin).extend(d.default.mixin(h,{_logNamespace:"dataset",defaults:{state:l.default.NEW,deleted:!1,purged:!1,name:"(unnamed dataset)",accessible:!0,data_type:"",file_ext:"",file_size:0,meta_files:[],misc_blurb:"",misc_info:"",tags:[]},initialize:function(e,t){this.debug(this+"(Dataset).initialize",e,t),
//!! this state is not in trans.app.model.Dataset.states - set it here -
-this.get("accessible")||this.set("state",l.default.NOT_VIEWABLE),this.urls=this._generateUrls(),this._setUpListeners()},_generateUrls:function(){var e=this.get("id");if(!e)return{};var t={purge:"datasets/"+e+"/purge_async",display:"datasets/"+e+"/display/?preview=True",edit:"datasets/edit?dataset_id="+e,download:"datasets/"+e+"/display"+this._downloadQueryParameters(),report_error:"dataset/errors?id="+e,rerun:"tool_runner/rerun?id="+e,show_params:"datasets/"+e+"/show_params",visualization:"visualization",meta_download:"dataset/get_metadata_file?hda_id="+e+"&metadata_name="};return n.each(t,function(e,i){t[i]=Galaxy.root+e}),this.urls=t,t},_downloadQueryParameters:function(){return"?to_ext="+this.get("file_ext")},_setUpListeners:function(){this.on("change:state",function(e,t){this.log(this+" has changed state:",e,t),this.inReadyState()&&this.trigger("state:ready",e,t,this.previous("state"))}),this.on("change:id change:file_ext",function(e){this._generateUrls()})},toJSON:function(){var t=e.Model.prototype.toJSON.call(this);return n.extend(t,{urls:this.urls})},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},inReadyState:function(){var e=n.contains(l.default.READY_STATES,this.get("state"));return this.isDeletedOrPurged()||e},hasDetails:function(){return!this.get("accessible")||this.has("annotation")},hasData:function(){return this.get("file_size")>0},fetch:function(t){var i=this;return e.Model.prototype.fetch.call(this,t).always(function(){i._generateUrls()})},parse:function(t,i){var n=e.Model.prototype.parse.call(this,t,i);return n.create_time&&(n.create_time=new Date(n.create_time)),n.update_time&&(n.update_time=new Date(n.update_time)),n},save:function(t,i){return i=i||{},i.wait=!!n.isUndefined(i.wait)||i.wait,e.Model.prototype.save.call(this,t,i)},delete:function(e){return this.get("deleted")?s.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?s.when():this.save({deleted:!1},e)},purge:function(e){if(this.get("purged"))return s.when();e=e||{},e.url=this.urls.purge;var t=this,i=s.ajax(e);return i.done(function(e,i,n){t.set({deleted:!0,purged:!0})}),i.fail(function(i,n,s){var a=(0,u.default)("Unable to purge dataset");i.responseJSON&&i.responseJSON.error?a=i.responseJSON.error:-1!==i.responseText.indexOf("Removal of datasets by users is not allowed in this Galaxy instance")&&(a="Removal of datasets by users is not allowed in this Galaxy instance"),i.responseText=a,t.trigger("error",t,i,e,(0,u.default)(a),{error:a})}),i},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var e=this.get("id")||"";return this.get("name")&&(e='"'+this.get("name")+'",'+e),"Dataset("+e+")"}})),p=e.Collection.extend(d.default.LoggableMixin).extend({_logNamespace:"dataset",model:f,urlRoot:Galaxy.root+"api/datasets",url:function(){return this.urlRoot},ids:function(){return this.map(function(e){return e.get("id")})},notReady:function(){return this.filter(function(e){return!e.inReadyState()})},haveDetails:function(){return this.all(function(e){return e.hasDetails()})},ajaxQueue:function(e,t){var i=s.Deferred(),n=this.length,a=[];if(!n)return i.resolve([]),i;var o=this.chain().reverse().map(function(s,l){return function(){var r=e.call(s,t);r.done(function(e){i.notify({curr:l,total:n,response:e,model:s})}),r.always(function(e){a.push(e),o.length?o.shift()():i.resolve(a)})}}).value();return o.shift()(),i},matches:function(e){return this.filter(function(t){return t.matches(e)})},toString:function(){return["DatasetAssociationCollection(",this.length,")"].join("")}});t.default={DatasetAssociation:f,DatasetAssociationCollection:p}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(16),a=(n(s),i(5)),o=(n(a),i(3)),l=(n(o),1e3);try{l=localStorage.getItem("collectionFuzzyCountDefault")||l}catch(e){}var r={defaults:{history_id:null,history_content_type:null,hid:null,visible:!0},idAttribute:"type_id",hidden:function(){return!this.get("visible")},isVisible:function(e,t){var i=!0;return e||!this.get("deleted")&&!this.get("purged")||(i=!1),t||this.get("visible")||(i=!1),i},urlRoot:Galaxy.root+"api/histories/",url:function(){var e=this.get("history_content_type"),t=this.get("history_id"),i=this.get("id"),n=""+this.urlRoot+t+"/contents/"+e+"s/"+i;return"dataset_collection"==e&&(n=n+"?view=element-reference&fuzzy_count="+l),n},hide:function(t){return this.get("visible")?this.save({visible:!1},t):e.when()},unhide:function(t){return this.get("visible")?e.when():this.save({visible:!0},t)},toString:function(){return[this.get("type_id"),this.get("hid"),this.get("name")].join(":")}};t.default={HistoryContentMixin:r}}).call(t,i(0))},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i={_validationWarning:function(e,t){"name"===e&&(e=this.$(".collection-name").add(this.$(".collection-name-prompt")),this.$(".collection-name").focus().select()),t?(e=e||this.$(".validation-warning"),e.removeClass("validation-warning")):e.addClass("validation-warning")},_changeHideOriginals:function(e){this.hideOriginals=this.$(".hide-originals").prop("checked")},_changeName:function(e){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(e){13!==e.keyCode||this.blocking||this._clickCreate()},_getName:function(){return e.escape(this.$(".collection-name").val())},_clickMoreHelp:function(e){e.stopPropagation(),this.$(".main-help").addClass("expanded"),this.$(".more-help").hide()},_clickLessHelp:function(e){e.stopPropagation(),this.$(".main-help").removeClass("expanded"),this.$(".more-help").show()},_toggleHelp:function(e){e.stopPropagation(),this.$(".main-help").toggleClass("expanded"),this.$(".more-help").toggle()},_showAlert:function(e,t){t=t||"alert-danger",this.$(".main-help").hide(),this.$(".header .alert").attr("class","alert alert-dismissable").addClass(t).show().find(".alert-message").html(e)},_hideAlert:function(e){this.$(".main-help").show(),this.$(".header .alert").hide()},_cancelCreate:function(e){"function"==typeof this.oncancel&&this.oncancel.call(this)},_clickCreate:function(e){var t=this._getName();t?this.blocking||this.createList(t):this._validationWarning("name")},_setUpCommonSettings:function(e){this.hideOriginals=e.defaultHideSourceItems||!1},_renderFooter:function(t,i){var n=this,s=this.$(".footer").empty().html(this.templates.footer());return e.each(this.footerSettings,function(e,t){n.$(t).prop("checked",n[e])}),"function"==typeof this.oncancel&&this.$(".cancel-create.btn").show(),s},_creatorTemplates:{main:e.template(['','',''].join(""))}};t.default={CollectionCreatorMixin:i}}).call(t,i(1))},function(e,t,i){"use strict";function n(e,t){var i=/(-?[0-9\.]+)/g,n=e.toString().toLowerCase()||"",s=t.toString().toLowerCase()||"",a=String.fromCharCode(0),o=n.replace(i,a+"$1"+a).split(a),l=s.replace(i,a+"$1"+a).split(a),r=new Date(n).getTime(),d=r?new Date(s).getTime():null;if(d){if(rd)return 1}for(var c,u,h=0,f=Math.max(o.length,l.length);hu)return 1}return 0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,i){"use strict";var n=i(0),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=s.default;s.default.fn.extend({hoverhighlight:function(e,t){return e=e||"body",this.length?(a(this).each(function(){var i=a(this),n=i.data("target");n&&i.mouseover(function(i){a(n,e).css({background:t})}).mouseout(function(e){a(n).css({background:""})})}),this):this}})},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=a(r),c=i(87),u=a(c),h=i(6),f=a(h),p=i(11),m=a(p),g=i(90),_=a(g),v=i(45),y=a(v),w=i(8),b=a(w),x=i(34),C=a(x),$=i(61),k=a($),S=e.View.extend({initialize:function(t){var i=this;this.modal=parent.Galaxy.modal||new b.default.View,this.model=t&&t.model||new e.Model(t),this.deferred=new u.default,this.setElement(n("").addClass("ui-form-composite").append(this.$message=n("")).append(this.$header=n("")).append(this.$steps=n(""))),n("body").append(this.$el),this._configure(),this.render(),n(window).resize(function(){i._refresh()})},_refresh:function(e){var t=s.reduce(this.$el.children(),function(e,t){return e+n(t).outerHeight()},0)-this.$steps.height()+90;this.$steps.css("height",n(window).height()-t)},_configure:function(){function e(e,n){for(var s,a=/\$\{(.+?)\}/g;s=a.exec(String(e));){var o=s[1];n(t.wp_inputs[o]=t.wp_inputs[o]||{label:o,name:o,type:"text",color:"hsl( "+100*++i+", 70%, 30% )",style:"ui-form-wp-source",links:[]})}}var t=this;this.forms=[],this.steps=[],this.links=[],this.parms=[],s.each(this.model.get("steps"),function(e,i){Galaxy.emit.debug("tool-form-composite::initialize()",i+" : Preparing workflow step.");var n=k.default[e.step_type],a=parseInt(i+1)+": "+(e.step_label||e.step_name);e.annotation&&(a+=" - "+e.annotation),e.step_version&&(a+=" (Galaxy Version "+e.step_version+")"),e=d.default.merge({index:i,fixed_title:s.escape(a),icon:n||"",help:null,citations:null,collapsible:!0,collapsed:i>0&&!t._isDataStep(e),sustain_version:!0,sustain_repeats:!0,sustain_conditionals:!0,narrow:!0,text_enable:"Edit",text_disable:"Undo",cls_enable:"fa fa-edit",cls_disable:"fa fa-undo",errors:e.messages,initial_errors:!0,cls:"ui-portlet-narrow",hide_operations:!0,needs_refresh:!1,always_refresh:"tool"!=e.step_type},e),t.steps[i]=e,t.links[i]=[],t.parms[i]={}}),s.each(this.steps,function(e,i){_.default.visitInputs(e.inputs,function(e,n){t.parms[i][n]=e})}),s.each(this.steps,function(e,i){s.each(e.output_connections,function(e){s.each(t.steps,function(n,s){n.step_index===e.input_step_index&&t.links[i].push(n)})})}),s.each(this.steps,function(e,i){s.each(t.steps,function(n,a){var o={};s.each(e.output_connections,function(e){n.step_index===e.input_step_index&&(o[e.input_name]=e)}),s.each(t.parms[a],function(t,n){var s=o[n];s&&(t.type="hidden",t.help=t.step_linked?t.help+", ":"",t.help+="Output dataset '"+s.output_name+"' from step "+(parseInt(i)+1),t.step_linked=t.step_linked||[],t.step_linked.push(e))})})});var i=0;this.wp_inputs={},s.each(this.steps,function(i,n){s.each(t.parms[n],function(t,n){e(t.value,function(e){e.links.push(i),t.wp_linked=!0,t.type="text",t.backdrop=!0,t.style="ui-form-wp-target"})}),s.each(i.post_job_actions,function(t){s.each(t.action_arguments,function(t){e(t,function(){})})})}),s.each(this.steps,function(e,i){if("tool"==e.step_type){var n=!0;_.default.visitInputs(e.inputs,function(i,s,a){var o=i.value&&"RuntimeValue"==i.value.__class__,l=-1!=["data","data_collection"].indexOf(i.type),r=a[i.data_ref];i.step_linked&&!t._isDataStep(i.step_linked)&&(n=!1),i.options&&(0==i.options.length&&!n||i.wp_linked)&&(i.is_workflow=!0),r&&(i.is_workflow=r.step_linked&&!t._isDataStep(r.step_linked)||i.wp_linked),(l||i.value&&"RuntimeValue"==i.value.__class__&&!i.step_linked)&&(e.collapsed=!1),o&&(i.value=i.default_value),i.flavor="workflow",o||l||"hidden"===i.type||i.wp_linked||(i.optional||!d.default.isEmpty(i.value)&&""!==i.value)&&(i.collapsible_value=i.value,i.collapsible_preview=!0)})}})},render:function(){var e=this;this.deferred.reset(),this._renderHeader(),this._renderMessage(),this._renderParameters(),this._renderHistory(),s.each(this.steps,function(t){e._renderStep(t)})},_renderHeader:function(){var e=this;this.execute_btn=new f.default.Button({icon:"fa-check",title:(0,l.default)("Run workflow"),cls:"btn btn-primary",onclick:function(){e._execute()}}),this.$header.addClass("ui-form-header").empty().append(new f.default.Label({title:"Workflow: "+this.model.get("name")}).$el).append(this.execute_btn.$el)},_renderMessage:function(){this.$message.empty(),this.model.get("has_upgrade_messages")&&this.$message.append(new f.default.Message({message:"Some tools in this workflow may have changed since it was last saved or some errors were found. The workflow may still run, but any new options will have default values. Please review the messages below to make a decision about whether the changes will affect your analysis.",status:"warning",persistent:!0,fade:!1}).$el);var e=this.model.get("step_version_changes");e&&e.length>0&&this.$message.append(new f.default.Message({message:"Some tools are being executed with different versions compared to those available when this workflow was last saved because the other versions are not or no longer available on this Galaxy instance. To upgrade your workflow and dismiss this message simply edit the workflow and re-save it.",status:"warning",persistent:!0,fade:!1}).$el)},_renderParameters:function(){var e=this;this.wp_form=null,s.isEmpty(this.wp_inputs)||(this.wp_form=new m.default({title:"Workflow Parameters",inputs:this.wp_inputs,cls:"ui-portlet-narrow",onchange:function(){s.each(e.wp_form.input_list,function(t,i){s.each(t.links,function(t){e._refreshStep(t)})})}}),this._append(this.$steps.empty(),this.wp_form.$el))},_renderHistory:function(){this.history_form=new m.default({cls:"ui-portlet-narrow",title:"History Options",inputs:[{type:"conditional",name:"new_history",test_param:{name:"check",label:"Send results to a new history",type:"boolean",value:"false",help:""},cases:[{value:"true",inputs:[{name:"name",label:"History name",type:"text",value:this.model.get("name")}]}]}]}),this._append(this.$steps,this.history_form.$el)},_renderStep:function(e){var t=this,i=null;this.deferred.execute(function(a){if(t.$steps.addClass("ui-steps"),"tool"==e.step_type)e.postchange=function(t,i){var s={tool_id:e.id,tool_version:e.version,inputs:n.extend(!0,{},i.data.create())};i.wait(!0),Galaxy.emit.debug("tool-form-composite::postchange()","Sending current state.",s),d.default.request({type:"POST",url:Galaxy.root+"api/tools/"+e.id+"/build",data:s,success:function(e){i.update(e),i.wait(!1),Galaxy.emit.debug("tool-form-composite::postchange()","Received new model.",e),t.resolve()},error:function(e){Galaxy.emit.debug("tool-form-composite::postchange()","Refresh request failed.",e),t.reject()}})},i=new y.default(e),e.post_job_actions&&e.post_job_actions.length&&i.portlet.append(n("").addClass("ui-form-element-disabled").append(n("").addClass("ui-form-title").html("Job Post Actions")).append(n("").addClass("ui-form-preview").html(s.reduce(e.post_job_actions,function(e,t){return e+" "+t.short_str},""))));else{var o=-1!=["data_input","data_collection_input"].indexOf(e.step_type);s.each(e.inputs,function(e){e.flavor="module",e.hide_label=o}),i=new m.default(d.default.merge({title:e.fixed_title,onchange:function(){s.each(t.links[e.index],function(e){t._refreshStep(e)})},inputs:e.inputs&&e.inputs.length>0?e.inputs:[{type:"hidden",name:"No options available.",ignore:null}]},e))}t.forms[e.index]=i,t._append(t.$steps,i.$el),t._refresh(),e.needs_refresh&&t._refreshStep(e),i.portlet[t.show_progress?"disable":"enable"](),t.show_progress&&t.execute_btn.model.set({wait:!0,wait_text:"Preparing...",percentage:100*(e.index+1)/t.steps.length}),Galaxy.emit.debug("tool-form-composite::initialize()",e.index+" : Workflow step state ready.",e),setTimeout(function(){a.resolve()},0)})},_refreshStep:function(e){var t=this,i=this.forms[e.index];i?(s.each(t.parms[e.index],function(e,n){if(e.step_linked||e.wp_linked){var a=i.field_list[i.data.match(n)];if(a){var o=void 0;if(e.step_linked)o={values:[]},s.each(e.step_linked,function(e){if(t._isDataStep(e)){var i=t.forms[e.index].data.create().input;i&&s.each(i.values,function(e){o.values.push(e)})}}),!e.multiple&&o.values.length>0&&(o={values:[o.values[0]]});else if(e.wp_linked){o=e.value;for(var l,r=/\$\{(.+?)\}/g;l=r.exec(e.value);){var d=t.wp_form.field_list[t.wp_form.data.match(l[1])],c=d&&d.value();c&&(o=o.split(l[0]).join(c))}}void 0!==o&&a.value(o)}}}),i.trigger("change")):e.needs_refresh=!0},_refreshHistory:function(){var e=this,t=parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.model;this._refresh_history&&clearTimeout(this._refresh_history),t&&t.refresh().success(function(){0===t.numOfUnfinishedShownContents()&&(e._refresh_history=setTimeout(function(){e._refreshHistory()},t.UPDATE_DELAY))})},_execute:function(){var e=this;this.show_progress=!0,this._enabled(!1),this.deferred.execute(function(t){setTimeout(function(){t.resolve(),e._submit()},0)})},_submit:function(){var e=this,t=this.history_form.data.create(),i={new_history_name:t["new_history|name"]?t["new_history|name"]:null,history_id:t["new_history|name"]?null:this.model.get("history_id"),replacement_params:this.wp_form?this.wp_form.data.create():{},parameters:{},parameters_normalized:!0,batch:!0},s=!0;for(var a in this.forms){var o=this.forms[a],r=o.data.create(),c=e.steps[a],u=c.step_index;o.trigger("reset");for(var h in r){var f=r[h],p=o.data.match(h),m=(o.field_list[p],o.input_list[p]);if(!m.step_linked){if(!(s=this._isDataStep(c)?f&&f.values&&f.values.length>0:m.optional||m.is_workflow&&""!==f||!m.is_workflow&&null!==f)){o.highlight(p);break}i.parameters[u]=i.parameters[u]||{},i.parameters[u][h]=r[h]}}if(!s)break}s?(Galaxy.emit.debug("tool-form-composite::submit()","Validation complete.",i),d.default.request({type:"POST",url:Galaxy.root+"api/workflows/"+this.model.id+"/invocations",data:i,success:function(t){if(Galaxy.emit.debug("tool-form-composite::submit","Submission successful.",t),e.$el.children().hide(),e.$el.append(e._templateSuccess(t)),n.isArray(t)&&t.length>0){e.$el.append(n("",{id:"webhook-view"}));new C.default.WebhookView({urlRoot:Galaxy.root+"api/webhooks/workflow",toolId:i.tool_id,toolVersion:i.tool_version})}e._refreshHistory()},error:function(t){Galaxy.emit.debug("tool-form-composite::submit","Submission failed.",t);var n=!1;if(t&&t.err_data)for(var s in e.forms){var a=e.forms[s],o=t.err_data[a.model.get("step_index")];if(o){var r=a.data.matchResponse(o);for(var d in r){a.highlight(d,r[d]),n=!0;break}}}n||e.modal.show({title:(0,l.default)("Workflow submission failed"),body:e._templateError(i,t&&t.err_msg),buttons:{Close:function(){e.modal.hide()}}})},complete:function(){e._enabled(!0)}})):(e._enabled(!0),Galaxy.emit.debug("tool-form-composite::submit()","Validation failed.",i))},_append:function(e,t){e.append("").append(t)},_enabled:function(e){this.execute_btn.model.set({wait:!e,wait_text:"Sending...",percentage:-1}),this.wp_form&&this.wp_form.portlet[e?"enable":"disable"](),this.history_form&&this.history_form.portlet[e?"enable":"disable"](),s.each(this.forms,function(t){t&&t.portlet[e?"enable":"disable"]()})},_isDataStep:function(e){for(var t=n.isArray(e)?e:[e],i=0;i0?n("").addClass("donemessagelarge").append(n("").html("Successfully invoked workflow "+d.default.sanitize(this.model.get("name"))+""+(e.length>1?" "+e.length+" times":"")+".")).append(n("").append("").text("You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered.")):this._templateError(e,"Invalid success response. No invocations found.")},_templateError:function(e,t){return n("").addClass("errormessagelarge").append(n("").text("The server could not complete the request. Please contact the Galaxy Team if this error persists. "+(JSON.stringify(t)||""))).append(n("").text(JSON.stringify(e,null,4)))}});t.default={View:S}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(8),l=a(o),r=i(113),d=a(r),c=i(3),u=a(c),h={defaultName:e.template("Copy of '<%- name %>'"),title:e.template((0,u.default)("Copying history")+' "<%- name %>"'),submitLabel:(0,u.default)("Copy"),errorMessage:(0,u.default)("History could not be copied."),progressive:(0,u.default)("Copying history"),activeLabel:(0,u.default)("Copy only the active, non-deleted datasets"),allLabel:(0,u.default)("Copy all datasets including deleted ones"),anonWarning:(0,u.default)("As an anonymous user, unless you login or register, you will lose your current history ")+(0,u.default)("after copying this history. "),_template:e.template(["<% if( isAnon ){ %>",'
";this.modal.$(".modal-body").empty().append(e).css({"margin-top":"8px"})},dialog:function(t,i,a){function o(){var e=t.$("#copy-modal-title").val();if(!e)return void t.$(".invalid-title").show();var n="copy-all"===t.$('input[name="copy-what"]:checked').val();t.$("button").prop("disabled",!0),l._showAjaxIndicator(),i.copy(!0,e,n).done(function(e){r.resolve(e)}).fail(function(t,s,a){var o={name:e,copyAllDatasets:n};d.default.ajaxErrorModal(i,t,o,l.errorMessage),r.rejectWith(r,arguments)}).done(function(){m&&t.hide()})}a=a||{};var l=this,r=n.Deferred(),c=a.nameFn||this.defaultName,h=c({name:i.get("name")}),f=a.allDatasets?"copy-all":"copy-non-deleted",p=!!e.isUndefined(a.allowAll)||a.allowAll,m=!!e.isUndefined(a.autoClose)||a.autoClose;this.modal=t;var g=a.closing_callback;return t.show(e.extend(a,{title:this.title({name:i.get("name")}),body:s(l._template({name:h,isAnon:Galaxy.user.isAnonymous(),allowAll:p,copyWhat:f,activeLabel:this.activeLabel,allLabel:this.allLabel,anonWarning:this.anonWarning})),buttons:e.object([[(0,u.default)("Cancel"),function(){t.hide()}],[this.submitLabel,o]]),height:"auto",closing_events:!0,closing_callback:function(e){e&&r.reject({cancelled:!0}),g&&g(e)}})),t.$("#copy-modal-title").focus().select(),t.$("#copy-modal-title").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),o())}),r}},f=e.extend({},h,{defaultName:e.template("imported: <%- name %>"),title:e.template((0,u.default)("Importing history")+' "<%- name %>"'),submitLabel:(0,u.default)("Import"),errorMessage:(0,u.default)("History could not be imported."),progressive:(0,u.default)("Importing history"),activeLabel:(0,u.default)("Import only the active, non-deleted datasets"),allLabel:(0,u.default)("Import all datasets including deleted ones"),anonWarning:(0,u.default)("As an anonymous user, unless you login or register, you will lose your current history ")+(0,u.default)("after importing this history. ")}),p=function(e,t){t=t||{};var i=window.parent.Galaxy.modal||new l.default.View({});return t.useImport?f.dialog(i,e,t):h.dialog(i,e,t)};t.default=p}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e,n){function s(t,i,n){return Galaxy.modal.show({title:i,body:t,closing_events:!0,buttons:{Ok:function(){Galaxy.modal.hide()}}}),Galaxy.modal.$el.addClass("error-modal"),n&&(Galaxy.modal.$(".error-details").add(Galaxy.modal.$('button:contains("Details")')).remove(),e("").addClass("error-details").hide().appendTo(Galaxy.modal.$(".modal-content")).append([e("").text(p),e("").text(JSON.stringify(n,null," "))]),e('").appendTo(Galaxy.modal.$(".buttons")).click(function(){Galaxy.modal.$(".error-details").toggle()})),Galaxy.modal}function a(e,t,i){if(e){if(e=(0,u.default)(e),t=(0,u.default)(t)||(0,u.default)("Error:"),window.Galaxy&&Galaxy.modal)return s(e,t,i);alert(t+"\n\n"+e),console.log("error details:",JSON.stringify(i))}}function o(){return a((0,u.default)("You appear to be offline. Please check your connection and try again."),(0,u.default)("Offline?"))}function l(){return a((0,u.default)("Galaxy is currently unreachable. Please try again in a few minutes.")+" "+h,(0,u.default)("Cannot connect to Galaxy"))}function r(e,t,i,n,s){return n=n||f,n+=" "+h,s=s||(0,u.default)("An error occurred"),a(n,s,d(e,t,i))}function d(e,t,i){return{raven:n.result(window.Raven,"lastEventId"),userAgent:navigator.userAgent,onLine:navigator.onLine,version:n.result(Galaxy.config,"version_major"),xhr:n.omit(t,n.functions(t)),options:n.omit(i,"xhr"),url:n.result(Galaxy.lastAjax,"url"),data:n.result(Galaxy.lastAjax,"data"),model:n.result(e,"toJSON",""+e),user:n.omit(n.result(Galaxy.user,"toJSON"),"email")}}Object.defineProperty(t,"__esModule",{value:!0});var c=i(3),u=function(e){return e&&e.__esModule?e:{default:e}}(c),h=(0,u.default)("Please contact a Galaxy administrator if the problem persists."),f=(0,u.default)("An error occurred while updating information with the server."),p=(0,u.default)("The following information can assist the developers in finding the source of the error:");t.default={errorModal:a,offlineErrorModal:o,badGatewayErrorModal:l,ajaxErrorModal:r}}).call(t,i(0),i(1))},function(e,t,i){"use strict";(function(e){function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0});var s=i(1),a=n(s),o=i(2),l=n(o),r=i(5),d=function(e){return e&&e.__esModule?e:{default:e}}(r),c=l.Collection.extend({initialize:function(e,t){l.Collection.prototype.initialize.call(this,e,t),this.setOrder(t.order||this.order,{silent:!0})},_setUpListeners:function(){return this.on({"changed-order":this.sort})},fetch:function(e){return e=this._buildFetchOptions(e),Galaxy.debug("fetch options:",e),l.Collection.prototype.fetch.call(this,e)},_buildFetchOptions:function(e){e=a.clone(e)||{};var t=this;e.traditional=!0,e.data=e.data||t._buildFetchData(e),Galaxy.debug("data:",e.data);var i=this._buildFetchFilters(e);return Galaxy.debug("filters:",i),a.isEmpty(i)||a.extend(e.data,this._fetchFiltersToAjaxData(i)),Galaxy.debug("data:",e.data),e},_buildFetchData:function(e){var t={};return this.order&&(t.order=this.order),a.defaults(a.pick(e,this._fetchParams),t)},_fetchParams:["order","limit","offset","view","keys"],_buildFetchFilters:function(e){return a.clone(e.filters||{})},_fetchFiltersToAjaxData:function(e){var t={q:[],qv:[]};return a.each(e,function(e,i){void 0!==e&&""!==e&&(!0===e&&(e="True"),!1===e&&(e="False"),null===e&&(e="None"),t.q.push(i),t.qv.push(e))}),t},reset:function(e,t){return this.allFetched=!1,l.Collection.prototype.reset.call(this,e,t)},order:null,comparators:{update_time:d.default.buildComparator("update_time",{ascending:!1}),"update_time-asc":d.default.buildComparator("update_time",{ascending:!0}),create_time:d.default.buildComparator("create_time",{ascending:!1}),"create_time-asc":d.default.buildComparator("create_time",{ascending:!0})},setOrder:function(e,t){t=t||{};var i=this,n=i.comparators[e];if(a.isUndefined(n))throw new Error("unknown order: "+e);if(n!==i.comparator)return i.order=e,i.comparator=n,t.silent||i.trigger("changed-order",t),i}}),u=c.extend({limitPerPage:500,initialize:function(e,t){c.prototype.initialize.call(this,e,t),this.currentPage=t.currentPage||0},getTotalItemCount:function(){return this.length},shouldPaginate:function(){return this.getTotalItemCount()>=this.limitPerPage},getLastPage:function(){return Math.floor(this.getTotalItemCount()/this.limitPerPage)},getPageCount:function(){return this.getLastPage()+1},getPageLimitOffset:function(e){return e=this.constrainPageNum(e),{limit:this.limitPerPage,offset:e*this.limitPerPage}},constrainPageNum:function(e){return Math.max(0,Math.min(e,this.getLastPage()))},fetchPage:function(e,t){var i=this;return e=i.constrainPageNum(e),i.currentPage=e,t=a.defaults(t||{},i.getPageLimitOffset(e)),i.trigger("fetching-more"),i.fetch(t).always(function(){i.trigger("fetching-more-done")})},fetchCurrentPage:function(e){return this.fetchPage(this.currentPage,e)},fetchPrevPage:function(e){return this.fetchPage(this.currentPage-1,e)},fetchNextPage:function(e){return this.fetchPage(this.currentPage+1,e)}}),h=c.extend({limitOnFirstFetch:null,limitPerFetch:100,initialize:function(e,t){c.prototype.initialize.call(this,e,t),this.limitOnFirstFetch=t.limitOnFirstFetch||this.limitOnFirstFetch,this.limitPerFetch=t.limitPerFetch||this.limitPerFetch,this.allFetched=!1,this.lastFetched=t.lastFetched||0},_buildFetchOptions:function(e){return e.remove=e.remove||!1,c.prototype._buildFetchOptions.call(this,e)},fetchFirst:function(e){return Galaxy.debug("ControlledFetchCollection.fetchFirst:",e),e=e?a.clone(e):{},this.allFetched=!1,this.lastFetched=0,this.fetchMore(a.defaults(e,{reset:!0,limit:this.limitOnFirstFetch}))},fetchMore:function(t){Galaxy.debug("ControlledFetchCollection.fetchMore:",t),t=a.clone(t||{});var i=this;if(Galaxy.debug("fetchMore, options.reset:",t.reset),!t.reset&&i.allFetched)return e.when();t.reset?t.offset=0:void 0===t.offset&&(t.offset=i.lastFetched);var n=t.limit=t.limit||i.limitPerFetch||null;return Galaxy.debug("fetchMore, limit:",n,"offset:",t.offset),i.trigger("fetching-more"),i.fetch(t).always(function(){i.trigger("fetching-more-done")}).done(function(e){var t=a.isArray(e)?e.length:0;i.lastFetched+=t,Galaxy.debug("fetchMore, lastFetched:",i.lastFetched),(!n||t1?this.renderItems():1===i.added.length?this.addItemView(n.first(i.added),e,t):1===i.removed.length?this.removeItemView(n.first(i.removed),e,t):void 0}}),this},_setUpViewListeners:function(){this.log(this+"._setUpViewListeners"),this.on({"view:selected":function(e,t){if(t&&t.shiftKey&&this.lastSelected){var i=this.viewFromModelId(this.lastSelected);i&&this.selectRange(e,i)}else t&&t.altKey&&!this.selecting&&this.showSelectors();this.selected.push(e.model.id),this.lastSelected=e.model.id},"view:de-selected":function(e,t){this.selected=n.without(this.selected,e.model.id)}})},render:function(e){this.log(this+".render",e);var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){this.debug(this+"(ListPanel)._buildNewRender");var e=s(this.templates.el({},this));return this._renderControls(e),this._renderTitle(e),this._renderSubtitle(e),this._renderSearch(e),this.renderItems(e),e},_renderControls:function(e){this.debug(this+"(ListPanel)._renderControls");var t=s(this.templates.controls({},this));return e.find(".controls").replaceWith(t),t},_renderTitle:function(e){},_renderSubtitle:function(e){},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;i.log("_queueNewRender:",e,t),s(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",this.className).append(e.children()),this.selecting&&this.showSelectors(0),this},_setUpBehaviors:function(e){return e=e||this.$el,this.$controls(e).find("[title]").tooltip(),this._renderMultiselectActionMenu(e),this},_renderMultiselectActionMenu:function(e){e=e||this.$el;var t=e.find(".list-action-menu"),i=this.multiselectActions();if(!i.length)return t.empty();var n=s(['
';if(s.errored()){return"a "+i+" with "+s.numInError()+" / "+o+" jobs in error"}if(s.terminal())return n;var l=s.states().running||0,r=s.states().ok||0,c=r/(1*o),u=l/(1*o),h=1-c-u;return'\n
\n '+(o&&o>1?o+" jobs":"a job")+" generating a "+i+'\n \n \n
\n
'}return'\n
\n Loading job data for '+i+'...\n
\n
'}return n},toString:function(){return"HDCAListItemView("+(this.model?""+this.model:"(no model)")+")"}});g.prototype.templates=function(){var t=e.extend({},m.prototype.templates.warnings,{hidden:function(e){e.visible||(0,p.default)("This collection has been hidden")}}),i=function(t){return'\n
'};return e.extend(e.clone(p.prototype.templates),{controls:t})}(),t.default={collectionTypeDescription:s,collectionDescription:a,CollectionView:m}}).call(t,i(1))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(16),o=s(a),l=i(66),r=s(l),d=i(39),c=s(d),u=i(124),h=s(u),f=i(21),p=s(f),m=i(5),g=s(m),_=i(3),v=s(_),y=r.default.DatasetListItemView,w=y.extend({initialize:function(e){y.prototype.initialize.call(this,e),this.hasUser=e.hasUser,this.purgeAllowed=e.purgeAllowed||!1,this.tagsEditorShown=e.tagsEditorShown||!1,this.annotationEditorShown=e.annotationEditorShown||!1},_renderPrimaryActions:function(){var e=y.prototype._renderPrimaryActions.call(this);return this.model.get("state")===o.default.NOT_VIEWABLE?e:y.prototype._renderPrimaryActions.call(this).concat([this._renderEditButton(),this._renderDeleteButton()])},_renderEditButton:function(){var t=this;if(this.model.get("state")===o.default.DISCARDED||!this.model.get("accessible"))return null;var i=this.model.get("purged"),n=this.model.get("deleted"),s={title:(0,v.default)("Edit attributes"),href:Galaxy.root+"datasets/edit?dataset_id="+this.model.attributes.id,faIcon:"fa-pencil",classes:"edit-btn",onclick:function(e){Galaxy.router&&(e.preventDefault(),Galaxy.router.push("datasets/edit",{dataset_id:t.model.attributes.id}))}};return n||i?(s.disabled=!0,i?s.title=(0,v.default)("Cannot edit attributes of datasets removed from disk"):n&&(s.title=(0,v.default)("Undelete dataset to edit attributes"))):e.contains([o.default.UPLOAD,o.default.NEW],this.model.get("state"))&&(s.disabled=!0,s.title=(0,v.default)("This dataset is not yet editable")),(0,p.default)(s)},_renderDeleteButton:function(){if(!this.model.get("accessible"))return null;var e=this,t=this.model.isDeletedOrPurged();return(0,p.default)({title:t?(0,v.default)("Dataset is already deleted"):(0,v.default)("Delete"),disabled:t,faIcon:"fa-times",classes:"delete-btn",onclick:function(){e.$el.find(".icon-btn.delete-btn").trigger("mouseout"),e.model.delete()}})},_renderDetails:function(){var t=y.prototype._renderDetails.call(this),i=this.model.get("state");return!this.model.isDeletedOrPurged()&&e.contains([o.default.OK,o.default.FAILED_METADATA],i)&&(this._renderTags(t),this._renderAnnotation(t),this._makeDbkeyEditLink(t)),this._setUpBehaviors(t),t},_renderToolHelpButton:function(){var e=this.model.attributes.dataset_id,t=this.model.attributes.creating_job,i=this,s=function(t){var s='
';t.name&&t.help?(s+="Tool help for "+t.name+"",s+=t.help):s+="Tool help is unavailable for this dataset.",s+="
",i.$el.find(".details").append(n.parseHTML(s))},a=function(e){n.ajax({url:Galaxy.root+"api/tools/"+e.tool_id+"/build"}).done(function(e){s(e)}).fail(function(){s({})})};return null===Galaxy.user.id?null:(0,p.default)({title:(0,v.default)("Tool Help"),classes:"icon-btn",href:"#",faIcon:"fa-question",onclick:function(){i.$el.find(".toolhelp").length>0?i.$el.find(".toolhelp").toggle():n.ajax({url:Galaxy.root+"api/jobs/"+t}).done(function(e){a(e)}).fail(function(){console.log('Failed at recovering job information from the Galaxy API for job id "'+t+'".')})}})},_renderSecondaryActions:function(){var e=y.prototype._renderSecondaryActions.call(this);switch(this.model.get("state")){case o.default.UPLOAD:case o.default.NOT_VIEWABLE:return e;case o.default.ERROR:return e.unshift(this._renderErrButton()),e.concat([this._renderRerunButton(),this._renderToolHelpButton()]);case o.default.OK:case o.default.FAILED_METADATA:return e.concat([this._renderRerunButton(),this._renderVisualizationsButton(),this._renderToolHelpButton()])}return e.concat([this._renderRerunButton(),this._renderToolHelpButton()])},_renderErrButton:function(){var e=this;return(0,p.default)({title:(0,v.default)("View or report this error"),href:Galaxy.root+"datasets/error?dataset_id="+this.model.attributes.id,classes:"report-error-btn",faIcon:"fa-bug",onclick:function(t){Galaxy.router&&(t.preventDefault(),Galaxy.router.push("datasets/error",{dataset_id:e.model.attributes.id}))}})},_renderRerunButton:function(){var e=this.model.get("creating_job");if(this.model.get("rerunnable"))return(0,p.default)({title:(0,v.default)("Run this job again"),href:this.model.urls.rerun,classes:"rerun-btn",target:this.linkTarget,faIcon:"fa-refresh",onclick:function(t){Galaxy.router&&(t.preventDefault(),Galaxy.router.push("/",{job_id:e}))}})},_renderVisualizationsButton:function(){var t=this.model.get("visualizations");if(this.model.isDeletedOrPurged()||!this.hasUser||!this.model.hasData()||e.isEmpty(t))return null;if(!e.isObject(t[0]))return this.warn("Visualizations have been switched off"),null;var i=n(this.templates.visualizations(t,this));return i.find('[target="galaxy_main"]').attr("target",this.linkTarget),this._addScratchBookFn(i.find(".visualization-link").addBack(".visualization-link")),i},_addScratchBookFn:function(e){e.click(function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:(0,v.default)("Visualization"),url:n(this).attr("href")}),e.preventDefault(),e.stopPropagation())})},_renderTags:function(e){if(this.hasUser){var t=this;this.tagsEditor=new c.default.TagsEditor({model:this.model,el:e.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.tagsEditorShown=!0},onhide:function(){t.tagsEditorShown=!1},$activator:(0,p.default)({title:(0,v.default)("Edit dataset tags"),classes:"tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".actions .right"))}),this.tagsEditorShown&&this.tagsEditor.toggle(!0)}},_renderAnnotation:function(e){if(this.hasUser){var t=this;this.annotationEditor=new h.default.AnnotationEditor({model:this.model,el:e.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.annotationEditorShown=!0},onhide:function(){t.annotationEditorShown=!1},$activator:(0,p.default)({title:(0,v.default)("Edit dataset annotation"),classes:"annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".actions .right"))}),this.annotationEditorShown&&this.annotationEditor.toggle(!0)}},_makeDbkeyEditLink:function(e){if("?"===this.model.get("metadata_dbkey")&&!this.model.isDeletedOrPurged()){var t=n('?').attr("href",this.model.urls.edit).attr("target","_top");e.find(".dbkey .value").replaceWith(t)}},events:e.extend(e.clone(y.prototype.events),{"click .undelete-link":"_clickUndeleteLink","click .purge-link":"_clickPurgeLink","click .edit-btn":function(e){this.trigger("edit",this,e)},"click .delete-btn":function(e){this.trigger("delete",this,e)},"click .rerun-btn":function(e){this.trigger("rerun",this,e)},"click .report-err-btn":function(e){this.trigger("report-err",this,e)},"click .visualization-btn":function(e){this.trigger("visualize",this,e)},"click .dbkey a":function(e){this.trigger("edit",this,e)}}),_clickUndeleteLink:function(e){return this.model.undelete(),!1},_clickPurgeLink:function(e){return confirm((0,v.default)("This will permanently remove the data in your dataset. Are you sure?"))&&this.model.purge(),!1},toString:function(){return"HDAEditView("+(this.model?""+this.model:"(no model)")+")"}});w.prototype.templates=function(){var t=e.extend({},y.prototype.templates.warnings,{failed_metadata:g.default.wrapTemplate(['<% if( dataset.state === "failed_metadata" ){ %>','
',"",(0,c.default)("Search did not match any tools."),"","
","
",'','','
',"",(0,c.default)("Workflows"),"","
",'
','',"
","
"].join("")},toString:function(){return"toolPanel"}}));t.default=h}).call(t,i(2),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),a=n(s),o=i(4),l=n(o),r=i(8),d=n(r),c=i(43),u=n(c),h=i(242),f=n(h),p=i(243),m=n(p),g=i(246),_=n(g),v=i(248),y=n(v);t.default=e.View.extend({options:{nginx_upload_path:"",ftp_upload_site:"n/a",default_genome:"?",default_extension:"auto",height:500,width:900,auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."}},list_extensions:[],list_genomes:[],initialize:function(e){var t=this;this.options=l.default.merge(e,this.options),this.ui_button=new f.default.View({onclick:function(e){e.preventDefault(),t.show()},onunload:function(){var e=t.ui_button.model.get("percentage",0);if(e>0&&e<100)return"Several uploads are queued."}}),this.setElement(this.ui_button.$el);var t=this;l.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(e){for(var i in e)t.list_extensions.push({id:e[i].extension,text:e[i].extension,description:e[i].description,description_url:e[i].description_url,composite_files:e[i].composite_files});t.list_extensions.sort(function(e,t){var i=e.text&&e.text.toLowerCase(),n=t.text&&t.text.toLowerCase();return i>n?1:ii.text?1:e.text0){var n={file_count:e.length,dbkey:e[0].get("genome","?"),file_type:e[0].get("extension","auto")};for(var s in e){var a=e[s];if(a.set("status","running"),!(a.get("file_size")>0)){i.error_message="Upload content incomplete.",a.set("status","error"),a.set("info",i.error_message);break}var o="files_"+s+"|";switch(n[o+"type"]="upload_dataset",n[o+"space_to_tab"]=a.get("space_to_tab")&&"Yes"||null,n[o+"to_posix_lines"]=a.get("to_posix_lines")&&"Yes"||null,n[o+"dbkey"]=a.get("genome",null),n[o+"file_type"]=a.get("extension",null),a.get("file_mode")){case"new":n[o+"url_paste"]=a.get("url_paste");break;case"ftp":n[o+"ftp_files"]=a.get("file_path");break;case"local":i.files.push({name:o+"file_data",file:a.get("file_data")})}}i.payload.inputs=JSON.stringify(n)}return i}})}).call(t,i(2))},function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),a=function(e){return e&&e.__esModule?e:{default:e}}(s),o=e.View.extend({initialize:function(t){var i=this;this.model=t&&t.model||new e.Model({icon:"fa-upload",tooltip:(0,a.default)("Download from URL or upload files from disk"),label:"Load Data",percentage:0,status:"",onunload:function(){},onclick:function(){}}).set(t),this.setElement(this._template()),this.$progress=this.$(".progress-bar"),this.listenTo(this.model,"change",this.render,this),this.render(),n(window).on("beforeunload",function(){return i.model.get("onunload")()})},render:function(){var e=this.model.attributes;this.$el.off("click").on("click",function(t){e.onclick(t)}).tooltip({title:this.model.get("tooltip"),placement:"bottom"}),this.$progress.removeClass().addClass("progress-bar").addClass("progress-bar-notransition").addClass(""!=e.status&&"progress-bar-"+e.status).css({width:e.percentage+"%"})},_template:function(){return'
'}});t.default={View:o}}).call(t,i(2),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=(a(r),i(29)),c=a(d),u=i(244),h=a(u),f=i(55),p=a(f),m=i(56),g=a(m),_=i(15),v=a(_),y=i(10),w=a(y),b=i(6),x=a(b),C=i(245),$=a(C);i(57),t.default=e.View.extend({upload_size:0,collection:new c.default.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.$uploadbox=this.$(".upload-box"),this.$uploadtable=this.$(".upload-table"),this.btnLocal=new x.default.Button({id:"btn-local",title:(0,l.default)("Choose local file"),onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new x.default.Button({id:"btn-ftp",title:(0,l.default)("Choose FTP file"),onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new x.default.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new x.default.Button({id:"btn-start",title:(0,l.default)("Start"),onclick:function(){t._eventStart()}}),this.btnStop=new x.default.Button({id:"btn-stop",title:(0,l.default)("Pause"),onclick:function(){t._eventStop()}}),this.btnReset=new x.default.Button({id:"btn-reset",title:(0,l.default)("Reset"),onclick:function(){t._eventReset()}}),this.btnClose=new x.default.Button({id:"btn-close",title:(0,l.default)("Close"),onclick:function(){t.app.modal.hide()}}),n.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$uploadbox.uploadbox({url:this.app.options.nginx_upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$uploadbox.addClass("highlight")},ondragleave:function(){t.$uploadbox.removeClass("highlight")}}),this.ftp=new v.default.View({title:(0,l.default)("FTP files"),container:this.btnFtp.$el}),this.select_extension=new w.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:n.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t._changeExtension(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){new g.default({$el:s(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new w.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t._changeGenome(e)}}),this.loader=new $.default({$container:this.$uploadbox,collection:this.collection,new_content:function(e){var i=new h.default(t,{model:e});return t.$uploadtable.find("> tbody:first").append(i.$el),i.render(),i}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this.render()},render:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running,s=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[n?"enable":"disable"](),this.btnFtp[n?"enable":"disable"](),this.btnCreate[n?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[s?"show":"hide"](),this.$(".upload-helper")[s?"hide":"show"]()},_eventAnnounce:function(e,t){this.counter.announce++;var i=new c.default.Model({id:e,file_name:t.name,file_size:t.size,file_mode:t.mode||"local",file_path:t.path,file_data:t});this.render(),this.collection.add(i)},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"success"}),this.ui_button.model.set("percentage",this._uploadPercentage(100,i.get("file_size"))),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.success++,this.render(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this.render()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this.render()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this.render()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new p.default({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){return e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(0!=this.counter.announce&&0==this.counter.running){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this._uploadFtp(),this.uploadbox.start(),this.render()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),s(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){if(0==this.counter.running){this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this.render()}},_changeExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},_changeGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_uploadFtp:function(){var e=this,t=[];this.collection.each(function(i){"queued"==i.get("status")&&"ftp"==i.get("file_mode")&&(e.uploadbox.remove(i.id),t.push(i))}),t.length>0&&s.uploadpost({data:this.app.toData(t),url:this.app.options.nginx_upload_path,success:function(i){n.each(t,function(t){e._eventSuccess(t.id)})},error:function(i){n.each(t,function(t){e._eventError(t.id,i)})}})},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(){return'
Drop files here
Name
Size
Type
Genome
Settings
Status
'}})}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=a(r),c=i(29),u=(a(c),i(54)),h=a(u),f=i(15),p=a(f),m=i(10),g=a(m);t.default=e.View.extend({status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template(t.model)),this.$mode=this.$(".upload-mode"),this.$title=this.$(".upload-title"),this.$text=this.$(".upload-text"),this.$size=this.$(".upload-size"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$text_content=this.$(".upload-text-content"),this.$settings=this.$(".upload-settings"),this.$symbol=this.$(".upload-symbol"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.settings=new p.default.View({title:(0,l.default)("Upload configuration"),container:this.$(".upload-settings"),placement:"bottom"});var s=this.app.select_genome.value(),a=this.app.select_extension.value();this.select_genome=new g.default.View({css:"upload-genome",data:i.app.list_genomes,container:this.$(".upload-genome"),value:s,onchange:function(e){i.model.set("genome",e)}}),this.select_extension=new g.default.View({css:"upload-extension",data:i.app.list_extensions,container:this.$(".upload-extension"),value:a,onchange:function(e){i.model.set("extension",e)}}),this.model.set({genome:s,extension:a}),this.$symbol.on("click",function(){i._removeRow()}),this.$(".upload-extension-info").on("click",function(e){i.app.showExtensionInfo({$el:n(e.target),title:i.select_extension.text(),extension:i.select_extension.value()})}).on("mousedown",function(e){e.preventDefault()}),this.$settings.on("click",function(e){i._showSettings()}).on("mousedown",function(e){e.preventDefault()}),this.$text_content.on("change input",function(e){i.model.set({url_paste:n(e.target).val(),file_size:n(e.target).val().length})}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:genome",function(){i._refreshGenome()}),this.listenTo(this.model,"change:extension",function(){i._refreshExtension()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()})},render:function(){this._refreshType(),this._refreshPercentage(),this._refreshStatus(),this._refreshInfo(),this._refreshGenome(),this._refreshExtension(),this._refreshFileSize()},remove:function(){this.select_genome.remove(),this.select_extension.remove(),e.View.prototype.remove.apply(this)},_refreshType:function(){var e=this.model.attributes;this.$title.html(s.escape(e.file_name)),this.$size.html(d.default.bytesToString(e.file_size)),this.$mode.removeClass().addClass("upload-mode").addClass("text-primary"),"new"==e.file_mode?(this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$mode.addClass("fa fa-edit")):"local"==e.file_mode?this.$mode.addClass("fa fa-laptop"):"ftp"==e.file_mode&&this.$mode.addClass("fa fa-folder-open-o")},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("Failed: "+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$progress_bar.css({width:e+"%"}),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$symbol.removeClass().addClass("upload-symbol").addClass(this.status_classes[e]),this.model.set("enabled","init"==e);var t=this.model.get("enabled");this.$text_content.attr("disabled",!t),t?(this.select_genome.enable(),this.select_extension.enable()):(this.select_genome.disable(),this.select_extension.disable()),"success"==e&&(this.$el.addClass("success"),this.$percentage.html("100%")),"error"==e&&(this.$el.addClass("danger"),this.$info_progress.hide())},_refreshFileSize:function(){this.$size.html(d.default.bytesToString(this.model.get("file_size")))},_removeRow:function(){-1!==["init","success","error"].indexOf(this.model.get("status"))&&this.app.collection.remove(this.model)},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new h.default(this).$el),this.settings.show())},_template:function(e){return'
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
 
0%
'}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,i,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e.View.extend({initialize:function(e){this.$container=e.$container,this.collection=e.collection,this.new_content=e.new_content,this.max=e.max||50,this.content_list={},this.$message=i("").addClass("ui-limitloader").append("...only the first "+this.max+" entries are visible."),this.$container.append(this.$message),this.listenTo(this.collection,"reset",this._reset,this),this.listenTo(this.collection,"add",this._refresh,this),this.listenTo(this.collection,"remove",this._remove,this)},_done:function(){var e=n.size(this.content_list)>this.max;return this.$message[e?"show":"hide"](),e},_reset:function(){n.each(this.content_list,function(e){e.remove()}),this.content_list={},this.$message.hide()},_remove:function(e){var t=e.id,i=this.content_list[t];i&&(i.remove(),delete this.content_list[t]),this._refresh()},_refresh:function(){if(!this._done())for(var e in this.collection.models){var t=this.collection.models[e];this.content_list[t.id];if(!this.content_list[t.id]){var i=this.new_content(t);if(this.content_list[t.id]=i,this._done())break}}}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=(a(r),i(29)),c=a(d),u=i(247),h=a(u),f=i(56),p=a(f),m=i(15),g=(a(m),i(10)),_=a(g),v=i(6),y=a(v);t.default=e.View.extend({collection:new c.default.Collection,initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.btnStart=new y.default.Button({title:(0,l.default)("Start"),onclick:function(){t._eventStart()}}),this.btnClose=new y.default.Button({title:(0,l.default)("Close"),onclick:function(){t.app.modal.hide()}}),n.each([this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.select_extension=new _.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:n.filter(this.list_extensions,function(e){return e.composite_files}),onchange:function(e){t.collection.reset();var i=n.findWhere(t.list_extensions,{id:e});i&&i.composite_files&&n.each(i.composite_files,function(e){t.collection.add({id:t.collection.size(),file_desc:e.description||e.name})})}}),this.$(".upload-footer-extension-info").on("click",function(e){new p.default({$el:s(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new _.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome}),this.listenTo(this.collection,"add",function(e){t._eventAnnounce(e)}),this.listenTo(this.collection,"change add",function(){t.render()}),this.select_extension.options.onchange(this.select_extension.value()),this.render()},render:function(){var e=this.collection.first();e&&"running"==e.get("status")?(this.select_genome.disable(),this.select_extension.disable()):(this.select_genome.enable(),this.select_extension.enable()),this.collection.where({status:"ready"}).length==this.collection.length&&this.collection.length>0?(this.btnStart.enable(),this.btnStart.$el.addClass("btn-primary")):(this.btnStart.disable(),this.btnStart.$el.removeClass("btn-primary")),this.$(".upload-table")[this.collection.length>0?"show":"hide"]()},_eventAnnounce:function(e){var t=new h.default(this,{model:e});this.$(".upload-table > tbody:first").append(t.$el),this.$(".upload-table")[this.collection.length>0?"show":"hide"](),t.render()},_eventStart:function(){var e=this;this.collection.each(function(t){t.set({genome:e.select_genome.value(),extension:e.select_extension.value()})}),s.uploadpost({url:this.app.options.nginx_upload_path,data:this.app.toData(this.collection.filter()),success:function(t){e._eventSuccess(t)},error:function(t){e._eventError(t)},progress:function(t){e._eventProgress(t)}})},_eventProgress:function(e){this.collection.each(function(t){t.set("percentage",e)})},_eventSuccess:function(e){this.collection.each(function(e){e.set("status","success")}),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e){this.collection.each(function(t){t.set({status:"error",info:e})})},_template:function(){return'
Description
Name
Size
Settings
Status
'}})}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=a(r),c=i(54),u=a(c),h=i(55),f=a(h),p=i(15),m=a(p),g=i(6),_=a(g),v=i(10);a(v);i(57),t.default=e.View.extend({status_classes:{init:"upload-mode fa fa-exclamation text-primary",ready:"upload-mode fa fa-check text-success",running:"upload-mode fa fa-spinner fa-spin",success:"upload-mode fa fa-check",error:"upload-mode fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template()),this.$source=this.$(".upload-source"),this.$settings=this.$(".upload-settings"),this.$status=this.$(".upload-status"),this.$text=this.$(".upload-text"),this.$text_content=this.$(".upload-text-content"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$file_name=this.$(".upload-file-name"),this.$file_desc=this.$(".upload-file-desc"),this.$file_size=this.$(".upload-file-size"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.uploadinput=this.$el.uploadinput({ondragover:function(){i.model.get("enabled")&&i.$el.addClass("warning")},ondragleave:function(){i.$el.removeClass("warning")},onchange:function(e){"running"!=i.model.get("status")&&e&&e.length>0&&(i.model.reset({file_data:e[0],file_name:e[0].name,file_size:e[0].size,file_mode:e[0].mode||"local"}),i._refreshReady())}}),this.button_menu=new _.default.ButtonMenu({icon:"fa-caret-down",title:(0,l.default)("Select"),pull:"left"}),this.$source.append(this.button_menu.$el),this.button_menu.addMenu({icon:"fa-laptop",title:(0,l.default)("Choose local file"),onclick:function(){i.uploadinput.dialog()}}),this.app.ftp_upload_site&&this.button_menu.addMenu({icon:"fa-folder-open-o",title:(0,l.default)("Choose FTP file"),onclick:function(){i._showFtp()}}),this.button_menu.addMenu({icon:"fa-edit",title:"Paste/Fetch data",onclick:function(){i.model.reset({file_mode:"new",file_name:"New File"})}}),this.ftp=new m.default.View({title:"Choose FTP file:",container:this.$source.find(".ui-button-menu"),placement:"right"}),this.settings=new m.default.View({title:(0,l.default)("Upload configuration"),container:this.$settings,placement:"bottom"}),this.$text_content.on("change input",function(e){i.model.set({url_paste:n(e.target).val(),file_size:n(e.target).val().length}),i._refreshReady()}),this.$settings.on("click",function(e){i._showSettings()}).on("mousedown",function(e){e.preventDefault()}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:file_name",function(){i._refreshFileName()}),this.listenTo(this.model,"change:file_mode",function(){i._refreshMode()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()}),this.listenTo(this.model,"remove",function(){i.remove()}),this.app.collection.on("reset",function(){i.remove()})},render:function(){this.$el.attr("id","upload-row-"+this.model.id),this.$file_name.html(s.escape(this.model.get("file_name")||"-")),this.$file_desc.html(this.model.get("file_desc")||"Unavailable"),this.$file_size.html(d.default.bytesToString(this.model.get("file_size"))),this.$status.removeClass().addClass(this.status_classes.init)},remove:function(){e.View.prototype.remove.apply(this)},_refreshReady:function(){this.app.collection.each(function(e){e.set("status",e.get("file_size")>0&&"ready"||"init")})},_refreshMode:function(){"new"==this.model.get("file_mode")?(this.height=this.$el.height(),this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$text_content.val("").trigger("keyup")):(this.$el.height(this.height),this.$text.hide())},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("Failed: "+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));0!=e?this.$progress_bar.css({width:e+"%"}):(this.$progress_bar.addClass("no-transition"),this.$progress_bar.css({width:"0%"}),this.$progress_bar[0].offsetHeight,this.$progress_bar.removeClass("no-transition")),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$status.removeClass().addClass(this.status_classes[e]),this.model.set("enabled","running"!=e),this.$text_content.attr("disabled",!this.model.get("enabled")),this.$el.removeClass("success danger warning"),"running"!=e&&"ready"!=e||this.model.set("percentage",0),this.$source.find(".button")["running"==e?"addClass":"removeClass"]("disabled"),"success"==e&&(this.$el.addClass("success"),this.model.set("percentage",100),this.$percentage.html("100%")),"error"==e?(this.$el.addClass("danger"),this.model.set("percentage",0),this.$info_progress.hide(),this.$info_text.show()):(this.$info_progress.show(),this.$info_text.hide())},_refreshFileName:function(){this.$file_name.html(this.model.get("file_name")||"-")},_refreshFileSize:function(){this.$file_size.html(d.default.bytesToString(this.model.get("file_size")))},_showFtp:function(){if(this.ftp.visible)this.ftp.hide();else{var e=this;this.ftp.empty(),this.ftp.append(new f.default({ftp_upload_site:this.app.ftp_upload_site,onchange:function(t){e.ftp.hide(),"running"!=e.model.get("status")&&t&&(e.model.reset({file_mode:"ftp",file_name:t.path,file_size:t.size,file_path:t.path}),e._refreshReady())}}).$el),this.ftp.show()}},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new u.default(this).$el),this.settings.show())},_template:function(){return'
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
0%
'}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=(a(r),i(29)),c=a(d),u=i(249),h=a(u),f=i(55),p=a(f),m=i(56),g=a(m),_=i(15),v=a(_),y=i(10),w=a(y),b=i(6),x=a(b),C=i(58);a(C);i(57),t.default=e.View.extend({upload_size:0,collection:new c.default.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.btnLocal=new x.default.Button({id:"btn-local",title:(0,l.default)("Choose local files"),onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new x.default.Button({id:"btn-ftp",title:(0,l.default)("Choose FTP files"),onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new x.default.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new x.default.Button({id:"btn-start",title:(0,l.default)("Start"),onclick:function(){t._eventStart()}}),this.btnBuild=new x.default.Button({id:"btn-build",title:(0,l.default)("Build"),onclick:function(){t._eventBuild()}}),this.btnStop=new x.default.Button({id:"btn-stop",title:(0,l.default)("Pause"),onclick:function(){t._eventStop()}}),this.btnReset=new x.default.Button({id:"btn-reset",title:(0,l.default)("Reset"),onclick:function(){t._eventReset()}}),this.btnClose=new x.default.Button({id:"btn-close",title:(0,l.default)("Close"),onclick:function(){t.app.modal.hide()}}),n.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnBuild,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$(".upload-box").uploadbox({url:this.app.options.nginx_upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$(".upload-box").addClass("highlight")},ondragleave:function(){t.$(".upload-box").removeClass("highlight")}}),this.ftp=new v.default.View({title:(0,l.default)("FTP files"),container:this.btnFtp.$el}),this.select_extension=new w.default.View({css:"upload-footer-selection-compressed",container:this.$(".upload-footer-extension"),data:n.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t.updateExtension(e)}}),this.collectionType="list",this.select_collection=new w.default.View({css:"upload-footer-selection-compressed",container:this.$(".upload-footer-collection-type"),data:[{id:"list",text:"List"},{id:"paired",text:"Paired"},{id:"list:paired",text:"List of Pairs"}],value:"list",onchange:function(e){t.updateCollectionType(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){new g.default({$el:s(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new w.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t.updateGenome(e)}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this._updateScreen()},_eventAnnounce:function(e,t){this.counter.announce++;var i=new c.default.Model({id:e,file_name:t.name,file_size:t.size,file_mode:t.mode||"local",file_path:t.path,file_data:t,extension:this.select_extension.value(),genome:this.select_genome.value()});this.collection.add(i);var n=new h.default(this,{model:i});this.$(".upload-table > tbody:first").append(n.$el),this._updateScreen(),n.render()},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=n.pluck(t.outputs,"hid"),s=this.collection.get(e);s.set({percentage:100,status:"success",hids:i}),this.ui_button.model.set("percentage",this._uploadPercentage(100,s.get("file_size"))),this.upload_completed+=100*s.get("file_size"),this.counter.announce--,this.counter.success++,this._updateScreen(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this._updateScreen()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this._updateScreen()},_eventBuild:function(){var e=[];n.forEach(this.collection.models,function(t){e.push.apply(e,t.get("hids"))});var t=n.map(e,function(e){return Galaxy.currHistoryPanel.collection.getByHid(e)}),i=new Galaxy.currHistoryPanel.collection.constructor(t);i.historyId=Galaxy.currHistoryPanel.collection.historyId,Galaxy.currHistoryPanel.buildCollection(this.collectionType,i,!0),this.counter.running=0,this._updateScreen(),this._eventReset(),this.app.modal.hide()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this._updateScreen()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new p.default({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){return e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(!(0==this.counter.announce||this.counter.running>0)){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this.uploadbox.start(),this._updateScreen()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),s(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){0==this.counter.running&&(this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this._updateScreen())},updateExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},updateCollectionType:function(e){this.collectionType=e},updateGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_updateScreen:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running&&0==this.counter.announce&&this.counter.success>0&&0==this.counter.error,s=0==this.counter.running,a=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnBuild[n?"enable":"disable"](),this.btnBuild.$el[n?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[s?"enable":"disable"](),this.btnFtp[s?"enable":"disable"](),this.btnCreate[s?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[a?"show":"hide"](),this.$(".upload-helper")[a?"hide":"show"]()},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(){return'
Drop files here
Name
Size
Status
'}})}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=a(r),c=i(29),u=(a(c),i(54)),h=a(u),f=i(15),p=a(f),m=i(10);a(m);t.default=e.View.extend({status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template(t.model)),this.$mode=this.$(".upload-mode"),this.$title=this.$(".upload-title-extended"),this.$text=this.$(".upload-text"),this.$size=this.$(".upload-size"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$text_content=this.$(".upload-text-content"),this.$symbol=this.$(".upload-symbol"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.settings=new p.default.View({title:(0,l.default)("Upload configuration"),container:this.$(".upload-settings"),placement:"bottom"});this.app.select_genome.value(),this.app.select_extension.value();this.$symbol.on("click",function(){i._removeRow()}),this.$text_content.on("change input",function(e){i.model.set({url_paste:n(e.target).val(),file_size:n(e.target).val().length})}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()}),this.listenTo(this.model,"remove",function(){i.remove()}),this.app.collection.on("reset",function(){i.remove()})},render:function(){var e=this.model.attributes;this.$title.html(s.escape(e.file_name)),this.$size.html(d.default.bytesToString(e.file_size)),this.$mode.removeClass().addClass("upload-mode").addClass("text-primary"),"new"==e.file_mode?(this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$mode.addClass("fa fa-edit")):"local"==e.file_mode?this.$mode.addClass("fa fa-laptop"):"ftp"==e.file_mode&&this.$mode.addClass("fa fa-folder-open-o")},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("Failed: "+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$progress_bar.css({width:e+"%"}),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$symbol.removeClass().addClass("upload-symbol").addClass(this.status_classes[e]),this.model.set("enabled","init"==e);var t=this.model.get("enabled");this.$text_content.attr("disabled",!t),"success"==e&&(this.$el.addClass("success"),this.$percentage.html("100%")),"error"==e&&(this.$el.addClass("danger"),this.$info_progress.hide())},_refreshFileSize:function(){this.$size.html(d.default.bytesToString(this.model.get("file_size")))},_removeRow:function(){-1!==["init","success","error"].indexOf(this.model.get("status"))&&this.app.collection.remove(this.model)},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new h.default(this).$el),this.settings.show())},_template:function(e){return'
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
0%
'}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(6),a=n(s),o=i(251),l=n(o),r=i(252),d=n(r),c=i(3),u=n(c),h=e.View.extend({initialize:function(t,i){var n=this;this.userIsAnonymous=Galaxy.user.isAnonymous(),this.allow_user_dataset_purge=i.config.allow_user_dataset_purge,this.root=i.root,this.historyView=new d.default.CurrentHistoryView({className:d.default.CurrentHistoryView.prototype.className+" middle",purgeAllowed:this.allow_user_dataset_purge,linkTarget:"galaxy_main"}),Galaxy.currHistoryPanel=this.historyView,Galaxy.currHistoryPanel.listenToGalaxy(Galaxy),this.buttonRefresh=new a.default.ButtonLink({id:"history-refresh-button",title:(0,u.default)("Refresh history"),cls:"panel-header-button",icon:"fa fa-refresh",onclick:function(){n.historyView.loadCurrentHistory()}}),this.buttonOptions=new a.default.ButtonLink({id:"history-options-button",title:(0,u.default)("History options"),cls:"panel-header-button",target:"galaxy_main",icon:"fa fa-cog",href:this.root+"root/history_options"}),this.buttonViewMulti=new a.default.ButtonLink({id:"history-view-multi-button",title:(0,u.default)("View all histories"),cls:"panel-header-button",icon:"fa fa-columns",href:this.root+"history/view_multiple"}),this.model=new e.Model({cls:"history-right-panel",title:(0,u.default)("History"),buttons:[this.buttonRefresh,this.buttonOptions,this.buttonViewMulti]}),this.setElement(this._template()),this.historyView.setElement(this.$el),this.historyView.connectToQuotaMeter(Galaxy.quotaMeter),this.historyView.loadCurrentHistory(),Galaxy.listenTo(this.historyView,"history-size-change",function(){Galaxy.user.fetch({url:Galaxy.user.urlRoot()+"/"+(Galaxy.user.id||"current")})})},render:function(){this.optionsMenu=(0,l.default)(this.buttonOptions.$el,{anonymous:this.userIsAnonymous,purgeAllowed:this.allow_user_dataset_purge,root:this.root}),this.buttonViewMulti.$el[this.userIsAnonymous?"hide":"show"]()},_template:function(e){return[''].join("")},toString:function(){return"historyPanel"}});t.default=h}).call(t,i(2))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,i){return n.clone(m).filter(function(n){return!(e&&!n.anon)&&(!(!t&&n.purge)&&(n.href&&(n.href=i+n.href,n.target=n.target||"galaxy_main"),n.confirm&&(n.func=function(){confirm(n.confirm)&&(galaxy_main.location=n.href)}),!0))})}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),l=s(o),r=i(112),d=s(r),c=i(5),u=(s(c),i(3)),h=s(u),f=i(34),p=s(f),m=[{html:(0,h.default)("History Lists"),header:!0},{html:(0,h.default)("Saved Histories"),href:"histories/list",target:"_top"},{html:(0,h.default)("Histories Shared with Me"),href:"histories/list_shared",target:"_top"},{html:(0,h.default)("Current History"),header:!0,anon:!0},{html:(0,h.default)("Create New"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.createNewHistory()}},{html:(0,h.default)("Copy History"),func:function(){(0,d.default)(Galaxy.currHistoryPanel.model).done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Share or Publish"),href:"history/sharing"},{html:(0,h.default)("Show Structure"),href:"history/display_structured",anon:!0},{html:(0,h.default)("Extract Workflow"),href:"workflow/build_from_current_history"},{html:(0,h.default)("Delete"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,h.default)("Really delete the current history?"))&&Galaxy.currHistoryPanel.model._delete().done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Delete Permanently"),purge:!0,anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,h.default)("Really delete the current history permanently? This cannot be undone."))&&Galaxy.currHistoryPanel.model.purge().done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Dataset Actions"),header:!0,anon:!0},{html:(0,h.default)("Copy Datasets"),href:"dataset/copy_datasets"},{html:(0,h.default)("Dataset Security"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/permissions?id="+Galaxy.currHistoryPanel.model.id)}},{html:(0,h.default)("Resume Paused Jobs"),href:"history/resume_paused_jobs?current=True",anon:!0},{html:(0,h.default)("Collapse Expanded Datasets"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.collapseAll()}},{html:(0,h.default)("Unhide Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,h.default)("Really unhide all hidden datasets?"))&&e.post(Galaxy.root+"history/adjust_hidden",{user_action:"unhide"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Delete Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,h.default)("Really delete all hidden datasets?"))&&e.post(Galaxy.root+"history/adjust_hidden",{user_action:"delete"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Purge Deleted Datasets"),confirm:(0,h.default)("Really delete all deleted datasets permanently? This cannot be undone."),href:"history/purge_deleted_datasets",purge:!0,anon:!0},{html:(0,h.default)("Downloads"),header:!0},{html:(0,h.default)("Export Tool Citations"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/citations?id="+Galaxy.currHistoryPanel.model.id)}},{html:(0,h.default)("Export History to File"),href:"history/export_archive?preview=True",anon:!0},{html:(0,h.default)("Other Actions"),header:!0},{html:(0,h.default)("Import from File"),href:"histories/import",target:"_top"}];p.default.add({url:"api/webhooks/history-menu/all",async:!1,callback:function(t){var i=[];e.each(t.models,function(e,t){var n=t.toJSON();n.activate&&i.push({html:(0,h.default)(n.config.title),anon:!0})}),i.length>0&&(i.unshift({html:(0,h.default)("Webhooks"),header:!0}),e.merge(m,i))}});var g=function(e,t){t=t||{};var i=void 0===t.anonymous||t.anonymous,n=t.purgeAllowed||!1,s=a(i,n,Galaxy.root);return new l.default(e,s)};t.default=g}).call(t,i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(62),l=(a(o),i(254)),r=a(l),d=i(5),c=a(d),u=i(3),h=a(u),f=c.default.SessionStorageModel.extend({defaults:{tagsEditorShown:!1,annotationEditorShown:!1,scrollPosition:0},toString:function(){return"HistoryViewPrefs("+JSON.stringify(this.toJSON())+")"}});f.storageKey=function(){return"history-panel"};var p=r.default.HistoryViewEdit,m=p.extend({className:p.prototype.className+" current-history-panel",HDCAViewClass:p.prototype.HDCAViewClass.extend({foldoutStyle:"drilldown"}),emptyMsg:[(0,h.default)("This history is empty"),". ",(0,h.default)("You can "),'',(0,h.default)("load your own data"),"",(0,h.default)(" or "),'',(0,h.default)("get data from an external source"),""].join(""),initialize:function(t){t=t||{},this.preferences=new f(e.extend({id:f.storageKey()},e.pick(t,e.keys(f.prototype.defaults)))),p.prototype.initialize.call(this,t),this.panelStack=[],this.currentContentId=t.currentContentId||null},_setUpListeners:function(){p.prototype._setUpListeners.call(this);var e=this;this.on("new-model",function(){e.preferences.set("scrollPosition",0)})},loadCurrentHistory:function(){return this.loadHistory(null,{url:Galaxy.root+"history/current_history_json"})},switchToHistory:function(e,t){return Galaxy.user.isAnonymous()?(this.trigger("error",(0,h.default)("You must be logged in to switch histories"),(0,h.default)("Anonymous user")),n.when()):this.loadHistory(e,{url:Galaxy.root+"history/set_as_current?id="+e})},createNewHistory:function(e){return Galaxy.user.isAnonymous()?(this.trigger("error",(0,h.default)("You must be logged in to create histories"),(0,h.default)("Anonymous user")),n.when()):this.loadHistory(null,{url:Galaxy.root+"history/create_new_current"})},setModel:function(e,t,i){return p.prototype.setModel.call(this,e,t,i),this.model&&this.model.id&&(this.log("checking for updates"),this.model.checkForUpdates()),this},_setUpModelListeners:function(){return p.prototype._setUpModelListeners.call(this),this.listenTo(this.model,{"change:nice_size change:size":function(){this.trigger("history-size-change",this,this.model,arguments)},"change:id":function(){this.once("loading-done",function(){this.model.checkForUpdates()})}})},_setUpCollectionListeners:function(){p.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,"state:ready",function(e,t,i){e.get("visible")||this.collection.storage.includeHidden()||this.removeItemView(e)})},_setUpBehaviors:function(t){t=t||this.$el;var i=this;return p.prototype._setUpBehaviors.call(i,t),this._debouncedScrollCaptureHandler||(this._debouncedScrollCaptureHandler=e.debounce(function(){i.$el.is(":visible")&&i.preferences.set("scrollPosition",n(this).scrollTop())},40)),i.$scrollContainer(t).off("scroll",this._debouncedScrollCaptureHandler).on("scroll",this._debouncedScrollCaptureHandler),i},_buildNewRender:function(){if(!this.model)return n();var e=p.prototype._buildNewRender.call(this);return e.find(".search").prependTo(e.find("> .controls")),this._renderQuotaMessage(e),e},_renderQuotaMessage:function(e){return e=e||this.$el,n(this.templates.quotaMsg({},this)).prependTo(e.find(".messages"))},_renderTags:function(e){var t=this;p.prototype._renderTags.call(t,e),t.preferences.get("tagsEditorShown")&&t.tagsEditor.toggle(!0),t.listenTo(t.tagsEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("tagsEditorShown",e.hidden)})},_renderAnnotation:function(e){var t=this;p.prototype._renderAnnotation.call(t,e),t.preferences.get("annotationEditorShown")&&t.annotationEditor.toggle(!0),t.listenTo(t.annotationEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("annotationEditorShown",e.hidden)})},_swapNewRender:function(t){p.prototype._swapNewRender.call(this,t);var i=this;return e.delay(function(){var e=i.preferences.get("scrollPosition");e&&i.scrollTo(e,0)},10),this},_attachItems:function(e){p.prototype._attachItems.call(this,e);var t=this;return t.currentContentId&&t._setCurrentContentById(t.currentContentId),this},addItemView:function(e,t,i){var n=p.prototype.addItemView.call(this,e,t,i);return n&&this.panelStack.length?this._collapseDrilldownPanel():n},_setUpItemViewListeners:function(e){var t=this;return p.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{"expanded:drilldown":function(e,t){this._expandDrilldownPanel(t)},"collapsed:drilldown":function(e,t){this._collapseDrilldownPanel(t)}})},setCurrentContent:function(e){this.$(".history-content.current-content").removeClass("current-content"),e?(e.$el.addClass("current-content"),this.currentContentId=e.model.id):this.currentContentId=null},_setCurrentContentById:function(e){var t=this.viewFromModelId(e)||null;this.setCurrentContent(t)},_expandDrilldownPanel:function(e){this.panelStack.push(e),this.$controls().add(this.$list()).hide(),e.parentName=this.model.get("name"),e.delegateEvents().render().$el.appendTo(this.$el)},_collapseDrilldownPanel:function(e){this.panelStack.pop(),this.$controls().add(this.$list()).show()},events:e.extend(e.clone(p.prototype.events),{"click .uploader-link":function(e){Galaxy.upload.show(e)},"click .get-data-link":function(e){var t=n(".toolMenuContainer");t.parent().scrollTop(0),t.find('span:contains("Get Data")').click()}}),listenToGalaxy:function(t){this.listenTo(t,{"center-frame:load":function(t){var i=t.fullpath,n=null,s={display:/datasets\/([a-f0-9]+)\/display/,edit:/datasets\/([a-f0-9]+)\/edit/,report_error:/dataset\/errors\?id=([a-f0-9]+)/,rerun:/tool_runner\/rerun\?id=([a-f0-9]+)/,show_params:/datasets\/([a-f0-9]+)\/show_params/};e.find(s,function(t,s){return n=e.result(i.match(t),1)}),this._setCurrentContentById(n?"dataset-"+n:null)},"center-panel:load":function(e){this._setCurrentContentById()}})},connectToQuotaMeter:function(e){return e?(this.listenTo(e,"quota:over",this.showQuotaMessage),this.listenTo(e,"quota:under",this.hideQuotaMessage),this.on("rendered rendered:initial",function(){e&&e.isOverQuota()&&this.showQuotaMessage()}),this):this},clearMessages:function(t){var i=e.isUndefined(t)?this.$messages().children('[class$="message"]'):n(t.currentTarget);return i=i.not(".quota-message"),i.fadeOut(this.fxSpeed,function(){n(this).remove()}),this},showQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")&&e.slideDown(this.fxSpeed)},hideQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")||e.slideUp(this.fxSpeed)},unhideHidden:function(){var e=this;return confirm((0,h.default)("Really unhide all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{visible:!0}).done(function(){e.model.contents.includeHidden||e.renderItems()}):s.when()},deleteHidden:function(){var e=this;return confirm((0,h.default)("Really delete all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{deleted:!0,visible:!0}):s.when()},toString:function(){return"CurrentHistoryView("+(this.model?this.model.get("name"):"")+")"}});m.prototype.templates=function(){var t=c.default.wrapTemplate(['
',(0,h.default)("You are over your disk quota"),". ",(0,h.default)("Tool execution is on hold until your disk usage drops below your allocated quota"),".","
"],"history");return e.extend(e.clone(p.prototype.templates),{quotaMsg:t})}(),t.default={CurrentHistoryView:m}}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(n),a=i(116),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=["new","queued","running"],r=["error","deleted"],d=s.Model.extend({url:function(){return Galaxy.root+"api/histories/"+this.attributes.history_id+"/contents/dataset_collections/"+this.attributes.collection_id+"/jobs_summary"},hasDetails:function(){return this.has("populated_state")},new:function(){return!this.hasDetails()||"new"==this.get("populated_state")},errored:function(){return"error"===this.get("populated_state")||this.anyWithStates(r)},states:function(){return this.get("states")||{}},anyWithState:function(e){return(this.states()[e]||0)>0},anyWithStates:function(e){var t=this.states();for(var i in e)if((t[e[i]]||0)>0)return!0;return!1},numWithStates:function(e){var t=this.states(),i=0;for(var n in e)i+=t[e[n]]||0;return i},numInError:function(){return this.numWithStates(r)},running:function(){return this.anyWithState("running")},terminal:function(){return!this.new()&&!this.anyWithStates(l)},jobCount:function(){var e=this.states(),t=0;for(var i in e)t+=e[i];return t},toString:function(){return"JobStatesSummary(id="+this.get("id")+")"}}),c=s.Collection.extend({model:d,initialize:function(){this.updateTimeoutId=null,this.active=!0},url:function(){var e=this.models.filter(function(e){return!e.terminal()}),t=e.map(function(e){return e.get("id")}).join(","),i=e.map(function(e){return e.get("model")}).join(",");return Galaxy.root+"api/histories/"+this.historyId+"/jobs_summary?ids="+t+"&types="+i},monitor:function(){var e=this;if(this.clearUpdateTimeout(),this.active){var t=function(){e.updateTimeoutId=setTimeout(function(){e.monitor()},2e3)},i=this.models.filter(function(e){return!e.terminal()});if(i.length,!1){var n=i.map(function(e){return function(){return e.fetch()}});return new o.default.AjaxQueue(n).done(t)}i.length>0?this.fetch({remove:!1}).done(t):t()}},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},toString:function(){return"JobStatesSummaryCollection()"}});t.default={JobStatesSummary:d,JobStatesSummaryCollection:c,FETCH_STATE_ON_ADD:!1}},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(255),l=a(o),r=i(63),d=(a(r),i(16)),c=(a(d),i(115)),u=a(c),h=i(257),f=a(h),p=i(258),m=a(p),g=i(39),_=a(g),v=i(124),y=a(v),w=i(58),b=a(w),x=i(261),C=a(x),$=i(262),k=a($),S=i(21),T=a(S),P=i(42),E=(a(P),i(5)),D=a(E),A=i(3),M=a(A);i(20);var I=l.default.HistoryView,L=I.extend({HDAViewClass:f.default.HDAListItemEdit,HDCAViewClass:m.default.HDCAListItemEdit,initialize:function(e){e=e||{},I.prototype.initialize.call(this,e),this.tagsEditor=null,this.dragItems=!0,this.annotationEditor=null,this.purgeAllowed=e.purgeAllowed||!1,this.annotationEditorShown=e.annotationEditorShown||!1,this.tagsEditorShown=e.tagsEditorShown||!1},_setUpListeners:function(){return I.prototype._setUpListeners.call(this),this.on({"droptarget:drop":function(e,t){this.dataDropped(t),this.dropTargetOff()},"view:attached view:removed":function(){this._renderCounts()},"search:loading-progress":this._renderSearchProgress,"search:searching":this._renderSearchFindings})},_setUpModelListeners:function(){return I.prototype._setUpModelListeners.call(this),this.listenTo(this.model,"change:size",this.updateHistoryDiskSize),this},_setUpCollectionListeners:function(){return I.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,{"change:deleted":this._handleItemDeletedChange,"change:visible":this._handleItemVisibleChange,"change:purged":function(e){this.model.fetch()},"fetching-deleted":function(e){this.$("> .controls .deleted-count").html(""+(0,M.default)("loading...")+"")},"fetching-hidden":function(e){this.$("> .controls .hidden-count").html(""+(0,M.default)("loading...")+"")},"fetching-deleted-done fetching-hidden-done":this._renderCounts}),this},_buildNewRender:function(){var e=I.prototype._buildNewRender.call(this);return this.model?(Galaxy&&Galaxy.user&&Galaxy.user.id&&Galaxy.user.id===this.model.get("user_id")&&(this._renderTags(e),this._renderAnnotation(e)),e):e},updateHistoryDiskSize:function(){this.$(".history-size").text(this.model.get("nice_size"))},renderItems:function(e){var t=I.prototype.renderItems.call(this,e);return this.searchFor?this._renderSearchFindings(e):this._renderCounts(e),t},_renderCounts:function(t){t=t instanceof e?t:this.$el;var i=this.templates.counts(this.model.toJSON(),this);return t.find("> .controls .subtitle").html(i)},_renderTags:function(e){var t=this;this.tagsEditor=new _.default.TagsEditor({model:this.model,el:e.find(".controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.toggleHDATagEditors(!0,t.fxSpeed)},onhide:function(){t.toggleHDATagEditors(!1,t.fxSpeed)},$activator:(0,T.default)({title:(0,M.default)("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".controls .actions"))})},_renderAnnotation:function(e){var t=this;this.annotationEditor=new y.default.AnnotationEditor({model:this.model,el:e.find(".controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.toggleHDAAnnotationEditors(!0,t.fxSpeed)},onhide:function(){t.toggleHDAAnnotationEditors(!1,t.fxSpeed)},$activator:(0,T.default)({title:(0,M.default)("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".controls .actions"))})},_setUpBehaviors:function(e){if(e=e||this.$el,I.prototype._setUpBehaviors.call(this,e),this.model&&Galaxy.user&&!Galaxy.user.isAnonymous()&&Galaxy.user.id===this.model.get("user_id")){var t=this;e.find("> .controls .name").attr("title",(0,M.default)("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(e){var i=t.model.get("name");e&&e!==i?(t.$el.find("> .controls .name").text(e),t.model.save({name:e}).fail(function(){t.$el.find("> .controls .name").text(t.model.previous("name"))})):t.$el.find("> .controls .name").text(i)}})}},multiselectActions:function(){var e=this,t=[{html:(0,M.default)("Hide datasets"),func:function(){var t=u.default.HistoryDatasetAssociation.prototype.hide;e.getSelectedModels().ajaxQueue(t)}},{html:(0,M.default)("Unhide datasets"),func:function(){var t=u.default.HistoryDatasetAssociation.prototype.unhide;e.getSelectedModels().ajaxQueue(t)}},{html:(0,M.default)("Delete datasets"),func:function(){var t=u.default.HistoryDatasetAssociation.prototype.delete;e.getSelectedModels().ajaxQueue(t)}},{html:(0,M.default)("Undelete datasets"),func:function(){var t=u.default.HistoryDatasetAssociation.prototype.undelete;e.getSelectedModels().ajaxQueue(t)}}];return e.purgeAllowed&&t.push({html:(0,M.default)("Permanently delete datasets"),func:function(){if(confirm((0,M.default)("This will permanently remove the data in your datasets. Are you sure?"))){var t=u.default.HistoryDatasetAssociation.prototype.purge;e.getSelectedModels().ajaxQueue(t)}}}),t=t.concat(e._collectionActions())},_collectionActions:function(){var e=this;return[{html:(0,M.default)("Build Dataset List"),func:function(){e.buildCollection("list")}},{html:(0,M.default)("Build Dataset Pair"),func:function(){e.buildCollection("paired")}},{html:(0,M.default)("Build List of Dataset Pairs"),func:function(){e.buildCollection("list:paired")}}]},buildCollection:function(e,t,i){var n,s=this,t=t||s.getSelectedModels(),i=i||!1;"list"==e?n=b.default.createListCollection:"paired"==e?n=C.default.createPairCollection:"list:paired"==e?n=k.default.createListOfPairsCollection:console.warn("Unknown collectionType encountered "+e),n(t,i).done(function(){s.model.refresh()})},_getItemViewOptions:function(e){var t=I.prototype._getItemViewOptions.call(this,e);return n.extend(t,{purgeAllowed:this.purgeAllowed,tagsEditorShown:this.tagsEditor&&!this.tagsEditor.hidden,annotationEditorShown:this.annotationEditor&&!this.annotationEditor.hidden}),t},_handleItemDeletedChange:function(e){e.get("deleted")?this._handleItemDeletion(e):this._handleItemUndeletion(e),this._renderCounts()},_handleItemDeletion:function(e){var t=this.model.get("contents_active");t.deleted+=1,t.active-=1,this.model.contents.includeDeleted||this.removeItemView(e),this.model.set("contents_active",t)},_handleItemUndeletion:function(e){var t=this.model.get("contents_active");t.deleted-=1,this.model.contents.includeDeleted||(t.active-=1),this.model.set("contents_active",t)},_handleItemVisibleChange:function(e){e.hidden()?this._handleItemHidden(e):this._handleItemUnhidden(e),this._renderCounts()},_handleItemHidden:function(e){var t=this.model.get("contents_active");t.hidden+=1,t.active-=1,this.model.contents.includeHidden||this.removeItemView(e),this.model.set("contents_active",t)},_handleItemUnhidden:function(e){var t=this.model.get("contents_active");t.hidden-=1,this.model.contents.includeHidden||(t.active-=1),this.model.set("contents_active",t)},toggleHDATagEditors:function(e,t){n.each(this.views,function(i){i.tagsEditor&&i.tagsEditor.toggle(e,t)})},toggleHDAAnnotationEditors:function(e,t){n.each(this.views,function(i){i.annotationEditor&&i.annotationEditor.toggle(e,t)})},events:n.extend(n.clone(I.prototype.events),{"click .show-selectors-btn":"toggleSelectors","click .toggle-deleted-link":function(e){this.toggleShowDeleted()},"click .toggle-hidden-link":function(e){this.toggleShowHidden()}}),_renderSearchProgress:function(e,t){var i=e+t;return this.$("> .controls .subtitle").html(["",(0,M.default)("Searching "),i,"/",this.model.contentsShown(),""].join(""))},_renderSearchFindings:function(t){t=t instanceof e?t:this.$el;var i=this.templates.found(this.model.toJSON(),this);return t.find("> .controls .subtitle").html(i),this},dropTargetOn:function(){if(this.dropTarget)return this;this.dropTarget=!0;var e={dragenter:n.bind(this.dragenter,this),dragover:n.bind(this.dragover,this),dragleave:n.bind(this.dragleave,this),drop:n.bind(this.drop,this)},t=this._renderDropTarget();this.$list().before([this._renderDropTargetHelp(),t]);for(var i in e)e.hasOwnProperty(i)&&t.on(i,e[i]);return this},_renderDropTarget:function(){return this.$(".history-drop-target").remove(),s("").addClass("history-drop-target")},_renderDropTargetHelp:function(){return this.$(".history-drop-target-help").remove(),s("").addClass("history-drop-target-help").text((0,M.default)("Drag datasets here to copy them to the current history"))},dropTargetOff:function(){if(!this.dropTarget)return this;this.dropTarget=!1;var e=this.$(".history-drop-target").get(0);for(var t in this._dropHandlers)this._dropHandlers.hasOwnProperty(t)&&e.off(t,this._dropHandlers[t]);return this.$(".history-drop-target").remove(),this.$(".history-drop-target-help").remove(),this},dropTargetToggle:function(){return this.dropTarget?this.dropTargetOff():this.dropTargetOn(),this},dragenter:function(e){e.preventDefault(),e.stopPropagation(),this.$(".history-drop-target").css("border","2px solid black")},dragover:function(e){e.preventDefault(),e.stopPropagation()},dragleave:function(e){e.preventDefault(),e.stopPropagation(),this.$(".history-drop-target").css("border","1px dashed black")},drop:function(e){e.preventDefault();var t=this,i=e.originalEvent.dataTransfer,n=i.getData("text");i.dropEffect="move";try{n=JSON.parse(n)}catch(e){t.warn("error parsing JSON from drop:",n)}return t.trigger("droptarget:drop",e,n,t),!1},dataDropped:function(t){var i=this;return n.isObject(t)&&"HistoryDatasetAssociation"===t.model_class&&t.id?0!==i.contents.currentPage?i.contents.fetchPage(0).then(function(){return i.model.contents.copy(t.id)}):i.model.contents.copy(t.id):e.when()},toString:function(){return"HistoryViewEdit("+(this.model?this.model.get("name"):"")+")"}});L.prototype.templates=function(){var e=D.default.wrapTemplate(["<% var shown = Math.max( view.views.length, history.contents_active.active ) %>","<% if( shown ){ %>",'',"<%- shown %> ",(0,M.default)("shown"),"","<% } %>","<% if( history.contents_active.deleted ){ %>",'',"<% if( view.model.contents.includeDeleted ){ %>",'',(0,M.default)("hide deleted"),"","<% } else { %>","<%- history.contents_active.deleted %> ",'',(0,M.default)("deleted"),"","<% } %>","","<% } %>","<% if( history.contents_active.hidden ){ %>",'',"<% if( view.model.contents.includeHidden ){ %>",'',(0,M.default)("hide hidden"),"","<% } else { %>","<%- history.contents_active.hidden %> ",'',(0,M.default)("hidden"),"","<% } %>","","<% } %>"],"history"),t=D.default.wrapTemplate([(0,M.default)("Found")," <%- view.views.length %>, ","<% if( history.contents_active.deleted ){ %>","<% if( view.model.contents.includeDeleted ){ %>",'',(0,M.default)("hide deleted"),", ","<% } else { %>",'',(0,M.default)("show deleted"),", ","<% } %>","<% } %>","<% if( history.contents_active.hidden ){ %>","<% if( view.model.contents.includeHidden ){ %>",'',(0,M.default)("hide hidden"),"","<% } else { %>",'',(0,M.default)("show hidden"),"","<% } %>","<% } %>"],"history");return n.extend(n.clone(I.prototype.templates),{counts:e,found:t})}(),t.default={HistoryViewEdit:L}}).call(t,i(0),i(1),i(0))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(117),o=s(a),l=i(62),r=s(l),d=i(63),c=s(d),u=i(64),h=(s(u),i(119)),f=s(h),p=i(121),m=s(p),g=i(24),_=(s(g),i(113)),v=s(_),y=i(21),w=s(y),b=i(5),x=s(b),C=i(3),$=s(C);i(118);var k=o.default.ModelListPanel,S=k.extend({_logNamespace:"history",HDAViewClass:f.default.HDAListItemView,HDCAViewClass:m.default.HDCAListItemView,collectionClass:c.default.HistoryContents,modelCollectionKey:"contents",tagName:"div",className:k.prototype.className+" history-panel",emptyMsg:(0,$.default)("This history is empty"),noneFoundMsg:(0,$.default)("No matching datasets found"),searchPlaceholder:(0,$.default)("search datasets"),initialize:function(e){k.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_createDefaultCollection:function(){return new this.collectionClass([],{history:this.model})},freeModel:function(){return k.prototype.freeModel.call(this),this.model&&this.model.stopPolling(),this},_setUpListeners:function(){k.prototype._setUpListeners.call(this),this.on({error:function(e,t,i,n,s){this.errorHandler(e,t,i,n,s)},"views:ready view:attached view:removed":function(e){this._renderSelectButton()},"view:attached":function(e){this.scrollTo(0)}})},loadHistory:function(t,i,n){var s=this;return n=e.extend(n||{silent:!0}),this.info("loadHistory:",t,i,n),this.setModel(new r.default.History({id:t})),n.silent=!0,this.trigger("loading"),this.model.fetchWithContents(i,n).always(function(){s.render(),s.trigger("loading-done")})},refreshContents:function(e){return this.model?this.model.refresh(e):n.when()},_setUpCollectionListeners:function(){return k.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,{"fetching-more":function(){this._toggleContentsLoadingIndicator(!0),this.$emptyMessage().hide()},"fetching-more-done":function(){this._toggleContentsLoadingIndicator(!1)}})},_showLoadingIndicator:function(t,i,s){var a=n('');this.$el.html(a.text(t).slideDown(e.isUndefined(i)?this.fxSpeed:i))},_hideLoadingIndicator:function(t){this.$(".loading-indicator").slideUp(e.isUndefined(t)?this.fxSpeed+200:t,function(){n(this).remove()})},_buildNewRender:function(){var e=k.prototype._buildNewRender.call(this);return this._renderSelectButton(e),e},_renderSelectButton:function(e){if(e=e||this.$el,!this.multiselectActions().length)return null;if(!this.views.length)return this.hideSelectors(),e.find(".controls .actions .show-selectors-btn").remove(),null;var t=e.find(".controls .actions .show-selectors-btn");return t.length?t:(0,w.default)({title:(0,$.default)("Operations on multiple datasets"),classes:"show-selectors-btn",faIcon:"fa-check-square-o"}).prependTo(e.find(".controls .actions"))},_renderEmptyMessage:function(e){var t=this.$emptyMessage(e);return this.model.get("contents_active").active<=0?t.empty().append(this.emptyMsg).show():this.searchFor&&this.model.contents.haveSearchDetails()&&!this.views.length?t.empty().append(this.noneFoundMsg).show():(t.hide(),n())},$scrollContainer:function(e){return this.$list(e)},_toggleContentsLoadingIndicator:function(e){e?this.$list().html('
",(0,p.default)(["Pair collections are permanent collections containing two datasets: one forward and one reverse. ","Often these are forward and reverse reads. The pair collections can be passed to tools and ","workflows in order to have analyses done on both datasets. This interface allows ","you to create a pair, name it, and swap which is forward and which reverse."].join("")),"
","
","
",(0,p.default)(['Click the "Swap" link to make your forward dataset the reverse ',"and the reverse dataset forward."].join("")),"
","
",(0,p.default)(['Click the "Cancel" button to exit the interface.'].join("")),"
","
","
",(0,p.default)(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"
"].join("")),invalidInitial:n.template(['
','
','',"<% if( _.size( problems ) ){ %>",(0,p.default)("The following selections could not be included due to problems"),"
<% _.each( problems, function( problem ){ %>","
<%- problem.element.name %>: <%- problem.text %>
","<% }); %>
","<% } else if( _.size( elements ) === 0 ){ %>",(0,p.default)("No datasets were selected"),".","<% } else if( _.size( elements ) === 1 ){ %>",(0,p.default)("Only one dataset was selected"),": <%- elements[0].name %>","<% } else if( _.size( elements ) > 2 ){ %>",(0,p.default)("Too many datasets were selected"),': <%- _.pluck( elements, "name" ).join( ", ") %>',"<% } %>"," ",(0,p.default)("Two (and only two) elements are needed for the pair"),". ",(0,p.default)("You may need to "),'',(0,p.default)("cancel")," ",(0,p.default)("and reselect new elements"),".","","
","
",'"].join(""))}),toString:function(){return"PairCollectionCreator"}}),v=function(e,t){return t=t||{},t.title=(0,p.default)("Create a collection from a pair of datasets"),r.default.collectionCreatorModal(e,t,_)};t.default={PairCollectionCreator:_,pairCollectionCreatorModal:v,createPairCollection:o}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}function l(e){function t(){return i.length||(i=[new RegExp(this.filters[0]),new RegExp(this.filters[1])]),i}e=e||{},e.createPair=e.createPair||function(e){e=e||{};var t=e.listA.splice(e.indexA,1)[0],i=e.listB.splice(e.indexB,1)[0],n=e.listB.indexOf(t),s=e.listA.indexOf(i);return-1!==n&&e.listB.splice(n,1),-1!==s&&e.listA.splice(s,1),this._pair(t,i,{silent:!0})};var i=[];return e.preprocessMatch=e.preprocessMatch||function(e){var i=t.call(this);return n.extend(e,{matchTo:e.matchTo.name.replace(i[0],""),possible:e.possible.name.replace(i[1],"")})},function(t){this.debug("autopair _strategy ---------------------------"),t=t||{};var i,n=t.listA,s=t.listB,a=0,o={score:0,index:null},l=[];for(this.debug("starting list lens:",n.length,s.length),this.debug("bestMatch (starting):",JSON.stringify(o,null," "));a=c?l.push(e.createPair.call(this,{listA:n,indexA:a,listB:s,indexB:o.index})):a+=1,!n.length||!s.length)return l}return this.debug("paired:",JSON.stringify(l,null," ")),this.debug("autopair _strategy ---------------------------"),l}}function r(e,t){var i=e.toJSON();return b(i,{historyId:e.historyId,defaultHideSourceItems:t})}Object.defineProperty(t,"__esModule",{value:!0});var d=i(263),c=o(d),u=i(109),h=o(u),f=i(108),p=o(f),m=i(5),g=o(m),_=i(3),v=o(_);i(110);var y=e.View.extend(g.default.LoggableMixin).extend({_logNamespace:"collections",tagName:"li",className:"dataset paired",initialize:function(e){this.pair=e.pair||{}},template:n.template(['<%- pair.forward.name %>','','<%- pair.name %>',"",'<%- pair.reverse.name %>'].join("")),render:function(){this.dragStartHandler=n.bind(this._dragstart,this),this.dragEndHandler=n.bind(this._dragend,this);var e=this.$el.attr("draggable",!0).data("pair",this.pair).html(this.template({pair:this.pair})).addClass("flex-column-container").get(0);return e.addEventListener("dragstart",this.dragStartHandler,!1),e.addEventListener("dragend",this.dragEndHandler,!1),this},events:{dragover:"_sendToParent",drop:"_sendToParent"},_dragstart:function(e){e.currentTarget.style.opacity="0.4",e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.pair)),this.$el.parent().trigger("pair.dragstart",[this])},_dragend:function(e){e.currentTarget.style.opacity="1.0",this.$el.parent().trigger("pair.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"PairView("+this.pair.name+")"}}),w=e.View.extend(g.default.LoggableMixin).extend(p.default.CollectionCreatorMixin).extend({_logNamespace:"collections",className:"list-of-pairs-collection-creator collection-creator flex-row-container",initialize:function(e){this.metric("PairedCollectionCreator.initialize",e),e=n.defaults(e,{datasets:[],filters:this.DEFAULT_FILTERS,automaticallyPair:!0,strategy:"lcs",matchPercentage:.9,twoPassAutopairing:!0}),this.initialList=e.datasets,this.historyId=e.historyId,this.filters=this.commonFilters[e.filters]||this.commonFilters[this.DEFAULT_FILTERS],n.isArray(e.filters)&&(this.filters=e.filters),this.automaticallyPair=e.automaticallyPair,this.strategy=this.strategies[e.strategy]||this.strategies[this.DEFAULT_STRATEGY],n.isFunction(e.strategy)&&(this.strategy=e.strategy),this.matchPercentage=e.matchPercentage,this.twoPassAutopairing=e.twoPassAutopairing,this.removeExtensions=!0,this.oncancel=e.oncancel,this.oncreate=e.oncreate,this.autoscrollDist=e.autoscrollDist||24,this.unpairedPanelHidden=!1,this.pairedPanelHidden=!1,this.$dragging=null,this.blocking=!1,this._setUpCommonSettings(e),this._setUpBehaviors(),this._dataSetUp()},commonFilters:{illumina:["_1","_2"],Rs:["_R1","_R2"]},DEFAULT_FILTERS:"illumina",strategies:{simple:"autopairSimple",lcs:"autopairLCS",levenshtein:"autopairLevenshtein"},DEFAULT_STRATEGY:"lcs",_dataSetUp:function(){this.paired=[],this.unpaired=[],this.selectedIds=[],this._sortInitialList(),this._ensureIds(),this.unpaired=this.initialList.slice(0),this.automaticallyPair&&(this.autoPair(),this.once("rendered:initial",function(){this.trigger("autopair")}))},_sortInitialList:function(){this._sortDatasetList(this.initialList)},_sortDatasetList:function(e){return e.sort(function(e,t){return(0,h.default)(e.name,t.name)}),e},_ensureIds:function(){return this.initialList.forEach(function(e){e.hasOwnProperty("id")||(e.id=n.uniqueId())}),this.initialList},_splitByFilters:function(){function e(e,t){return t.test(e.name)}var t=this.filters.map(function(e){return new RegExp(e)}),i=[[],[]];return this.unpaired.forEach(function(n){t.forEach(function(t,s){e(n,t)&&i[s].push(n)})}),i},_addToUnpaired:function(e){var t=this;this.unpaired.splice(function i(n,s){if(n===s)return n;var a=Math.floor((s-n)/2)+n,o=(0,h.default)(e.name,t.unpaired[a].name);if(o<0)return i(n,a);if(o>0)return i(a+1,s);for(;t.unpaired[a]&&t.unpaired[a].name===e.name;)a++;return a}(0,this.unpaired.length),0,e)},autoPair:function(e){var t=this._splitByFilters(),i=[];return this.twoPassAutopairing&&(i=this.autopairSimple({listA:t[0],listB:t[1]}),t=this._splitByFilters()),e=e||this.strategy,t=this._splitByFilters(),i=i.concat(this[e].call(this,{listA:t[0],listB:t[1]}))},autopairSimple:l({scoreThreshold:function(){return.6},match:function(e){return e=e||{},e.matchTo===e.possible?{index:e.index,score:1}:e.bestMatch}}),autopairLevenshtein:l({scoreThreshold:function(){return this.matchPercentage},match:function(e){e=e||{};var t=(0,c.default)(e.matchTo,e.possible),i=1-t/Math.max(e.matchTo.length,e.possible.length);return i>e.bestMatch.score?{index:e.index,score:i}:e.bestMatch}}),autopairLCS:l({scoreThreshold:function(){return this.matchPercentage},match:function(e){e=e||{};var t=this._naiveStartingAndEndingLCS(e.matchTo,e.possible).length,i=t/Math.max(e.matchTo.length,e.possible.length);return i>e.bestMatch.score?{index:e.index,score:i}:e.bestMatch}}),_naiveStartingAndEndingLCS:function(e,t){for(var i="",n="",s=0,a=0;s=0&&a>=0&&e[s]===t[a];)n=[e[s],n].join(""),s-=1,a-=1;return i+n},_pair:function(e,t,i){i=i||{},this.debug("_pair:",e,t);var s=this._createPair(e,t,i.name);return this.paired.push(s),this.unpaired=n.without(this.unpaired,e,t),i.silent||this.trigger("pair:new",s),s},_createPair:function(e,t,i){if(!e||!t||e===t)throw new Error("Bad pairing: "+[JSON.stringify(e),JSON.stringify(t)]);return i=i||this._guessNameForPair(e,t),{forward:e,name:i,reverse:t}},_guessNameForPair:function(e,t,i){i=void 0!==i?i:this.removeExtensions;var n=e.name,s=t.name,a=this._naiveStartingAndEndingLCS(n.replace(new RegExp(this.filters[0]),""),s.replace(new RegExp(this.filters[1]),""));if(i){var o=a.lastIndexOf(".");if(o>0){var l=a.slice(o,a.length);a=a.replace(l,""),n=n.replace(l,""),s=s.replace(l,"")}}return a||n+" & "+s},_unpair:function(e,t){if(t=t||{},!e)throw new Error("Bad pair: "+JSON.stringify(e));return this.paired=n.without(this.paired,e),this._addToUnpaired(e.forward),this._addToUnpaired(e.reverse),t.silent||this.trigger("pair:unpair",[e]),e},unpairAll:function(){for(var e=[];this.paired.length;)e.push(this._unpair(this.paired[0],{silent:!0}));this.trigger("pair:unpair",e)},_pairToJSON:function(e,t){return t=t||"hda",{collection_type:"paired",src:"new_collection",name:e.name,element_identifiers:[{name:"forward",id:e.forward.id,src:t},{name:"reverse",id:e.reverse.id,src:t}]}},createList:function(e){var t=this,i=Galaxy.root+"api/histories/"+this.historyId+"/contents/dataset_collections",a={type:"dataset_collection",collection_type:"list:paired",hide_source_items:t.hideOriginals||!1,name:n.escape(e||t.$(".collection-name").val()),element_identifiers:t.paired.map(function(e){return t._pairToJSON(e)})};return t.blocking=!0,s.ajax(i,{type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify(a)}).always(function(){t.blocking=!1}).fail(function(e,i,n){t._ajaxErrHandler(e,i,n)}).done(function(e,i,n){t.trigger("collection:created",e,i,n),t.metric("collection:created",e),"function"==typeof t.oncreate&&t.oncreate.call(this,e,i,n)})},_ajaxErrHandler:function(e,t,i){this.error(e,t,i);var n=this,s=(0,v.default)("An error occurred while creating this collection");e&&(0===e.readyState&&0===e.status?s+=": "+(0,v.default)("Galaxy could not be reached and may be updating.")+(0,v.default)(" Try again in a few minutes."):e.responseJSON?s+="
",(0,v.default)(["Collections of paired datasets are ordered lists of dataset pairs (often forward and reverse reads). ","These collections can be passed to tools and workflows in order to have analyses done on each member of ","the entire group. This interface allows you to create a collection, choose which datasets are paired, ","and re-order the final collection."].join("")),"
","
",(0,v.default)(['Unpaired datasets are shown in the unpaired section ',"(hover over the underlined words to highlight below). ",'Paired datasets are shown in the paired section.',"
To pair datasets, you can:","
Click a dataset in the ",'forward column ',"to select it then click a dataset in the ",'reverse column.',"
",'
Click one of the "Pair these datasets" buttons in the ','middle column ',"to pair the datasets in a particular row.","
",'
Click "Auto-pair" ',"to have your datasets automatically paired based on name.","
","
"].join("")),"","
",(0,v.default)(["
You can filter what is shown in the unpaired sections by:","
Entering partial dataset names in either the ",'forward filter or ','reverse filter.',"
","
Choosing from a list of preset filters by clicking the ",'"Choose filters" link.',"
Clearing the filters by clicking the ",'"Clear filters" link.',"
","
"].join("")),"","
",(0,v.default)(["To unpair individual dataset pairs, click the ",'unpair buttons ( ). ','Click the "Unpair all" link to unpair all pairs.'].join("")),"
","
",(0,v.default)(['You can include or remove the file extensions (e.g. ".fastq") from your pair names by toggling the ','"Remove file extensions from pair names?" control.'].join("")),"
","
",(0,v.default)(['Once your collection is complete, enter a name and ','click "Create list". ',"(Note: you do not have to pair all unpaired datasets to finish.)"].join("")),"
"].join(""))})}),b=function(e,t){var i,a=s.Deferred();if(t=n.defaults(t||{},{datasets:e,oncancel:function(){Galaxy.modal.hide(),a.reject("cancelled")},oncreate:function(e,t){Galaxy.modal.hide(),a.resolve(t)}}),!window.Galaxy||!Galaxy.modal)throw new Error("Galaxy or Galaxy.modal not found");return i=new w(t),Galaxy.modal.show({title:(0,v.default)("Create a collection of paired datasets"),body:i.$el,width:"80%",height:"800px",closing_events:!0}),i.render(),window.creator=i,a};t.default={PairedCollectionCreator:w,pairedCollectionCreatorModal:b,createListOfPairsCollection:r}}).call(t,i(2),i(1),i(0),i(0))},function(e,t,i){"use strict";function n(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var i,n=[];for(i=0;i<=t.length;i++)n[i]=[i];var s;for(s=0;s<=e.length;s++)n[0][s]=s;for(i=1;i<=t.length;i++)for(s=1;s<=e.length;s++)t.charAt(i-1)===e.charAt(s-1)?n[i][s]=n[i-1][s-1]:n[i][s]=Math.min(n[i-1][s-1]+1,Math.min(n[i][s-1]+1,n[i-1][s]+1));return n[t.length][e.length]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(11),d=(a(r),i(6)),c=a(d),u=i(14),h=a(u),f=e.Model.extend({initialize:function(e){e=e||{},e.user_id=e.user_id||Galaxy.user.id,this.set({user_id:e.user_id,information:{title:(0,l.default)("Manage information"),description:"Edit your email, addresses and custom parameters or change your username.",url:"api/users/"+e.user_id+"/information/inputs",icon:"fa-user",redirect:"user"},password:{title:(0,l.default)("Change password"),description:(0,l.default)("Allows you to change your login credentials."),icon:"fa-unlock-alt",url:"api/users/"+e.user_id+"/password/inputs",submit_title:"Save password",redirect:"user"},communication:{title:(0,l.default)("Change communication settings"),description:(0,l.default)("Enable or disable the communication feature to chat with other users."),url:"api/users/"+e.user_id+"/communication/inputs",icon:"fa-comments-o",redirect:"user"},permissions:{title:(0,l.default)("Set dataset permissions for new histories"),description:"Grant others default access to newly created histories. Changes made here will only affect histories created after these settings have been stored.",url:"api/users/"+e.user_id+"/permissions/inputs",icon:"fa-users",submit_title:"Save permissions",redirect:"user"},api_key:{title:(0,l.default)("Manage API key"),description:(0,l.default)("Access your current API key or create a new one."),url:"api/users/"+e.user_id+"/api_key/inputs",icon:"fa-key",submit_title:"Create a new key",submit_icon:"fa-check"},toolbox_filters:{title:(0,l.default)("Manage Toolbox filters"),description:(0,l.default)("Customize your Toolbox by displaying or omitting sets of Tools."),url:"api/users/"+e.user_id+"/toolbox_filters/inputs",icon:"fa-filter",submit_title:"Save filters",redirect:"user"},openids:{title:(0,l.default)("Manage OpenIDs"),description:(0,l.default)("Associate OpenIDs with your account."),icon:"fa-openid",onclick:function(){window.location.href=Galaxy.root+"openids/list"}},custom_builds:{title:(0,l.default)("Manage custom builds"),description:(0,l.default)("Add or remove custom builds using history datasets."),icon:"fa-cubes",onclick:function(){window.location.href=Galaxy.root+"custom_builds"}},logout:{title:(0,l.default)("Sign out"),description:(0,l.default)("Click here to sign out of all sessions."),icon:"fa-sign-out",onclick:function(){Galaxy.modal.show({title:(0,l.default)("Sign out"),body:"Do you want to continue and sign out of all active sessions?",buttons:{Cancel:function(){Galaxy.modal.hide()},"Sign out":function(){window.location.href=Galaxy.root+"user/logout?session_csrf_token="+Galaxy.session_csrf_token}}})}}})}}),p=e.View.extend({title:(0,l.default)("User Preferences"),initialize:function(){this.model=new f,this.setElement(""),this.render()},render:function(){var e=this,t=Galaxy.config;n.getJSON(Galaxy.root+"api/users/"+Galaxy.user.id,function(i){e.$preferences=n("").addClass("ui-panel").append(n("").append("User preferences")).append(n("").append("You are logged in as "+s.escape(i.email)+".")).append(e.$table=n("
You are using '+e.nice_total_disk_usage+" of disk space in this Galaxy instance. "+(Galaxy.config.enable_quotas?"Your disk quota is: "+e.quota+". ":"")+'Is your usage more than expected? See the documentation for tips on how to find all of the data in your account.
'}});t.default={View:p,Model:f}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),o=s(a),l=i(4),r=(s(l),i(6)),d=s(r),c=i(11),u=s(c),h=i(88),f=s(h),p=e.Collection.extend({comparator:function(e,t){return e=e.get("name"),t=t.get("name"),e>t?1:e").append(n("").text("Current Custom Builds")).append(this.table.$el).append(this.$installed=n("").append(n("").text("System Installed Builds").addClass("ui-margin-top")).append(this.installed_builds.$el)).append(n("").text("Add a Custom Build").addClass("ui-margin-top")).append(n("").addClass("ui-column").append(n("").addClass("ui-column-left").append(this.message.$el).append(this.$form=n("").addClass("ui-margin-top"))).append(this.$help=n("").addClass("ui-column-right")))),this.listenTo(this.collection,"add remove reset",function(){i._renderTable()}),this.listenTo(this.model,"change",function(){i._renderForm()}),this.collection.fetch(),this.model.fetch()},render:function(){this._renderTable(),this._renderForm()},_renderTable:function(){var e=this;this.table.delAll(),this.collection.sort(),this.collection.each(function(t){e.table.add(t.get("name")),e.table.add(t.id),e.table.add(void 0!==t.get("count")?t.get("count"):"Processing..."),e.table.add(new d.default.ButtonIcon({icon:"fa-trash-o",cls:"ui-button-icon-plain",tooltip:(0,o.default)("Delete custom build."),onclick:function(){t.destroy()}}).$el),e.table.append(t.id)})},_renderForm:function(){var e=this,t=new u.default({inputs:[{type:"text",name:"name",label:"Name",help:"Specify a build name e.g. Hamster."},{type:"text",name:"id",label:"Key",help:"Specify a build key e.g. hamster_v1."},{name:"len",type:"conditional",test_param:{name:"type",label:"Definition",help:(0,o.default)("Provide the data source."),type:"select",value:"fasta",data:[{value:"fasta",label:"FASTA-file from history"},{value:"file",label:"Len-file from disk"},{value:"text",label:"Len-file by copy/paste"}]},cases:[{value:"fasta",inputs:[{type:"select",name:"value",label:"FASTA-file",data:this.model.get("fasta_hdas")}]},{value:"file",inputs:[{type:"upload",name:"value",label:"Len-file",data:this.model.get("len_hdas")}]},{value:"text",inputs:[{type:"text",area:!0,name:"value",label:"Edit/Paste"}]}]}],buttons:{save:new d.default.Button({icon:"fa-save",tooltip:(0,o.default)("Create new Build"),title:(0,o.default)("Save"),cls:"btn btn-primary ui-clear-float",onclick:function(){var i=t.data.create();i.id&&i.name?e.collection.create(i,{wait:!0,success:function(t){t.get("message")?e.message.update({message:t.get("message"),status:"warning"}):e.message.update({message:"Successfully added a new custom build.",status:"success"})},error:function(t,i){var n=i&&i.responseJSON&&i.responseJSON.err_msg;e.message.update({message:n||"Failed to create custom build.",status:"danger"})}}):e.message.update({message:"All inputs are required.",status:"danger"})}})},onchange:function(){var i=t.data.match("len|type");if(i){var n=t.field_list[i];e._renderHelp(n.value())}}});this.$form.empty().append(t.$el);var i=this.model.get("installed_builds");i&&i.length?(this.$installed.show(),this.installed_builds.update(this.model.get("installed_builds"))):this.$installed.hide(),this._renderHelp("fasta")},_renderHelp:function(e){this.$help.empty().addClass("alert alert-info").html("fasta"==e?this._templateFasta():this._templateLen())},_templateLen:function(){return"
Length Format
The length format is two-column, separated by whitespace, of the form:
chrom/contig length of chrom/contig
For example, the first few entries of mm9.len are as follows:
Trackster uses this information to populate the select box for chrom/contig, andto set the maximum basepair of the track browser. You may either upload a .len fileof this format (Len File option), or directly enter the information into the box (Len Entry option).
"},_templateFasta:function(){return"
FASTA format
This is a multi-fasta file from your current history that provides the genomesequences for each chromosome/contig in your build.
Here is a snippet from an example multi-fasta file:
")}),t.append(a)}else t.append("No "+this.model.get("plural").toLowerCase()+" have been shared with you.");return t}});t.default={View:l}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(7),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(o),r=i(39),d=a(r),c=i(268),u=a(c),h=i(14),f=a(h),p=i(3),m=a(p),g=e.View.extend({tagName:"tr",initialize:function(){n.bindAll(this,"render","_rowTemplate","renderTagEditor","_templateActions","removeWorkflow","copyWorkflow"),l.options.timeOut=1500},events:{"click #show-in-tool-panel":"showInToolPanel","click #delete-workflow":"removeWorkflow","click #rename-workflow":"renameWorkflow","click #copy-workflow":"copyWorkflow"},render:function(){return s(this.el).html(this._rowTemplate()),this},showInToolPanel:function(){this.model.set("show_in_tool_panel",!this.model.get("show_in_tool_panel")),this.model.save(),window.location=Galaxy.root+"workflows/list"},removeWorkflow:function(){var e=this.model.get("name");window.confirm("Are you sure you want to delete workflow '"+e+"'?")&&(this.model.destroy({success:function(){l.success("Successfully deleted workflow '"+e+"'")}}),this.remove())},renameWorkflow:function(){var e=this.model.get("name"),t=window.prompt("Enter a new Name for workflow '"+e+"'",e);t&&(this.model.save({name:t},{success:function(){l.success("Successfully renamed workflow '"+e+"' to '"+t+"'")}}),this.render())},copyWorkflow:function(){var e=this,t=this.model.get("name");s.getJSON(this.model.urlRoot+"/"+this.model.id+"/download",function(i){var n="Copy of "+t,s=e.model.get("owner");s!=Galaxy.user.attributes.username&&(n+=" shared by user "+s),i.name=n,e.collection.create(i,{at:0,wait:!0,success:function(){l.success("Successfully copied workflow '"+t+"' to '"+n+"'")},error:function(e,t,i){l.error(i.errorThrown)}})}).error(function(e,t,i){l.error(e.responseJSON.err_msg)})},_rowTemplate:function(){var e=this.model.get("show_in_tool_panel"),t=this.model.id,i='';return'
'}}),_=e.View.extend({title:(0,m.default)("Workflows"),initialize:function(){this.setElement(""),n.bindAll(this,"adjustActiondropdown"),this.collection=new u.default.WorkflowCollection,this.collection.fetch().done(this.render()),this.collection.bind("add",this.appendItem),this.collection.on("sync",this.render,this)},events:{dragleave:"unhighlightDropZone",drop:"drop",dragover:function(e){s(".hidden_description_layer").addClass("dragover"),s(".menubutton").addClass("background-none"),e.preventDefault()}},unhighlightDropZone:function(){s(".hidden_description_layer").removeClass("dragover"),s(".menubutton").removeClass("background-none")},drop:function(e){this.unhighlightDropZone(),e.preventDefault();for(var t,i=e.dataTransfer.files,n=this,s=0;t=i[s];s++)n.readWorkflowFiles(t)},readWorkflowFiles:function(e){var t=this,i=new FileReader;i.onload=function(n){var s;try{s=JSON.parse(i.result)}catch(t){l.error("Could not read file '"+e.name+"'. Verify it is a valid Galaxy workflow"),s=null}s&&t.collection.create(s,{at:0,wait:!0,success:function(){l.success("Successfully imported workflow '"+s.name+"'")},error:function(e,t,i){l.error(i.errorThrown)}})},i.readAsText(e,"utf-8")},_showArgErrors:n.once(function(){var e=f.default.get("message");"error"===f.default.get("status")?l.error(n.escape(e||"Unknown Error, please report this to an administrator.")):e&&l.info(n.escape(e))}),render:function(){var e=this._templateHeader(),t=this._templateActionButtons(),i=this._templateWorkflowTable();this.$el.html(e+t+i);var s=this;n(this.collection.models).each(function(e){s.appendItem(e),s.confirmDelete(e)},this);return this.searchWorkflow(this.$(".search-wf"),this.$(".workflow-search tr"),3),this.adjustActiondropdown(),this._showArgErrors(),this},appendItem:function(e){var t=new g({model:e,collection:this.collection});s(".workflow-search").append(t.render().el),t.renderTagEditor()},confirmDelete:function(e){this.$(".link-confirm-shared-"+e.id).click(function(){return window.confirm("Are you sure you want to remove the shared workflow '"+e.attributes.name+"'?")})},searchWorkflow:function(e,t,i){e.on("keyup",function(){var e=s(this).val();if(e.length>=i){var n=new RegExp(e,"i");t.hide(),t.filter(function(){return n.test(s(this).text())}).show()}else t.show()})},adjustActiondropdown:function(){s(this.el).on("show.bs.dropdown",function(){s(this.el).css("overflow","inherit")}),s(this.el).on("hide.bs.dropdown",function(){s(this.el).css("overflow","auto")})},_templateNoWorkflow:function(){return'
Click the link above to visit myExperiment and browse for Galaxy workflows.
"}});t.default={View:_,ImportWorkflowView:v}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=i(5),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=e.Model.extend(s.default.LoggableMixin).extend({_logNamespace:"workflow",urlRoot:Galaxy.root+"api/workflows",toJSON:function(){return{workflow:this.attributes}}}),o=e.Collection.extend({model:a,url:Galaxy.root+"api/workflows"});t.default={WorkflowItem:a,WorkflowCollection:o}}).call(t,i(2))},function(e,t,i){"use strict";function n(e){i(270)}Object.defineProperty(t,"__esModule",{value:!0});var s=i(272),a=i.n(s),o=i(273),l=i(48),r=n,d=l(a.a,o.a,!1,r,null,null);t.default=d.exports},function(e,t,i){var n=i(271);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);i(47)("2fdc4394",n,!0)},function(e,t,i){t=e.exports=i(46)(void 0),t.push([e.i,".ui-message{display:block}",""])},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default={data:function(){return{errormessage:null}},methods:{submit:function(){var t=this;e.ajax({url:Galaxy.root+"api/histories",data:new FormData(this.$refs.form),cache:!1,contentType:!1,processData:!1,method:"POST"}).done(function(e){window.location=Galaxy.root+"histories/list?message="+e.message+"&status=success"}).fail(function(e){var i=e.responseJSON&&e.responseJSON.err_msg;t.errormessage=i||"Import failed for unkown reason."})}}}}).call(t,i(0))},function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-portlet-limited"},[e._m(0),e._v(" "),i("div",{staticClass:"portlet-content"},[e.errormessage?i("div",{staticClass:"ui-message alert alert-danger"},[e._v("\n "+e._s(e.errormessage)+"\n ")]):e._e(),e._v(" "),i("div",{staticClass:"portlet-body"},[i("form",{ref:"form"},[e._m(1),e._v(" "),e._m(2)])]),e._v(" "),i("div",{staticClass:"portlet-buttons"},[i("input",{staticClass:"btn btn-primary",attrs:{type:"button",value:"Import History"},on:{click:e.submit}})])])])},s=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"portlet-header"},[i("div",{staticClass:"portlet-title"},[i("i",{staticClass:"portlet-title-icon fa fa-upload"}),e._v(" "),i("span",{staticClass:"portlet-title-text"},[i("b",[e._v("Import a History from an Archive")])])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived History URL")]),e._v(" "),i("input",{staticClass:"ui-input",attrs:{type:"text",name:"archive_source"}})])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived History file")]),e._v(" "),i("input",{attrs:{type:"file",name:"archive_file"}})])}],a={render:n,staticRenderFns:s};t.a=a},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),o=s(a),l=i(4),r=s(l),d=i(19),c=s(d),u=i(62),h=s(u),f=i(112),p=s(f),m=c.default.extend({_showCopyDialog:function(e){var t=new h.default.History({id:e});t.fetch().fail(function(){alert("History could not be fetched. Please contact an administrator")}).done(function(){(0,p.default)(t,{}).done(function(){window.parent&&window.parent.Galaxy&&window.parent.Galaxy.currHistoryPanel&&window.parent.Galaxy.currHistoryPanel.loadCurrentHistory(),window.location.reload(!0)})})},_add_operation:function(t,i,n){var s=this,a=n.operation_config[i.label];"Copy"==i.label&&(i.onclick=function(e){s._showCopyDialog(e)}),a.allowed&&i.allow_popup&&t.addItem({html:i.label,href:a.url_args,target:a.target,confirmation_text:i.confirm,func:function(t){t.preventDefault();var a=e(t.target).html();i.onclick?i.onclick(n.encode_id):s.execute(this.findItemByHtml(a))}})}}),g=n.View.extend({title:(0,o.default)("Histories"),initialize:function(t){var i=this;this.setElement(e("")),this.model=new n.Model,r.default.get({url:Galaxy.root+"history/"+t.action_id+"?"+e.param(Galaxy.params),success:function(e){i.model.set(e),i.render()}})},render:function(){var e=new m(this.model.attributes);this.$el.empty().append(e.$el)}});t.default={View:g}}).call(t,i(0),i(2))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),o=s(a),l=i(4),r=s(l),d=i(6),c=s(d),u=i(11),h=s(u),f=e.View.extend({initialize:function(){this.setElement(""),this.model=new e.Model({dataset_id:Galaxy.params.dataset_id}),this.render()},render:function(){var e=Galaxy.root+"api/datasets/"+this.model.get("dataset_id"),t=this;r.default.get({url:e,success:function(e){var i=Galaxy.root+"api/jobs/"+e.creating_job+"?full=True";r.default.get({url:i,success:function(i){Galaxy.root,e.creating_job;t.render_error_page(t,e,i)},error:function(e){var i={status:"error",message:"Error occured while loading the job.",persistent:!0,cls:"errormessage"};t.display_message(i,t.$(".response-message"))}})},error:function(e){var i={status:"error",message:"Error occured while loading the dataset.",persistent:!0,cls:"errormessage"};t.display_message(i,t.$(".response-message"))}})},render_error_page:function(e,t,i){e.$el.empty().append(e._templateHeader()),e.$el.append("
Dataset Error
"),e.$el.append("
An error occured while running the tool "+i.tool_id+".
"),e.$el.append("
Tool execution generated the following messages:
"),e.$el.append('
'+i.stderr+"
"),e.$el.append("
Report This Error"),e.$el.append("
Usually the local Galaxy administrators regularly review errors that occur on the server. However, if you would like to provide additional information (such as what you were trying to do when the error occurred) and a contact e-mail address, we will be better able to investigate your problem and get back to you.
'},_getBugFormTemplate:function(e,t){var i=this,n=[{help:(0,o.default)("Your email address"),options:[],type:"text",name:"email",label:"Your email",value:Galaxy.user.get("email")},{help:(0,o.default)("Any additional comments you can provide regarding what you were doing at the time of the bug."),options:[],type:"text",area:!0,name:"message",label:"Message"}],s=new h.default({title:(0,o.default)("Error Report"),inputs:n,buttons:{save:new c.default.Button({icon:"fa-bug",title:(0,o.default)("Report"),cls:"ui-button btn btn-primary",floating:"clear",onclick:function(){var n=s.data.create(),a=Galaxy.root+"api/jobs/"+t.id+"/error";n.dataset_id=e.id,i.submit(n,a)}})}});return s.$el},submit:function(e,t){var i=this;n.ajax({type:"POST",url:t,data:e,success:function(e){i.$el.empty().append(i._templateHeader()),e.messages.forEach(function(e){i.display_message({status:e[1],message:e[0],persistent:!0},i.$(".response-message"),!0,!0)})},error:function(e){var t={status:"error",message:"Error occured while saving. Please fill all the required fields and try again.",persistent:!0,cls:"errormessage"};i.display_message(t,i.$(".response-message"))}})}});t.default={View:f}}).call(t,i(2),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=(a(r),i(43)),c=a(d),u=i(6),h=a(u),f=i(11),p=a(f),m=e.View.extend({initialize:function(){this.setElement(""),this.model=new e.Model({dataset_id:Galaxy.params.dataset_id}),this.message=new h.default.Message({persistent:!0}),this.tabs=this._createTabs(),this.$el.append(n("").append("Edit dataset attributes")).append(this.message.$el).append("").append(this.tabs.$el).hide(),this.render()},render:function(){var e=this;n.ajax({url:Galaxy.root+"dataset/get_edit?dataset_id="+e.model.get("dataset_id"),success:function(t){!e.initial_message&&e.message.update(t),e.initial_message=!0,s.each(e.forms,function(e,i){e.model.set("inputs",t[i+"_inputs"]),e.model.set("hide_operations",t[i+"_disable"]),e.render()}),e.$el.show()},error:function(t){var i=t.responseJSON&&t.responseJSON.err_msg;e.message.update({status:"danger",message:i||"Error occured while loading the dataset."})}})},_submit:function(e,t){var i=this,s=t.data.create();s.dataset_id=this.model.get("dataset_id"),s.operation=e,n.ajax({type:"PUT",url:Galaxy.root+"dataset/set_edit",data:s,success:function(e){i.message.update(e),i.render(),i._reloadHistory()},error:function(e){var t=e.responseJSON&&e.responseJSON.err_msg;i.message.update({status:"danger",message:t||"Error occured while editing the dataset attributes."})}})},_createTabs:function(){this.forms={attribute:this._getAttribute(),conversion:this._getConversion(),datatype:this._getDatatype(),permission:this._getPermission()};var e=new c.default.View;return e.add({id:"attribute",title:(0,l.default)("Attributes"),icon:"fa fa-bars",tooltip:(0,l.default)("Edit dataset attributes"),$el:this.forms.attribute.$el}),e.add({id:"convert",title:(0,l.default)("Convert"),icon:"fa-gear",tooltip:(0,l.default)("Convert to new format"),$el:this.forms.conversion.$el}),e.add({id:"datatype",title:(0,l.default)("Datatypes"),icon:"fa-database",tooltip:(0,l.default)("Change data type"),$el:this.forms.datatype.$el}),e.add({id:"permissions",title:(0,l.default)("Permissions"),icon:"fa-user",tooltip:(0,l.default)("Permissions"),$el:this.forms.permission.$el}),e},_getAttribute:function(){var e=this,t=new p.default({title:(0,l.default)("Edit attributes"),operations:{submit_attributes:new h.default.ButtonIcon({tooltip:(0,l.default)("Save attributes of the dataset."),icon:"fa-floppy-o",title:(0,l.default)("Save"),onclick:function(){e._submit("attributes",t)}}),submit_autodetect:new h.default.ButtonIcon({tooltip:"This will inspect the dataset and attempt to correct the values of fields if they are not accurate.",icon:"fa-undo",title:"Auto-detect",onclick:function(){e._submit("autodetect",t)}})}});return t},_getConversion:function(){var e=this,t=new p.default({title:(0,l.default)("Convert to new format"),operations:{submit_conversion:new h.default.ButtonIcon({tooltip:(0,l.default)("Convert the datatype to a new format."),title:(0,l.default)("Convert datatype"),icon:"fa-exchange",onclick:function(){e._submit("conversion",t)}})}});return t},_getDatatype:function(){var e=this,t=new p.default({title:(0,l.default)("Change datatype"),operations:{submit_datatype:new h.default.ButtonIcon({tooltip:(0,l.default)("Change the datatype to a new type."),title:(0,l.default)("Change datatype"),icon:"fa-exchange",onclick:function(){e._submit("datatype",t)}})}});return t},_getPermission:function(){var e=this,t=new p.default({title:(0,l.default)("Manage dataset permissions"),operations:{submit_permission:new h.default.ButtonIcon({tooltip:(0,l.default)("Save permissions."),title:(0,l.default)("Save permissions"),icon:"fa-floppy-o ",onclick:function(){e._submit("permission",t)}})}});return t},_reloadHistory:function(){window.Galaxy&&window.Galaxy.currHistoryPanel.loadCurrentHistory()}});t.default={View:m}}).call(t,i(2),i(0),i(1))}],[239]);
\ No newline at end of file
+this.get("accessible")||this.set("state",l.default.NOT_VIEWABLE),this.urls=this._generateUrls(),this._setUpListeners()},_generateUrls:function(){var e=this.get("id");if(!e)return{};var t={purge:"datasets/"+e+"/purge_async",display:"datasets/"+e+"/display/?preview=True",edit:"datasets/edit?dataset_id="+e,download:"datasets/"+e+"/display"+this._downloadQueryParameters(),report_error:"dataset/errors?id="+e,rerun:"tool_runner/rerun?id="+e,show_params:"datasets/"+e+"/show_params",visualization:"visualization",meta_download:"dataset/get_metadata_file?hda_id="+e+"&metadata_name="};return n.each(t,function(e,i){t[i]=Galaxy.root+e}),this.urls=t,t},_downloadQueryParameters:function(){return"?to_ext="+this.get("file_ext")},_setUpListeners:function(){this.on("change:state",function(e,t){this.log(this+" has changed state:",e,t),this.inReadyState()&&this.trigger("state:ready",e,t,this.previous("state"))}),this.on("change:id change:file_ext",function(e){this._generateUrls()})},toJSON:function(){var t=e.Model.prototype.toJSON.call(this);return n.extend(t,{urls:this.urls})},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},inReadyState:function(){var e=n.contains(l.default.READY_STATES,this.get("state"));return this.isDeletedOrPurged()||e},hasDetails:function(){return!this.get("accessible")||this.has("annotation")},hasData:function(){return this.get("file_size")>0},fetch:function(t){var i=this;return e.Model.prototype.fetch.call(this,t).always(function(){i._generateUrls()})},parse:function(t,i){var n=e.Model.prototype.parse.call(this,t,i);return n.create_time&&(n.create_time=new Date(n.create_time)),n.update_time&&(n.update_time=new Date(n.update_time)),n},save:function(t,i){return i=i||{},i.wait=!!n.isUndefined(i.wait)||i.wait,e.Model.prototype.save.call(this,t,i)},delete:function(e){return this.get("deleted")?s.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?s.when():this.save({deleted:!1},e)},purge:function(e){if(this.get("purged"))return s.when();e=e||{},e.url=this.urls.purge;var t=this,i=s.ajax(e);return i.done(function(e,i,n){t.set({deleted:!0,purged:!0})}),i.fail(function(i,n,s){var a=(0,u.default)("Unable to purge dataset");i.responseJSON&&i.responseJSON.error?a=i.responseJSON.error:-1!==i.responseText.indexOf("Removal of datasets by users is not allowed in this Galaxy instance")&&(a="Removal of datasets by users is not allowed in this Galaxy instance"),i.responseText=a,t.trigger("error",t,i,e,(0,u.default)(a),{error:a})}),i},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var e=this.get("id")||"";return this.get("name")&&(e='"'+this.get("name")+'",'+e),"Dataset("+e+")"}})),p=e.Collection.extend(d.default.LoggableMixin).extend({_logNamespace:"dataset",model:f,urlRoot:Galaxy.root+"api/datasets",url:function(){return this.urlRoot},ids:function(){return this.map(function(e){return e.get("id")})},notReady:function(){return this.filter(function(e){return!e.inReadyState()})},haveDetails:function(){return this.all(function(e){return e.hasDetails()})},ajaxQueue:function(e,t){var i=s.Deferred(),n=this.length,a=[];if(!n)return i.resolve([]),i;var o=this.chain().reverse().map(function(s,l){return function(){var r=e.call(s,t);r.done(function(e){i.notify({curr:l,total:n,response:e,model:s})}),r.always(function(e){a.push(e),o.length?o.shift()():i.resolve(a)})}}).value();return o.shift()(),i},matches:function(e){return this.filter(function(t){return t.matches(e)})},toString:function(){return["DatasetAssociationCollection(",this.length,")"].join("")}});t.default={DatasetAssociation:f,DatasetAssociationCollection:p}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(16),a=(n(s),i(5)),o=(n(a),i(3)),l=(n(o),1e3);try{l=localStorage.getItem("collectionFuzzyCountDefault")||l}catch(e){}var r={defaults:{history_id:null,history_content_type:null,hid:null,visible:!0},idAttribute:"type_id",hidden:function(){return!this.get("visible")},isVisible:function(e,t){var i=!0;return e||!this.get("deleted")&&!this.get("purged")||(i=!1),t||this.get("visible")||(i=!1),i},urlRoot:Galaxy.root+"api/histories/",url:function(){var e=this.get("history_content_type"),t=this.get("history_id"),i=this.get("id"),n=""+this.urlRoot+t+"/contents/"+e+"s/"+i;return"dataset_collection"==e&&(n=n+"?view=element-reference&fuzzy_count="+l),n},hide:function(t){return this.get("visible")?this.save({visible:!1},t):e.when()},unhide:function(t){return this.get("visible")?e.when():this.save({visible:!0},t)},toString:function(){return[this.get("type_id"),this.get("hid"),this.get("name")].join(":")}};t.default={HistoryContentMixin:r}}).call(t,i(0))},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i={_validationWarning:function(e,t){"name"===e&&(e=this.$(".collection-name").add(this.$(".collection-name-prompt")),this.$(".collection-name").focus().select()),t?(e=e||this.$(".validation-warning"),e.removeClass("validation-warning")):e.addClass("validation-warning")},_changeHideOriginals:function(e){this.hideOriginals=this.$(".hide-originals").prop("checked")},_changeName:function(e){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(e){13!==e.keyCode||this.blocking||this._clickCreate()},_getName:function(){return e.escape(this.$(".collection-name").val())},_clickMoreHelp:function(e){e.stopPropagation(),this.$(".main-help").addClass("expanded"),this.$(".more-help").hide()},_clickLessHelp:function(e){e.stopPropagation(),this.$(".main-help").removeClass("expanded"),this.$(".more-help").show()},_toggleHelp:function(e){e.stopPropagation(),this.$(".main-help").toggleClass("expanded"),this.$(".more-help").toggle()},_showAlert:function(e,t){t=t||"alert-danger",this.$(".main-help").hide(),this.$(".header .alert").attr("class","alert alert-dismissable").addClass(t).show().find(".alert-message").html(e)},_hideAlert:function(e){this.$(".main-help").show(),this.$(".header .alert").hide()},_cancelCreate:function(e){"function"==typeof this.oncancel&&this.oncancel.call(this)},_clickCreate:function(e){var t=this._getName();t?this.blocking||this.createList(t):this._validationWarning("name")},_setUpCommonSettings:function(e){this.hideOriginals=e.defaultHideSourceItems||!1},_renderFooter:function(t,i){var n=this,s=this.$(".footer").empty().html(this.templates.footer());return e.each(this.footerSettings,function(e,t){n.$(t).prop("checked",n[e])}),"function"==typeof this.oncancel&&this.$(".cancel-create.btn").show(),s},_creatorTemplates:{main:e.template(['','',''].join(""))}};t.default={CollectionCreatorMixin:i}}).call(t,i(1))},function(e,t,i){"use strict";function n(e,t){var i=/(-?[0-9\.]+)/g,n=e.toString().toLowerCase()||"",s=t.toString().toLowerCase()||"",a=String.fromCharCode(0),o=n.replace(i,a+"$1"+a).split(a),l=s.replace(i,a+"$1"+a).split(a),r=new Date(n).getTime(),d=r?new Date(s).getTime():null;if(d){if(rd)return 1}for(var c,u,h=0,f=Math.max(o.length,l.length);hu)return 1}return 0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,i){"use strict";var n=i(0),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=s.default;s.default.fn.extend({hoverhighlight:function(e,t){return e=e||"body",this.length?(a(this).each(function(){var i=a(this),n=i.data("target");n&&i.mouseover(function(i){a(n,e).css({background:t})}).mouseout(function(e){a(n).css({background:""})})}),this):this}})},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=a(r),c=i(87),u=a(c),h=i(6),f=a(h),p=i(11),m=a(p),g=i(90),_=a(g),v=i(45),y=a(v),w=i(8),b=a(w),x=i(34),C=a(x),$=i(61),k=a($),S=e.View.extend({initialize:function(t){var i=this;this.modal=parent.Galaxy.modal||new b.default.View,this.model=t&&t.model||new e.Model(t),this.deferred=new u.default,this.setElement(n("").addClass("ui-form-composite").append(this.$message=n("")).append(this.$header=n("")).append(this.$steps=n(""))),n("body").append(this.$el),this._configure(),this.render(),n(window).resize(function(){i._refresh()})},_refresh:function(e){var t=s.reduce(this.$el.children(),function(e,t){return e+n(t).outerHeight()},0)-this.$steps.height()+90;this.$steps.css("height",n(window).height()-t)},_configure:function(){function e(e,n){for(var s,a=/\$\{(.+?)\}/g;s=a.exec(String(e));){var o=s[1];n(t.wp_inputs[o]=t.wp_inputs[o]||{label:o,name:o,type:"text",color:"hsl( "+100*++i+", 70%, 30% )",style:"ui-form-wp-source",links:[]})}}var t=this;this.forms=[],this.steps=[],this.links=[],this.parms=[],s.each(this.model.get("steps"),function(e,i){Galaxy.emit.debug("tool-form-composite::initialize()",i+" : Preparing workflow step.");var n=k.default[e.step_type],a=parseInt(i+1)+": "+(e.step_label||e.step_name);e.annotation&&(a+=" - "+e.annotation),e.step_version&&(a+=" (Galaxy Version "+e.step_version+")"),e=d.default.merge({index:i,fixed_title:s.escape(a),icon:n||"",help:null,citations:null,collapsible:!0,collapsed:i>0&&!t._isDataStep(e),sustain_version:!0,sustain_repeats:!0,sustain_conditionals:!0,narrow:!0,text_enable:"Edit",text_disable:"Undo",cls_enable:"fa fa-edit",cls_disable:"fa fa-undo",errors:e.messages,initial_errors:!0,cls:"ui-portlet-narrow",hide_operations:!0,needs_refresh:!1,always_refresh:"tool"!=e.step_type},e),t.steps[i]=e,t.links[i]=[],t.parms[i]={}}),s.each(this.steps,function(e,i){_.default.visitInputs(e.inputs,function(e,n){t.parms[i][n]=e})}),s.each(this.steps,function(e,i){s.each(e.output_connections,function(e){s.each(t.steps,function(n,s){n.step_index===e.input_step_index&&t.links[i].push(n)})})}),s.each(this.steps,function(e,i){s.each(t.steps,function(n,a){var o={};s.each(e.output_connections,function(e){n.step_index===e.input_step_index&&(o[e.input_name]=e)}),s.each(t.parms[a],function(t,n){var s=o[n];s&&(t.type="hidden",t.help=t.step_linked?t.help+", ":"",t.help+="Output dataset '"+s.output_name+"' from step "+(parseInt(i)+1),t.step_linked=t.step_linked||[],t.step_linked.push(e))})})});var i=0;this.wp_inputs={},s.each(this.steps,function(i,n){s.each(t.parms[n],function(t,n){e(t.value,function(e){e.links.push(i),t.wp_linked=!0,t.type="text",t.backdrop=!0,t.style="ui-form-wp-target"})}),s.each(i.post_job_actions,function(t){s.each(t.action_arguments,function(t){e(t,function(){})})})}),s.each(this.steps,function(e,i){if("tool"==e.step_type){var n=!0;_.default.visitInputs(e.inputs,function(i,s,a){var o=i.value&&"RuntimeValue"==i.value.__class__,l=-1!=["data","data_collection"].indexOf(i.type),r=a[i.data_ref];i.step_linked&&!t._isDataStep(i.step_linked)&&(n=!1),i.options&&(0==i.options.length&&!n||i.wp_linked)&&(i.is_workflow=!0),r&&(i.is_workflow=r.step_linked&&!t._isDataStep(r.step_linked)||i.wp_linked),(l||i.value&&"RuntimeValue"==i.value.__class__&&!i.step_linked)&&(e.collapsed=!1),o&&(i.value=i.default_value),i.flavor="workflow",o||l||"hidden"===i.type||i.wp_linked||(i.optional||!d.default.isEmpty(i.value)&&""!==i.value)&&(i.collapsible_value=i.value,i.collapsible_preview=!0)})}})},render:function(){var e=this;this.deferred.reset(),this._renderHeader(),this._renderMessage(),this._renderParameters(),this._renderHistory(),s.each(this.steps,function(t){e._renderStep(t)})},_renderHeader:function(){var e=this;this.execute_btn=new f.default.Button({icon:"fa-check",title:(0,l.default)("Run workflow"),cls:"btn btn-primary",onclick:function(){e._execute()}}),this.$header.addClass("ui-form-header").empty().append(new f.default.Label({title:"Workflow: "+this.model.get("name")}).$el).append(this.execute_btn.$el)},_renderMessage:function(){this.$message.empty(),this.model.get("has_upgrade_messages")&&this.$message.append(new f.default.Message({message:"Some tools in this workflow may have changed since it was last saved or some errors were found. The workflow may still run, but any new options will have default values. Please review the messages below to make a decision about whether the changes will affect your analysis.",status:"warning",persistent:!0,fade:!1}).$el);var e=this.model.get("step_version_changes");e&&e.length>0&&this.$message.append(new f.default.Message({message:"Some tools are being executed with different versions compared to those available when this workflow was last saved because the other versions are not or no longer available on this Galaxy instance. To upgrade your workflow and dismiss this message simply edit the workflow and re-save it.",status:"warning",persistent:!0,fade:!1}).$el)},_renderParameters:function(){var e=this;this.wp_form=null,s.isEmpty(this.wp_inputs)||(this.wp_form=new m.default({title:"Workflow Parameters",inputs:this.wp_inputs,cls:"ui-portlet-narrow",onchange:function(){s.each(e.wp_form.input_list,function(t,i){s.each(t.links,function(t){e._refreshStep(t)})})}}),this._append(this.$steps.empty(),this.wp_form.$el))},_renderHistory:function(){this.history_form=new m.default({cls:"ui-portlet-narrow",title:"History Options",inputs:[{type:"conditional",name:"new_history",test_param:{name:"check",label:"Send results to a new history",type:"boolean",value:"false",help:""},cases:[{value:"true",inputs:[{name:"name",label:"History name",type:"text",value:this.model.get("name")}]}]}]}),this._append(this.$steps,this.history_form.$el)},_renderStep:function(e){var t=this,i=null;this.deferred.execute(function(a){if(t.$steps.addClass("ui-steps"),"tool"==e.step_type)e.postchange=function(t,i){var s={tool_id:e.id,tool_version:e.version,inputs:n.extend(!0,{},i.data.create())};i.wait(!0),Galaxy.emit.debug("tool-form-composite::postchange()","Sending current state.",s),d.default.request({type:"POST",url:Galaxy.root+"api/tools/"+e.id+"/build",data:s,success:function(e){i.update(e),i.wait(!1),Galaxy.emit.debug("tool-form-composite::postchange()","Received new model.",e),t.resolve()},error:function(e){Galaxy.emit.debug("tool-form-composite::postchange()","Refresh request failed.",e),t.reject()}})},i=new y.default(e),e.post_job_actions&&e.post_job_actions.length&&i.portlet.append(n("").addClass("ui-form-element-disabled").append(n("").addClass("ui-form-title").html("Job Post Actions")).append(n("").addClass("ui-form-preview").html(s.reduce(e.post_job_actions,function(e,t){return e+" "+t.short_str},""))));else{var o=-1!=["data_input","data_collection_input"].indexOf(e.step_type);s.each(e.inputs,function(e){e.flavor="module",e.hide_label=o}),i=new m.default(d.default.merge({title:e.fixed_title,onchange:function(){s.each(t.links[e.index],function(e){t._refreshStep(e)})},inputs:e.inputs&&e.inputs.length>0?e.inputs:[{type:"hidden",name:"No options available.",ignore:null}]},e))}t.forms[e.index]=i,t._append(t.$steps,i.$el),t._refresh(),e.needs_refresh&&t._refreshStep(e),i.portlet[t.show_progress?"disable":"enable"](),t.show_progress&&t.execute_btn.model.set({wait:!0,wait_text:"Preparing...",percentage:100*(e.index+1)/t.steps.length}),Galaxy.emit.debug("tool-form-composite::initialize()",e.index+" : Workflow step state ready.",e),setTimeout(function(){a.resolve()},0)})},_refreshStep:function(e){var t=this,i=this.forms[e.index];i?(s.each(t.parms[e.index],function(e,n){if(e.step_linked||e.wp_linked){var a=i.field_list[i.data.match(n)];if(a){var o=void 0;if(e.step_linked)o={values:[]},s.each(e.step_linked,function(e){if(t._isDataStep(e)){var i=t.forms[e.index].data.create().input;i&&s.each(i.values,function(e){o.values.push(e)})}}),!e.multiple&&o.values.length>0&&(o={values:[o.values[0]]});else if(e.wp_linked){o=e.value;for(var l,r=/\$\{(.+?)\}/g;l=r.exec(e.value);){var d=t.wp_form.field_list[t.wp_form.data.match(l[1])],c=d&&d.value();c&&(o=o.split(l[0]).join(c))}}void 0!==o&&a.value(o)}}}),i.trigger("change")):e.needs_refresh=!0},_refreshHistory:function(){var e=this,t=parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.model;this._refresh_history&&clearTimeout(this._refresh_history),t&&t.refresh().success(function(){0===t.numOfUnfinishedShownContents()&&(e._refresh_history=setTimeout(function(){e._refreshHistory()},t.UPDATE_DELAY))})},_execute:function(){var e=this;this.show_progress=!0,this._enabled(!1),this.deferred.execute(function(t){setTimeout(function(){t.resolve(),e._submit()},0)})},_submit:function(){var e=this,t=this.history_form.data.create(),i={new_history_name:t["new_history|name"]?t["new_history|name"]:null,history_id:t["new_history|name"]?null:this.model.get("history_id"),replacement_params:this.wp_form?this.wp_form.data.create():{},parameters:{},parameters_normalized:!0,batch:!0},s=!0;for(var a in this.forms){var o=this.forms[a],r=o.data.create(),c=e.steps[a],u=c.step_index;o.trigger("reset");for(var h in r){var f=r[h],p=o.data.match(h),m=(o.field_list[p],o.input_list[p]);if(!m.step_linked){if(!(s=this._isDataStep(c)?f&&f.values&&f.values.length>0:m.optional||m.is_workflow&&""!==f||!m.is_workflow&&null!==f)){o.highlight(p);break}i.parameters[u]=i.parameters[u]||{},i.parameters[u][h]=r[h]}}if(!s)break}s?(Galaxy.emit.debug("tool-form-composite::submit()","Validation complete.",i),d.default.request({type:"POST",url:Galaxy.root+"api/workflows/"+this.model.id+"/invocations",data:i,success:function(t){if(Galaxy.emit.debug("tool-form-composite::submit","Submission successful.",t),e.$el.children().hide(),e.$el.append(e._templateSuccess(t)),n.isArray(t)&&t.length>0){e.$el.append(n("",{id:"webhook-view"}));new C.default.WebhookView({urlRoot:Galaxy.root+"api/webhooks/workflow",toolId:i.tool_id,toolVersion:i.tool_version})}e._refreshHistory()},error:function(t){Galaxy.emit.debug("tool-form-composite::submit","Submission failed.",t);var n=!1;if(t&&t.err_data)for(var s in e.forms){var a=e.forms[s],o=t.err_data[a.model.get("step_index")];if(o){var r=a.data.matchResponse(o);for(var d in r){a.highlight(d,r[d]),n=!0;break}}}n||e.modal.show({title:(0,l.default)("Workflow submission failed"),body:e._templateError(i,t&&t.err_msg),buttons:{Close:function(){e.modal.hide()}}})},complete:function(){e._enabled(!0)}})):(e._enabled(!0),Galaxy.emit.debug("tool-form-composite::submit()","Validation failed.",i))},_append:function(e,t){e.append("").append(t)},_enabled:function(e){this.execute_btn.model.set({wait:!e,wait_text:"Sending...",percentage:-1}),this.wp_form&&this.wp_form.portlet[e?"enable":"disable"](),this.history_form&&this.history_form.portlet[e?"enable":"disable"](),s.each(this.forms,function(t){t&&t.portlet[e?"enable":"disable"]()})},_isDataStep:function(e){for(var t=n.isArray(e)?e:[e],i=0;i0?n("").addClass("donemessagelarge").append(n("").html("Successfully invoked workflow "+d.default.sanitize(this.model.get("name"))+""+(e.length>1?" "+e.length+" times":"")+".")).append(n("").append("").text("You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered.")):this._templateError(e,"Invalid success response. No invocations found.")},_templateError:function(e,t){return n("").addClass("errormessagelarge").append(n("").text("The server could not complete the request. Please contact the Galaxy Team if this error persists. "+(JSON.stringify(t)||""))).append(n("").text(JSON.stringify(e,null,4)))}});t.default={View:S}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(8),l=a(o),r=i(113),d=a(r),c=i(3),u=a(c),h={defaultName:e.template("Copy of '<%- name %>'"),title:e.template((0,u.default)("Copying history")+' "<%- name %>"'),submitLabel:(0,u.default)("Copy"),errorMessage:(0,u.default)("History could not be copied."),progressive:(0,u.default)("Copying history"),activeLabel:(0,u.default)("Copy only the active, non-deleted datasets"),allLabel:(0,u.default)("Copy all datasets including deleted ones"),anonWarning:(0,u.default)("As an anonymous user, unless you login or register, you will lose your current history ")+(0,u.default)("after copying this history. "),_template:e.template(["<% if( isAnon ){ %>",'
";this.modal.$(".modal-body").empty().append(e).css({"margin-top":"8px"})},dialog:function(t,i,a){function o(){var e=t.$("#copy-modal-title").val();if(!e)return void t.$(".invalid-title").show();var n="copy-all"===t.$('input[name="copy-what"]:checked').val();t.$("button").prop("disabled",!0),l._showAjaxIndicator(),i.copy(!0,e,n).done(function(e){r.resolve(e)}).fail(function(t,s,a){var o={name:e,copyAllDatasets:n};d.default.ajaxErrorModal(i,t,o,l.errorMessage),r.rejectWith(r,arguments)}).done(function(){m&&t.hide()})}a=a||{};var l=this,r=n.Deferred(),c=a.nameFn||this.defaultName,h=c({name:i.get("name")}),f=a.allDatasets?"copy-all":"copy-non-deleted",p=!!e.isUndefined(a.allowAll)||a.allowAll,m=!!e.isUndefined(a.autoClose)||a.autoClose;this.modal=t;var g=a.closing_callback;return t.show(e.extend(a,{title:this.title({name:i.get("name")}),body:s(l._template({name:h,isAnon:Galaxy.user.isAnonymous(),allowAll:p,copyWhat:f,activeLabel:this.activeLabel,allLabel:this.allLabel,anonWarning:this.anonWarning})),buttons:e.object([[(0,u.default)("Cancel"),function(){t.hide()}],[this.submitLabel,o]]),height:"auto",closing_events:!0,closing_callback:function(e){e&&r.reject({cancelled:!0}),g&&g(e)}})),t.$("#copy-modal-title").focus().select(),t.$("#copy-modal-title").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),o())}),r}},f=e.extend({},h,{defaultName:e.template("imported: <%- name %>"),title:e.template((0,u.default)("Importing history")+' "<%- name %>"'),submitLabel:(0,u.default)("Import"),errorMessage:(0,u.default)("History could not be imported."),progressive:(0,u.default)("Importing history"),activeLabel:(0,u.default)("Import only the active, non-deleted datasets"),allLabel:(0,u.default)("Import all datasets including deleted ones"),anonWarning:(0,u.default)("As an anonymous user, unless you login or register, you will lose your current history ")+(0,u.default)("after importing this history. ")}),p=function(e,t){t=t||{};var i=window.parent.Galaxy.modal||new l.default.View({});return t.useImport?f.dialog(i,e,t):h.dialog(i,e,t)};t.default=p}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";(function(e,n){function s(t,i,n){return Galaxy.modal.show({title:i,body:t,closing_events:!0,buttons:{Ok:function(){Galaxy.modal.hide()}}}),Galaxy.modal.$el.addClass("error-modal"),n&&(Galaxy.modal.$(".error-details").add(Galaxy.modal.$('button:contains("Details")')).remove(),e("").addClass("error-details").hide().appendTo(Galaxy.modal.$(".modal-content")).append([e("").text(p),e("").text(JSON.stringify(n,null," "))]),e('").appendTo(Galaxy.modal.$(".buttons")).click(function(){Galaxy.modal.$(".error-details").toggle()})),Galaxy.modal}function a(e,t,i){if(e){if(e=(0,u.default)(e),t=(0,u.default)(t)||(0,u.default)("Error:"),window.Galaxy&&Galaxy.modal)return s(e,t,i);alert(t+"\n\n"+e),console.log("error details:",JSON.stringify(i))}}function o(){return a((0,u.default)("You appear to be offline. Please check your connection and try again."),(0,u.default)("Offline?"))}function l(){return a((0,u.default)("Galaxy is currently unreachable. Please try again in a few minutes.")+" "+h,(0,u.default)("Cannot connect to Galaxy"))}function r(e,t,i,n,s){return n=n||f,n+=" "+h,s=s||(0,u.default)("An error occurred"),a(n,s,d(e,t,i))}function d(e,t,i){return{raven:n.result(window.Raven,"lastEventId"),userAgent:navigator.userAgent,onLine:navigator.onLine,version:n.result(Galaxy.config,"version_major"),xhr:n.omit(t,n.functions(t)),options:n.omit(i,"xhr"),url:n.result(Galaxy.lastAjax,"url"),data:n.result(Galaxy.lastAjax,"data"),model:n.result(e,"toJSON",""+e),user:n.omit(n.result(Galaxy.user,"toJSON"),"email")}}Object.defineProperty(t,"__esModule",{value:!0});var c=i(3),u=function(e){return e&&e.__esModule?e:{default:e}}(c),h=(0,u.default)("Please contact a Galaxy administrator if the problem persists."),f=(0,u.default)("An error occurred while updating information with the server."),p=(0,u.default)("The following information can assist the developers in finding the source of the error:");t.default={errorModal:a,offlineErrorModal:o,badGatewayErrorModal:l,ajaxErrorModal:r}}).call(t,i(0),i(1))},function(e,t,i){"use strict";(function(e){function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}Object.defineProperty(t,"__esModule",{value:!0});var s=i(1),a=n(s),o=i(2),l=n(o),r=i(5),d=function(e){return e&&e.__esModule?e:{default:e}}(r),c=l.Collection.extend({initialize:function(e,t){l.Collection.prototype.initialize.call(this,e,t),this.setOrder(t.order||this.order,{silent:!0})},_setUpListeners:function(){return this.on({"changed-order":this.sort})},fetch:function(e){return e=this._buildFetchOptions(e),Galaxy.debug("fetch options:",e),l.Collection.prototype.fetch.call(this,e)},_buildFetchOptions:function(e){e=a.clone(e)||{};var t=this;e.traditional=!0,e.data=e.data||t._buildFetchData(e),Galaxy.debug("data:",e.data);var i=this._buildFetchFilters(e);return Galaxy.debug("filters:",i),a.isEmpty(i)||a.extend(e.data,this._fetchFiltersToAjaxData(i)),Galaxy.debug("data:",e.data),e},_buildFetchData:function(e){var t={};return this.order&&(t.order=this.order),a.defaults(a.pick(e,this._fetchParams),t)},_fetchParams:["order","limit","offset","view","keys"],_buildFetchFilters:function(e){return a.clone(e.filters||{})},_fetchFiltersToAjaxData:function(e){var t={q:[],qv:[]};return a.each(e,function(e,i){void 0!==e&&""!==e&&(!0===e&&(e="True"),!1===e&&(e="False"),null===e&&(e="None"),t.q.push(i),t.qv.push(e))}),t},reset:function(e,t){return this.allFetched=!1,l.Collection.prototype.reset.call(this,e,t)},order:null,comparators:{update_time:d.default.buildComparator("update_time",{ascending:!1}),"update_time-asc":d.default.buildComparator("update_time",{ascending:!0}),create_time:d.default.buildComparator("create_time",{ascending:!1}),"create_time-asc":d.default.buildComparator("create_time",{ascending:!0})},setOrder:function(e,t){t=t||{};var i=this,n=i.comparators[e];if(a.isUndefined(n))throw new Error("unknown order: "+e);if(n!==i.comparator)return i.order=e,i.comparator=n,t.silent||i.trigger("changed-order",t),i}}),u=c.extend({limitPerPage:500,initialize:function(e,t){c.prototype.initialize.call(this,e,t),this.currentPage=t.currentPage||0},getTotalItemCount:function(){return this.length},shouldPaginate:function(){return this.getTotalItemCount()>=this.limitPerPage},getLastPage:function(){return Math.floor(this.getTotalItemCount()/this.limitPerPage)},getPageCount:function(){return this.getLastPage()+1},getPageLimitOffset:function(e){return e=this.constrainPageNum(e),{limit:this.limitPerPage,offset:e*this.limitPerPage}},constrainPageNum:function(e){return Math.max(0,Math.min(e,this.getLastPage()))},fetchPage:function(e,t){var i=this;return e=i.constrainPageNum(e),i.currentPage=e,t=a.defaults(t||{},i.getPageLimitOffset(e)),i.trigger("fetching-more"),i.fetch(t).always(function(){i.trigger("fetching-more-done")})},fetchCurrentPage:function(e){return this.fetchPage(this.currentPage,e)},fetchPrevPage:function(e){return this.fetchPage(this.currentPage-1,e)},fetchNextPage:function(e){return this.fetchPage(this.currentPage+1,e)}}),h=c.extend({limitOnFirstFetch:null,limitPerFetch:100,initialize:function(e,t){c.prototype.initialize.call(this,e,t),this.limitOnFirstFetch=t.limitOnFirstFetch||this.limitOnFirstFetch,this.limitPerFetch=t.limitPerFetch||this.limitPerFetch,this.allFetched=!1,this.lastFetched=t.lastFetched||0},_buildFetchOptions:function(e){return e.remove=e.remove||!1,c.prototype._buildFetchOptions.call(this,e)},fetchFirst:function(e){return Galaxy.debug("ControlledFetchCollection.fetchFirst:",e),e=e?a.clone(e):{},this.allFetched=!1,this.lastFetched=0,this.fetchMore(a.defaults(e,{reset:!0,limit:this.limitOnFirstFetch}))},fetchMore:function(t){Galaxy.debug("ControlledFetchCollection.fetchMore:",t),t=a.clone(t||{});var i=this;if(Galaxy.debug("fetchMore, options.reset:",t.reset),!t.reset&&i.allFetched)return e.when();t.reset?t.offset=0:void 0===t.offset&&(t.offset=i.lastFetched);var n=t.limit=t.limit||i.limitPerFetch||null;return Galaxy.debug("fetchMore, limit:",n,"offset:",t.offset),i.trigger("fetching-more"),i.fetch(t).always(function(){i.trigger("fetching-more-done")}).done(function(e){var t=a.isArray(e)?e.length:0;i.lastFetched+=t,Galaxy.debug("fetchMore, lastFetched:",i.lastFetched),(!n||t1?this.renderItems():1===i.added.length?this.addItemView(n.first(i.added),e,t):1===i.removed.length?this.removeItemView(n.first(i.removed),e,t):void 0}}),this},_setUpViewListeners:function(){this.log(this+"._setUpViewListeners"),this.on({"view:selected":function(e,t){if(t&&t.shiftKey&&this.lastSelected){var i=this.viewFromModelId(this.lastSelected);i&&this.selectRange(e,i)}else t&&t.altKey&&!this.selecting&&this.showSelectors();this.selected.push(e.model.id),this.lastSelected=e.model.id},"view:de-selected":function(e,t){this.selected=n.without(this.selected,e.model.id)}})},render:function(e){this.log(this+".render",e);var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){this.debug(this+"(ListPanel)._buildNewRender");var e=s(this.templates.el({},this));return this._renderControls(e),this._renderTitle(e),this._renderSubtitle(e),this._renderSearch(e),this.renderItems(e),e},_renderControls:function(e){this.debug(this+"(ListPanel)._renderControls");var t=s(this.templates.controls({},this));return e.find(".controls").replaceWith(t),t},_renderTitle:function(e){},_renderSubtitle:function(e){},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;i.log("_queueNewRender:",e,t),s(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",this.className).append(e.children()),this.selecting&&this.showSelectors(0),this},_setUpBehaviors:function(e){return e=e||this.$el,this.$controls(e).find("[title]").tooltip(),this._renderMultiselectActionMenu(e),this},_renderMultiselectActionMenu:function(e){e=e||this.$el;var t=e.find(".list-action-menu"),i=this.multiselectActions();if(!i.length)return t.empty();var n=s(['
';if(s.errored()){return"a "+i+" with "+s.numInError()+" / "+o+" jobs in error"}if(s.terminal())return n;var l=s.states().running||0,r=s.states().ok||0,c=r/(1*o),u=l/(1*o),h=1-c-u;return'\n
\n '+(o&&o>1?o+" jobs":"a job")+" generating a "+i+'\n \n \n
\n
'}return'\n
\n Loading job data for '+i+'...\n
\n
'}return n},toString:function(){return"HDCAListItemView("+(this.model?""+this.model:"(no model)")+")"}});g.prototype.templates=function(){var t=e.extend({},m.prototype.templates.warnings,{hidden:function(e){e.visible||(0,p.default)("This collection has been hidden")}}),i=function(t){return'\n
'};return e.extend(e.clone(p.prototype.templates),{controls:t})}(),t.default={collectionTypeDescription:s,collectionDescription:a,CollectionView:m}}).call(t,i(1))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(16),o=s(a),l=i(66),r=s(l),d=i(39),c=s(d),u=i(124),h=s(u),f=i(21),p=s(f),m=i(5),g=s(m),_=i(3),v=s(_),y=r.default.DatasetListItemView,w=y.extend({initialize:function(e){y.prototype.initialize.call(this,e),this.hasUser=e.hasUser,this.purgeAllowed=e.purgeAllowed||!1,this.tagsEditorShown=e.tagsEditorShown||!1,this.annotationEditorShown=e.annotationEditorShown||!1},_renderPrimaryActions:function(){var e=y.prototype._renderPrimaryActions.call(this);return this.model.get("state")===o.default.NOT_VIEWABLE?e:y.prototype._renderPrimaryActions.call(this).concat([this._renderEditButton(),this._renderDeleteButton()])},_renderEditButton:function(){var t=this;if(this.model.get("state")===o.default.DISCARDED||!this.model.get("accessible"))return null;var i=this.model.get("purged"),n=this.model.get("deleted"),s={title:(0,v.default)("Edit attributes"),href:Galaxy.root+"datasets/edit?dataset_id="+this.model.attributes.id,faIcon:"fa-pencil",classes:"edit-btn",onclick:function(e){Galaxy.router&&(e.preventDefault(),Galaxy.router.push("datasets/edit",{dataset_id:t.model.attributes.id}))}};return n||i?(s.disabled=!0,i?s.title=(0,v.default)("Cannot edit attributes of datasets removed from disk"):n&&(s.title=(0,v.default)("Undelete dataset to edit attributes"))):e.contains([o.default.UPLOAD,o.default.NEW],this.model.get("state"))&&(s.disabled=!0,s.title=(0,v.default)("This dataset is not yet editable")),(0,p.default)(s)},_renderDeleteButton:function(){if(!this.model.get("accessible"))return null;var e=this,t=this.model.isDeletedOrPurged();return(0,p.default)({title:t?(0,v.default)("Dataset is already deleted"):(0,v.default)("Delete"),disabled:t,faIcon:"fa-times",classes:"delete-btn",onclick:function(){e.$el.find(".icon-btn.delete-btn").trigger("mouseout"),e.model.delete()}})},_renderDetails:function(){var t=y.prototype._renderDetails.call(this),i=this.model.get("state");return!this.model.isDeletedOrPurged()&&e.contains([o.default.OK,o.default.FAILED_METADATA],i)&&(this._renderTags(t),this._renderAnnotation(t),this._makeDbkeyEditLink(t)),this._setUpBehaviors(t),t},_renderToolHelpButton:function(){var e=this.model.attributes.dataset_id,t=this.model.attributes.creating_job,i=this,s=function(t){var s='
';t.name&&t.help?(s+="Tool help for "+t.name+"",s+=t.help):s+="Tool help is unavailable for this dataset.",s+="
",i.$el.find(".details").append(n.parseHTML(s))},a=function(e){n.ajax({url:Galaxy.root+"api/tools/"+e.tool_id+"/build"}).done(function(e){s(e)}).fail(function(){s({})})};return null===Galaxy.user.id?null:(0,p.default)({title:(0,v.default)("Tool Help"),classes:"icon-btn",href:"#",faIcon:"fa-question",onclick:function(){i.$el.find(".toolhelp").length>0?i.$el.find(".toolhelp").toggle():n.ajax({url:Galaxy.root+"api/jobs/"+t}).done(function(e){a(e)}).fail(function(){console.log('Failed at recovering job information from the Galaxy API for job id "'+t+'".')})}})},_renderSecondaryActions:function(){var e=y.prototype._renderSecondaryActions.call(this);switch(this.model.get("state")){case o.default.UPLOAD:case o.default.NOT_VIEWABLE:return e;case o.default.ERROR:return e.unshift(this._renderErrButton()),e.concat([this._renderRerunButton(),this._renderToolHelpButton()]);case o.default.OK:case o.default.FAILED_METADATA:return e.concat([this._renderRerunButton(),this._renderVisualizationsButton(),this._renderToolHelpButton()])}return e.concat([this._renderRerunButton(),this._renderToolHelpButton()])},_renderErrButton:function(){var e=this;return(0,p.default)({title:(0,v.default)("View or report this error"),href:Galaxy.root+"datasets/error?dataset_id="+this.model.attributes.id,classes:"report-error-btn",faIcon:"fa-bug",onclick:function(t){Galaxy.router&&(t.preventDefault(),Galaxy.router.push("datasets/error",{dataset_id:e.model.attributes.id}))}})},_renderRerunButton:function(){var e=this.model.get("creating_job");if(this.model.get("rerunnable"))return(0,p.default)({title:(0,v.default)("Run this job again"),href:this.model.urls.rerun,classes:"rerun-btn",target:this.linkTarget,faIcon:"fa-refresh",onclick:function(t){Galaxy.router&&(t.preventDefault(),Galaxy.router.push("/",{job_id:e}))}})},_renderVisualizationsButton:function(){var t=this.model.get("visualizations");if(this.model.isDeletedOrPurged()||!this.hasUser||!this.model.hasData()||e.isEmpty(t))return null;if(!e.isObject(t[0]))return this.warn("Visualizations have been switched off"),null;var i=n(this.templates.visualizations(t,this));return i.find('[target="galaxy_main"]').attr("target",this.linkTarget),this._addScratchBookFn(i.find(".visualization-link").addBack(".visualization-link")),i},_addScratchBookFn:function(e){e.click(function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:(0,v.default)("Visualization"),url:n(this).attr("href")}),e.preventDefault(),e.stopPropagation())})},_renderTags:function(e){if(this.hasUser){var t=this;this.tagsEditor=new c.default.TagsEditor({model:this.model,el:e.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.tagsEditorShown=!0},onhide:function(){t.tagsEditorShown=!1},$activator:(0,p.default)({title:(0,v.default)("Edit dataset tags"),classes:"tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".actions .right"))}),this.tagsEditorShown&&this.tagsEditor.toggle(!0)}},_renderAnnotation:function(e){if(this.hasUser){var t=this;this.annotationEditor=new h.default.AnnotationEditor({model:this.model,el:e.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.annotationEditorShown=!0},onhide:function(){t.annotationEditorShown=!1},$activator:(0,p.default)({title:(0,v.default)("Edit dataset annotation"),classes:"annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".actions .right"))}),this.annotationEditorShown&&this.annotationEditor.toggle(!0)}},_makeDbkeyEditLink:function(e){if("?"===this.model.get("metadata_dbkey")&&!this.model.isDeletedOrPurged()){var t=n('?').attr("href",this.model.urls.edit).attr("target","_top");e.find(".dbkey .value").replaceWith(t)}},events:e.extend(e.clone(y.prototype.events),{"click .undelete-link":"_clickUndeleteLink","click .purge-link":"_clickPurgeLink","click .edit-btn":function(e){this.trigger("edit",this,e)},"click .delete-btn":function(e){this.trigger("delete",this,e)},"click .rerun-btn":function(e){this.trigger("rerun",this,e)},"click .report-err-btn":function(e){this.trigger("report-err",this,e)},"click .visualization-btn":function(e){this.trigger("visualize",this,e)},"click .dbkey a":function(e){this.trigger("edit",this,e)}}),_clickUndeleteLink:function(e){return this.model.undelete(),!1},_clickPurgeLink:function(e){return confirm((0,v.default)("This will permanently remove the data in your dataset. Are you sure?"))&&this.model.purge(),!1},toString:function(){return"HDAEditView("+(this.model?""+this.model:"(no model)")+")"}});w.prototype.templates=function(){var t=e.extend({},y.prototype.templates.warnings,{failed_metadata:g.default.wrapTemplate(['<% if( dataset.state === "failed_metadata" ){ %>','
',"",(0,c.default)("Search did not match any tools."),"","
","
",'','','
',"",(0,c.default)("Workflows"),"","
",'
','',"
","
"].join("")},toString:function(){return"toolPanel"}}));t.default=h}).call(t,i(2),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),a=n(s),o=i(4),l=n(o),r=i(8),d=n(r),c=i(43),u=n(c),h=i(242),f=n(h),p=i(243),m=n(p),g=i(246),_=n(g),v=i(248),y=n(v);t.default=e.View.extend({options:{nginx_upload_path:"",ftp_upload_site:"n/a",default_genome:"?",default_extension:"auto",height:500,width:900,auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."}},list_extensions:[],list_genomes:[],initialize:function(e){var t=this;this.options=l.default.merge(e,this.options),this.ui_button=new f.default.View({onclick:function(e){e.preventDefault(),t.show()},onunload:function(){var e=t.ui_button.model.get("percentage",0);if(e>0&&e<100)return"Several uploads are queued."}}),this.setElement(this.ui_button.$el);var t=this;l.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(e){for(var i in e)t.list_extensions.push({id:e[i].extension,text:e[i].extension,description:e[i].description,description_url:e[i].description_url,composite_files:e[i].composite_files});t.list_extensions.sort(function(e,t){var i=e.text&&e.text.toLowerCase(),n=t.text&&t.text.toLowerCase();return i>n?1:ii.text?1:e.text0){var n={file_count:e.length,dbkey:e[0].get("genome","?"),file_type:e[0].get("extension","auto")};for(var s in e){var a=e[s];if(a.set("status","running"),!(a.get("file_size")>0)){i.error_message="Upload content incomplete.",a.set("status","error"),a.set("info",i.error_message);break}var o="files_"+s+"|";switch(n[o+"type"]="upload_dataset",n[o+"space_to_tab"]=a.get("space_to_tab")&&"Yes"||null,n[o+"to_posix_lines"]=a.get("to_posix_lines")&&"Yes"||null,n[o+"dbkey"]=a.get("genome",null),n[o+"file_type"]=a.get("extension",null),a.get("file_mode")){case"new":n[o+"url_paste"]=a.get("url_paste");break;case"ftp":n[o+"ftp_files"]=a.get("file_path");break;case"local":i.files.push({name:o+"file_data",file:a.get("file_data")})}}i.payload.inputs=JSON.stringify(n)}return i}})}).call(t,i(2))},function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),a=function(e){return e&&e.__esModule?e:{default:e}}(s),o=e.View.extend({initialize:function(t){var i=this;this.model=t&&t.model||new e.Model({icon:"fa-upload",tooltip:(0,a.default)("Download from URL or upload files from disk"),label:"Load Data",percentage:0,status:"",onunload:function(){},onclick:function(){}}).set(t),this.setElement(this._template()),this.$progress=this.$(".progress-bar"),this.listenTo(this.model,"change",this.render,this),this.render(),n(window).on("beforeunload",function(){return i.model.get("onunload")()})},render:function(){var e=this.model.attributes;this.$el.off("click").on("click",function(t){e.onclick(t)}).tooltip({title:this.model.get("tooltip"),placement:"bottom"}),this.$progress.removeClass().addClass("progress-bar").addClass("progress-bar-notransition").addClass(""!=e.status&&"progress-bar-"+e.status).css({width:e.percentage+"%"})},_template:function(){return'
'}});t.default={View:o}}).call(t,i(2),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=(a(r),i(29)),c=a(d),u=i(244),h=a(u),f=i(55),p=a(f),m=i(56),g=a(m),_=i(15),v=a(_),y=i(10),w=a(y),b=i(6),x=a(b),C=i(245),$=a(C);i(57),t.default=e.View.extend({upload_size:0,collection:new c.default.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.$uploadbox=this.$(".upload-box"),this.$uploadtable=this.$(".upload-table"),this.btnLocal=new x.default.Button({id:"btn-local",title:(0,l.default)("Choose local file"),onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new x.default.Button({id:"btn-ftp",title:(0,l.default)("Choose FTP file"),onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new x.default.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new x.default.Button({id:"btn-start",title:(0,l.default)("Start"),onclick:function(){t._eventStart()}}),this.btnStop=new x.default.Button({id:"btn-stop",title:(0,l.default)("Pause"),onclick:function(){t._eventStop()}}),this.btnReset=new x.default.Button({id:"btn-reset",title:(0,l.default)("Reset"),onclick:function(){t._eventReset()}}),this.btnClose=new x.default.Button({id:"btn-close",title:(0,l.default)("Close"),onclick:function(){t.app.modal.hide()}}),n.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$uploadbox.uploadbox({url:this.app.options.nginx_upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$uploadbox.addClass("highlight")},ondragleave:function(){t.$uploadbox.removeClass("highlight")}}),this.ftp=new v.default.View({title:(0,l.default)("FTP files"),container:this.btnFtp.$el}),this.select_extension=new w.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:n.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t._changeExtension(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){new g.default({$el:s(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new w.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t._changeGenome(e)}}),this.loader=new $.default({$container:this.$uploadbox,collection:this.collection,new_content:function(e){var i=new h.default(t,{model:e});return t.$uploadtable.find("> tbody:first").append(i.$el),i.render(),i}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this.render()},render:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running,s=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[n?"enable":"disable"](),this.btnFtp[n?"enable":"disable"](),this.btnCreate[n?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[s?"show":"hide"](),this.$(".upload-helper")[s?"hide":"show"]()},_eventAnnounce:function(e,t){this.counter.announce++;var i=new c.default.Model({id:e,file_name:t.name,file_size:t.size,file_mode:t.mode||"local",file_path:t.path,file_data:t});this.render(),this.collection.add(i)},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"success"}),this.ui_button.model.set("percentage",this._uploadPercentage(100,i.get("file_size"))),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.success++,this.render(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this.render()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this.render()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this.render()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new p.default({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){return e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(0!=this.counter.announce&&0==this.counter.running){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this._uploadFtp(),this.uploadbox.start(),this.render()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),s(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){if(0==this.counter.running){this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this.render()}},_changeExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},_changeGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_uploadFtp:function(){var e=this,t=[];this.collection.each(function(i){"queued"==i.get("status")&&"ftp"==i.get("file_mode")&&(e.uploadbox.remove(i.id),t.push(i))}),t.length>0&&s.uploadpost({data:this.app.toData(t),url:this.app.options.nginx_upload_path,success:function(i){n.each(t,function(t){e._eventSuccess(t.id)})},error:function(i){n.each(t,function(t){e._eventError(t.id,i)})}})},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(){return'
Drop files here
Name
Size
Type
Genome
Settings
Status
'}})}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=a(r),c=i(29),u=(a(c),i(54)),h=a(u),f=i(15),p=a(f),m=i(10),g=a(m);t.default=e.View.extend({status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template(t.model)),this.$mode=this.$(".upload-mode"),this.$title=this.$(".upload-title"),this.$text=this.$(".upload-text"),this.$size=this.$(".upload-size"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$text_content=this.$(".upload-text-content"),this.$settings=this.$(".upload-settings"),this.$symbol=this.$(".upload-symbol"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.settings=new p.default.View({title:(0,l.default)("Upload configuration"),container:this.$(".upload-settings"),placement:"bottom"});var s=this.app.select_genome.value(),a=this.app.select_extension.value();this.select_genome=new g.default.View({css:"upload-genome",data:i.app.list_genomes,container:this.$(".upload-genome"),value:s,onchange:function(e){i.model.set("genome",e)}}),this.select_extension=new g.default.View({css:"upload-extension",data:i.app.list_extensions,container:this.$(".upload-extension"),value:a,onchange:function(e){i.model.set("extension",e)}}),this.model.set({genome:s,extension:a}),this.$symbol.on("click",function(){i._removeRow()}),this.$(".upload-extension-info").on("click",function(e){i.app.showExtensionInfo({$el:n(e.target),title:i.select_extension.text(),extension:i.select_extension.value()})}).on("mousedown",function(e){e.preventDefault()}),this.$settings.on("click",function(e){i._showSettings()}).on("mousedown",function(e){e.preventDefault()}),this.$text_content.on("change input",function(e){i.model.set({url_paste:n(e.target).val(),file_size:n(e.target).val().length})}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:genome",function(){i._refreshGenome()}),this.listenTo(this.model,"change:extension",function(){i._refreshExtension()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()})},render:function(){this._refreshType(),this._refreshPercentage(),this._refreshStatus(),this._refreshInfo(),this._refreshGenome(),this._refreshExtension(),this._refreshFileSize()},remove:function(){this.select_genome.remove(),this.select_extension.remove(),e.View.prototype.remove.apply(this)},_refreshType:function(){var e=this.model.attributes;this.$title.html(s.escape(e.file_name)),this.$size.html(d.default.bytesToString(e.file_size)),this.$mode.removeClass().addClass("upload-mode").addClass("text-primary"),"new"==e.file_mode?(this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$mode.addClass("fa fa-edit")):"local"==e.file_mode?this.$mode.addClass("fa fa-laptop"):"ftp"==e.file_mode&&this.$mode.addClass("fa fa-folder-open-o")},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("Failed: "+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$progress_bar.css({width:e+"%"}),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$symbol.removeClass().addClass("upload-symbol").addClass(this.status_classes[e]),this.model.set("enabled","init"==e);var t=this.model.get("enabled");this.$text_content.attr("disabled",!t),t?(this.select_genome.enable(),this.select_extension.enable()):(this.select_genome.disable(),this.select_extension.disable()),"success"==e&&(this.$el.addClass("success"),this.$percentage.html("100%")),"error"==e&&(this.$el.addClass("danger"),this.$info_progress.hide())},_refreshFileSize:function(){this.$size.html(d.default.bytesToString(this.model.get("file_size")))},_removeRow:function(){-1!==["init","success","error"].indexOf(this.model.get("status"))&&this.app.collection.remove(this.model)},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new h.default(this).$el),this.settings.show())},_template:function(e){return'
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
 
0%
'}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,i,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e.View.extend({initialize:function(e){this.$container=e.$container,this.collection=e.collection,this.new_content=e.new_content,this.max=e.max||50,this.content_list={},this.$message=i("").addClass("ui-limitloader").append("...only the first "+this.max+" entries are visible."),this.$container.append(this.$message),this.listenTo(this.collection,"reset",this._reset,this),this.listenTo(this.collection,"add",this._refresh,this),this.listenTo(this.collection,"remove",this._remove,this)},_done:function(){var e=n.size(this.content_list)>this.max;return this.$message[e?"show":"hide"](),e},_reset:function(){n.each(this.content_list,function(e){e.remove()}),this.content_list={},this.$message.hide()},_remove:function(e){var t=e.id,i=this.content_list[t];i&&(i.remove(),delete this.content_list[t]),this._refresh()},_refresh:function(){if(!this._done())for(var e in this.collection.models){var t=this.collection.models[e];this.content_list[t.id];if(!this.content_list[t.id]){var i=this.new_content(t);if(this.content_list[t.id]=i,this._done())break}}}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=(a(r),i(29)),c=a(d),u=i(247),h=a(u),f=i(56),p=a(f),m=i(15),g=(a(m),i(10)),_=a(g),v=i(6),y=a(v);t.default=e.View.extend({collection:new c.default.Collection,initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.btnStart=new y.default.Button({title:(0,l.default)("Start"),onclick:function(){t._eventStart()}}),this.btnClose=new y.default.Button({title:(0,l.default)("Close"),onclick:function(){t.app.modal.hide()}}),n.each([this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.select_extension=new _.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:n.filter(this.list_extensions,function(e){return e.composite_files}),onchange:function(e){t.collection.reset();var i=n.findWhere(t.list_extensions,{id:e});i&&i.composite_files&&n.each(i.composite_files,function(e){t.collection.add({id:t.collection.size(),file_desc:e.description||e.name})})}}),this.$(".upload-footer-extension-info").on("click",function(e){new p.default({$el:s(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new _.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome}),this.listenTo(this.collection,"add",function(e){t._eventAnnounce(e)}),this.listenTo(this.collection,"change add",function(){t.render()}),this.select_extension.options.onchange(this.select_extension.value()),this.render()},render:function(){var e=this.collection.first();e&&"running"==e.get("status")?(this.select_genome.disable(),this.select_extension.disable()):(this.select_genome.enable(),this.select_extension.enable()),this.collection.where({status:"ready"}).length==this.collection.length&&this.collection.length>0?(this.btnStart.enable(),this.btnStart.$el.addClass("btn-primary")):(this.btnStart.disable(),this.btnStart.$el.removeClass("btn-primary")),this.$(".upload-table")[this.collection.length>0?"show":"hide"]()},_eventAnnounce:function(e){var t=new h.default(this,{model:e});this.$(".upload-table > tbody:first").append(t.$el),this.$(".upload-table")[this.collection.length>0?"show":"hide"](),t.render()},_eventStart:function(){var e=this;this.collection.each(function(t){t.set({genome:e.select_genome.value(),extension:e.select_extension.value()})}),s.uploadpost({url:this.app.options.nginx_upload_path,data:this.app.toData(this.collection.filter()),success:function(t){e._eventSuccess(t)},error:function(t){e._eventError(t)},progress:function(t){e._eventProgress(t)}})},_eventProgress:function(e){this.collection.each(function(t){t.set("percentage",e)})},_eventSuccess:function(e){this.collection.each(function(e){e.set("status","success")}),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e){this.collection.each(function(t){t.set({status:"error",info:e})})},_template:function(){return'
Description
Name
Size
Settings
Status
'}})}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=a(r),c=i(54),u=a(c),h=i(55),f=a(h),p=i(15),m=a(p),g=i(6),_=a(g),v=i(10);a(v);i(57),t.default=e.View.extend({status_classes:{init:"upload-mode fa fa-exclamation text-primary",ready:"upload-mode fa fa-check text-success",running:"upload-mode fa fa-spinner fa-spin",success:"upload-mode fa fa-check",error:"upload-mode fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template()),this.$source=this.$(".upload-source"),this.$settings=this.$(".upload-settings"),this.$status=this.$(".upload-status"),this.$text=this.$(".upload-text"),this.$text_content=this.$(".upload-text-content"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$file_name=this.$(".upload-file-name"),this.$file_desc=this.$(".upload-file-desc"),this.$file_size=this.$(".upload-file-size"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.uploadinput=this.$el.uploadinput({ondragover:function(){i.model.get("enabled")&&i.$el.addClass("warning")},ondragleave:function(){i.$el.removeClass("warning")},onchange:function(e){"running"!=i.model.get("status")&&e&&e.length>0&&(i.model.reset({file_data:e[0],file_name:e[0].name,file_size:e[0].size,file_mode:e[0].mode||"local"}),i._refreshReady())}}),this.button_menu=new _.default.ButtonMenu({icon:"fa-caret-down",title:(0,l.default)("Select"),pull:"left"}),this.$source.append(this.button_menu.$el),this.button_menu.addMenu({icon:"fa-laptop",title:(0,l.default)("Choose local file"),onclick:function(){i.uploadinput.dialog()}}),this.app.ftp_upload_site&&this.button_menu.addMenu({icon:"fa-folder-open-o",title:(0,l.default)("Choose FTP file"),onclick:function(){i._showFtp()}}),this.button_menu.addMenu({icon:"fa-edit",title:"Paste/Fetch data",onclick:function(){i.model.reset({file_mode:"new",file_name:"New File"})}}),this.ftp=new m.default.View({title:"Choose FTP file:",container:this.$source.find(".ui-button-menu"),placement:"right"}),this.settings=new m.default.View({title:(0,l.default)("Upload configuration"),container:this.$settings,placement:"bottom"}),this.$text_content.on("change input",function(e){i.model.set({url_paste:n(e.target).val(),file_size:n(e.target).val().length}),i._refreshReady()}),this.$settings.on("click",function(e){i._showSettings()}).on("mousedown",function(e){e.preventDefault()}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:file_name",function(){i._refreshFileName()}),this.listenTo(this.model,"change:file_mode",function(){i._refreshMode()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()}),this.listenTo(this.model,"remove",function(){i.remove()}),this.app.collection.on("reset",function(){i.remove()})},render:function(){this.$el.attr("id","upload-row-"+this.model.id),this.$file_name.html(s.escape(this.model.get("file_name")||"-")),this.$file_desc.html(this.model.get("file_desc")||"Unavailable"),this.$file_size.html(d.default.bytesToString(this.model.get("file_size"))),this.$status.removeClass().addClass(this.status_classes.init)},remove:function(){e.View.prototype.remove.apply(this)},_refreshReady:function(){this.app.collection.each(function(e){e.set("status",e.get("file_size")>0&&"ready"||"init")})},_refreshMode:function(){"new"==this.model.get("file_mode")?(this.height=this.$el.height(),this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$text_content.val("").trigger("keyup")):(this.$el.height(this.height),this.$text.hide())},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("Failed: "+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));0!=e?this.$progress_bar.css({width:e+"%"}):(this.$progress_bar.addClass("no-transition"),this.$progress_bar.css({width:"0%"}),this.$progress_bar[0].offsetHeight,this.$progress_bar.removeClass("no-transition")),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$status.removeClass().addClass(this.status_classes[e]),this.model.set("enabled","running"!=e),this.$text_content.attr("disabled",!this.model.get("enabled")),this.$el.removeClass("success danger warning"),"running"!=e&&"ready"!=e||this.model.set("percentage",0),this.$source.find(".button")["running"==e?"addClass":"removeClass"]("disabled"),"success"==e&&(this.$el.addClass("success"),this.model.set("percentage",100),this.$percentage.html("100%")),"error"==e?(this.$el.addClass("danger"),this.model.set("percentage",0),this.$info_progress.hide(),this.$info_text.show()):(this.$info_progress.show(),this.$info_text.hide())},_refreshFileName:function(){this.$file_name.html(this.model.get("file_name")||"-")},_refreshFileSize:function(){this.$file_size.html(d.default.bytesToString(this.model.get("file_size")))},_showFtp:function(){if(this.ftp.visible)this.ftp.hide();else{var e=this;this.ftp.empty(),this.ftp.append(new f.default({ftp_upload_site:this.app.ftp_upload_site,onchange:function(t){e.ftp.hide(),"running"!=e.model.get("status")&&t&&(e.model.reset({file_mode:"ftp",file_name:t.path,file_size:t.size,file_path:t.path}),e._refreshReady())}}).$el),this.ftp.show()}},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new u.default(this).$el),this.settings.show())},_template:function(){return'
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
0%
'}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=(a(r),i(29)),c=a(d),u=i(249),h=a(u),f=i(55),p=a(f),m=i(56),g=a(m),_=i(15),v=a(_),y=i(10),w=a(y),b=i(6),x=a(b),C=i(58);a(C);i(57),t.default=e.View.extend({upload_size:0,collection:new c.default.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.btnLocal=new x.default.Button({id:"btn-local",title:(0,l.default)("Choose local files"),onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new x.default.Button({id:"btn-ftp",title:(0,l.default)("Choose FTP files"),onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new x.default.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new x.default.Button({id:"btn-start",title:(0,l.default)("Start"),onclick:function(){t._eventStart()}}),this.btnBuild=new x.default.Button({id:"btn-build",title:(0,l.default)("Build"),onclick:function(){t._eventBuild()}}),this.btnStop=new x.default.Button({id:"btn-stop",title:(0,l.default)("Pause"),onclick:function(){t._eventStop()}}),this.btnReset=new x.default.Button({id:"btn-reset",title:(0,l.default)("Reset"),onclick:function(){t._eventReset()}}),this.btnClose=new x.default.Button({id:"btn-close",title:(0,l.default)("Close"),onclick:function(){t.app.modal.hide()}}),n.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnBuild,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$(".upload-box").uploadbox({url:this.app.options.nginx_upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$(".upload-box").addClass("highlight")},ondragleave:function(){t.$(".upload-box").removeClass("highlight")}}),this.ftp=new v.default.View({title:(0,l.default)("FTP files"),container:this.btnFtp.$el}),this.select_extension=new w.default.View({css:"upload-footer-selection-compressed",container:this.$(".upload-footer-extension"),data:n.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t.updateExtension(e)}}),this.collectionType="list",this.select_collection=new w.default.View({css:"upload-footer-selection-compressed",container:this.$(".upload-footer-collection-type"),data:[{id:"list",text:"List"},{id:"paired",text:"Paired"},{id:"list:paired",text:"List of Pairs"}],value:"list",onchange:function(e){t.updateCollectionType(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){new g.default({$el:s(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),list:t.list_extensions,placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new w.default.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t.updateGenome(e)}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this._updateScreen()},_eventAnnounce:function(e,t){this.counter.announce++;var i=new c.default.Model({id:e,file_name:t.name,file_size:t.size,file_mode:t.mode||"local",file_path:t.path,file_data:t,extension:this.select_extension.value(),genome:this.select_genome.value()});this.collection.add(i);var n=new h.default(this,{model:i});this.$(".upload-table > tbody:first").append(n.$el),this._updateScreen(),n.render()},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=n.pluck(t.outputs,"hid"),s=this.collection.get(e);s.set({percentage:100,status:"success",hids:i}),this.ui_button.model.set("percentage",this._uploadPercentage(100,s.get("file_size"))),this.upload_completed+=100*s.get("file_size"),this.counter.announce--,this.counter.success++,this._updateScreen(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this._updateScreen()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this._updateScreen()},_eventBuild:function(){var e=[];n.forEach(this.collection.models,function(t){e.push.apply(e,t.get("hids"))});var t=n.map(e,function(e){return Galaxy.currHistoryPanel.collection.getByHid(e)}),i=new Galaxy.currHistoryPanel.collection.constructor(t);i.historyId=Galaxy.currHistoryPanel.collection.historyId,Galaxy.currHistoryPanel.buildCollection(this.collectionType,i,!0),this.counter.running=0,this._updateScreen(),this._eventReset(),this.app.modal.hide()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this._updateScreen()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new p.default({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){return e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(!(0==this.counter.announce||this.counter.running>0)){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this.uploadbox.start(),this._updateScreen()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),s(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){0==this.counter.running&&(this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this._updateScreen())},updateExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},updateCollectionType:function(e){this.collectionType=e},updateGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_updateScreen:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running&&0==this.counter.announce&&this.counter.success>0&&0==this.counter.error,s=0==this.counter.running,a=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnBuild[n?"enable":"disable"](),this.btnBuild.$el[n?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[s?"enable":"disable"](),this.btnFtp[s?"enable":"disable"](),this.btnCreate[s?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[a?"show":"hide"](),this.$(".upload-helper")[a?"hide":"show"]()},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_template:function(){return'
Drop files here
Name
Size
Status
'}})}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(4),d=a(r),c=i(29),u=(a(c),i(54)),h=a(u),f=i(15),p=a(f),m=i(10);a(m);t.default=e.View.extend({status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template(t.model)),this.$mode=this.$(".upload-mode"),this.$title=this.$(".upload-title-extended"),this.$text=this.$(".upload-text"),this.$size=this.$(".upload-size"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$text_content=this.$(".upload-text-content"),this.$symbol=this.$(".upload-symbol"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.settings=new p.default.View({title:(0,l.default)("Upload configuration"),container:this.$(".upload-settings"),placement:"bottom"});this.app.select_genome.value(),this.app.select_extension.value();this.$symbol.on("click",function(){i._removeRow()}),this.$text_content.on("change input",function(e){i.model.set({url_paste:n(e.target).val(),file_size:n(e.target).val().length})}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()}),this.listenTo(this.model,"remove",function(){i.remove()}),this.app.collection.on("reset",function(){i.remove()})},render:function(){var e=this.model.attributes;this.$title.html(s.escape(e.file_name)),this.$size.html(d.default.bytesToString(e.file_size)),this.$mode.removeClass().addClass("upload-mode").addClass("text-primary"),"new"==e.file_mode?(this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$mode.addClass("fa fa-edit")):"local"==e.file_mode?this.$mode.addClass("fa fa-laptop"):"ftp"==e.file_mode&&this.$mode.addClass("fa fa-folder-open-o")},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("Failed: "+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$progress_bar.css({width:e+"%"}),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$symbol.removeClass().addClass("upload-symbol").addClass(this.status_classes[e]),this.model.set("enabled","init"==e);var t=this.model.get("enabled");this.$text_content.attr("disabled",!t),"success"==e&&(this.$el.addClass("success"),this.$percentage.html("100%")),"error"==e&&(this.$el.addClass("danger"),this.$info_progress.hide())},_refreshFileSize:function(){this.$size.html(d.default.bytesToString(this.model.get("file_size")))},_removeRow:function(){-1!==["init","success","error"].indexOf(this.model.get("status"))&&this.app.collection.remove(this.model)},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new h.default(this).$el),this.settings.show())},_template:function(e){return'
You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.
0%
'}})}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e){function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var s=i(6),a=n(s),o=i(251),l=n(o),r=i(252),d=n(r),c=i(3),u=n(c),h=e.View.extend({initialize:function(t,i){var n=this;this.userIsAnonymous=Galaxy.user.isAnonymous(),this.allow_user_dataset_purge=i.config.allow_user_dataset_purge,this.root=i.root,this.historyView=new d.default.CurrentHistoryView({className:d.default.CurrentHistoryView.prototype.className+" middle",purgeAllowed:this.allow_user_dataset_purge,linkTarget:"galaxy_main"}),Galaxy.currHistoryPanel=this.historyView,Galaxy.currHistoryPanel.listenToGalaxy(Galaxy),this.buttonRefresh=new a.default.ButtonLink({id:"history-refresh-button",title:(0,u.default)("Refresh history"),cls:"panel-header-button",icon:"fa fa-refresh",onclick:function(){n.historyView.loadCurrentHistory()}}),this.buttonOptions=new a.default.ButtonLink({id:"history-options-button",title:(0,u.default)("History options"),cls:"panel-header-button",target:"galaxy_main",icon:"fa fa-cog",href:this.root+"root/history_options"}),this.buttonViewMulti=new a.default.ButtonLink({id:"history-view-multi-button",title:(0,u.default)("View all histories"),cls:"panel-header-button",icon:"fa fa-columns",href:this.root+"history/view_multiple"}),this.model=new e.Model({cls:"history-right-panel",title:(0,u.default)("History"),buttons:[this.buttonRefresh,this.buttonOptions,this.buttonViewMulti]}),this.setElement(this._template()),this.historyView.setElement(this.$el),this.historyView.connectToQuotaMeter(Galaxy.quotaMeter),this.historyView.loadCurrentHistory(),Galaxy.listenTo(this.historyView,"history-size-change",function(){Galaxy.user.fetch({url:Galaxy.user.urlRoot()+"/"+(Galaxy.user.id||"current")})})},render:function(){this.optionsMenu=(0,l.default)(this.buttonOptions.$el,{anonymous:this.userIsAnonymous,purgeAllowed:this.allow_user_dataset_purge,root:this.root}),this.buttonViewMulti.$el[this.userIsAnonymous?"hide":"show"]()},_template:function(e){return[''].join("")},toString:function(){return"historyPanel"}});t.default=h}).call(t,i(2))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t,i){return n.clone(m).filter(function(n){return!(e&&!n.anon)&&(!(!t&&n.purge)&&(n.href&&(n.href=i+n.href,n.target=n.target||"galaxy_main"),n.confirm&&(n.func=function(){confirm(n.confirm)&&(galaxy_main.location=n.href)}),!0))})}Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),l=s(o),r=i(112),d=s(r),c=i(5),u=(s(c),i(3)),h=s(u),f=i(34),p=s(f),m=[{html:(0,h.default)("History Lists"),header:!0},{html:(0,h.default)("Saved Histories"),href:"histories/list",target:"_top"},{html:(0,h.default)("Histories Shared with Me"),href:"histories/list_shared",target:"_top"},{html:(0,h.default)("Current History"),header:!0,anon:!0},{html:(0,h.default)("Create New"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.createNewHistory()}},{html:(0,h.default)("Copy History"),func:function(){(0,d.default)(Galaxy.currHistoryPanel.model).done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Share or Publish"),href:"history/sharing"},{html:(0,h.default)("Show Structure"),href:"history/display_structured",anon:!0},{html:(0,h.default)("Extract Workflow"),href:"workflow/build_from_current_history"},{html:(0,h.default)("Delete"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,h.default)("Really delete the current history?"))&&Galaxy.currHistoryPanel.model._delete().done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Delete Permanently"),purge:!0,anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,h.default)("Really delete the current history permanently? This cannot be undone."))&&Galaxy.currHistoryPanel.model.purge().done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Dataset Actions"),header:!0,anon:!0},{html:(0,h.default)("Copy Datasets"),href:"dataset/copy_datasets"},{html:(0,h.default)("Dataset Security"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/permissions?id="+Galaxy.currHistoryPanel.model.id)}},{html:(0,h.default)("Resume Paused Jobs"),href:"history/resume_paused_jobs?current=True",anon:!0},{html:(0,h.default)("Collapse Expanded Datasets"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.collapseAll()}},{html:(0,h.default)("Unhide Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,h.default)("Really unhide all hidden datasets?"))&&e.post(Galaxy.root+"history/adjust_hidden",{user_action:"unhide"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Delete Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm((0,h.default)("Really delete all hidden datasets?"))&&e.post(Galaxy.root+"history/adjust_hidden",{user_action:"delete"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:(0,h.default)("Purge Deleted Datasets"),confirm:(0,h.default)("Really delete all deleted datasets permanently? This cannot be undone."),href:"history/purge_deleted_datasets",purge:!0,anon:!0},{html:(0,h.default)("Downloads"),header:!0},{html:(0,h.default)("Export Tool Citations"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.router&&Galaxy.router.push("/histories/citations?id="+Galaxy.currHistoryPanel.model.id)}},{html:(0,h.default)("Export History to File"),href:"history/export_archive?preview=True",anon:!0},{html:(0,h.default)("Other Actions"),header:!0},{html:(0,h.default)("Import from File"),href:"histories/import",target:"_top"}];p.default.add({url:"api/webhooks/history-menu/all",async:!1,callback:function(t){var i=[];e.each(t.models,function(e,t){var n=t.toJSON();n.activate&&i.push({html:(0,h.default)(n.config.title),anon:!0})}),i.length>0&&(i.unshift({html:(0,h.default)("Webhooks"),header:!0}),e.merge(m,i))}});var g=function(e,t){t=t||{};var i=void 0===t.anonymous||t.anonymous,n=t.purgeAllowed||!1,s=a(i,n,Galaxy.root);return new l.default(e,s)};t.default=g}).call(t,i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(62),l=(a(o),i(254)),r=a(l),d=i(5),c=a(d),u=i(3),h=a(u),f=c.default.SessionStorageModel.extend({defaults:{tagsEditorShown:!1,annotationEditorShown:!1,scrollPosition:0},toString:function(){return"HistoryViewPrefs("+JSON.stringify(this.toJSON())+")"}});f.storageKey=function(){return"history-panel"};var p=r.default.HistoryViewEdit,m=p.extend({className:p.prototype.className+" current-history-panel",HDCAViewClass:p.prototype.HDCAViewClass.extend({foldoutStyle:"drilldown"}),emptyMsg:[(0,h.default)("This history is empty"),". ",(0,h.default)("You can "),'',(0,h.default)("load your own data"),"",(0,h.default)(" or "),'',(0,h.default)("get data from an external source"),""].join(""),initialize:function(t){t=t||{},this.preferences=new f(e.extend({id:f.storageKey()},e.pick(t,e.keys(f.prototype.defaults)))),p.prototype.initialize.call(this,t),this.panelStack=[],this.currentContentId=t.currentContentId||null},_setUpListeners:function(){p.prototype._setUpListeners.call(this);var e=this;this.on("new-model",function(){e.preferences.set("scrollPosition",0)})},loadCurrentHistory:function(){return this.loadHistory(null,{url:Galaxy.root+"history/current_history_json"})},switchToHistory:function(e,t){return Galaxy.user.isAnonymous()?(this.trigger("error",(0,h.default)("You must be logged in to switch histories"),(0,h.default)("Anonymous user")),n.when()):this.loadHistory(e,{url:Galaxy.root+"history/set_as_current?id="+e})},createNewHistory:function(e){return Galaxy.user.isAnonymous()?(this.trigger("error",(0,h.default)("You must be logged in to create histories"),(0,h.default)("Anonymous user")),n.when()):this.loadHistory(null,{url:Galaxy.root+"history/create_new_current"})},setModel:function(e,t,i){return p.prototype.setModel.call(this,e,t,i),this.model&&this.model.id&&(this.log("checking for updates"),this.model.checkForUpdates()),this},_setUpModelListeners:function(){return p.prototype._setUpModelListeners.call(this),this.listenTo(this.model,{"change:nice_size change:size":function(){this.trigger("history-size-change",this,this.model,arguments)},"change:id":function(){this.once("loading-done",function(){this.model.checkForUpdates()})}})},_setUpCollectionListeners:function(){p.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,"state:ready",function(e,t,i){e.get("visible")||this.collection.storage.includeHidden()||this.removeItemView(e)})},_setUpBehaviors:function(t){t=t||this.$el;var i=this;return p.prototype._setUpBehaviors.call(i,t),this._debouncedScrollCaptureHandler||(this._debouncedScrollCaptureHandler=e.debounce(function(){i.$el.is(":visible")&&i.preferences.set("scrollPosition",n(this).scrollTop())},40)),i.$scrollContainer(t).off("scroll",this._debouncedScrollCaptureHandler).on("scroll",this._debouncedScrollCaptureHandler),i},_buildNewRender:function(){if(!this.model)return n();var e=p.prototype._buildNewRender.call(this);return e.find(".search").prependTo(e.find("> .controls")),this._renderQuotaMessage(e),e},_renderQuotaMessage:function(e){return e=e||this.$el,n(this.templates.quotaMsg({},this)).prependTo(e.find(".messages"))},_renderTags:function(e){var t=this;p.prototype._renderTags.call(t,e),t.preferences.get("tagsEditorShown")&&t.tagsEditor.toggle(!0),t.listenTo(t.tagsEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("tagsEditorShown",e.hidden)})},_renderAnnotation:function(e){var t=this;p.prototype._renderAnnotation.call(t,e),t.preferences.get("annotationEditorShown")&&t.annotationEditor.toggle(!0),t.listenTo(t.annotationEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("annotationEditorShown",e.hidden)})},_swapNewRender:function(t){p.prototype._swapNewRender.call(this,t);var i=this;return e.delay(function(){var e=i.preferences.get("scrollPosition");e&&i.scrollTo(e,0)},10),this},_attachItems:function(e){p.prototype._attachItems.call(this,e);var t=this;return t.currentContentId&&t._setCurrentContentById(t.currentContentId),this},addItemView:function(e,t,i){var n=p.prototype.addItemView.call(this,e,t,i);return n&&this.panelStack.length?this._collapseDrilldownPanel():n},_setUpItemViewListeners:function(e){var t=this;return p.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{"expanded:drilldown":function(e,t){this._expandDrilldownPanel(t)},"collapsed:drilldown":function(e,t){this._collapseDrilldownPanel(t)}})},setCurrentContent:function(e){this.$(".history-content.current-content").removeClass("current-content"),e?(e.$el.addClass("current-content"),this.currentContentId=e.model.id):this.currentContentId=null},_setCurrentContentById:function(e){var t=this.viewFromModelId(e)||null;this.setCurrentContent(t)},_expandDrilldownPanel:function(e){this.panelStack.push(e),this.$controls().add(this.$list()).hide(),e.parentName=this.model.get("name"),e.delegateEvents().render().$el.appendTo(this.$el)},_collapseDrilldownPanel:function(e){this.panelStack.pop(),this.$controls().add(this.$list()).show()},events:e.extend(e.clone(p.prototype.events),{"click .uploader-link":function(e){Galaxy.upload.show(e)},"click .get-data-link":function(e){var t=n(".toolMenuContainer");t.parent().scrollTop(0),t.find('span:contains("Get Data")').click()}}),listenToGalaxy:function(t){this.listenTo(t,{"center-frame:load":function(t){var i=t.fullpath,n=null,s={display:/datasets\/([a-f0-9]+)\/display/,edit:/datasets\/([a-f0-9]+)\/edit/,report_error:/dataset\/errors\?id=([a-f0-9]+)/,rerun:/tool_runner\/rerun\?id=([a-f0-9]+)/,show_params:/datasets\/([a-f0-9]+)\/show_params/};e.find(s,function(t,s){return n=e.result(i.match(t),1)}),this._setCurrentContentById(n?"dataset-"+n:null)},"center-panel:load":function(e){this._setCurrentContentById()}})},connectToQuotaMeter:function(e){return e?(this.listenTo(e,"quota:over",this.showQuotaMessage),this.listenTo(e,"quota:under",this.hideQuotaMessage),this.on("rendered rendered:initial",function(){e&&e.isOverQuota()&&this.showQuotaMessage()}),this):this},clearMessages:function(t){var i=e.isUndefined(t)?this.$messages().children('[class$="message"]'):n(t.currentTarget);return i=i.not(".quota-message"),i.fadeOut(this.fxSpeed,function(){n(this).remove()}),this},showQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")&&e.slideDown(this.fxSpeed)},hideQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")||e.slideUp(this.fxSpeed)},unhideHidden:function(){var e=this;return confirm((0,h.default)("Really unhide all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{visible:!0}).done(function(){e.model.contents.includeHidden||e.renderItems()}):s.when()},deleteHidden:function(){var e=this;return confirm((0,h.default)("Really delete all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{deleted:!0,visible:!0}):s.when()},toString:function(){return"CurrentHistoryView("+(this.model?this.model.get("name"):"")+")"}});m.prototype.templates=function(){var t=c.default.wrapTemplate(['
',(0,h.default)("You are over your disk quota"),". ",(0,h.default)("Tool execution is on hold until your disk usage drops below your allocated quota"),".","
"],"history");return e.extend(e.clone(p.prototype.templates),{quotaMsg:t})}(),t.default={CurrentHistoryView:m}}).call(t,i(1),i(0),i(0))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(2),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(n),a=i(116),o=function(e){return e&&e.__esModule?e:{default:e}}(a),l=["new","queued","running"],r=["error","deleted"],d=s.Model.extend({url:function(){return Galaxy.root+"api/histories/"+this.attributes.history_id+"/contents/dataset_collections/"+this.attributes.collection_id+"/jobs_summary"},hasDetails:function(){return this.has("populated_state")},new:function(){return!this.hasDetails()||"new"==this.get("populated_state")},errored:function(){return"error"===this.get("populated_state")||this.anyWithStates(r)},states:function(){return this.get("states")||{}},anyWithState:function(e){return(this.states()[e]||0)>0},anyWithStates:function(e){var t=this.states();for(var i in e)if((t[e[i]]||0)>0)return!0;return!1},numWithStates:function(e){var t=this.states(),i=0;for(var n in e)i+=t[e[n]]||0;return i},numInError:function(){return this.numWithStates(r)},running:function(){return this.anyWithState("running")},terminal:function(){return!this.new()&&!this.anyWithStates(l)},jobCount:function(){var e=this.states(),t=0;for(var i in e)t+=e[i];return t},toString:function(){return"JobStatesSummary(id="+this.get("id")+")"}}),c=s.Collection.extend({model:d,initialize:function(){this.updateTimeoutId=null,this.active=!0},url:function(){var e=this.models.filter(function(e){return!e.terminal()}),t=e.map(function(e){return e.get("id")}).join(","),i=e.map(function(e){return e.get("model")}).join(",");return Galaxy.root+"api/histories/"+this.historyId+"/jobs_summary?ids="+t+"&types="+i},monitor:function(){var e=this;if(this.clearUpdateTimeout(),this.active){var t=function(){e.updateTimeoutId=setTimeout(function(){e.monitor()},2e3)},i=this.models.filter(function(e){return!e.terminal()});if(i.length,!1){var n=i.map(function(e){return function(){return e.fetch()}});return new o.default.AjaxQueue(n).done(t)}i.length>0?this.fetch({remove:!1}).done(t):t()}},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},toString:function(){return"JobStatesSummaryCollection()"}});t.default={JobStatesSummary:d,JobStatesSummaryCollection:c,FETCH_STATE_ON_ADD:!1}},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(255),l=a(o),r=i(63),d=(a(r),i(16)),c=(a(d),i(115)),u=a(c),h=i(257),f=a(h),p=i(258),m=a(p),g=i(39),_=a(g),v=i(124),y=a(v),w=i(58),b=a(w),x=i(261),C=a(x),$=i(262),k=a($),S=i(21),T=a(S),P=i(42),E=(a(P),i(5)),D=a(E),A=i(3),M=a(A);i(20);var I=l.default.HistoryView,L=I.extend({HDAViewClass:f.default.HDAListItemEdit,HDCAViewClass:m.default.HDCAListItemEdit,initialize:function(e){e=e||{},I.prototype.initialize.call(this,e),this.tagsEditor=null,this.dragItems=!0,this.annotationEditor=null,this.purgeAllowed=e.purgeAllowed||!1,this.annotationEditorShown=e.annotationEditorShown||!1,this.tagsEditorShown=e.tagsEditorShown||!1},_setUpListeners:function(){return I.prototype._setUpListeners.call(this),this.on({"droptarget:drop":function(e,t){this.dataDropped(t),this.dropTargetOff()},"view:attached view:removed":function(){this._renderCounts()},"search:loading-progress":this._renderSearchProgress,"search:searching":this._renderSearchFindings})},_setUpModelListeners:function(){return I.prototype._setUpModelListeners.call(this),this.listenTo(this.model,"change:size",this.updateHistoryDiskSize),this},_setUpCollectionListeners:function(){return I.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,{"change:deleted":this._handleItemDeletedChange,"change:visible":this._handleItemVisibleChange,"change:purged":function(e){this.model.fetch()},"fetching-deleted":function(e){this.$("> .controls .deleted-count").html(""+(0,M.default)("loading...")+"")},"fetching-hidden":function(e){this.$("> .controls .hidden-count").html(""+(0,M.default)("loading...")+"")},"fetching-deleted-done fetching-hidden-done":this._renderCounts}),this},_buildNewRender:function(){var e=I.prototype._buildNewRender.call(this);return this.model?(Galaxy&&Galaxy.user&&Galaxy.user.id&&Galaxy.user.id===this.model.get("user_id")&&(this._renderTags(e),this._renderAnnotation(e)),e):e},updateHistoryDiskSize:function(){this.$(".history-size").text(this.model.get("nice_size"))},renderItems:function(e){var t=I.prototype.renderItems.call(this,e);return this.searchFor?this._renderSearchFindings(e):this._renderCounts(e),t},_renderCounts:function(t){t=t instanceof e?t:this.$el;var i=this.templates.counts(this.model.toJSON(),this);return t.find("> .controls .subtitle").html(i)},_renderTags:function(e){var t=this;this.tagsEditor=new _.default.TagsEditor({model:this.model,el:e.find(".controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.toggleHDATagEditors(!0,t.fxSpeed)},onhide:function(){t.toggleHDATagEditors(!1,t.fxSpeed)},$activator:(0,T.default)({title:(0,M.default)("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".controls .actions"))})},_renderAnnotation:function(e){var t=this;this.annotationEditor=new y.default.AnnotationEditor({model:this.model,el:e.find(".controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.toggleHDAAnnotationEditors(!0,t.fxSpeed)},onhide:function(){t.toggleHDAAnnotationEditors(!1,t.fxSpeed)},$activator:(0,T.default)({title:(0,M.default)("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".controls .actions"))})},_setUpBehaviors:function(e){if(e=e||this.$el,I.prototype._setUpBehaviors.call(this,e),this.model&&Galaxy.user&&!Galaxy.user.isAnonymous()&&Galaxy.user.id===this.model.get("user_id")){var t=this;e.find("> .controls .name").attr("title",(0,M.default)("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(e){var i=t.model.get("name");e&&e!==i?(t.$el.find("> .controls .name").text(e),t.model.save({name:e}).fail(function(){t.$el.find("> .controls .name").text(t.model.previous("name"))})):t.$el.find("> .controls .name").text(i)}})}},multiselectActions:function(){var e=this,t=[{html:(0,M.default)("Hide datasets"),func:function(){var t=u.default.HistoryDatasetAssociation.prototype.hide;e.getSelectedModels().ajaxQueue(t)}},{html:(0,M.default)("Unhide datasets"),func:function(){var t=u.default.HistoryDatasetAssociation.prototype.unhide;e.getSelectedModels().ajaxQueue(t)}},{html:(0,M.default)("Delete datasets"),func:function(){var t=u.default.HistoryDatasetAssociation.prototype.delete;e.getSelectedModels().ajaxQueue(t)}},{html:(0,M.default)("Undelete datasets"),func:function(){var t=u.default.HistoryDatasetAssociation.prototype.undelete;e.getSelectedModels().ajaxQueue(t)}}];return e.purgeAllowed&&t.push({html:(0,M.default)("Permanently delete datasets"),func:function(){if(confirm((0,M.default)("This will permanently remove the data in your datasets. Are you sure?"))){var t=u.default.HistoryDatasetAssociation.prototype.purge;e.getSelectedModels().ajaxQueue(t)}}}),t=t.concat(e._collectionActions())},_collectionActions:function(){var e=this;return[{html:(0,M.default)("Build Dataset List"),func:function(){e.buildCollection("list")}},{html:(0,M.default)("Build Dataset Pair"),func:function(){e.buildCollection("paired")}},{html:(0,M.default)("Build List of Dataset Pairs"),func:function(){e.buildCollection("list:paired")}}]},buildCollection:function(e,t,i){var n,s=this,t=t||s.getSelectedModels(),i=i||!1;"list"==e?n=b.default.createListCollection:"paired"==e?n=C.default.createPairCollection:"list:paired"==e?n=k.default.createListOfPairsCollection:console.warn("Unknown collectionType encountered "+e),n(t,i).done(function(){s.model.refresh()})},_getItemViewOptions:function(e){var t=I.prototype._getItemViewOptions.call(this,e);return n.extend(t,{purgeAllowed:this.purgeAllowed,tagsEditorShown:this.tagsEditor&&!this.tagsEditor.hidden,annotationEditorShown:this.annotationEditor&&!this.annotationEditor.hidden}),t},_handleItemDeletedChange:function(e){e.get("deleted")?this._handleItemDeletion(e):this._handleItemUndeletion(e),this._renderCounts()},_handleItemDeletion:function(e){var t=this.model.get("contents_active");t.deleted+=1,t.active-=1,this.model.contents.includeDeleted||this.removeItemView(e),this.model.set("contents_active",t)},_handleItemUndeletion:function(e){var t=this.model.get("contents_active");t.deleted-=1,this.model.contents.includeDeleted||(t.active-=1),this.model.set("contents_active",t)},_handleItemVisibleChange:function(e){e.hidden()?this._handleItemHidden(e):this._handleItemUnhidden(e),this._renderCounts()},_handleItemHidden:function(e){var t=this.model.get("contents_active");t.hidden+=1,t.active-=1,this.model.contents.includeHidden||this.removeItemView(e),this.model.set("contents_active",t)},_handleItemUnhidden:function(e){var t=this.model.get("contents_active");t.hidden-=1,this.model.contents.includeHidden||(t.active-=1),this.model.set("contents_active",t)},toggleHDATagEditors:function(e,t){n.each(this.views,function(i){i.tagsEditor&&i.tagsEditor.toggle(e,t)})},toggleHDAAnnotationEditors:function(e,t){n.each(this.views,function(i){i.annotationEditor&&i.annotationEditor.toggle(e,t)})},events:n.extend(n.clone(I.prototype.events),{"click .show-selectors-btn":"toggleSelectors","click .toggle-deleted-link":function(e){this.toggleShowDeleted()},"click .toggle-hidden-link":function(e){this.toggleShowHidden()}}),_renderSearchProgress:function(e,t){var i=e+t;return this.$("> .controls .subtitle").html(["",(0,M.default)("Searching "),i,"/",this.model.contentsShown(),""].join(""))},_renderSearchFindings:function(t){t=t instanceof e?t:this.$el;var i=this.templates.found(this.model.toJSON(),this);return t.find("> .controls .subtitle").html(i),this},dropTargetOn:function(){if(this.dropTarget)return this;this.dropTarget=!0;var e={dragenter:n.bind(this.dragenter,this),dragover:n.bind(this.dragover,this),dragleave:n.bind(this.dragleave,this),drop:n.bind(this.drop,this)},t=this._renderDropTarget();this.$list().before([this._renderDropTargetHelp(),t]);for(var i in e)e.hasOwnProperty(i)&&t.on(i,e[i]);return this},_renderDropTarget:function(){return this.$(".history-drop-target").remove(),s("").addClass("history-drop-target")},_renderDropTargetHelp:function(){return this.$(".history-drop-target-help").remove(),s("").addClass("history-drop-target-help").text((0,M.default)("Drag datasets here to copy them to the current history"))},dropTargetOff:function(){if(!this.dropTarget)return this;this.dropTarget=!1;var e=this.$(".history-drop-target").get(0);for(var t in this._dropHandlers)this._dropHandlers.hasOwnProperty(t)&&e.off(t,this._dropHandlers[t]);return this.$(".history-drop-target").remove(),this.$(".history-drop-target-help").remove(),this},dropTargetToggle:function(){return this.dropTarget?this.dropTargetOff():this.dropTargetOn(),this},dragenter:function(e){e.preventDefault(),e.stopPropagation(),this.$(".history-drop-target").css("border","2px solid black")},dragover:function(e){e.preventDefault(),e.stopPropagation()},dragleave:function(e){e.preventDefault(),e.stopPropagation(),this.$(".history-drop-target").css("border","1px dashed black")},drop:function(e){e.preventDefault();var t=this,i=e.originalEvent.dataTransfer,n=i.getData("text");i.dropEffect="move";try{n=JSON.parse(n)}catch(e){t.warn("error parsing JSON from drop:",n)}return t.trigger("droptarget:drop",e,n,t),!1},dataDropped:function(t){var i=this;return n.isObject(t)&&"HistoryDatasetAssociation"===t.model_class&&t.id?0!==i.contents.currentPage?i.contents.fetchPage(0).then(function(){return i.model.contents.copy(t.id)}):i.model.contents.copy(t.id):e.when()},toString:function(){return"HistoryViewEdit("+(this.model?this.model.get("name"):"")+")"}});L.prototype.templates=function(){var e=D.default.wrapTemplate(["<% var shown = Math.max( view.views.length, history.contents_active.active ) %>","<% if( shown ){ %>",'',"<%- shown %> ",(0,M.default)("shown"),"","<% } %>","<% if( history.contents_active.deleted ){ %>",'',"<% if( view.model.contents.includeDeleted ){ %>",'',(0,M.default)("hide deleted"),"","<% } else { %>","<%- history.contents_active.deleted %> ",'',(0,M.default)("deleted"),"","<% } %>","","<% } %>","<% if( history.contents_active.hidden ){ %>",'',"<% if( view.model.contents.includeHidden ){ %>",'',(0,M.default)("hide hidden"),"","<% } else { %>","<%- history.contents_active.hidden %> ",'',(0,M.default)("hidden"),"","<% } %>","","<% } %>"],"history"),t=D.default.wrapTemplate([(0,M.default)("Found")," <%- view.views.length %>, ","<% if( history.contents_active.deleted ){ %>","<% if( view.model.contents.includeDeleted ){ %>",'',(0,M.default)("hide deleted"),", ","<% } else { %>",'',(0,M.default)("show deleted"),", ","<% } %>","<% } %>","<% if( history.contents_active.hidden ){ %>","<% if( view.model.contents.includeHidden ){ %>",'',(0,M.default)("hide hidden"),"","<% } else { %>",'',(0,M.default)("show hidden"),"","<% } %>","<% } %>"],"history");return n.extend(n.clone(I.prototype.templates),{counts:e,found:t})}(),t.default={HistoryViewEdit:L}}).call(t,i(0),i(1),i(0))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(117),o=s(a),l=i(62),r=s(l),d=i(63),c=s(d),u=i(64),h=(s(u),i(119)),f=s(h),p=i(121),m=s(p),g=i(24),_=(s(g),i(113)),v=s(_),y=i(21),w=s(y),b=i(5),x=s(b),C=i(3),$=s(C);i(118);var k=o.default.ModelListPanel,S=k.extend({_logNamespace:"history",HDAViewClass:f.default.HDAListItemView,HDCAViewClass:m.default.HDCAListItemView,collectionClass:c.default.HistoryContents,modelCollectionKey:"contents",tagName:"div",className:k.prototype.className+" history-panel",emptyMsg:(0,$.default)("This history is empty"),noneFoundMsg:(0,$.default)("No matching datasets found"),searchPlaceholder:(0,$.default)("search datasets"),initialize:function(e){k.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_createDefaultCollection:function(){return new this.collectionClass([],{history:this.model})},freeModel:function(){return k.prototype.freeModel.call(this),this.model&&this.model.stopPolling(),this},_setUpListeners:function(){k.prototype._setUpListeners.call(this),this.on({error:function(e,t,i,n,s){this.errorHandler(e,t,i,n,s)},"views:ready view:attached view:removed":function(e){this._renderSelectButton()},"view:attached":function(e){this.scrollTo(0)}})},loadHistory:function(t,i,n){var s=this;return n=e.extend(n||{silent:!0}),this.info("loadHistory:",t,i,n),this.setModel(new r.default.History({id:t})),n.silent=!0,this.trigger("loading"),this.model.fetchWithContents(i,n).always(function(){s.render(),s.trigger("loading-done")})},refreshContents:function(e){return this.model?this.model.refresh(e):n.when()},_setUpCollectionListeners:function(){return k.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,{"fetching-more":function(){this._toggleContentsLoadingIndicator(!0),this.$emptyMessage().hide()},"fetching-more-done":function(){this._toggleContentsLoadingIndicator(!1)}})},_showLoadingIndicator:function(t,i,s){var a=n('');this.$el.html(a.text(t).slideDown(e.isUndefined(i)?this.fxSpeed:i))},_hideLoadingIndicator:function(t){this.$(".loading-indicator").slideUp(e.isUndefined(t)?this.fxSpeed+200:t,function(){n(this).remove()})},_buildNewRender:function(){var e=k.prototype._buildNewRender.call(this);return this._renderSelectButton(e),e},_renderSelectButton:function(e){if(e=e||this.$el,!this.multiselectActions().length)return null;if(!this.views.length)return this.hideSelectors(),e.find(".controls .actions .show-selectors-btn").remove(),null;var t=e.find(".controls .actions .show-selectors-btn");return t.length?t:(0,w.default)({title:(0,$.default)("Operations on multiple datasets"),classes:"show-selectors-btn",faIcon:"fa-check-square-o"}).prependTo(e.find(".controls .actions"))},_renderEmptyMessage:function(e){var t=this.$emptyMessage(e);return this.model.get("contents_active").active<=0?t.empty().append(this.emptyMsg).show():this.searchFor&&this.model.contents.haveSearchDetails()&&!this.views.length?t.empty().append(this.noneFoundMsg).show():(t.hide(),n())},$scrollContainer:function(e){return this.$list(e)},_toggleContentsLoadingIndicator:function(e){e?this.$list().html('
",(0,p.default)(["Pair collections are permanent collections containing two datasets: one forward and one reverse. ","Often these are forward and reverse reads. The pair collections can be passed to tools and ","workflows in order to have analyses done on both datasets. This interface allows ","you to create a pair, name it, and swap which is forward and which reverse."].join("")),"
","
","
",(0,p.default)(['Click the "Swap" link to make your forward dataset the reverse ',"and the reverse dataset forward."].join("")),"
","
",(0,p.default)(['Click the "Cancel" button to exit the interface.'].join("")),"
","
","
",(0,p.default)(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"
"].join("")),invalidInitial:n.template(['
','
','',"<% if( _.size( problems ) ){ %>",(0,p.default)("The following selections could not be included due to problems"),"
<% _.each( problems, function( problem ){ %>","
<%- problem.element.name %>: <%- problem.text %>
","<% }); %>
","<% } else if( _.size( elements ) === 0 ){ %>",(0,p.default)("No datasets were selected"),".","<% } else if( _.size( elements ) === 1 ){ %>",(0,p.default)("Only one dataset was selected"),": <%- elements[0].name %>","<% } else if( _.size( elements ) > 2 ){ %>",(0,p.default)("Too many datasets were selected"),': <%- _.pluck( elements, "name" ).join( ", ") %>',"<% } %>"," ",(0,p.default)("Two (and only two) elements are needed for the pair"),". ",(0,p.default)("You may need to "),'',(0,p.default)("cancel")," ",(0,p.default)("and reselect new elements"),".","","
","
",'"].join(""))}),toString:function(){return"PairCollectionCreator"}}),v=function(e,t){return t=t||{},t.title=(0,p.default)("Create a collection from a pair of datasets"),r.default.collectionCreatorModal(e,t,_)};t.default={PairCollectionCreator:_,pairCollectionCreatorModal:v,createPairCollection:o}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e,n,s,a){function o(e){return e&&e.__esModule?e:{default:e}}function l(e){function t(){return i.length||(i=[new RegExp(this.filters[0]),new RegExp(this.filters[1])]),i}e=e||{},e.createPair=e.createPair||function(e){e=e||{};var t=e.listA.splice(e.indexA,1)[0],i=e.listB.splice(e.indexB,1)[0],n=e.listB.indexOf(t),s=e.listA.indexOf(i);return-1!==n&&e.listB.splice(n,1),-1!==s&&e.listA.splice(s,1),this._pair(t,i,{silent:!0})};var i=[];return e.preprocessMatch=e.preprocessMatch||function(e){var i=t.call(this);return n.extend(e,{matchTo:e.matchTo.name.replace(i[0],""),possible:e.possible.name.replace(i[1],"")})},function(t){this.debug("autopair _strategy ---------------------------"),t=t||{};var i,n=t.listA,s=t.listB,a=0,o={score:0,index:null},l=[];for(this.debug("starting list lens:",n.length,s.length),this.debug("bestMatch (starting):",JSON.stringify(o,null," "));a=c?l.push(e.createPair.call(this,{listA:n,indexA:a,listB:s,indexB:o.index})):a+=1,!n.length||!s.length)return l}return this.debug("paired:",JSON.stringify(l,null," ")),this.debug("autopair _strategy ---------------------------"),l}}function r(e,t){var i=e.toJSON();return b(i,{historyId:e.historyId,defaultHideSourceItems:t})}Object.defineProperty(t,"__esModule",{value:!0});var d=i(263),c=o(d),u=i(109),h=o(u),f=i(108),p=o(f),m=i(5),g=o(m),_=i(3),v=o(_);i(110);var y=e.View.extend(g.default.LoggableMixin).extend({_logNamespace:"collections",tagName:"li",className:"dataset paired",initialize:function(e){this.pair=e.pair||{}},template:n.template(['<%- pair.forward.name %>','','<%- pair.name %>',"",'<%- pair.reverse.name %>'].join("")),render:function(){this.dragStartHandler=n.bind(this._dragstart,this),this.dragEndHandler=n.bind(this._dragend,this);var e=this.$el.attr("draggable",!0).data("pair",this.pair).html(this.template({pair:this.pair})).addClass("flex-column-container").get(0);return e.addEventListener("dragstart",this.dragStartHandler,!1),e.addEventListener("dragend",this.dragEndHandler,!1),this},events:{dragover:"_sendToParent",drop:"_sendToParent"},_dragstart:function(e){e.currentTarget.style.opacity="0.4",e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.pair)),this.$el.parent().trigger("pair.dragstart",[this])},_dragend:function(e){e.currentTarget.style.opacity="1.0",this.$el.parent().trigger("pair.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"PairView("+this.pair.name+")"}}),w=e.View.extend(g.default.LoggableMixin).extend(p.default.CollectionCreatorMixin).extend({_logNamespace:"collections",className:"list-of-pairs-collection-creator collection-creator flex-row-container",initialize:function(e){this.metric("PairedCollectionCreator.initialize",e),e=n.defaults(e,{datasets:[],filters:this.DEFAULT_FILTERS,automaticallyPair:!0,strategy:"lcs",matchPercentage:.9,twoPassAutopairing:!0}),this.initialList=e.datasets,this.historyId=e.historyId,this.filters=this.commonFilters[e.filters]||this.commonFilters[this.DEFAULT_FILTERS],n.isArray(e.filters)&&(this.filters=e.filters),this.automaticallyPair=e.automaticallyPair,this.strategy=this.strategies[e.strategy]||this.strategies[this.DEFAULT_STRATEGY],n.isFunction(e.strategy)&&(this.strategy=e.strategy),this.matchPercentage=e.matchPercentage,this.twoPassAutopairing=e.twoPassAutopairing,this.removeExtensions=!0,this.oncancel=e.oncancel,this.oncreate=e.oncreate,this.autoscrollDist=e.autoscrollDist||24,this.unpairedPanelHidden=!1,this.pairedPanelHidden=!1,this.$dragging=null,this.blocking=!1,this._setUpCommonSettings(e),this._setUpBehaviors(),this._dataSetUp()},commonFilters:{illumina:["_1","_2"],Rs:["_R1","_R2"]},DEFAULT_FILTERS:"illumina",strategies:{simple:"autopairSimple",lcs:"autopairLCS",levenshtein:"autopairLevenshtein"},DEFAULT_STRATEGY:"lcs",_dataSetUp:function(){this.paired=[],this.unpaired=[],this.selectedIds=[],this._sortInitialList(),this._ensureIds(),this.unpaired=this.initialList.slice(0),this.automaticallyPair&&(this.autoPair(),this.once("rendered:initial",function(){this.trigger("autopair")}))},_sortInitialList:function(){this._sortDatasetList(this.initialList)},_sortDatasetList:function(e){return e.sort(function(e,t){return(0,h.default)(e.name,t.name)}),e},_ensureIds:function(){return this.initialList.forEach(function(e){e.hasOwnProperty("id")||(e.id=n.uniqueId())}),this.initialList},_splitByFilters:function(){function e(e,t){return t.test(e.name)}var t=this.filters.map(function(e){return new RegExp(e)}),i=[[],[]];return this.unpaired.forEach(function(n){t.forEach(function(t,s){e(n,t)&&i[s].push(n)})}),i},_addToUnpaired:function(e){var t=this;this.unpaired.splice(function i(n,s){if(n===s)return n;var a=Math.floor((s-n)/2)+n,o=(0,h.default)(e.name,t.unpaired[a].name);if(o<0)return i(n,a);if(o>0)return i(a+1,s);for(;t.unpaired[a]&&t.unpaired[a].name===e.name;)a++;return a}(0,this.unpaired.length),0,e)},autoPair:function(e){var t=this._splitByFilters(),i=[];return this.twoPassAutopairing&&(i=this.autopairSimple({listA:t[0],listB:t[1]}),t=this._splitByFilters()),e=e||this.strategy,t=this._splitByFilters(),i=i.concat(this[e].call(this,{listA:t[0],listB:t[1]}))},autopairSimple:l({scoreThreshold:function(){return.6},match:function(e){return e=e||{},e.matchTo===e.possible?{index:e.index,score:1}:e.bestMatch}}),autopairLevenshtein:l({scoreThreshold:function(){return this.matchPercentage},match:function(e){e=e||{};var t=(0,c.default)(e.matchTo,e.possible),i=1-t/Math.max(e.matchTo.length,e.possible.length);return i>e.bestMatch.score?{index:e.index,score:i}:e.bestMatch}}),autopairLCS:l({scoreThreshold:function(){return this.matchPercentage},match:function(e){e=e||{};var t=this._naiveStartingAndEndingLCS(e.matchTo,e.possible).length,i=t/Math.max(e.matchTo.length,e.possible.length);return i>e.bestMatch.score?{index:e.index,score:i}:e.bestMatch}}),_naiveStartingAndEndingLCS:function(e,t){for(var i="",n="",s=0,a=0;s=0&&a>=0&&e[s]===t[a];)n=[e[s],n].join(""),s-=1,a-=1;return i+n},_pair:function(e,t,i){i=i||{},this.debug("_pair:",e,t);var s=this._createPair(e,t,i.name);return this.paired.push(s),this.unpaired=n.without(this.unpaired,e,t),i.silent||this.trigger("pair:new",s),s},_createPair:function(e,t,i){if(!e||!t||e===t)throw new Error("Bad pairing: "+[JSON.stringify(e),JSON.stringify(t)]);return i=i||this._guessNameForPair(e,t),{forward:e,name:i,reverse:t}},_guessNameForPair:function(e,t,i){i=void 0!==i?i:this.removeExtensions;var n=e.name,s=t.name,a=this._naiveStartingAndEndingLCS(n.replace(new RegExp(this.filters[0]),""),s.replace(new RegExp(this.filters[1]),""));if(i){var o=a.lastIndexOf(".");if(o>0){var l=a.slice(o,a.length);a=a.replace(l,""),n=n.replace(l,""),s=s.replace(l,"")}}return a||n+" & "+s},_unpair:function(e,t){if(t=t||{},!e)throw new Error("Bad pair: "+JSON.stringify(e));return this.paired=n.without(this.paired,e),this._addToUnpaired(e.forward),this._addToUnpaired(e.reverse),t.silent||this.trigger("pair:unpair",[e]),e},unpairAll:function(){for(var e=[];this.paired.length;)e.push(this._unpair(this.paired[0],{silent:!0}));this.trigger("pair:unpair",e)},_pairToJSON:function(e,t){return t=t||"hda",{collection_type:"paired",src:"new_collection",name:e.name,element_identifiers:[{name:"forward",id:e.forward.id,src:t},{name:"reverse",id:e.reverse.id,src:t}]}},createList:function(e){var t=this,i=Galaxy.root+"api/histories/"+this.historyId+"/contents/dataset_collections",a={type:"dataset_collection",collection_type:"list:paired",hide_source_items:t.hideOriginals||!1,name:n.escape(e||t.$(".collection-name").val()),element_identifiers:t.paired.map(function(e){return t._pairToJSON(e)})};return t.blocking=!0,s.ajax(i,{type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify(a)}).always(function(){t.blocking=!1}).fail(function(e,i,n){t._ajaxErrHandler(e,i,n)}).done(function(e,i,n){t.trigger("collection:created",e,i,n),t.metric("collection:created",e),"function"==typeof t.oncreate&&t.oncreate.call(this,e,i,n)})},_ajaxErrHandler:function(e,t,i){this.error(e,t,i);var n=this,s=(0,v.default)("An error occurred while creating this collection");e&&(0===e.readyState&&0===e.status?s+=": "+(0,v.default)("Galaxy could not be reached and may be updating.")+(0,v.default)(" Try again in a few minutes."):e.responseJSON?s+="
",(0,v.default)(["Collections of paired datasets are ordered lists of dataset pairs (often forward and reverse reads). ","These collections can be passed to tools and workflows in order to have analyses done on each member of ","the entire group. This interface allows you to create a collection, choose which datasets are paired, ","and re-order the final collection."].join("")),"
","
",(0,v.default)(['Unpaired datasets are shown in the unpaired section ',"(hover over the underlined words to highlight below). ",'Paired datasets are shown in the paired section.',"
To pair datasets, you can:","
Click a dataset in the ",'forward column ',"to select it then click a dataset in the ",'reverse column.',"
",'
Click one of the "Pair these datasets" buttons in the ','middle column ',"to pair the datasets in a particular row.","
",'
Click "Auto-pair" ',"to have your datasets automatically paired based on name.","
","
"].join("")),"","
",(0,v.default)(["
You can filter what is shown in the unpaired sections by:","
Entering partial dataset names in either the ",'forward filter or ','reverse filter.',"
","
Choosing from a list of preset filters by clicking the ",'"Choose filters" link.',"
Clearing the filters by clicking the ",'"Clear filters" link.',"
","
"].join("")),"","
",(0,v.default)(["To unpair individual dataset pairs, click the ",'unpair buttons ( ). ','Click the "Unpair all" link to unpair all pairs.'].join("")),"
","
",(0,v.default)(['You can include or remove the file extensions (e.g. ".fastq") from your pair names by toggling the ','"Remove file extensions from pair names?" control.'].join("")),"
","
",(0,v.default)(['Once your collection is complete, enter a name and ','click "Create list". ',"(Note: you do not have to pair all unpaired datasets to finish.)"].join("")),"
"].join(""))})}),b=function(e,t){var i,a=s.Deferred();if(t=n.defaults(t||{},{datasets:e,oncancel:function(){Galaxy.modal.hide(),a.reject("cancelled")},oncreate:function(e,t){Galaxy.modal.hide(),a.resolve(t)}}),!window.Galaxy||!Galaxy.modal)throw new Error("Galaxy or Galaxy.modal not found");return i=new w(t),Galaxy.modal.show({title:(0,v.default)("Create a collection of paired datasets"),body:i.$el,width:"80%",height:"800px",closing_events:!0}),i.render(),window.creator=i,a};t.default={PairedCollectionCreator:w,pairedCollectionCreatorModal:b,createListOfPairsCollection:r}}).call(t,i(2),i(1),i(0),i(0))},function(e,t,i){"use strict";function n(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var i,n=[];for(i=0;i<=t.length;i++)n[i]=[i];var s;for(s=0;s<=e.length;s++)n[0][s]=s;for(i=1;i<=t.length;i++)for(s=1;s<=e.length;s++)t.charAt(i-1)===e.charAt(s-1)?n[i][s]=n[i-1][s-1]:n[i][s]=Math.min(n[i-1][s-1]+1,Math.min(n[i][s-1]+1,n[i-1][s]+1));return n[t.length][e.length]}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(3),l=a(o),r=i(11),d=(a(r),i(6)),c=a(d),u=i(14),h=a(u),f=e.Model.extend({initialize:function(e){e=e||{},e.user_id=e.user_id||Galaxy.user.id,this.set({user_id:e.user_id,information:{title:(0,l.default)("Manage information"),description:"Edit your email, addresses and custom parameters or change your username.",url:"api/users/"+e.user_id+"/information/inputs",icon:"fa-user",redirect:"user"},password:{title:(0,l.default)("Change password"),description:(0,l.default)("Allows you to change your login credentials."),icon:"fa-unlock-alt",url:"api/users/"+e.user_id+"/password/inputs",submit_title:"Save password",redirect:"user"},communication:{title:(0,l.default)("Change communication settings"),description:(0,l.default)("Enable or disable the communication feature to chat with other users."),url:"api/users/"+e.user_id+"/communication/inputs",icon:"fa-comments-o",redirect:"user"},permissions:{title:(0,l.default)("Set dataset permissions for new histories"),description:"Grant others default access to newly created histories. Changes made here will only affect histories created after these settings have been stored.",url:"api/users/"+e.user_id+"/permissions/inputs",icon:"fa-users",submit_title:"Save permissions",redirect:"user"},api_key:{title:(0,l.default)("Manage API key"),description:(0,l.default)("Access your current API key or create a new one."),url:"api/users/"+e.user_id+"/api_key/inputs",icon:"fa-key",submit_title:"Create a new key",submit_icon:"fa-check"},toolbox_filters:{title:(0,l.default)("Manage Toolbox filters"),description:(0,l.default)("Customize your Toolbox by displaying or omitting sets of Tools."),url:"api/users/"+e.user_id+"/toolbox_filters/inputs",icon:"fa-filter",submit_title:"Save filters",redirect:"user"},openids:{title:(0,l.default)("Manage OpenIDs"),description:(0,l.default)("Associate OpenIDs with your account."),icon:"fa-openid",onclick:function(){window.location.href=Galaxy.root+"openids/list"}},custom_builds:{title:(0,l.default)("Manage custom builds"),description:(0,l.default)("Add or remove custom builds using history datasets."),icon:"fa-cubes",onclick:function(){window.location.href=Galaxy.root+"custom_builds"}},logout:{title:(0,l.default)("Sign out"),description:(0,l.default)("Click here to sign out of all sessions."),icon:"fa-sign-out",onclick:function(){Galaxy.modal.show({title:(0,l.default)("Sign out"),body:"Do you want to continue and sign out of all active sessions?",buttons:{Cancel:function(){Galaxy.modal.hide()},"Sign out":function(){window.location.href=Galaxy.root+"user/logout?session_csrf_token="+Galaxy.session_csrf_token}}})}}})}}),p=e.View.extend({title:(0,l.default)("User Preferences"),initialize:function(){this.model=new f,this.setElement(""),this.render()},render:function(){var e=this,t=Galaxy.config;n.getJSON(Galaxy.root+"api/users/"+Galaxy.user.id,function(i){e.$preferences=n("").addClass("ui-panel").append(n("").append("User preferences")).append(n("").append("You are logged in as "+s.escape(i.email)+".")).append(e.$table=n("
You are using '+e.nice_total_disk_usage+" of disk space in this Galaxy instance. "+(Galaxy.config.enable_quotas?"Your disk quota is: "+e.quota+". ":"")+'Is your usage more than expected? See the documentation for tips on how to find all of the data in your account.
'}});t.default={View:p,Model:f}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),o=s(a),l=i(4),r=(s(l),i(6)),d=s(r),c=i(11),u=s(c),h=i(88),f=s(h),p=e.Collection.extend({comparator:function(e,t){return e=e.get("name"),t=t.get("name"),e>t?1:e").append(n("").text("Current Custom Builds")).append(this.table.$el).append(this.$installed=n("").append(n("").text("System Installed Builds").addClass("ui-margin-top")).append(this.installed_builds.$el)).append(n("").text("Add a Custom Build").addClass("ui-margin-top")).append(n("").addClass("ui-column").append(n("").addClass("ui-column-left").append(this.message.$el).append(this.$form=n("").addClass("ui-margin-top"))).append(this.$help=n("").addClass("ui-column-right")))),this.listenTo(this.collection,"add remove reset",function(){i._renderTable()}),this.listenTo(this.model,"change",function(){i._renderForm()}),this.collection.fetch(),this.model.fetch()},render:function(){this._renderTable(),this._renderForm()},_renderTable:function(){var e=this;this.table.delAll(),this.collection.sort(),this.collection.each(function(t){e.table.add(t.get("name")),e.table.add(t.id),e.table.add(void 0!==t.get("count")?t.get("count"):"Processing..."),e.table.add(new d.default.ButtonIcon({icon:"fa-trash-o",cls:"ui-button-icon-plain",tooltip:(0,o.default)("Delete custom build."),onclick:function(){t.destroy()}}).$el),e.table.append(t.id)})},_renderForm:function(){var e=this,t=new u.default({inputs:[{type:"text",name:"name",label:"Name",help:"Specify a build name e.g. Hamster."},{type:"text",name:"id",label:"Key",help:"Specify a build key e.g. hamster_v1."},{name:"len",type:"conditional",test_param:{name:"type",label:"Definition",help:(0,o.default)("Provide the data source."),type:"select",value:"fasta",data:[{value:"fasta",label:"FASTA-file from history"},{value:"file",label:"Len-file from disk"},{value:"text",label:"Len-file by copy/paste"}]},cases:[{value:"fasta",inputs:[{type:"select",name:"value",label:"FASTA-file",data:this.model.get("fasta_hdas")}]},{value:"file",inputs:[{type:"upload",name:"value",label:"Len-file",data:this.model.get("len_hdas")}]},{value:"text",inputs:[{type:"text",area:!0,name:"value",label:"Edit/Paste"}]}]}],buttons:{save:new d.default.Button({icon:"fa-save",tooltip:(0,o.default)("Create new Build"),title:(0,o.default)("Save"),cls:"btn btn-primary ui-clear-float",onclick:function(){var i=t.data.create();i.id&&i.name?e.collection.create(i,{wait:!0,success:function(t){t.get("message")?e.message.update({message:t.get("message"),status:"warning"}):e.message.update({message:"Successfully added a new custom build.",status:"success"})},error:function(t,i){var n=i&&i.responseJSON&&i.responseJSON.err_msg;e.message.update({message:n||"Failed to create custom build.",status:"danger"})}}):e.message.update({message:"All inputs are required.",status:"danger"})}})},onchange:function(){var i=t.data.match("len|type");if(i){var n=t.field_list[i];e._renderHelp(n.value())}}});this.$form.empty().append(t.$el);var i=this.model.get("installed_builds");i&&i.length?(this.$installed.show(),this.installed_builds.update(this.model.get("installed_builds"))):this.$installed.hide(),this._renderHelp("fasta")},_renderHelp:function(e){this.$help.empty().addClass("alert alert-info").html("fasta"==e?this._templateFasta():this._templateLen())},_templateLen:function(){return"
Length Format
The length format is two-column, separated by whitespace, of the form:
chrom/contig length of chrom/contig
For example, the first few entries of mm9.len are as follows:
Trackster uses this information to populate the select box for chrom/contig, andto set the maximum basepair of the track browser. You may either upload a .len fileof this format (Len File option), or directly enter the information into the box (Len Entry option).
"},_templateFasta:function(){return"
FASTA format
This is a multi-fasta file from your current history that provides the genomesequences for each chromosome/contig in your build.
Here is a snippet from an example multi-fasta file:
")}),t.append(a)}else t.append("No "+this.model.get("plural").toLowerCase()+" have been shared with you.");return t}});t.default={View:l}}).call(t,i(2),i(0),i(1))},function(e,t,i){"use strict";(function(e,n,s){function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=i(7),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(o),r=i(39),d=a(r),c=i(268),u=a(c),h=i(14),f=a(h),p=i(3),m=a(p),g=e.View.extend({tagName:"tr",initialize:function(){n.bindAll(this,"render","_rowTemplate","renderTagEditor","_templateActions","removeWorkflow","copyWorkflow"),l.options.timeOut=1500},events:{"click #show-in-tool-panel":"showInToolPanel","click #delete-workflow":"removeWorkflow","click #rename-workflow":"renameWorkflow","click #copy-workflow":"copyWorkflow"},render:function(){return s(this.el).html(this._rowTemplate()),this},showInToolPanel:function(){this.model.set("show_in_tool_panel",!this.model.get("show_in_tool_panel")),this.model.save(),window.location=Galaxy.root+"workflows/list"},removeWorkflow:function(){var e=this.model.get("name");window.confirm("Are you sure you want to delete workflow '"+e+"'?")&&(this.model.destroy({success:function(){l.success("Successfully deleted workflow '"+e+"'")}}),this.remove())},renameWorkflow:function(){var e=this.model.get("name"),t=window.prompt("Enter a new Name for workflow '"+e+"'",e);t&&(this.model.save({name:t},{success:function(){l.success("Successfully renamed workflow '"+e+"' to '"+t+"'")}}),this.render())},copyWorkflow:function(){var e=this,t=this.model.get("name");s.getJSON(this.model.urlRoot+"/"+this.model.id+"/download",function(i){var n="Copy of "+t,s=e.model.get("owner");s!=Galaxy.user.attributes.username&&(n+=" shared by user "+s),i.name=n,e.collection.create(i,{at:0,wait:!0,success:function(){l.success("Successfully copied workflow '"+t+"' to '"+n+"'")},error:function(e,t,i){l.error(i.errorThrown)}})}).error(function(e,t,i){l.error(e.responseJSON.err_msg)})},_rowTemplate:function(){var e=this.model.get("show_in_tool_panel"),t=this.model.id,i='';return'
'}}),_=e.View.extend({title:(0,m.default)("Workflows"),initialize:function(){this.setElement(""),n.bindAll(this,"adjustActiondropdown"),this.collection=new u.default.WorkflowCollection,this.collection.fetch().done(this.render()),this.collection.bind("add",this.appendItem),this.collection.on("sync",this.render,this)},events:{dragleave:"unhighlightDropZone",drop:"drop",dragover:function(e){s(".hidden_description_layer").addClass("dragover"),s(".menubutton").addClass("background-none"),e.preventDefault()}},unhighlightDropZone:function(){s(".hidden_description_layer").removeClass("dragover"),s(".menubutton").removeClass("background-none")},drop:function(e){this.unhighlightDropZone(),e.preventDefault();for(var t,i=e.dataTransfer.files,n=this,s=0;t=i[s];s++)n.readWorkflowFiles(t)},readWorkflowFiles:function(e){var t=this,i=new FileReader;i.onload=function(n){var s;try{s=JSON.parse(i.result)}catch(t){l.error("Could not read file '"+e.name+"'. Verify it is a valid Galaxy workflow"),s=null}s&&t.collection.create(s,{at:0,wait:!0,success:function(){l.success("Successfully imported workflow '"+s.name+"'")},error:function(e,t,i){l.error(i.errorThrown)}})},i.readAsText(e,"utf-8")},_showArgErrors:n.once(function(){var e=f.default.get("message");"error"===f.default.get("status")?l.error(n.escape(e||"Unknown Error, please report this to an administrator.")):e&&l.info(n.escape(e))}),render:function(){var e=this._templateHeader(),t=this._templateActionButtons(),i=this._templateWorkflowTable();this.$el.html(e+t+i);var s=this;n(this.collection.models).each(function(e){s.appendItem(e),s.confirmDelete(e)},this);return this.searchWorkflow(this.$(".search-wf"),this.$(".workflow-search tr"),3),this.adjustActiondropdown(),this._showArgErrors(),this},appendItem:function(e){var t=new g({model:e,collection:this.collection});s(".workflow-search").append(t.render().el),t.renderTagEditor()},confirmDelete:function(e){this.$(".link-confirm-shared-"+e.id).click(function(){return window.confirm("Are you sure you want to remove the shared workflow '"+e.attributes.name+"'?")})},searchWorkflow:function(e,t,i){e.on("keyup",function(){var e=s(this).val();if(e.length>=i){var n=new RegExp(e,"i");t.hide(),t.filter(function(){return n.test(s(this).text())}).show()}else t.show()})},adjustActiondropdown:function(){s(this.el).on("show.bs.dropdown",function(){s(this.el).css("overflow","inherit")}),s(this.el).on("hide.bs.dropdown",function(){s(this.el).css("overflow","auto")})},_templateNoWorkflow:function(){return'
Click the link above to visit myExperiment and browse for Galaxy workflows.
"}});t.default={View:_,ImportWorkflowView:v}}).call(t,i(2),i(1),i(0))},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=i(5),s=function(e){return e&&e.__esModule?e:{default:e}}(n),a=e.Model.extend(s.default.LoggableMixin).extend({_logNamespace:"workflow",urlRoot:Galaxy.root+"api/workflows",toJSON:function(){return{workflow:this.attributes}}}),o=e.Collection.extend({model:a,url:Galaxy.root+"api/workflows"});t.default={WorkflowItem:a,WorkflowCollection:o}}).call(t,i(2))},function(e,t,i){"use strict";function n(e){i(270)}Object.defineProperty(t,"__esModule",{value:!0});var s=i(272),a=i.n(s),o=i(273),l=i(48),r=n,d=l(a.a,o.a,!1,r,null,null);t.default=d.exports},function(e,t,i){var n=i(271);"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);i(47)("2fdc4394",n,!0)},function(e,t,i){t=e.exports=i(46)(void 0),t.push([e.i,".ui-message{display:block}",""])},function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default={data:function(){return{errormessage:null}},methods:{submit:function(){var t=this;e.ajax({url:Galaxy.root+"api/histories",data:new FormData(this.$refs.form),cache:!1,contentType:!1,processData:!1,method:"POST"}).done(function(e){window.location=Galaxy.root+"histories/list?message="+e.message+"&status=success"}).fail(function(e){var i=e.responseJSON&&e.responseJSON.err_msg;t.errormessage=i||"Import failed for unkown reason."})}}}}).call(t,i(0))},function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-portlet-limited"},[e._m(0,!1,!1),e._v(" "),i("div",{staticClass:"portlet-content"},[e.errormessage?i("div",{staticClass:"ui-message alert alert-danger"},[e._v("\n "+e._s(e.errormessage)+"\n ")]):e._e(),e._v(" "),i("div",{staticClass:"portlet-body"},[i("form",{ref:"form"},[e._m(1,!1,!1),e._v(" "),e._m(2,!1,!1)])]),e._v(" "),i("div",{staticClass:"portlet-buttons"},[i("input",{staticClass:"btn btn-primary",attrs:{type:"button",value:"Import History"},on:{click:e.submit}})])])])},s=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"portlet-header"},[i("div",{staticClass:"portlet-title"},[i("i",{staticClass:"portlet-title-icon fa fa-upload"}),e._v(" "),i("span",{staticClass:"portlet-title-text"},[i("b",[e._v("Import a History from an Archive")])])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived History URL")]),e._v(" "),i("input",{staticClass:"ui-input",attrs:{type:"text",name:"archive_source"}})])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"ui-form-element"},[i("div",{staticClass:"ui-form-title"},[e._v("Archived History file")]),e._v(" "),i("input",{attrs:{type:"file",name:"archive_file"}})])}],a={render:n,staticRenderFns:s};t.a=a},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),o=s(a),l=i(4),r=s(l),d=i(19),c=s(d),u=i(62),h=s(u),f=i(112),p=s(f),m=c.default.extend({_showCopyDialog:function(e){var t=new h.default.History({id:e});t.fetch().fail(function(){alert("History could not be fetched. Please contact an administrator")}).done(function(){(0,p.default)(t,{}).done(function(){window.parent&&window.parent.Galaxy&&window.parent.Galaxy.currHistoryPanel&&window.parent.Galaxy.currHistoryPanel.loadCurrentHistory(),window.location.reload(!0)})})},_add_operation:function(t,i,n){var s=this,a=n.operation_config[i.label];"Copy"==i.label&&(i.onclick=function(e){s._showCopyDialog(e)}),a.allowed&&i.allow_popup&&t.addItem({html:i.label,href:a.url_args,target:a.target,confirmation_text:i.confirm,func:function(t){t.preventDefault();var a=e(t.target).html();i.onclick?i.onclick(n.encode_id):s.execute(this.findItemByHtml(a))}})}}),g=n.View.extend({title:(0,o.default)("Histories"),initialize:function(t){var i=this;this.setElement(e("")),this.model=new n.Model,r.default.get({url:Galaxy.root+"history/"+t.action_id+"?"+e.param(Galaxy.params),success:function(e){i.model.set(e),i.render()}})},render:function(){var e=new m(this.model.attributes);this.$el.empty().append(e.$el)}});t.default={View:g}}).call(t,i(0),i(2))},function(e,t,i){"use strict";(function(e,n){function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=i(3),o=s(a),l=i(4),r=s(l),d=i(6),c=s(d),u=i(11),h=s(u),f=e.View.extend({initialize:function(){this.setElement(""),this.model=new e.Model({dataset_id:Galaxy.params.dataset_id}),this.render()},render:function(){var e=Galaxy.root+"api/datasets/"+this.model.get("dataset_id"),t=this;r.default.get({url:e,success:function(e){var i=Galaxy.root+"api/jobs/"+e.creating_job+"?full=True";r.default.get({url:i,success:function(i){Galaxy.root,e.creating_job;t.render_error_page(t,e,i)},error:function(e){var i={status:"error",message:"Error occured while loading the job.",persistent:!0,cls:"errormessage"};t.display_message(i,t.$(".response-message"))}})},error:function(e){var i={status:"error",message:"Error occured while loading the dataset.",persistent:!0,cls:"errormessage"};t.display_message(i,t.$(".response-message"))}})},render_error_page:function(e,t,i){e.$el.empty().append(e._templateHeader()),e.$el.append("
Dataset Error
"),e.$el.append("
An error occured while running the tool "+i.tool_id+".
"),e.$el.append("
Tool execution generated the following messages:
"),e.$el.append('
'+i.stderr+"
"),e.$el.append("
Report This Error"),e.$el.append("
Usually the local Galaxy administrators regularly review errors that occur on the server. However, if you would like to provide additional information (such as what you were trying to do when the error occurred) and a contact e-mail address, we will be better able to investigate your problem and get back to you.