mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge remote-tracking branch 'upstream/dev' into es6imports
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
client/galaxy/style/source_material/circle.py
|
||||
config/
|
||||
contrib/
|
||||
cron/
|
||||
doc/parse_gx_xsd.py
|
||||
@@ -21,22 +22,13 @@ lib/galaxy/jobs/command_factory.py
|
||||
lib/galaxy/jobs/datasets.py
|
||||
lib/galaxy/jobs/deferred/
|
||||
lib/galaxy/jobs/error_level.py
|
||||
lib/galaxy/jobs/handler.py
|
||||
lib/galaxy/jobs/__init__.py
|
||||
lib/galaxy/jobs/manager.py
|
||||
lib/galaxy/jobs/metrics/
|
||||
lib/galaxy/jobs/output_checker.py
|
||||
lib/galaxy/jobs/rules/
|
||||
lib/galaxy/jobs/runners/cli.py
|
||||
lib/galaxy/jobs/runners/condor.py
|
||||
lib/galaxy/jobs/runners/drmaa.py
|
||||
lib/galaxy/jobs/runners/godocker.py
|
||||
lib/galaxy/jobs/runners/kubernetes.py
|
||||
lib/galaxy/jobs/runners/local.py
|
||||
lib/galaxy/jobs/runners/pbs.py
|
||||
lib/galaxy/jobs/runners/pulsar.py
|
||||
lib/galaxy/jobs/runners/slurm.py
|
||||
lib/galaxy/jobs/runners/state_handlers/
|
||||
lib/galaxy/jobs/runners/tasks.py
|
||||
lib/galaxy/jobs/runners/util/
|
||||
lib/galaxy/jobs/runners/
|
||||
lib/galaxy/jobs/splitters/basic.py
|
||||
lib/galaxy/jobs/splitters/__init__.py
|
||||
lib/galaxy/jobs/stock_rules.py
|
||||
@@ -61,9 +53,7 @@ lib/galaxy/objectstore/s3_multipart_upload.py
|
||||
lib/galaxy/objectstore/s3.py
|
||||
lib/galaxy/openid/__init__.py
|
||||
lib/galaxy/quota/
|
||||
lib/galaxy/sample_tracking/data_transfer.py
|
||||
lib/galaxy/sample_tracking/__init__.py
|
||||
lib/galaxy/sample_tracking/sample.py
|
||||
lib/galaxy/sample_tracking/
|
||||
lib/galaxy/security/
|
||||
lib/galaxy/tags/
|
||||
lib/galaxy/tools/
|
||||
@@ -71,6 +61,7 @@ lib/galaxy/util/
|
||||
lib/galaxy/version.py
|
||||
lib/galaxy/visualization/data_providers/basic.py
|
||||
lib/galaxy/visualization/data_providers/cigar.py
|
||||
lib/galaxy/visualization/data_providers/genome.py
|
||||
lib/galaxy/visualization/data_providers/__init__.py
|
||||
lib/galaxy/visualization/data_providers/phyloviz/baseparser.py
|
||||
lib/galaxy/visualization/genome/
|
||||
@@ -99,14 +90,23 @@ lib/galaxy/web/framework/middleware/xforwardedhost.py
|
||||
lib/galaxy/web/framework/webapp.py
|
||||
lib/galaxy/web/__init__.py
|
||||
lib/galaxy/web/params.py
|
||||
lib/galaxy/web/stack/
|
||||
lib/galaxy/webapps/galaxy/api/authenticate.py
|
||||
lib/galaxy/webapps/galaxy/api/forms.py
|
||||
lib/galaxy/webapps/galaxy/api/genomes.py
|
||||
lib/galaxy/webapps/galaxy/api/group_roles.py
|
||||
lib/galaxy/webapps/galaxy/api/group_users.py
|
||||
lib/galaxy/webapps/galaxy/api/groups.py
|
||||
lib/galaxy/webapps/galaxy/api/histories.py
|
||||
lib/galaxy/webapps/galaxy/api/__init__.py
|
||||
lib/galaxy/webapps/galaxy/api/jobs.py
|
||||
lib/galaxy/webapps/galaxy/api/library_contents.py
|
||||
lib/galaxy/webapps/galaxy/api/library_datasets.py
|
||||
lib/galaxy/webapps/galaxy/api/requests.py
|
||||
lib/galaxy/webapps/galaxy/api/request_types.py
|
||||
lib/galaxy/webapps/galaxy/api/roles.py
|
||||
lib/galaxy/webapps/galaxy/api/samples.py
|
||||
lib/galaxy/webapps/galaxy/api/tool_data.py
|
||||
lib/galaxy/webapps/galaxy/api/tools.py
|
||||
lib/galaxy/webapps/galaxy/api/tours.py
|
||||
lib/galaxy/webapps/galaxy/api/users.py
|
||||
@@ -116,6 +116,7 @@ lib/galaxy/webapps/galaxy/config_watchers.py
|
||||
lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
|
||||
lib/galaxy/webapps/galaxy/controllers/async.py
|
||||
lib/galaxy/webapps/galaxy/controllers/data_manager.py
|
||||
lib/galaxy/webapps/galaxy/controllers/dataset.py
|
||||
lib/galaxy/webapps/galaxy/controllers/error.py
|
||||
lib/galaxy/webapps/galaxy/controllers/external_services.py
|
||||
lib/galaxy/webapps/galaxy/controllers/forms.py
|
||||
@@ -124,21 +125,29 @@ lib/galaxy/webapps/galaxy/controllers/__init__.py
|
||||
lib/galaxy/webapps/galaxy/controllers/library_common.py
|
||||
lib/galaxy/webapps/galaxy/controllers/mobile.py
|
||||
lib/galaxy/webapps/galaxy/controllers/page.py
|
||||
lib/galaxy/webapps/galaxy/controllers/requests_admin.py
|
||||
lib/galaxy/webapps/galaxy/controllers/requests_common.py
|
||||
lib/galaxy/webapps/galaxy/controllers/requests.py
|
||||
lib/galaxy/webapps/galaxy/controllers/request_type.py
|
||||
lib/galaxy/webapps/galaxy/controllers/root.py
|
||||
lib/galaxy/webapps/galaxy/controllers/search.py
|
||||
lib/galaxy/webapps/galaxy/controllers/tool_runner.py
|
||||
lib/galaxy/webapps/galaxy/controllers/userskeys.py
|
||||
lib/galaxy/webapps/galaxy/__init__.py
|
||||
lib/galaxy/webapps/__init__.py
|
||||
lib/galaxy/webapps/reports/buildapp.py
|
||||
lib/galaxy/webapps/reports/config.py
|
||||
lib/galaxy/webapps/reports/controllers/__init__.py
|
||||
lib/galaxy/webapps/reports/controllers/query.py
|
||||
lib/galaxy/webapps/reports/controllers/system.py
|
||||
lib/galaxy/webapps/reports/controllers/tools.py
|
||||
lib/galaxy/webapps/reports/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/api/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/buildapp.py
|
||||
lib/galaxy/webapps/tool_shed/config.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/groups.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/repository.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/user.py
|
||||
lib/galaxy/webapps/tool_shed/framework/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/framework/middleware/__init__.py
|
||||
|
||||
@@ -13,10 +13,12 @@ env:
|
||||
- TOX_ENV=py27-lint-imports-include-list
|
||||
- TOX_ENV=validate-test-tools
|
||||
- TOX_ENV=py27-lint-docstring-include-list
|
||||
- TOX_ENV=check-python-dependencies
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- env: TOX_ENV=py27-lint-imports
|
||||
- env: TOX_ENV=check-python-dependencies
|
||||
|
||||
addons:
|
||||
apt:
|
||||
|
||||
@@ -30,6 +30,12 @@ docs: ## Generate HTML documentation.
|
||||
$(IN_VENV) $(MAKE) -C doc clean
|
||||
$(IN_VENV) $(MAKE) -C doc html
|
||||
|
||||
setup-venv:
|
||||
if [ ! -f $(VENV)/bin/activate ]; then bash scripts/common_startup.sh --dev-wheels; fi
|
||||
|
||||
list-dependency-updates: setup-venv
|
||||
$(IN_VENV) pip list --outdated --format=columns
|
||||
|
||||
docs-slides-ready:
|
||||
test -f plantuml.jar || wget http://jaist.dl.sourceforge.net/project/plantuml/plantuml.jar
|
||||
java -jar plantuml.jar -c $(DOC_SOURCE_DIR)/slideshow/architecture/images/plantuml_options.txt -tsvg $(SLIDESHOW_DIR)/architecture/images/ *.plantuml.txt
|
||||
|
||||
@@ -22,6 +22,7 @@ window.app = function app(options, bootstrapped) {
|
||||
"(/)admin(/)groups": "show_groups",
|
||||
"(/)admin(/)tool_versions": "show_tool_versions",
|
||||
"(/)admin(/)quotas": "show_quotas",
|
||||
"(/)admin(/)repositories": "show_repositories",
|
||||
"(/)admin(/)forms": "show_forms",
|
||||
"(/)admin(/)form(/)(:form_id)": "show_form"
|
||||
},
|
||||
@@ -60,6 +61,17 @@ window.app = function app(options, bootstrapped) {
|
||||
);
|
||||
},
|
||||
|
||||
show_repositories: function() {
|
||||
this.page.display(
|
||||
new GridView({
|
||||
url_base:
|
||||
Galaxy.root + "admin_toolshed/browse_repositories",
|
||||
url_data: Galaxy.params,
|
||||
dict_format: true
|
||||
})
|
||||
);
|
||||
},
|
||||
|
||||
show_tool_versions: function() {
|
||||
this.page.display(
|
||||
new GridView({
|
||||
|
||||
@@ -24,6 +24,10 @@ var AdminPanel = Backbone.View.extend({
|
||||
title: "Data tables registry",
|
||||
url: "admin/view_tool_data_tables"
|
||||
},
|
||||
{
|
||||
title: "Data libraries",
|
||||
url: "library_admin/browse_libraries"
|
||||
},
|
||||
{
|
||||
title: "Display applications",
|
||||
url: "admin/display_applications"
|
||||
@@ -31,6 +35,50 @@ var AdminPanel = Backbone.View.extend({
|
||||
{
|
||||
title: "Manage jobs",
|
||||
url: "admin/jobs"
|
||||
},
|
||||
{
|
||||
title: "Local data",
|
||||
url: "data_manager"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "User Management",
|
||||
items: [
|
||||
{
|
||||
title: "Users",
|
||||
url: "admin/users",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Quotas",
|
||||
url: "admin/quotas",
|
||||
target: "__use_router__",
|
||||
enabled: self.config.enable_quotas
|
||||
},
|
||||
{
|
||||
title: "Groups",
|
||||
url: "admin/groups",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Roles",
|
||||
url: "admin/roles",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Forms",
|
||||
url: "admin/forms",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "API keys",
|
||||
url: "userskeys/all_users"
|
||||
},
|
||||
{
|
||||
title: "Impersonate a user",
|
||||
url: "admin/impersonate",
|
||||
enabled: self.config.allow_user_impersonation
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -51,15 +99,14 @@ var AdminPanel = Backbone.View.extend({
|
||||
},
|
||||
{
|
||||
title: "Monitor installing repositories",
|
||||
url:
|
||||
"admin_toolshed/monitor_repository_installation?installing_repository_ids=" +
|
||||
self.settings.installing_repository_ids,
|
||||
url: "admin_toolshed/monitor_repository_installation",
|
||||
enabled: self.settings.installing_repository_ids
|
||||
},
|
||||
{
|
||||
title: "Manage installed tools",
|
||||
url: "admin_toolshed/browse_repositories",
|
||||
enabled: self.settings.is_repo_installed
|
||||
url: "admin/repositories",
|
||||
enabled: self.settings.is_repo_installed,
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Reset metadata",
|
||||
@@ -97,91 +144,6 @@ var AdminPanel = Backbone.View.extend({
|
||||
url: "admin/manage_tool_dependencies"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "User Management",
|
||||
items: [
|
||||
{
|
||||
title: "Users",
|
||||
url: "admin/users",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Groups",
|
||||
url: "admin/groups",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Roles",
|
||||
url: "admin/roles",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "API keys",
|
||||
url: "userskeys/all_users"
|
||||
},
|
||||
{
|
||||
title: "Impersonate a user",
|
||||
url: "admin/impersonate",
|
||||
enabled: self.config.allow_user_impersonation
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Data",
|
||||
items: [
|
||||
{
|
||||
title: "Quotas",
|
||||
url: "admin/quotas",
|
||||
target: "__use_router__",
|
||||
enabled: self.config.enable_quotas
|
||||
},
|
||||
{
|
||||
title: "Data libraries",
|
||||
url: "library_admin/browse_libraries"
|
||||
},
|
||||
{
|
||||
title: "Roles",
|
||||
url: "admin/roles",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Local data",
|
||||
url: "data_manager"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Form Definitions",
|
||||
items: [
|
||||
{
|
||||
title: "Form definitions",
|
||||
url: "admin/forms",
|
||||
target: "__use_router__"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Sample Tracking",
|
||||
items: [
|
||||
{
|
||||
title: "Sequencers and external services",
|
||||
url: "external_service/browse_external_services"
|
||||
},
|
||||
{
|
||||
title: "Request types",
|
||||
url: "request_type/browse_request_types"
|
||||
},
|
||||
{
|
||||
title: "Sequencing requests",
|
||||
url: "requests_admin/browse_requests"
|
||||
},
|
||||
{
|
||||
title: "Find samples",
|
||||
url:
|
||||
"requests_common/find_samples?cntrller=requests_admin"
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
this.setElement(this._template());
|
||||
|
||||
@@ -111,8 +111,10 @@ function spin(
|
||||
type: "GET",
|
||||
timeout: spin_state.ajax_timeout,
|
||||
success: function(data, status, jqxhr) {
|
||||
if (!success_callback(data, status, jqxhr))
|
||||
if (!success_callback(data, status, jqxhr)) {
|
||||
spin_state.count++;
|
||||
spin_again(spin_state);
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error) {
|
||||
if (status == "timeout") {
|
||||
|
||||
@@ -74,29 +74,6 @@ var Collection = Backbone.Collection.extend({
|
||||
]
|
||||
});
|
||||
|
||||
//
|
||||
// Lab menu.
|
||||
//
|
||||
options.user_requests &&
|
||||
this.add({
|
||||
id: "lab",
|
||||
title: "Lab",
|
||||
menu: [
|
||||
{
|
||||
title: "Sequencing Requests",
|
||||
url: "requests/index"
|
||||
},
|
||||
{
|
||||
title: "Find Samples",
|
||||
url: "requests/find_samples_index"
|
||||
},
|
||||
{
|
||||
title: "Help",
|
||||
url: options.lims_doc_url
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
//
|
||||
// Visualization tab.
|
||||
//
|
||||
|
||||
@@ -143,7 +143,7 @@ var View = Backbone.View.extend({
|
||||
'<div id="messagebox"/>',
|
||||
'<div id="inactivebox" class="panel-warning-message" />',
|
||||
'<div id="left" />',
|
||||
'<div id="center" class="inbound" />',
|
||||
'<div id="center" />',
|
||||
'<div id="right" />',
|
||||
"</div>",
|
||||
'<div id="dd-helper" />'
|
||||
|
||||
@@ -512,7 +512,8 @@ var LibraryDatasetView = Backbone.View.extend({
|
||||
}
|
||||
},
|
||||
|
||||
copyToClipboard: function() {
|
||||
copyToClipboard: function(e) {
|
||||
e.preventDefault();
|
||||
var href = Backbone.history.location.href;
|
||||
if (href.lastIndexOf("/permissions") !== -1) {
|
||||
href = href.substr(0, href.lastIndexOf("/permissions"));
|
||||
@@ -732,7 +733,7 @@ var LibraryDatasetView = Backbone.View.extend({
|
||||
|
||||
'<% if (item.get("is_unrestricted")) { %>',
|
||||
"<div>",
|
||||
'This dataset is unrestricted so everybody with the link can access it. Just share <span class="copy-link-to-clipboard"><a>this page</a></span>.',
|
||||
'This dataset is unrestricted so everybody with the link can access it. Just share <span class="copy-link-to-clipboard"><a href=""a>this page</a></span>.',
|
||||
"</div>",
|
||||
"<% } %>",
|
||||
|
||||
@@ -821,8 +822,34 @@ var LibraryDatasetView = Backbone.View.extend({
|
||||
'<td scope="row"><%= _.escape(item.get("tags")) %></td>',
|
||||
"</tr>",
|
||||
"<% } %>",
|
||||
'<% if ( item.get("uuid") !== "ok" ) { %>',
|
||||
"<tr>",
|
||||
'<th scope="row">UUID</th>',
|
||||
'<td scope="row"><%= _.escape(item.get("uuid")) %></td>',
|
||||
"</tr>",
|
||||
"<% } %>",
|
||||
'<% if ( item.get("state") !== "ok" ) { %>',
|
||||
"<tr>",
|
||||
'<th scope="row">State</th>',
|
||||
'<td scope="row"><%= _.escape(item.get("state")) %></td>',
|
||||
"</tr>",
|
||||
"<% } %>",
|
||||
"</table>",
|
||||
|
||||
'<% if (item.get("job_stderr")) { %>',
|
||||
"<h4>Job Standard Error</h4>",
|
||||
'<pre class="code">',
|
||||
'<%= _.escape(item.get("job_stderr")) %>',
|
||||
"</pre>",
|
||||
"<% } %>",
|
||||
|
||||
'<% if (item.get("job_stdout")) { %>',
|
||||
"<h4>Job Standard Output</h4>",
|
||||
'<pre class="code">',
|
||||
'<%= _.escape(item.get("job_stdout")) %>',
|
||||
"</pre>",
|
||||
"<% } %>",
|
||||
|
||||
"<div>",
|
||||
'<pre class="peek">',
|
||||
"</pre>",
|
||||
@@ -1122,9 +1149,9 @@ var LibraryDatasetView = Backbone.View.extend({
|
||||
"<h2>Dataset-related permissions</h2>",
|
||||
'<div class="alert alert-warning">Changes made below will affect <strong>every</strong> library item that was created from this dataset and also every history this dataset is part of.</div>',
|
||||
'<% if (!item.get("is_unrestricted")) { %>',
|
||||
'<p>You can <span class="remove-restrictions"><a>remove all access restrictions</a></span> on this dataset.</p>',
|
||||
'<p>You can <span class="remove-restrictions"><a href="">remove all access restrictions</a></span> on this dataset.</p>',
|
||||
"<% } else { %>",
|
||||
'<p>You can <span class="make-private"><a>make this dataset private</a></span> to you.</p>',
|
||||
'<p>You can <span class="make-private"><a href="">make this dataset private</a></span> to you.</p>',
|
||||
"<% } %>",
|
||||
"<h4>Roles that can access the dataset</h4>",
|
||||
'<div id="access_perm" class="access_perm roles-selection"></div>',
|
||||
|
||||
@@ -13,13 +13,18 @@ var FolderListView = Backbone.View.extend({
|
||||
|
||||
folderContainer: null,
|
||||
|
||||
sort: "asc",
|
||||
current_sort_order: "asc",
|
||||
|
||||
current_sort_key: "name",
|
||||
|
||||
events: {
|
||||
"click #select-all-checkboxes": "selectAll",
|
||||
"click .dataset_row": "selectClickedRow",
|
||||
"click .folder_row": "selectClickedRow",
|
||||
"click .sort-folder-link": "sortColumnClicked"
|
||||
"click .sort-folder-name": "sortColumnClicked",
|
||||
"click .sort-folder-file_ext": "sortColumnClicked",
|
||||
"click .sort-folder-description": "sortColumnClicked",
|
||||
"click .sort-folder-state": "sortColumnClicked"
|
||||
},
|
||||
|
||||
collection: null,
|
||||
@@ -123,7 +128,7 @@ var FolderListView = Backbone.View.extend({
|
||||
.parent_library_id,
|
||||
id: this.options.id,
|
||||
upper_folder_id: upper_folder_id,
|
||||
order: this.sort
|
||||
order: this.current_sort_order
|
||||
})
|
||||
);
|
||||
|
||||
@@ -202,7 +207,7 @@ var FolderListView = Backbone.View.extend({
|
||||
addAll: function(models) {
|
||||
_.each(models, function(model) {
|
||||
Galaxy.libraries.folderListView.collection.add(model, {
|
||||
sort: false
|
||||
current_sort_order: false
|
||||
});
|
||||
});
|
||||
$("#center [data-toggle]").tooltip();
|
||||
@@ -289,37 +294,21 @@ var FolderListView = Backbone.View.extend({
|
||||
}
|
||||
},
|
||||
|
||||
/** User clicked the table heading = he wants to sort stuff */
|
||||
sortColumnClicked: function(event) {
|
||||
event.preventDefault();
|
||||
if (this.sort === "asc") {
|
||||
this.sortFolder("name", "desc");
|
||||
this.sort = "desc";
|
||||
} else {
|
||||
this.sortFolder("name", "asc");
|
||||
this.sort = "asc";
|
||||
}
|
||||
this.current_sort_order =
|
||||
this.current_sort_order === "asc" ? "desc" : "asc";
|
||||
this.current_sort_key = event.currentTarget.className.replace(
|
||||
"sort-folder-",
|
||||
""
|
||||
);
|
||||
this.collection.sortFolder(
|
||||
this.current_sort_key,
|
||||
this.current_sort_order
|
||||
);
|
||||
this.renderSortIcon();
|
||||
},
|
||||
|
||||
/**
|
||||
* Sorts the underlying collection according to the parameters received.
|
||||
* Currently supports only sorting by name.
|
||||
*/
|
||||
sortFolder: function(sort_by, order) {
|
||||
// default to asc sort by name
|
||||
if (sort_by === "undefined" && order === "undefined") {
|
||||
return this.collection.sortByNameAsc();
|
||||
}
|
||||
if (sort_by === "name") {
|
||||
if (order === "asc") {
|
||||
return this.collection.sortByNameAsc();
|
||||
} else if (order === "desc") {
|
||||
return this.collection.sortByNameDesc();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* User clicked the checkbox in the table heading
|
||||
* @param {context} event
|
||||
@@ -406,14 +395,17 @@ var FolderListView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
renderSortIcon: function() {
|
||||
if (this.sort === "asc") {
|
||||
$(".sort-icon")
|
||||
if (this.current_sort_order === "asc") {
|
||||
$('[class*="sort-icon"]')
|
||||
.removeClass("fa-sort-alpha-desc")
|
||||
.addClass("fa-sort-alpha-asc");
|
||||
.removeClass("fa-sort-alpha-asc");
|
||||
$(".sort-icon" + "-" + this.current_sort_key).addClass(
|
||||
"fa-sort-alpha-asc"
|
||||
);
|
||||
} else {
|
||||
$(".sort-icon")
|
||||
.removeClass("fa-sort-alpha-asc")
|
||||
.addClass("fa-sort-alpha-desc");
|
||||
$(".sort-icon" + "-" + this.current_sort_key).addClass(
|
||||
"fa-sort-alpha-desc"
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -437,12 +429,13 @@ var FolderListView = Backbone.View.extend({
|
||||
"<thead>",
|
||||
'<th class="button_heading"></th>',
|
||||
'<th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>',
|
||||
'<th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a> <span title="Sorted alphabetically" class="sort-icon fa fa-sort-alpha-<%- order %>"></span></th>',
|
||||
'<th style="width:25%;">description</th>',
|
||||
'<th style="width:5%;">data type</th>',
|
||||
'<th><a class="sort-folder-name" title="Click to reverse order" href="#">name</a> <span title="Sorted alphabetically" class="sort-icon-name fa fa-sort-alpha-<%- order %>"></span></th>',
|
||||
'<th style="width:20%;"><a class="sort-folder-description" title="Click to reverse order" href="#">description</a> <span title="Sorted alphabetically" class="sort-icon-description fa"></span></th>',
|
||||
'<th style="width:5%;"><a class="sort-folder-file_ext" title="Click to reverse order" href="#">data type</a> <span title="Sorted alphabetically" class="sort-icon-file_ext fa"></span></th>',
|
||||
'<th style="width:10%;">size</th>',
|
||||
'<th style="width:160px;">time updated (UTC)</th>',
|
||||
'<th style="width:10%;"></th> ',
|
||||
'<th style="width:5%;"><a class="sort-folder-state" title="Click to reverse order" href="#">state</a> <span title="Sorted alphabetically" class="sort-icon-state fa"></span></th>',
|
||||
'<th style="width:150px;"></th> ',
|
||||
"</thead>",
|
||||
'<tbody id="folder_list_body">',
|
||||
'<tr id="first_folder_item">',
|
||||
@@ -456,6 +449,7 @@ var FolderListView = Backbone.View.extend({
|
||||
"<td></td>",
|
||||
"<td></td>",
|
||||
"<td></td>",
|
||||
"<td></td>",
|
||||
"</tr>",
|
||||
"</tbody>",
|
||||
"</table>",
|
||||
|
||||
@@ -13,10 +13,10 @@ var FolderRowView = Backbone.View.extend({
|
||||
defaults: {
|
||||
type: null,
|
||||
visibility_config: {
|
||||
edit_folder_btn: true,
|
||||
edit_folder_btn: false,
|
||||
save_folder_btn: false,
|
||||
cancel_folder_btn: false,
|
||||
permission_folder_btn: true
|
||||
permission_folder_btn: false
|
||||
},
|
||||
edit_mode: false
|
||||
},
|
||||
@@ -125,7 +125,10 @@ var FolderRowView = Backbone.View.extend({
|
||||
Galaxy.libraries.folderListView.collection.remove(dataset_id);
|
||||
var updated_dataset = new mod_library_model.Item(response);
|
||||
Galaxy.libraries.folderListView.collection.add(updated_dataset);
|
||||
Galaxy.libraries.folderListView.collection.sortByNameAsc();
|
||||
Galaxy.libraries.folderListView.collection.sortFolder(
|
||||
"name",
|
||||
"asc"
|
||||
);
|
||||
mod_toastr.success(
|
||||
"Dataset undeleted. Click this to see it.",
|
||||
"",
|
||||
@@ -173,7 +176,10 @@ var FolderRowView = Backbone.View.extend({
|
||||
response
|
||||
);
|
||||
Galaxy.libraries.folderListView.collection.add(updated_folder);
|
||||
Galaxy.libraries.folderListView.collection.sortByNameAsc();
|
||||
Galaxy.libraries.folderListView.collection.sortFolder(
|
||||
"name",
|
||||
"asc"
|
||||
);
|
||||
mod_toastr.success("Folder undeleted.");
|
||||
},
|
||||
error: function(model, response) {
|
||||
@@ -296,23 +302,22 @@ var FolderRowView = Backbone.View.extend({
|
||||
"<td>",
|
||||
'<%= _.escape(content_item.get("update_time")) %>',
|
||||
"</td>",
|
||||
"<td></td>",
|
||||
"<td>",
|
||||
"<% if(edit_mode) { %>", // start edit mode
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_folder_btn" type="button" style="<% if(button_config.save_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-floppy-o"/>',
|
||||
" Save",
|
||||
'<span class="fa fa-floppy-o"/> Save',
|
||||
"</button>",
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_folder_btn" type="button" style="<% if(button_config.cancel_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-times"/>',
|
||||
" Cancel",
|
||||
'<span class="fa fa-times"/> Cancel',
|
||||
"</button>",
|
||||
"<% } else if (!edit_mode){%>", // start no edit mode
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Modify \'<%- content_item.get("name") %>\'" class="primary-button btn-xs edit_folder_btn" type="button" style="<% if(button_config.edit_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-pencil"/>',
|
||||
'<span class="fa fa-pencil"/> Edit',
|
||||
"</button>",
|
||||
'<a href="#/folders/<%- content_item.id %>/permissions">',
|
||||
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permission_folder_btn" title="Manage \'<%- content_item.get("name") %>\'" style="<% if(button_config.permission_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-group"/>',
|
||||
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permission_folder_btn" title="Permissions of \'<%- content_item.get("name") %>\'" style="<% if(button_config.permission_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-group"/> Manage',
|
||||
"</button>",
|
||||
"</a>",
|
||||
"<% } %>", //end no edit mode
|
||||
@@ -342,6 +347,11 @@ var FolderRowView = Backbone.View.extend({
|
||||
'<td><%= _.escape(content_item.get("file_size")) %></td>',
|
||||
'<td><%= _.escape(content_item.get("update_time")) %></td>',
|
||||
"<td>",
|
||||
'<% if ( content_item.get("state") !== "ok" ) { %>',
|
||||
'<%= _.escape(content_item.get("state")) %>',
|
||||
"<% } %>",
|
||||
"</td>",
|
||||
"<td>",
|
||||
'<% if (content_item.get("is_unrestricted")) { %>',
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Unrestricted dataset" style="color:grey;" class="fa fa-globe fa-lg"/>',
|
||||
"<% } %>",
|
||||
@@ -353,8 +363,8 @@ var FolderRowView = Backbone.View.extend({
|
||||
"<% } %>",
|
||||
'<% if (content_item.get("can_manage")) { %>',
|
||||
'<a href="#folders/<%- content_item.get("folder_id") %>/datasets/<%- content_item.id %>/permissions">',
|
||||
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permissions-dataset-btn" title="Manage permissions">',
|
||||
'<span class="fa fa-group"/>',
|
||||
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permissions-dataset-btn" title="Permissions of \'<%- content_item.get("name") %>\'">',
|
||||
'<span class="fa fa-group"/> Manage',
|
||||
"</button>",
|
||||
"</a>",
|
||||
"<% } %>",
|
||||
@@ -388,10 +398,14 @@ var FolderRowView = Backbone.View.extend({
|
||||
'<%= _.escape(content_item.get("update_time")) %>',
|
||||
"</td>",
|
||||
"<td>",
|
||||
'<% if ( content_item.get("state") !== "ok" ) { %>',
|
||||
'<%= _.escape(content_item.get("state")) %>',
|
||||
"<% } %>",
|
||||
"</td>",
|
||||
"<td>",
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"/>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_dataset_btn" type="button" style="margin-left:1em;">',
|
||||
'<span class="fa fa-unlock"/>',
|
||||
" Undelete",
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete \'<%- content_item.get("name") %>\'" class="primary-button btn-xs undelete_dataset_btn" type="button" style="margin-left:1em;">',
|
||||
'<span class="fa fa-unlock"/> Undelete',
|
||||
"</button>",
|
||||
"</td>",
|
||||
"</tr>"
|
||||
@@ -420,11 +434,11 @@ var FolderRowView = Backbone.View.extend({
|
||||
"<td>",
|
||||
'<%= _.escape(content_item.get("update_time")) %>',
|
||||
"</td>",
|
||||
"<td></td>",
|
||||
"<td>",
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"/>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_folder_btn" type="button" style="margin-left:1em;">',
|
||||
'<span class="fa fa-unlock"/>',
|
||||
" Undelete",
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete \'<%- content_item.get("name") %>\'" class="primary-button btn-xs undelete_folder_btn" type="button" style="margin-left:1em;">',
|
||||
'<span class="fa fa-unlock"/> Undelete',
|
||||
"</button>",
|
||||
"</td>",
|
||||
"</tr>"
|
||||
|
||||
@@ -3,7 +3,7 @@ import mod_utils from "utils/utils";
|
||||
import mod_toastr from "libs/toastr";
|
||||
import mod_library_model from "mvc/library/library-model";
|
||||
import mod_select from "mvc/ui/ui-select";
|
||||
import jstree from "libs/jquery/jstree";
|
||||
import "libs/jquery/jstree";
|
||||
var FolderToolbarView = Backbone.View.extend({
|
||||
el: "#center",
|
||||
|
||||
@@ -103,7 +103,10 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
show_page: parseInt(this.options.show_page),
|
||||
page_count: parseInt(this.options.page_count),
|
||||
total_items_count: this.options.total_items_count,
|
||||
items_shown: this.options.items_shown
|
||||
items_shown: this.options.items_shown,
|
||||
folder_page_size: Galaxy.libraries.preferences.get(
|
||||
"folder_page_size"
|
||||
)
|
||||
})
|
||||
);
|
||||
},
|
||||
@@ -620,8 +623,6 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
disabled_jstree_element;
|
||||
this.jstree.fetch({
|
||||
success: function(model, response) {
|
||||
// This is to prevent double jquery load. I think. Carl is magician.
|
||||
// Now we need jstree, time to lazy load it.
|
||||
$("#jstree_browser").jstree("destroy");
|
||||
$("#jstree_browser").jstree({
|
||||
core: {
|
||||
@@ -1377,7 +1378,8 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
/**
|
||||
* Show user the prompt to change the number of items shown on page.
|
||||
*/
|
||||
showPageSizePrompt: function() {
|
||||
showPageSizePrompt: function(e) {
|
||||
e.preventDefault();
|
||||
var folder_page_size = prompt(
|
||||
"How many items per page do you want to see?",
|
||||
Galaxy.libraries.preferences.get("folder_page_size")
|
||||
@@ -1831,11 +1833,10 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
"<% } %>",
|
||||
"</ul>",
|
||||
"<span>",
|
||||
" showing ",
|
||||
'<a data-toggle="tooltip" data-placement="top" title="Click to change the number of items on page" class="page_size_prompt">',
|
||||
"<%- items_shown %>",
|
||||
"</a>",
|
||||
" of <%- total_items_count %> items",
|
||||
' <%- items_shown %> items shown <a href="" data-toggle="tooltip" data-placement="top" title="currently <%- folder_page_size %> per page" class="page_size_prompt">(change)</a>',
|
||||
"</span>",
|
||||
"<span>",
|
||||
" <%- total_items_count %> total",
|
||||
"</span>"
|
||||
].join("")
|
||||
);
|
||||
|
||||
@@ -208,11 +208,11 @@ var LibraryListView = Backbone.View.extend({
|
||||
sortLibraries: function() {
|
||||
if (Galaxy.libraries.preferences.get("sort_by") === "name") {
|
||||
if (Galaxy.libraries.preferences.get("sort_order") === "asc") {
|
||||
this.collection.sortByNameAsc();
|
||||
this.collection.sortLibraries("name", "asc");
|
||||
} else if (
|
||||
Galaxy.libraries.preferences.get("sort_order") === "desc"
|
||||
) {
|
||||
this.collection.sortByNameDesc();
|
||||
this.collection.sortLibraries("name", "desc");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -258,7 +258,7 @@ var LibraryRowView = Backbone.View.extend({
|
||||
'<tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">',
|
||||
"<% if(!edit_mode) { %>",
|
||||
'<% if(library.get("deleted")) { %>',
|
||||
'<td style="color:grey;"><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"> </span> <%- library.get("name") %></td>',
|
||||
'<td style="color:grey;"><%- library.get("name") %></td>',
|
||||
"<% } else { %>",
|
||||
'<td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>',
|
||||
"<% } %>",
|
||||
@@ -287,14 +287,16 @@ var LibraryRowView = Backbone.View.extend({
|
||||
"<% } %>",
|
||||
'<td class="right-center">',
|
||||
'<% if( (library.get("public")) && (library.get("deleted") === false) ) { %>',
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Unrestricted library" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"> </span>',
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Unrestricted library" style="color:grey;" class="fa fa-globe fa-lg"> </span>',
|
||||
"<% }%>",
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Modify \'<%- library.get("name") %>\'" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span></button>',
|
||||
'<a href="#library/<%- library.get("id") %>/permissions"><button data-toggle="tooltip" data-placement="top" title="Manage \'<%- library.get("name") %>\'" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span></button></a>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"> Save</span></button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"> Cancel</span></button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Delete <%- library.get("name") %>" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"> Delete</span></button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete <%- library.get("name") %> " class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"> Undelete</span></button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Modify \'<%- library.get("name") %>\'" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span> Edit</button>',
|
||||
'<a href="#library/<%- library.get("id") %>/permissions"><button data-toggle="tooltip" data-placement="top" title="Permissions of \'<%- library.get("name") %>\'" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span> Manage</button></a>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"></span> Save</button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"></span> Cancel</button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Delete \'<%- library.get("name") %>\'" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"></span> Delete</button>',
|
||||
// For deleted libraries
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey; <% if(button_config.undelete_library_btn === false) { print("display:none;") } %>" class="fa fa-ban fa-lg"></span>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete \'<%- library.get("name") %>\' " class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"></span> Undelete</button>',
|
||||
"</td>",
|
||||
"</tr>"
|
||||
].join("")
|
||||
|
||||
@@ -15,7 +15,7 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
"click #create_new_library_btn": "createLibraryFromModal",
|
||||
"click #include_deleted_chk": "includeDeletedChecked",
|
||||
"click #exclude_restricted_chk": "excludeRestrictedChecked",
|
||||
"click #lib_page_size_prompt": "showPageSizePrompt",
|
||||
"click .page_size_prompt": "showPageSizePrompt",
|
||||
"keyup .library-search-input": "searchLibraries"
|
||||
},
|
||||
|
||||
@@ -58,7 +58,10 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
show_page: parseInt(this.options.show_page),
|
||||
page_count: parseInt(this.options.page_count),
|
||||
total_libraries_count: this.options.total_libraries_count,
|
||||
libraries_shown: this.options.libraries_shown
|
||||
libraries_shown: this.options.libraries_shown,
|
||||
library_page_size: Galaxy.libraries.preferences.get(
|
||||
"library_page_size"
|
||||
)
|
||||
})
|
||||
);
|
||||
},
|
||||
@@ -120,7 +123,8 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
/**
|
||||
* Show user the propmpt to change the number of libs shown on page.
|
||||
*/
|
||||
showPageSizePrompt: function() {
|
||||
showPageSizePrompt: function(e) {
|
||||
e.preventDefault();
|
||||
var library_page_size = prompt(
|
||||
"How many libraries per page do you want to see?",
|
||||
Galaxy.libraries.preferences.get("library_page_size")
|
||||
@@ -273,8 +277,11 @@ var LibraryToolbarView = Backbone.View.extend({
|
||||
'<li class="disabled"><a href="#page/<% print( page_count ) %>"><span class="fa fa-angle-double-right"></span></a></li>',
|
||||
"<% } %>",
|
||||
"</ul>",
|
||||
'<span id="lib_page_size_prompt">',
|
||||
' showing <a data-toggle="tooltip" data-placement="top" title="Click to change the number of libraries on page"><%- libraries_shown %></a> of <%- total_libraries_count %> libraries',
|
||||
"<span>",
|
||||
' <%- libraries_shown %> libraries shown <a href="" data-toggle="tooltip" data-placement="top" title="currently <%- library_page_size %> per page" class="page_size_prompt">(change)</a>',
|
||||
"</span>",
|
||||
"<span>",
|
||||
" <%- total_libraries_count %> total",
|
||||
"</span>"
|
||||
].join("")
|
||||
);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import mod_util from "mvc/library/library-util";
|
||||
// ============================================================================
|
||||
// LIBRARY RELATED MODELS
|
||||
|
||||
@@ -21,10 +22,6 @@ var Libraries = Backbone.Collection.extend({
|
||||
|
||||
model: Library,
|
||||
|
||||
sort_key: "name", // default
|
||||
|
||||
sort_order: null, // default
|
||||
|
||||
initialize: function(options) {
|
||||
options = options || {};
|
||||
},
|
||||
@@ -59,50 +56,12 @@ var Libraries = Backbone.Collection.extend({
|
||||
return filteredLibraries;
|
||||
},
|
||||
|
||||
/** Sort collection by library name (ascending) and return the sorted
|
||||
* collection
|
||||
*/
|
||||
sortByNameAsc: function() {
|
||||
this.comparator = function(libraryA, libraryB) {
|
||||
if (
|
||||
libraryA.get("name").toLowerCase() >
|
||||
libraryB.get("name").toLowerCase()
|
||||
) {
|
||||
return 1; // after
|
||||
}
|
||||
if (
|
||||
libraryB.get("name").toLowerCase() >
|
||||
libraryA.get("name").toLowerCase()
|
||||
) {
|
||||
return -1; // before
|
||||
}
|
||||
return 0; // equal
|
||||
};
|
||||
sortLibraries: function(sort_key, sort_order) {
|
||||
this.comparator = mod_util.generateLibraryComparator(
|
||||
sort_key,
|
||||
sort_order
|
||||
);
|
||||
this.sort();
|
||||
return this;
|
||||
},
|
||||
|
||||
/** Sort collection by library name (descending) and return the sorted
|
||||
* collection
|
||||
*/
|
||||
sortByNameDesc: function() {
|
||||
this.comparator = function(libraryA, libraryB) {
|
||||
if (
|
||||
libraryA.get("name").toLowerCase() >
|
||||
libraryB.get("name").toLowerCase()
|
||||
) {
|
||||
return -1; // before
|
||||
}
|
||||
if (
|
||||
libraryB.get("name").toLowerCase() >
|
||||
libraryA.get("name").toLowerCase()
|
||||
) {
|
||||
return 1; // after
|
||||
}
|
||||
return 0; // equal
|
||||
};
|
||||
this.sort();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -122,66 +81,12 @@ var FolderAsModel = LibraryItem.extend({
|
||||
var Folder = Backbone.Collection.extend({
|
||||
model: LibraryItem,
|
||||
|
||||
/** Sort collection by item name (ascending) and return the sorted
|
||||
* collection. Folders go before datasets.
|
||||
*/
|
||||
sortByNameAsc: function() {
|
||||
this.comparator = function(itemA, itemB) {
|
||||
if (itemA.get("type") === itemB.get("type")) {
|
||||
if (
|
||||
itemA.get("name").toLowerCase() >
|
||||
itemB.get("name").toLowerCase()
|
||||
) {
|
||||
return 1; // after
|
||||
}
|
||||
if (
|
||||
itemB.get("name").toLowerCase() >
|
||||
itemA.get("name").toLowerCase()
|
||||
) {
|
||||
return -1; // before
|
||||
}
|
||||
return 0; // equal
|
||||
} else {
|
||||
if (itemA.get("type") === "folder") {
|
||||
return -1; // folder is always before dataset
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
sortFolder: function(sort_key, sort_order) {
|
||||
this.comparator = mod_util.generateFolderComparator(
|
||||
sort_key,
|
||||
sort_order
|
||||
);
|
||||
this.sort();
|
||||
return this;
|
||||
},
|
||||
|
||||
/** Sort collection by item name (descending) and return the sorted
|
||||
* collection. Folders go before datasets.
|
||||
*/
|
||||
sortByNameDesc: function() {
|
||||
this.comparator = function(itemA, itemB) {
|
||||
if (itemA.get("type") === itemB.get("type")) {
|
||||
if (
|
||||
itemA.get("name").toLowerCase() >
|
||||
itemB.get("name").toLowerCase()
|
||||
) {
|
||||
return -1; // after
|
||||
}
|
||||
if (
|
||||
itemB.get("name").toLowerCase() >
|
||||
itemA.get("name").toLowerCase()
|
||||
) {
|
||||
return 1; // before
|
||||
}
|
||||
return 0; // equal
|
||||
} else {
|
||||
if (itemA.get("type") === "folder") {
|
||||
return -1; // folder is always before dataset
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
this.sort();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Create alphabetical based two-argument comparator
|
||||
* that takes into account that Folder comes before Dataset.
|
||||
* If sort_key is not present it is set to ''.
|
||||
* @param {str} sort_key key to sort by
|
||||
* @param {str} sort_order order to sort by (asc, desc)
|
||||
* @return {function} two-argument comparator function
|
||||
*/
|
||||
var generateFolderComparator = function(sort_key, sort_order) {
|
||||
return function(itemA, itemB) {
|
||||
if (itemA.get("type") === itemB.get("type")) {
|
||||
if (!itemA.has(sort_key) && !itemB.has(sort_key)) {
|
||||
return 0;
|
||||
} else if (!itemA.has(sort_key)) {
|
||||
return 1;
|
||||
} else if (!itemB.has(sort_key)) {
|
||||
return -1;
|
||||
}
|
||||
if (
|
||||
itemA.get(sort_key).toLowerCase() >
|
||||
itemB.get(sort_key).toLowerCase()
|
||||
) {
|
||||
return sort_order === "asc" ? 1 : -1;
|
||||
}
|
||||
if (
|
||||
itemB.get(sort_key).toLowerCase() >
|
||||
itemA.get(sort_key).toLowerCase()
|
||||
) {
|
||||
return sort_order === "asc" ? -1 : 1;
|
||||
}
|
||||
return 0; // equal
|
||||
} else {
|
||||
if (itemA.get("type") === "folder") {
|
||||
return -1; // folder is always before dataset
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Create alphabetical based two-argument comparator
|
||||
* @param {str} sort_key key to sort by
|
||||
* @param {str} sort_order order to sort by (asc, desc)
|
||||
* @return {function} two-argument comparator function
|
||||
*/
|
||||
var generateLibraryComparator = function(sort_key, sort_order) {
|
||||
return function(libraryA, libraryB) {
|
||||
if (
|
||||
libraryA.get(sort_key).toLowerCase() >
|
||||
libraryB.get(sort_key).toLowerCase()
|
||||
) {
|
||||
return sort_order === "asc" ? 1 : -1;
|
||||
}
|
||||
if (
|
||||
libraryB.get(sort_key).toLowerCase() >
|
||||
libraryA.get(sort_key).toLowerCase()
|
||||
) {
|
||||
return sort_order === "asc" ? -1 : 1;
|
||||
}
|
||||
return 0; // equal
|
||||
};
|
||||
};
|
||||
export default {
|
||||
generateFolderComparator: generateFolderComparator,
|
||||
generateLibraryComparator: generateLibraryComparator
|
||||
};
|
||||
@@ -100,7 +100,7 @@ var View = Backbone.View.extend({
|
||||
var repositories = iri_params.repositories;
|
||||
var new_route = "status/r/" + repositories.join("|");
|
||||
$.post(
|
||||
Galaxy.root + "admin_toolshed/manage_repositories",
|
||||
Galaxy.root + "admin_toolshed/install_repositories",
|
||||
iri_params,
|
||||
function(data) {
|
||||
console.log(
|
||||
|
||||
@@ -351,7 +351,8 @@ var ToolShedRepositoryView = Backbone.View.extend({
|
||||
},
|
||||
|
||||
doInstall: function(params) {
|
||||
var controller_url = Galaxy.root + "admin_toolshed/manage_repositories";
|
||||
var controller_url =
|
||||
Galaxy.root + "admin_toolshed/install_repositories";
|
||||
var repositories = params.repositories;
|
||||
var new_route = "status/r/" + repositories.join("|");
|
||||
$.post(controller_url, params, function(data) {
|
||||
|
||||
@@ -9,16 +9,38 @@ var gxy_root = typeof Galaxy === "undefined" ? "/" : Galaxy.root;
|
||||
var tourpage_template = `<h2>Galaxy Tours</h2>
|
||||
<p>This page presents a list of interactive tours available on this Galaxy server.
|
||||
Select any tour to get started (and remember, you can click 'End Tour' at any time).</p>
|
||||
<ul>
|
||||
<% _.each(tours, function(tour) { %>
|
||||
<li>
|
||||
<a href="/tours/<%- tour.id %>" class="tourItem" data-tour.id=<%- tour.id %>>
|
||||
<%- tour.attributes.name || tour.id %>
|
||||
</a>
|
||||
- <%- tour.attributes.description || "No description given." %>
|
||||
</li>
|
||||
<% }); %>
|
||||
</ul>`;
|
||||
|
||||
<div class="col-12 btn-group" role="group" aria-label="Tag selector">
|
||||
<% _.each(tourtagorder, function(tag) { %>
|
||||
<button class="btn btn-primary tag-selector-button" tag-selector-button="<%- tag %>">
|
||||
<%- tag %>
|
||||
</button>
|
||||
<% }); %>
|
||||
</div>
|
||||
|
||||
<% _.each(tourtagorder, function(tourtagkey) { %>
|
||||
<div tag="<%- tourtagkey %>" style="display: block;">
|
||||
<% var tourtag = tourtags[tourtagkey]; %>
|
||||
<h4>
|
||||
<%- tourtag.name %>
|
||||
</h4>
|
||||
<ul class="list-group">
|
||||
<% _.each(tourtag.tours, function(tour) { %>
|
||||
<li class="list-group-item">
|
||||
<a href="/tours/<%- tour.id %>" class="tourItem" data-tour.id=<%- tour.id %>>
|
||||
<%- tour.name || tour.id %>
|
||||
</a>
|
||||
- <%- tour.attributes.description || \"No description given.\" %>
|
||||
<% _.each(tour.attributes.tags, function(tag) { %>
|
||||
<span class="label label-primary sm-label-pad">
|
||||
<%- tag.charAt(0).toUpperCase() + tag.slice(1) %>
|
||||
</span>
|
||||
<% }); %>
|
||||
</li>
|
||||
<% }); %>
|
||||
</ul>
|
||||
</div>
|
||||
<% }); %>`;
|
||||
|
||||
var tour_opts = {
|
||||
storage: window.sessionStorage,
|
||||
@@ -91,6 +113,7 @@ var giveTour = function(tour_id) {
|
||||
tour.restart();
|
||||
});
|
||||
};
|
||||
|
||||
var ToursView = Backbone.View.extend({
|
||||
title: "Tours",
|
||||
// initialize
|
||||
@@ -111,11 +134,50 @@ var ToursView = Backbone.View.extend({
|
||||
|
||||
render: function() {
|
||||
var tpl = _.template(tourpage_template);
|
||||
|
||||
var tourtags = {};
|
||||
_.each(this.model.models, function(tour) {
|
||||
if (tour.attributes.tags === null) {
|
||||
if (tourtags.Untagged === undefined) {
|
||||
tourtags.Untagged = { name: "Untagged", tours: [] };
|
||||
}
|
||||
tourtags.Untagged.tours.push(tour);
|
||||
} else {
|
||||
_.each(tour.attributes.tags, function(tag) {
|
||||
tag = tag.charAt(0).toUpperCase() + tag.slice(1);
|
||||
if (tourtags[tag] === undefined) {
|
||||
tourtags[tag] = { name: tag, tours: [] };
|
||||
}
|
||||
tourtags[tag].tours.push(tour);
|
||||
});
|
||||
}
|
||||
});
|
||||
var tourtagorder = Object.keys(tourtags).sort();
|
||||
|
||||
this.$el
|
||||
.html(tpl({ tours: this.model.models }))
|
||||
.html(
|
||||
tpl({
|
||||
tours: this.model.models,
|
||||
tourtags: tourtags,
|
||||
tourtagorder: tourtagorder
|
||||
})
|
||||
)
|
||||
.on("click", ".tourItem", function(e) {
|
||||
e.preventDefault();
|
||||
giveTour($(this).data("tour.id"));
|
||||
})
|
||||
.on("click", ".tag-selector-button", function(e) {
|
||||
var elem = $(e.target);
|
||||
var display = "block";
|
||||
var tag = elem.attr("tag-selector-button");
|
||||
|
||||
elem.toggleClass("btn-primary");
|
||||
elem.toggleClass("btn-secondary");
|
||||
|
||||
if (elem.hasClass("btn-secondary")) {
|
||||
display = "none";
|
||||
}
|
||||
$("div[tag='" + tag + "']").css({ display: display });
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -310,7 +310,7 @@ function time() {
|
||||
var d = new Date();
|
||||
var hours = (d.getHours() < 10 ? "0" : "") + d.getHours();
|
||||
var minutes = (d.getMinutes() < 10 ? "0" : "") + d.getMinutes();
|
||||
return (datetime =
|
||||
return (
|
||||
d.getDate() +
|
||||
"/" +
|
||||
(d.getMonth() + 1) +
|
||||
@@ -319,7 +319,8 @@ function time() {
|
||||
", " +
|
||||
hours +
|
||||
":" +
|
||||
minutes);
|
||||
minutes
|
||||
);
|
||||
}
|
||||
|
||||
/** Append script and style tags to Galaxy main application */
|
||||
|
||||
@@ -1086,6 +1086,10 @@ div.odd_row {
|
||||
.label-info();
|
||||
}
|
||||
|
||||
.sm-label-pad {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
span.toolParameterExpandableCollapsable {
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -11,7 +11,7 @@ overflow: auto !important;
|
||||
.fa{
|
||||
font-size: 12px;
|
||||
}
|
||||
.fa-globe{
|
||||
.fa-globe, .fa-shield, .fa-key, .fa-ban{
|
||||
font-size: initial;
|
||||
margin-left: 0.6em;
|
||||
}
|
||||
|
||||
@@ -212,6 +212,7 @@
|
||||
color: @base-text-color;
|
||||
background: @side-panel-bg;
|
||||
padding: 10px;
|
||||
min-height:100%;
|
||||
.ui-side-section-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
resize: none;
|
||||
background: inherit;
|
||||
color: @black;
|
||||
white-space: nowrap;
|
||||
white-space: pre;
|
||||
overflow: scroll;
|
||||
}
|
||||
.upload-text-info {
|
||||
|
||||
@@ -8,6 +8,7 @@ var babel = require('gulp-babel');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
var uglify = require('gulp-uglify');
|
||||
var cached = require('gulp-cached');
|
||||
var plumber = require('gulp-plumber');
|
||||
|
||||
var paths = {
|
||||
node_modules: './node_modules',
|
||||
@@ -37,6 +38,7 @@ var paths = {
|
||||
|
||||
gulp.task('scripts', function() {
|
||||
return gulp.src(paths.scripts)
|
||||
.pipe(plumber())
|
||||
.pipe(cached('scripts'))
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(babel({
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-babel": "^7.0.0",
|
||||
"gulp-cached": "^1.1.1",
|
||||
"gulp-plumber": "^1.1.0",
|
||||
"gulp-sourcemaps": "^2.5.1",
|
||||
"gulp-uglify": "^3.0.0",
|
||||
"gulp-watch": "^4.3.11",
|
||||
|
||||
+9
-2
@@ -2218,6 +2218,13 @@ gulp-cached@^1.1.1:
|
||||
lodash.defaults "^4.2.0"
|
||||
through2 "^2.0.1"
|
||||
|
||||
gulp-plumber@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/gulp-plumber/-/gulp-plumber-1.1.0.tgz#f12176c2d0422f60306c242fff6a01a394faba09"
|
||||
dependencies:
|
||||
gulp-util "^3"
|
||||
through2 "^2"
|
||||
|
||||
gulp-sourcemaps@^2.5.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-2.6.1.tgz#833a4e28f0b8f4661075032cd782417f7cd8fb0b"
|
||||
@@ -2247,7 +2254,7 @@ gulp-uglify@^3.0.0:
|
||||
uglify-js "^3.0.5"
|
||||
vinyl-sourcemaps-apply "^0.2.0"
|
||||
|
||||
gulp-util@^3.0.0, gulp-util@^3.0.7:
|
||||
gulp-util@^3, gulp-util@^3.0.0, gulp-util@^3.0.7:
|
||||
version "3.0.8"
|
||||
resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f"
|
||||
dependencies:
|
||||
@@ -4630,7 +4637,7 @@ tar@^2.2.1:
|
||||
fstream "^1.0.2"
|
||||
inherits "2"
|
||||
|
||||
through2@2.X, through2@^2.0.0, through2@^2.0.1, through2@^2.0.3:
|
||||
through2@2.X, through2@^2, through2@^2.0.0, through2@^2.0.1, through2@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
|
||||
dependencies:
|
||||
|
||||
@@ -245,6 +245,7 @@
|
||||
<datatype extension="hardklor" type="galaxy.datatypes.tabular:Tabular" subclass="true" />
|
||||
<datatype extension="kronik" type="galaxy.datatypes.tabular:Tabular" subclass="true" />
|
||||
<datatype extension="imzml" type="galaxy.datatypes.proteomics:ImzML" mimetype="application/xml" display_in_upload="true"/>
|
||||
<datatype extension="analyze75" type="galaxy.datatypes.proteomics:Analyze75" mimetype="application/xml" display_in_upload="true"/>
|
||||
<!-- End Proteomics Datatypes -->
|
||||
<datatype extension="deeptools_compute_matrix_archive" type="galaxy.datatypes.binary:CompressedArchive" subclass="true" display_in_upload="true"/>
|
||||
<datatype extension="deeptools_coverage_matrix" type="galaxy.datatypes.binary:CompressedArchive" subclass="true" display_in_upload="true"/>
|
||||
|
||||
+22
-12
@@ -447,10 +447,9 @@ paste.app_factory = galaxy.web.buildapp:app_factory
|
||||
# -- Mail and notification
|
||||
|
||||
# Galaxy sends mail for various things: subscribing users to the mailing list
|
||||
# if they request it, password resets, notifications from the Galaxy Sample
|
||||
# Tracking system, reporting dataset errors, and sending activation emails.
|
||||
# To do this, it needs to send mail through an SMTP server, which you may
|
||||
# define here (host:port).
|
||||
# if they request it, password resets, reporting dataset errors, and sending
|
||||
# activation emails. To do this, it needs to send mail through an SMTP server,
|
||||
# which you may define here (host:port).
|
||||
# Galaxy will automatically try STARTTLS but will continue upon failure.
|
||||
#smtp_server = None
|
||||
|
||||
@@ -912,6 +911,14 @@ use_interactive = True
|
||||
# sub-directories of files contained in their directory.
|
||||
#user_library_import_dir = None
|
||||
|
||||
# For security reasons, users may not import any files that actually lie
|
||||
# outside of their `user_library_import_dir` (e.g. using symbolic links). A
|
||||
# list of directories can be allowed by setting the following option (the list
|
||||
# is comma-separated). Be aware that *any* user with library import permissions
|
||||
# can import from anywhere in these directories (assuming they are able to
|
||||
# create symlinks to them).
|
||||
#user_library_import_symlink_whitelist = None
|
||||
|
||||
# Allow admins to paste filesystem paths during upload. For libraries this
|
||||
# adds an option to the admin library upload tool allowing admins to paste
|
||||
# filesystem paths to files and directories in a box, and these paths will be
|
||||
@@ -1224,6 +1231,9 @@ use_interactive = True
|
||||
# Directory to store Data Manager based tool-data; defaults to tool_data_path.
|
||||
#galaxy_data_manager_data_path = tool-data
|
||||
|
||||
# Enable the API for sample tracking
|
||||
#enable_legacy_sample_tracking_api = False
|
||||
|
||||
# -- Job Execution
|
||||
|
||||
# To increase performance of job execution and the web interface, you can
|
||||
@@ -1325,16 +1335,16 @@ use_interactive = True
|
||||
#drmaa_external_killjob_script = sudo -E scripts/drmaa_external_killer.py
|
||||
#external_chown_script = sudo -E scripts/external_chown_script.py
|
||||
|
||||
# For the job submission as the actual system user, Galaxy can extract
|
||||
# the user name from the email address (actually the local-part before the @)
|
||||
# or the username which are both stored in the Galaxy data base.
|
||||
# The latter option is particularly useful for installations that get the
|
||||
# For the job submission as the actual system user, Galaxy can extract
|
||||
# the user name from the email address (actually the local-part before the @)
|
||||
# or the username which are both stored in the Galaxy data base.
|
||||
# The latter option is particularly useful for installations that get the
|
||||
# authentication from LDAP.
|
||||
# Also, Galaxy can accept the name of a common system user (eg. galaxy_worker)
|
||||
# who can run every job being submitted. This user should not be the same user
|
||||
# running the galaxy system.
|
||||
# Also, Galaxy can accept the name of a common system user (eg. galaxy_worker)
|
||||
# who can run every job being submitted. This user should not be the same user
|
||||
# running the galaxy system.
|
||||
# Possible values are user_email (default), username or <common_system_user>
|
||||
#real_system_username = user_email
|
||||
#real_system_username = user_email
|
||||
|
||||
# File to source to set up the environment when running jobs. By default, the
|
||||
# environment in which the Galaxy server starts is used when running jobs
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# See $GALAXY_ROOT/lib/galaxy/tools/deps/default_conda_mapping.yml for example mapping -
|
||||
# See $GALAXY_ROOT/lib/galaxy/tools/deps/resolvers/default_conda_mapping.yml for example mapping -
|
||||
# additional site-specific mappings can be added to config/conda_mapping.yml.
|
||||
|
||||
@@ -53,7 +53,7 @@ function keep_alive(){
|
||||
var count_max = 60;
|
||||
// we sleep 15 seconds between requests and the default timeout for the Jupyter container is 120 seconds, so start
|
||||
// with a pretty high ajax timeout. sleep starts low because we want to get the warning up pretty quickly
|
||||
var spin_state = make_spin_state("IE keep alive", 8000, 16000, 2000, 5000, 15000, 5000, false);
|
||||
var spin_state = make_spin_state("IE keepalive", 8000, 16000, 2000, 5000, 15000, 5000, false);
|
||||
var success = function(){
|
||||
console.log("IE keepalive request succeeded");
|
||||
toastr.clear()
|
||||
@@ -85,7 +85,7 @@ function keep_alive(){
|
||||
return true; // stop spinning
|
||||
}
|
||||
}
|
||||
console.log("IE keep alive worker starting");
|
||||
console.log("IE keepalive worker starting");
|
||||
spin(notebook_access_url, false, success, timeout_error, timeout_error, spin_state);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@ id: galaxy_ui
|
||||
name: Galaxy UI
|
||||
description: A gentle introduction to the Galaxy User Interface
|
||||
title_default: "Welcome to Galaxy"
|
||||
tags:
|
||||
- "core"
|
||||
- "UI"
|
||||
|
||||
# A tour is made of several steps, each of them beginning with a dash '-'
|
||||
steps:
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
name: History Introduction
|
||||
description: A detailed introduction to the Galaxy History
|
||||
title_default: "Galaxy History Introduction"
|
||||
tags:
|
||||
- "core"
|
||||
- "history"
|
||||
|
||||
steps:
|
||||
- content: "This short tour will guide you through <b>Galaxy's History</b> and datasets."
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
name: Scratchbook - Introduction
|
||||
title_default: "Scratchbook Introduction"
|
||||
description: "An introduction on how to display multiple datasets and visualizations next to each other."
|
||||
tags:
|
||||
- "core"
|
||||
- "UI"
|
||||
- "visualization"
|
||||
|
||||
steps:
|
||||
- content: "This short tour will walk you through <b>Galaxy's Scratchbook</b> feature"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
import logging
|
||||
import os
|
||||
from cgi import FieldStorage
|
||||
|
||||
from galaxy.util import Params
|
||||
|
||||
@@ -19,7 +19,7 @@ def add_manual_builds(input_file, build_file, chr_dir):
|
||||
if line.startswith("#"):
|
||||
continue
|
||||
existing_builds.append(line.replace("\n", "").replace("\r", "").split("\t")[0])
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
build_file_out = open(build_file, 'a')
|
||||
for line in open(input_file):
|
||||
@@ -31,7 +31,7 @@ def add_manual_builds(input_file, build_file, chr_dir):
|
||||
name = fields.pop(0)
|
||||
try: # get chrom lens if included in file, otherwise still add build
|
||||
chrs = fields.pop(0).split(",")
|
||||
except:
|
||||
except Exception:
|
||||
chrs = []
|
||||
print>>build_file_out, build + "\t" + name + " (" + build + ")"
|
||||
if chrs: # create len file if provided chrom lens
|
||||
@@ -39,7 +39,7 @@ def add_manual_builds(input_file, build_file, chr_dir):
|
||||
for chr in chrs:
|
||||
print>>chr_len_out, chr.replace("=", "\t")
|
||||
chr_len_out.close()
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
build_file_out.close()
|
||||
|
||||
|
||||
@@ -60,13 +60,13 @@ if __name__ == "__main__":
|
||||
if line.startswith("#"):
|
||||
continue
|
||||
builds.append(line.split("\t")[0])
|
||||
except:
|
||||
except Exception:
|
||||
sys.exit("Bad input file.")
|
||||
else:
|
||||
try:
|
||||
for build in parse_builds.getbuilds("http://genome.cse.ucsc.edu/cgi-bin/das/dsn"):
|
||||
builds.append(build[0])
|
||||
except:
|
||||
except Exception:
|
||||
sys.exit("Unable to retrieve builds.")
|
||||
for build in builds:
|
||||
if build == "?":
|
||||
|
||||
@@ -15,14 +15,14 @@ import requests
|
||||
def getbuilds(url):
|
||||
try:
|
||||
text = requests.get(url).text
|
||||
except:
|
||||
except Exception:
|
||||
print("#Unable to open " + url)
|
||||
print("?\tunspecified (?)")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
tree = ElementTree.fromstring(text)
|
||||
except:
|
||||
except Exception:
|
||||
print("#Invalid xml passed back from " + url)
|
||||
print("?\tunspecified (?)")
|
||||
sys.exit(1)
|
||||
|
||||
@@ -21,13 +21,13 @@ def main():
|
||||
builds = []
|
||||
try:
|
||||
text = requests.get(site).text
|
||||
except:
|
||||
except Exception:
|
||||
print("#Unable to connect to " + site)
|
||||
continue
|
||||
|
||||
try:
|
||||
tree = ElementTree.fromstring(text)
|
||||
except:
|
||||
except Exception:
|
||||
print("#Invalid xml passed back from " + site)
|
||||
continue
|
||||
print("#Harvested from", site)
|
||||
|
||||
+21
-12
@@ -15,8 +15,23 @@ number of tutorials on building Galaxy tools that would better serve that purpos
|
||||
|
||||
$tag:tool://element[@name='tool']
|
||||
$tag:tool|description://element[@name='tool']//element[@name='description']
|
||||
$tag:tool|macros://complexType[@name='Macros']
|
||||
$tag:tool|edam_topics://complexType[@name='EdamTopics']
|
||||
$tag:tool|edam_operations://complexType[@name='EdamOperations']
|
||||
$tag:tool|requirements://complexType[@name='Requirements']
|
||||
$tag:tool|requirements|requirement://complexType[@name='Requirement']
|
||||
$tag:tool|requirements|container://complexType[@name='Container']
|
||||
$tag:tool|code://complexType[@name='Code']
|
||||
$tag:tool|stdio://complexType[@name='Stdio']
|
||||
$tag:tool|stdio|exit_code://complexType[@name='ExitCode'] hide_attributes
|
||||
$tag:tool|stdio|regex://complexType[@name='Regex'] hide_attributes
|
||||
$tag:tool|version_command://complexType[@name='VersionCommand']
|
||||
$tag:tool|command://element[@name='tool']//element[@name='command'] hide_attributes
|
||||
$tag:tool|environment_variables://complexType[@name='EnvironmentVariables']
|
||||
$tag:tool|environment_variables|environment_variable://complexType[@name='EnvironmentVariable']
|
||||
$tag:tool|configfiles://complexType[@name='ConfigFiles']
|
||||
$tag:tool|configfiles|configfile://complexType[@name='ConfigFile']
|
||||
$tag:tool|configfiles|inputs://complexType[@name='ConfigInputs']
|
||||
$tag:tool|inputs://complexType[@name='Inputs']
|
||||
$tag:tool|inputs|section://complexType[@name='Section']
|
||||
$tag:tool|inputs|repeat://complexType[@name='Repeat']
|
||||
@@ -36,11 +51,12 @@ $tag:tool|inputs|param|sanitizer|valid|remove://complexType[@name='SanitizerVali
|
||||
$tag:tool|inputs|param|sanitizer|mapping://complexType[@name='SanitizerMapping']
|
||||
$tag:tool|inputs|param|sanitizer|mapping|add://complexType[@name='SanitizerMappingAdd']
|
||||
$tag:tool|inputs|param|sanitizer|mapping|remove://complexType[@name='SanitizerMappingRemove']
|
||||
$tag:tool|configfiles://complexType[@name='ConfigFiles']
|
||||
$tag:tool|configfiles|configfile://complexType[@name='ConfigFile']
|
||||
$tag:tool|configfiles|inputs://complexType[@name='ConfigInputs']
|
||||
$tag:tool|environment_variables://complexType[@name='EnvironmentVariables']
|
||||
$tag:tool|environment_variables|environment_variable://complexType[@name='EnvironmentVariable']
|
||||
$tag:tool|request_param_translation://complexType[@name='RequestParameterTranslation']
|
||||
$tag:tool|request_param_translation|request_param://complexType[@name='RequestParameter']
|
||||
$tag:tool|request_param_translation|request_param|append_param://complexType[@name='RequestParameterAppend']
|
||||
$tag:tool|request_param_translation|request_param|append_param|value://complexType[@name='RequestParameterAppendValue']
|
||||
$tag:tool|request_param_translation|request_param|value_translation://complexType[@name='RequestParameterValueTranslation']
|
||||
$tag:tool|request_param_translation|request_param|value_translation|value://complexType[@name='RequestParameterValueTranslationValue']
|
||||
$tag:tool|outputs://complexType[@name='Outputs']
|
||||
$tag:tool|outputs|data://complexType[@name='Data']
|
||||
$tag:tool|outputs|data|filter://complexType[@name='OutputFilter']
|
||||
@@ -68,13 +84,6 @@ $tag:tool|tests|test|output_collection://complexType[@name='TestOutputCollection
|
||||
$tag:tool|tests|test|assert_command://group[@name='TestParamElement']//element[@name='assert_command']
|
||||
$tag:tool|tests|test|assert_stdout://group[@name='TestParamElement']//element[@name='assert_stdout']
|
||||
$tag:tool|tests|test|assert_stderr://group[@name='TestParamElement']//element[@name='assert_stderr']
|
||||
$tag:tool|code://complexType[@name='Code']
|
||||
$tag:tool|requirements://complexType[@name='Requirements']
|
||||
$tag:tool|requirements|requirement://complexType[@name='Requirement']
|
||||
$tag:tool|requirements|container://complexType[@name='Container']
|
||||
$tag:tool|stdio://complexType[@name='Stdio']
|
||||
$tag:tool|stdio|exit_code://complexType[@name='ExitCode'] hide_attributes
|
||||
$tag:tool|stdio|regex://complexType[@name='Regex'] hide_attributes
|
||||
$tag:tool|help://element[@name='tool']//element[@name='help']
|
||||
$tag:tool|citations://complexType[@name='Citations']
|
||||
$tag:tool|citations|citation://complexType[@name='Citation']
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,149 @@
|
||||
September 2017 Galaxy Release (v 17.09)
|
||||
===========================================================
|
||||
|
||||
.. include:: _header.rst
|
||||
|
||||
Schedule
|
||||
Highlights
|
||||
===========================================================
|
||||
* Planned Freeze Date: 2017-09-04
|
||||
* Planned Release Date: 2017-09-25
|
||||
|
||||
**Singularity**
|
||||
Tool execution using the HPC-friendly container technology `Singularity <http://singularity.lbl.gov/>`__
|
||||
is now supported. Custom containers can be specified by the Galaxy admin on a per job destination basis
|
||||
or standardized containers corresponding to Conda requirements can be built or downloaded automatically
|
||||
using the mulled toolkit built into Galaxy (just like is possible for Docker). For more information
|
||||
checkout `this presentation <http://bit.ly/gcc-biocontainers>`__ from the 2017 Galaxy Community Conference.
|
||||
`Pull Request 4175`_
|
||||
|
||||
**Download entire collection**
|
||||
Downloading whole colections is now possible from the history interface. `Pull Request 4098`_
|
||||
Thanks to `@mvdbeek <https://github.com/mvdbeek>`__.
|
||||
|
||||
**Switch tool versions in workflows**
|
||||
You can now select exactly what version of tool you want to use when building workflows. `Pull Request 4373`_
|
||||
Thanks to `@mvdbeek <https://github.com/mvdbeek>`__.
|
||||
|
||||
Get Galaxy
|
||||
==========
|
||||
|
||||
The code lives at `Github <https://github.com/galaxyproject/galaxy>`__ and you should have `Git <https://git-scm.com/>`__ to obtain it.
|
||||
|
||||
To get a new Galaxy repository run:
|
||||
.. code-block:: shell
|
||||
|
||||
$ git clone -b release_17.09 https://github.com/galaxyproject/galaxy.git
|
||||
|
||||
To update an existing Galaxy repository run:
|
||||
.. code-block:: shell
|
||||
|
||||
$ git checkout release_17.09 && git pull --ff-only origin release_17.09
|
||||
|
||||
See `the community hub <https://galaxyproject.org/develop/source-code/>`__ for additional details regarding the source code locations.
|
||||
|
||||
|
||||
Security
|
||||
========
|
||||
|
||||
The 17.09 Galaxy version includes many security patches. Per our new `Security Policy
|
||||
<https://github.com/galaxyproject/galaxy/blob/dev/SECURITY_POLICY.md>`__ some of these have been
|
||||
applied to Galaxy releases going back 12 months.
|
||||
|
||||
Details of the vulnerabilities that have been backported can be found in the `Security patch details`_
|
||||
section of these release notes. Some issues have only been addressed in 17.09, for this reason
|
||||
if security is important to your Galaxy instance we strongly recommend upgrading to this latest release
|
||||
as soon as possible.
|
||||
|
||||
If you maintain a publicly accessible Galaxy please consider signing up for this `mailing list <https://lists.galaxyproject.org/listinfo/galaxy-public-servers>`__ to receive the future security patches in advance of the public disclosure.
|
||||
|
||||
Deprecation Notices
|
||||
===================
|
||||
|
||||
* The Galaxy Sample Tracking and External Services functionality is now considered deprecated. In future releases we will strip down the related
|
||||
user interface and introduce configuration option to keep relevant API controllers active if desired. `Related PR <https://github.com/galaxyproject/galaxy/pull/4526>`__.
|
||||
* The deprecated admin-only interface for Galaxy Data Libraries is staged to be removed in the next release.
|
||||
* Workflows API: When exposing WorkflowInvocationSteps ``state`` will no longer be available.
|
||||
* The ``refresh_on_change`` attribute of a ``<param>`` tag in the tool syntax can no longer be set to a value of another parameter. Use boolean instead (e.g.``refresh_on_change="True"``). `Details <https://github.com/galaxyproject/galaxy/issues/4810>`__
|
||||
|
||||
|
||||
Release Notes
|
||||
===========================================================
|
||||
|
||||
.. include:: 17.09.rst
|
||||
:start-after: announce_start
|
||||
|
||||
Security patch details
|
||||
======================
|
||||
|
||||
Limited Galaxy Data Library unauthorized filesystem access
|
||||
----------------------------------------------------------
|
||||
|
||||
Tracked as `GX-2017-0001 <https://lists.galaxyproject.org/pipermail/galaxy-dev/2017-October/026058.html>`__
|
||||
|
||||
A medium severity security vulnerability in Galaxy Data Libraries was
|
||||
recently discovered by `Jelle Scholtalbers <https://github.com/scholtalbers>`__.
|
||||
This vulnerability allows the following unauthorized actions:
|
||||
|
||||
1. Any user that has been granted the permission to add datasets to a
|
||||
library, library folder, or to modify an existing library dataset (an
|
||||
"authorized user"), is able to import any file on the system that is
|
||||
readable by the user running the Galaxy server.
|
||||
|
||||
2. Anyone can create libraries and library folders (but not add datasets to them)
|
||||
|
||||
The fix for this issue has been applied to Galaxy releases back to 16.07 and can be found in this `commit <https://github.com/galaxyproject/galaxy/commit/93a8bfc7cb5e9c3395c5057910ec39d68ad787b4>`__
|
||||
|
||||
Arbitrary code execution for Galaxy servers with Galaxy Interactive Environments enabled
|
||||
----------------------------------------------------------------------------------------
|
||||
|
||||
Tracked as `GX-2017-0002 <https://lists.galaxyproject.org/pipermail/galaxy-dev/2017-October/026059.html>`__
|
||||
|
||||
A high severity security vulnerability was recently discovered in Galaxy
|
||||
Interactive Environments (GIEs) by the Galaxy Committers Team. Anyone with
|
||||
a Galaxy account can exploit this vulnerability to execute arbitrary code
|
||||
on the Galaxy server as the user running the Galaxy server process.
|
||||
|
||||
The vulnerability only affects Galaxy servers on which Galaxy Interactive
|
||||
Environments are enabled (by setting the
|
||||
`interactive_environment_plugins_directory`
|
||||
option in `galaxy.ini`). Because the vulnerability can be exploited to
|
||||
execute arbitrary code, the impact for affected servers is severe.
|
||||
|
||||
Administrators of Galaxy servers where GIEs *are* enabled should update
|
||||
immediately.
|
||||
|
||||
The fix for this issue has been applied to Galaxy releases back to 17.05 and can be found in this `commit <https://github.com/galaxyproject/galaxy/commit/9f8d3ee444ad10038add204ed1c1dc11e636dd9d>`__
|
||||
|
||||
Unauthorized filesystem access via data source tools
|
||||
----------------------------------------------------
|
||||
|
||||
Tracked as `GX-2017-0003 <https://lists.galaxyproject.org/pipermail/galaxy-dev/2017-October/026060.html>`__
|
||||
|
||||
A medium severity security vulnerability in tools utilizing the Galaxy data
|
||||
source protocol was recently discovered by the Galaxy Committers Team.
|
||||
Anyone who is able to run an external data source tool can access
|
||||
any file that is readable by the user running Galaxy jobs
|
||||
on the host where the job runs.
|
||||
|
||||
Many such "external data source" tools are provided with the Galaxy
|
||||
distribution and are enabled by default (most tools under the "Get Data"
|
||||
section of the tool panel), meaning that its exploitability is fairly high,
|
||||
as only one such tool needs to be enabled to be vulnerable, including any
|
||||
custom data source tools (any tool that uses
|
||||
`tools/data_source/data_source.py`).
|
||||
What files are readable depends entirely upon what the job's user has
|
||||
access to read on the host(s) where jobs run.
|
||||
|
||||
The fix for this issue has been applied to Galaxy releases back to 16.07 and can be found in this `commit <https://github.com/galaxyproject/galaxy/commit/0e698813a96f1ad61d797255686f69cf5e6b1280>`__
|
||||
|
||||
Cross site scripting and session fixation
|
||||
-----------------------------------------
|
||||
|
||||
Disclosed on the `mailing list <https://lists.galaxyproject.org/pipermail/galaxy-dev/2017-August/025938.html>`__ in August 2017.
|
||||
|
||||
Vulnerabilities were found by Eric Rasche and Manabu Ishii respectively. Detailed descriptions of these categories of vulnerabilities can be found at:
|
||||
|
||||
- https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)
|
||||
- https://www.owasp.org/index.php/Session_fixation
|
||||
|
||||
The fix for these issues has been applied to Galaxy releases back to 16.10 and can be found in this `diff <https://gist.githubusercontent.com/jmchilton/760bf8ba6055b9a47a48529fcc49a493/raw/01bc98e5a8067a435f38d7cf4fda4e304c4425a2/2017augsecurity_1610.patch>`__
|
||||
|
||||
.. include:: _thanks.rst
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
===========================================================
|
||||
January 2018 Galaxy Release (v 18.01)
|
||||
===========================================================
|
||||
|
||||
|
||||
Schedule
|
||||
===========================================================
|
||||
* Planned Freeze Date: 2018-01-08
|
||||
* Planned Release Date: 2018-01-29
|
||||
@@ -4,6 +4,7 @@ Releases
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
17.09_announce
|
||||
17.05_announce
|
||||
17.01_announce
|
||||
16.10_announce
|
||||
|
||||
@@ -95,7 +95,7 @@ class LDAP(AuthProvider):
|
||||
|
||||
try:
|
||||
import ldap
|
||||
except:
|
||||
except ImportError:
|
||||
log.debug('LDAP authenticate: could not load ldap module')
|
||||
return (failure_mode, '', '')
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ class Configuration(object):
|
||||
self.hours_between_check = 12.0
|
||||
else:
|
||||
self.hours_between_check = 12
|
||||
except:
|
||||
except Exception:
|
||||
self.hours_between_check = 12
|
||||
self.update_integrated_tool_panel = kwargs.get("update_integrated_tool_panel", True)
|
||||
self.enable_data_manager_user_view = string_as_bool(kwargs.get("enable_data_manager_user_view", "False"))
|
||||
@@ -338,6 +338,9 @@ class Configuration(object):
|
||||
# Beta containers interface used by GIEs
|
||||
self.enable_beta_containers_interface = string_as_bool(kwargs.get('enable_beta_containers_interface', 'False'))
|
||||
|
||||
# Deprecated API for sample tracking
|
||||
self.enable_legacy_sample_tracking_api = string_as_bool(kwargs.get('enable_legacy_sample_tracking_api', 'False'))
|
||||
|
||||
# Certain modules such as the pause module will automatically cause
|
||||
# workflows to be scheduled in job handlers the way all workflows will
|
||||
# be someday - the following two properties can also be used to force this
|
||||
@@ -395,6 +398,7 @@ class Configuration(object):
|
||||
self.genomespace_ui_url = kwargs.get('genomespace_ui_url', 'https://gsui.genomespace.org/jsui/')
|
||||
self.library_import_dir = kwargs.get('library_import_dir', None)
|
||||
self.user_library_import_dir = kwargs.get('user_library_import_dir', None)
|
||||
self.user_library_import_symlink_whitelist = listify(kwargs.get('user_library_import_symlink_whitelist', []), do_strip=True)
|
||||
# Searching data libraries
|
||||
self.enable_lucene_library_search = string_as_bool(kwargs.get('enable_lucene_library_search', False))
|
||||
self.enable_whoosh_library_search = string_as_bool(kwargs.get('enable_whoosh_library_search', False))
|
||||
@@ -793,7 +797,7 @@ class Configuration(object):
|
||||
|
||||
try:
|
||||
port = config.getint('server:%s' % self.server_name, 'port')
|
||||
except:
|
||||
except Exception:
|
||||
# uWSGI galaxy installations don't use paster and only speak uWSGI not http
|
||||
port = None
|
||||
return port
|
||||
|
||||
@@ -374,7 +374,7 @@ class DockerNode(object):
|
||||
|
||||
@property
|
||||
def labels(self):
|
||||
labels = self.inspect[0]['Spec'].get('Labels', {})
|
||||
labels = self.inspect[0]['Spec'].get('Labels', {}) or {}
|
||||
return DockerNodeLabels.from_label_dictionary(labels)
|
||||
|
||||
def label_add(self, label, value):
|
||||
|
||||
@@ -23,7 +23,7 @@ class SnapHmm(Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "SNAP HMM model (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def sniff(self, filename):
|
||||
@@ -54,7 +54,7 @@ class Augustus(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Augustus model (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def sniff(self, filename):
|
||||
|
||||
@@ -63,7 +63,7 @@ class Amos(data.Text):
|
||||
if re.match(r'{(RED|CTG|TLE)$', line):
|
||||
isAmos = True
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return isAmos
|
||||
|
||||
@@ -102,7 +102,7 @@ class Sequences(sequence.Fasta):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a fasta header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -138,7 +138,7 @@ class Roadmaps(data.Text):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a fasta header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -202,7 +202,7 @@ class Velvet(Html):
|
||||
gen_msg = gen_msg + ' Long Reads'
|
||||
if len(gen_msg) > 0:
|
||||
gen_msg = 'Uses: ' + gen_msg
|
||||
except:
|
||||
except Exception:
|
||||
log.debug("Velveth could not read Log file in %s" % efp)
|
||||
log.debug("Velveth log info %s" % gen_msg)
|
||||
rval = ['<html><head><title>Velvet Galaxy Composite Dataset </title></head><p/>']
|
||||
|
||||
@@ -106,7 +106,7 @@ class Ab1(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary ab1 sequence file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ class Idat(Binary):
|
||||
if header == b'IDAT':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ class Cel(Binary):
|
||||
if header == b';\x01\x00\x00':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ class CompressedArchive(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Compressed binary file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ class CompressedZipArchive(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Compressed zip file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -425,7 +425,7 @@ class Bam(Binary):
|
||||
dataset.metadata.read_groups = [read_group['ID'] for read_group in dataset.metadata.bam_header.get('RG', []) if 'ID' in read_group]
|
||||
dataset.metadata.sort_order = dataset.metadata.bam_header.get('HD', {}).get('SO', None)
|
||||
dataset.metadata.bam_version = dataset.metadata.bam_header.get('HD', {}).get('VN', None)
|
||||
except:
|
||||
except Exception:
|
||||
# Per Dan, don't log here because doing so will cause datasets that
|
||||
# fail metadata to end in the error state
|
||||
pass
|
||||
@@ -438,7 +438,7 @@ class Bam(Binary):
|
||||
if header == b'BAM\1':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -452,7 +452,7 @@ class Bam(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary bam alignments file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def to_archive(self, trans, dataset, name=""):
|
||||
@@ -664,7 +664,7 @@ class CRAM(Binary):
|
||||
if header == b"CRAM":
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -700,7 +700,7 @@ class Bcf(BaseBcf):
|
||||
if header == b'BCF':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_meta(self, dataset, overwrite=True, **kwd):
|
||||
@@ -756,7 +756,7 @@ class BcfUncompressed(Bcf):
|
||||
if header == b'BCF':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -789,7 +789,7 @@ class H5(Binary):
|
||||
if header == self._magic:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -803,7 +803,7 @@ class H5(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary HDF5 file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -886,7 +886,7 @@ class Biom2(H5):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Biom2 (HDF5) file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -911,7 +911,7 @@ class Scf(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary scf sequence file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -932,7 +932,7 @@ class Sff(Binary):
|
||||
if header == b'.sff':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -946,7 +946,7 @@ class Sff(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary sff file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -976,7 +976,7 @@ class BigWig(Binary):
|
||||
try:
|
||||
magic = self._unpack("I", open(filename, 'rb'))
|
||||
return magic[0] == self._magic
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -990,7 +990,7 @@ class BigWig(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary UCSC %s file (%s)" % (self._name, nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1040,7 +1040,7 @@ class TwoBit(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary TwoBit format nucleotide file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1097,7 +1097,7 @@ class SQlite(Binary):
|
||||
if header == b'SQLite format 3\0':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -1108,7 +1108,7 @@ class SQlite(Binary):
|
||||
for table in dataset.metadata.tables:
|
||||
try:
|
||||
lines.append('%s [%s]' % (table, dataset.metadata.table_row_count[table]))
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
dataset.peek = '\n'.join(lines)
|
||||
dataset.blurb = nice_size(dataset.get_size())
|
||||
@@ -1119,7 +1119,7 @@ class SQlite(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "SQLite Database (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('sqlite', dataproviders.dataset.SQliteDataProvider.settings)
|
||||
@@ -1191,7 +1191,7 @@ class GeminiSQLite(SQlite):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Gemini SQLite Database, version %s" % (dataset.metadata.gemini_version or 'unknown')
|
||||
|
||||
|
||||
@@ -1265,7 +1265,7 @@ class IdpDB(SQlite):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "IDPickerDB SQLite file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1289,7 +1289,7 @@ class Xlsx(Binary):
|
||||
if "[Content_Types].xml" in tempzip.namelist() and tempzip.read("[Content_Types].xml").find(b'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml') != -1:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1320,7 +1320,7 @@ class ExcelXls(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Microsoft Excel XLS file (%s)" % (data.nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1341,7 +1341,7 @@ class Sra(Binary):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -1355,7 +1355,7 @@ class Sra(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return 'Binary sra file (%s)' % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1376,7 +1376,7 @@ class RData(Binary):
|
||||
header = gzip.open(filename).read(7)
|
||||
if header == rdata_header:
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1612,7 +1612,7 @@ class PostgresqlArchive(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "PostgreSQL Archive (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1669,7 +1669,7 @@ class Fast5Archive(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "FAST5 Archive (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1771,7 +1771,7 @@ class SearchGuiArchive(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "SearchGUI Archive, version %s" % (dataset.metadata.searchgui_version or 'unknown')
|
||||
|
||||
|
||||
@@ -1795,7 +1795,7 @@ class NetCDF(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary netCDF file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def sniff(self, filename):
|
||||
@@ -1805,7 +1805,7 @@ class NetCDF(Binary):
|
||||
if header == b'CDF':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1838,7 +1838,7 @@ class DMND(Binary):
|
||||
if header == self._magic:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ class Ply(object):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Ply file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ class Vtk(object):
|
||||
dataset.metadata.field_names.append(field_name)
|
||||
try:
|
||||
num_components = int(items[-1])
|
||||
except:
|
||||
except Exception:
|
||||
num_components = 1
|
||||
field_component_indexes = [str(i) for i in range(num_components)]
|
||||
field_components[field_name] = field_component_indexes
|
||||
@@ -319,7 +319,7 @@ class Vtk(object):
|
||||
float(items[0])
|
||||
# Don't process the cell data.
|
||||
# 0.0123457 0.197531
|
||||
except:
|
||||
except Exception:
|
||||
# Line consists of arrayName numComponents numTuples dataType.
|
||||
# Example: surface_field1 1 12 double
|
||||
field_name = items[0]
|
||||
@@ -438,7 +438,7 @@ class Vtk(object):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Vtk file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
|
||||
@@ -30,21 +30,21 @@ def __main__():
|
||||
else:
|
||||
try:
|
||||
feature = elems[3]
|
||||
except:
|
||||
except Exception:
|
||||
feature = 'feature%d' % (i + 1)
|
||||
start = int(elems[1]) + 1
|
||||
end = int(elems[2])
|
||||
try:
|
||||
score = elems[4]
|
||||
except:
|
||||
except Exception:
|
||||
score = '0'
|
||||
try:
|
||||
strand = elems[5]
|
||||
except:
|
||||
except Exception:
|
||||
strand = '+'
|
||||
try:
|
||||
group = elems[3]
|
||||
except:
|
||||
except Exception:
|
||||
group = 'group%d' % (i + 1)
|
||||
if complete_bed:
|
||||
out.write('%s\tbed2gff\t%s\t%d\t%d\t%s\t%s\t.\t%s %s;\n' % (chrom, feature, start, end, score, strand, feature, group))
|
||||
@@ -59,7 +59,7 @@ def __main__():
|
||||
exon_start = int(start) + int(block_starts[j])
|
||||
exon_end = exon_start + int(block_sizes[j]) - 1
|
||||
out.write('%s\tbed2gff\texon\t%d\t%d\t%s\t%s\t.\texon %s;\n' % (chrom, exon_start, exon_end, score, strand, group))
|
||||
except:
|
||||
except Exception:
|
||||
skipped_lines += 1
|
||||
if not first_skipped_line:
|
||||
first_skipped_line = i + 1
|
||||
|
||||
@@ -68,10 +68,10 @@ def __main__():
|
||||
# peek: ascii or digits?
|
||||
val = line.split()[0]
|
||||
|
||||
fastq_integer = True
|
||||
try:
|
||||
int(val)
|
||||
fastq_integer = True
|
||||
except:
|
||||
except ValueError:
|
||||
fastq_integer = False
|
||||
|
||||
if fastq_integer: # digits
|
||||
|
||||
@@ -28,7 +28,7 @@ def __main__():
|
||||
# Replace any spaces in the name with underscores so UCSC will not complain
|
||||
name = elems[2].replace(" ", "_")
|
||||
out.write("%s\t%s\t%s\t%s\t0\t%s\n" % (elems[0], start, elems[4], name, strand))
|
||||
except:
|
||||
except Exception:
|
||||
skipped_lines += 1
|
||||
if not first_skipped_line:
|
||||
first_skipped_line = i + 1
|
||||
|
||||
@@ -19,23 +19,23 @@ def __main__():
|
||||
input_name = sys.argv[2]
|
||||
try:
|
||||
chromCol = int(sys.argv[3]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid chrom column, correct the column settings before attempting to convert the data format." % str(sys.argv[3]))
|
||||
try:
|
||||
startCol = int(sys.argv[4]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid start column, correct the column settings before attempting to convert the data format." % str(sys.argv[4]))
|
||||
try:
|
||||
endCol = int(sys.argv[5]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid end column, correct the column settings before attempting to convert the data format." % str(sys.argv[5]))
|
||||
try:
|
||||
strandCol = int(sys.argv[6]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
strandCol = -1
|
||||
try:
|
||||
nameCol = int(sys.argv[7]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
nameCol = -1
|
||||
skipped_lines = 0
|
||||
first_skipped_line = 0
|
||||
@@ -47,12 +47,12 @@ def __main__():
|
||||
name = region.fields[nameCol]
|
||||
else:
|
||||
raise IndexError
|
||||
except:
|
||||
except Exception:
|
||||
name = "region_%i" % count
|
||||
try:
|
||||
|
||||
out.write("%s\t%i\t%i\t%s\t%i\t%s\n" % (region.chrom, region.start, region.end, name, 0, region.strand))
|
||||
except:
|
||||
except Exception:
|
||||
skipped_lines += 1
|
||||
if not first_skipped_line:
|
||||
first_skipped_line = count + 1
|
||||
|
||||
@@ -41,31 +41,31 @@ def __main__():
|
||||
input_name = sys.argv[2]
|
||||
try:
|
||||
chromCol = int(sys.argv[3]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid chrom column, correct the column settings before attempting to convert the data format." % str(sys.argv[3]))
|
||||
try:
|
||||
startCol = int(sys.argv[4]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid start column, correct the column settings before attempting to convert the data format." % str(sys.argv[4]))
|
||||
try:
|
||||
endCol = int(sys.argv[5]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid end column, correct the column settings before attempting to convert the data format." % str(sys.argv[5]))
|
||||
try:
|
||||
strandCol = int(sys.argv[6]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
strandCol = -1
|
||||
try:
|
||||
nameCol = int(sys.argv[7]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
nameCol = -1
|
||||
try:
|
||||
extension = sys.argv[8]
|
||||
except:
|
||||
except IndexError:
|
||||
extension = 'interval' # default extension
|
||||
try:
|
||||
force_num_columns = int(sys.argv[9])
|
||||
except:
|
||||
except Exception:
|
||||
force_num_columns = None
|
||||
|
||||
skipped_lines = 0
|
||||
@@ -116,7 +116,7 @@ def __main__():
|
||||
fields2 = fields[11].rstrip(",").split(",") # remove trailing comma and split on comma
|
||||
for field in fields2:
|
||||
int(field)
|
||||
except:
|
||||
except Exception:
|
||||
strict_bed = False
|
||||
break
|
||||
if force_num_columns is not None and len(fields) != force_num_columns:
|
||||
@@ -137,14 +137,14 @@ def __main__():
|
||||
name = region.fields[nameCol]
|
||||
else:
|
||||
raise IndexError
|
||||
except:
|
||||
except Exception:
|
||||
name = "region_%i" % count
|
||||
try:
|
||||
fields = [str(item) for item in (region.chrom, region.start, region.end, name, 0, region.strand)]
|
||||
if force_num_columns is not None and len(fields) != force_num_columns:
|
||||
fields = force_bed_field_count(fields, count, force_num_columns)
|
||||
out.write("%s\n" % '\t'.join(fields))
|
||||
except:
|
||||
except Exception:
|
||||
skipped_lines += 1
|
||||
if first_skipped_line is None:
|
||||
first_skipped_line = count + 1
|
||||
|
||||
@@ -127,7 +127,7 @@ if __name__ == "__main__":
|
||||
chr_col_1, start_col_1, end_col_1, strand_col_1 = [int(x) - 1 for x in options.cols1.split(',')]
|
||||
chr_col_2, position_col_2, forward_col_2, reverse_col_2 = [int(x) - 1 for x in options.cols2.split(',')]
|
||||
in_fname, out_fname = args
|
||||
except:
|
||||
except Exception:
|
||||
doc_optparse.exception()
|
||||
|
||||
# Sort through a tempfile first
|
||||
|
||||
@@ -48,7 +48,7 @@ def main():
|
||||
try:
|
||||
float(val)
|
||||
continue
|
||||
except:
|
||||
except ValueError:
|
||||
convert_gff_coords_to_bed(feature)
|
||||
# Value is not a number, so it can be indexed.
|
||||
if val not in name_loc_dict:
|
||||
|
||||
@@ -41,17 +41,17 @@ def rgConv(inpedfilepath, outhtmlname, outfilepath):
|
||||
outfpath = os.path.join(outfilepath, outf) # where to write the fbat format file to
|
||||
try:
|
||||
mf = open(inmap, 'r')
|
||||
except:
|
||||
except Exception:
|
||||
sys.stderr.write('%s cannot open inmap file %s - do you have permission?\n' % (prog, inmap))
|
||||
sys.exit(1)
|
||||
try:
|
||||
rsl = [x.split()[1] for x in mf]
|
||||
except:
|
||||
except Exception:
|
||||
sys.stderr.write('## cannot parse %s' % inmap)
|
||||
sys.exit(1)
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass # already exists
|
||||
head = ' '.join(rsl) # list of rs numbers
|
||||
# TODO add anno to rs but fbat will prolly barf?
|
||||
@@ -64,7 +64,7 @@ def rgConv(inpedfilepath, outhtmlname, outfilepath):
|
||||
lrow = row.split()
|
||||
try:
|
||||
[int(x) for x in lrow[10:50]] # look for non numeric codes
|
||||
except:
|
||||
except Exception:
|
||||
dorecode = 1
|
||||
if dorecode:
|
||||
lrow = row.strip().split()
|
||||
@@ -94,7 +94,7 @@ def main():
|
||||
outfilepath = sys.argv[3]
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
rgConv(inpedfilepath, outhtmlname, outfilepath)
|
||||
flist = os.listdir(outfilepath)
|
||||
|
||||
@@ -42,13 +42,13 @@ def getMissval(inped=''):
|
||||
commonmissvals = {'N': 'N', '0': '0', 'n': 'n', '9': '9', '-': '-', '.': '.'}
|
||||
try:
|
||||
f = open(inped, 'r')
|
||||
except:
|
||||
except Exception:
|
||||
return None # signal no in file
|
||||
missval = None
|
||||
while missval is None: # doggedly continue until we solve the mystery
|
||||
try:
|
||||
l = f.readline()
|
||||
except:
|
||||
except Exception:
|
||||
break
|
||||
ll = l.split()[6:] # ignore pedigree stuff
|
||||
for c in ll:
|
||||
@@ -94,7 +94,7 @@ def main():
|
||||
outfilepath = sys.argv[3]
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
plink = sys.argv[4]
|
||||
rgConv(inpedfilepath, outhtmlname, outfilepath, plink)
|
||||
|
||||
@@ -48,7 +48,7 @@ def pruneLD(plinktasks=[], cd='./', vclbase=[]):
|
||||
alog += lplog
|
||||
alog.append('\n')
|
||||
os.unlink(plog) # no longer needed
|
||||
except:
|
||||
except Exception:
|
||||
alog.append('### %s Strange - no std out from plink when running command line\n%s\n' % (timenow(), ' '.join(vcl)))
|
||||
return alog
|
||||
|
||||
@@ -92,7 +92,7 @@ def main():
|
||||
outfilepath = sys.argv[6]
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
plink = sys.argv[7]
|
||||
makeLDreduced(base_name, infpath=inpedfilepath, outfpath=outfilepath, plinke=plink, forcerebuild=False, returnFname=False,
|
||||
|
||||
@@ -60,7 +60,7 @@ def main():
|
||||
outfilepath = sys.argv[3]
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
plink = sys.argv[4]
|
||||
rgConv(inpedfilepath, outhtmlname, outfilepath, plink)
|
||||
|
||||
@@ -179,7 +179,7 @@ class Data(object):
|
||||
def set_max_optional_metadata_filesize(self, max_value):
|
||||
try:
|
||||
max_value = int(max_value)
|
||||
except:
|
||||
except (TypeError, ValueError):
|
||||
return
|
||||
self.__class__._max_optional_metadata_filesize = max_value
|
||||
|
||||
@@ -394,7 +394,7 @@ class Data(object):
|
||||
if not mime:
|
||||
try:
|
||||
mime = trans.app.datatypes_registry.get_mimetype_by_extension(".".split(file_path)[-1])
|
||||
except:
|
||||
except Exception:
|
||||
mime = "text/plain"
|
||||
self._clean_and_set_mime_type(trans, mime)
|
||||
return self._yield_user_file_content(trans, data, file_path)
|
||||
@@ -490,7 +490,7 @@ class Data(object):
|
||||
info = unicodify(info, 'utf-8')
|
||||
|
||||
return info
|
||||
except:
|
||||
except Exception:
|
||||
return "info unavailable"
|
||||
|
||||
def validate(self, dataset):
|
||||
@@ -521,7 +521,7 @@ class Data(object):
|
||||
self.supported_display_apps = self.supported_display_apps.copy()
|
||||
try:
|
||||
del self.supported_display_apps[app_id]
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Tried to remove display app %s from datatype %s, but this display app is not declared.', type, self.__class__.__name__)
|
||||
|
||||
def clear_display_apps(self):
|
||||
@@ -551,7 +551,7 @@ class Data(object):
|
||||
"""Returns primary label for display app"""
|
||||
try:
|
||||
return self.supported_display_apps[type]['label']
|
||||
except:
|
||||
except Exception:
|
||||
return 'unknown'
|
||||
|
||||
def as_display_type(self, dataset, type, **kwd):
|
||||
@@ -559,7 +559,7 @@ class Data(object):
|
||||
try:
|
||||
if type in self.get_display_types():
|
||||
return getattr(self, self.supported_display_apps[type]['file_function'])(dataset, **kwd)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Function %s is referred to in datatype %s for displaying as type %s, but is not accessible', self.supported_display_apps[type]['file_function'], self.__class__.__name__, type)
|
||||
return "This display type (%s) is not implemented for this datatype (%s)." % (type, dataset.ext)
|
||||
|
||||
@@ -573,7 +573,7 @@ class Data(object):
|
||||
try:
|
||||
if app.config.enable_old_display_applications and type in self.get_display_types():
|
||||
return target_frame, getattr(self, self.supported_display_apps[type]['links_function'])(dataset, type, app, base_url, **kwd)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Function %s is referred to in datatype %s for generating links for type %s, but is not accessible',
|
||||
self.supported_display_apps[type]['links_function'], self.__class__.__name__, type)
|
||||
return target_frame, []
|
||||
|
||||
@@ -7,7 +7,7 @@ import logging
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
from six.moves.urllib.parse import urlencode
|
||||
from six.moves.urllib.parse import urlencode, urlparse
|
||||
from six.moves.urllib.request import urlopen
|
||||
|
||||
from . import (
|
||||
@@ -112,6 +112,9 @@ class URLDataProvider(base.DataProvider):
|
||||
self.data = data or {}
|
||||
encoded_data = urlencode(self.data)
|
||||
|
||||
scheme = urlparse(url).scheme
|
||||
assert scheme in ('http', 'https', 'ftp'), 'Invalid URL scheme: %s' % scheme
|
||||
|
||||
if method == 'GET':
|
||||
self.url += '?%s' % (encoded_data)
|
||||
opened = urlopen(url)
|
||||
|
||||
@@ -122,7 +122,7 @@ class DynamicDisplayApplicationBuilder(object):
|
||||
id_col = elem.get('id', None)
|
||||
try:
|
||||
id_col = int(id_col)
|
||||
except:
|
||||
except (TypeError, ValueError):
|
||||
if data_table:
|
||||
if id_col is None:
|
||||
id_col = data_table.columns.get('id', None)
|
||||
@@ -130,14 +130,14 @@ class DynamicDisplayApplicationBuilder(object):
|
||||
id_col = data_table.columns.get('value', None)
|
||||
try:
|
||||
id_col = int(id_col)
|
||||
except:
|
||||
except (TypeError, ValueError):
|
||||
# id is set to a string or None, use column by that name if available
|
||||
id_col = data_table.columns.get(id_col, None)
|
||||
id_col = int(id_col)
|
||||
name_col = elem.get('name', None)
|
||||
try:
|
||||
name_col = int(name_col)
|
||||
except:
|
||||
except (TypeError, ValueError):
|
||||
if data_table:
|
||||
if name_col is None:
|
||||
name_col = data_table.columns.get('name', None)
|
||||
|
||||
@@ -126,7 +126,7 @@ class GenomeGraphs(Tabular):
|
||||
hasheader = 0
|
||||
try:
|
||||
['%f' % x for x in d[0][1:]] # first is name - see if starts all numerics
|
||||
except:
|
||||
except Exception:
|
||||
hasheader = 1
|
||||
# Generate column header
|
||||
out.append('<tr>')
|
||||
@@ -158,7 +158,7 @@ class GenomeGraphs(Tabular):
|
||||
for j, x in enumerate(ll):
|
||||
try:
|
||||
x = float(x)
|
||||
except:
|
||||
except Exception:
|
||||
badvals.append('col%d:%s' % (j + 1, x))
|
||||
if len(badvals) > 0:
|
||||
errors.append('row %d, %s' % (' '.join(badvals)))
|
||||
@@ -331,13 +331,13 @@ class Rgenetics(Html):
|
||||
return True
|
||||
try:
|
||||
efp = dataset.extra_files_path
|
||||
except:
|
||||
except Exception:
|
||||
if verbose:
|
||||
gal_Log.debug('@@@rgenetics set_meta failed %s - dataset %s has no efp ?' % (sys.exc_info()[0], dataset.name))
|
||||
return False
|
||||
try:
|
||||
flist = os.listdir(efp)
|
||||
except:
|
||||
except Exception:
|
||||
if verbose:
|
||||
gal_Log.debug('@@@rgenetics set_meta failed %s - dataset %s has no efp ?' % (sys.exc_info()[0], dataset.name))
|
||||
return False
|
||||
@@ -655,7 +655,7 @@ class RexpBase(Html):
|
||||
pp = os.path.join(dataset.extra_files_path, '%s.pheno' % dataset.metadata.base_name)
|
||||
try:
|
||||
p = open(pp, 'r').readlines()
|
||||
except:
|
||||
except Exception:
|
||||
p = ['##failed to find %s' % pp, ]
|
||||
dataset.peek = ''.join(p[:5])
|
||||
dataset.blurb = 'Galaxy Rexpression composite file'
|
||||
@@ -670,7 +670,7 @@ class RexpBase(Html):
|
||||
pp = os.path.join(dataset.extra_files_path, '%s.pheno' % dataset.metadata.base_name)
|
||||
try:
|
||||
p = open(pp, 'r').readlines()
|
||||
except:
|
||||
except Exception:
|
||||
p = ['##failed to find %s' % pp]
|
||||
return ''.join(p[:5])
|
||||
|
||||
@@ -681,7 +681,7 @@ class RexpBase(Html):
|
||||
h = '## rexpression get_file_peek: no file found'
|
||||
try:
|
||||
h = open(filename, 'r').readlines()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return ''.join(h[:5])
|
||||
|
||||
@@ -713,7 +713,7 @@ class RexpBase(Html):
|
||||
Html.set_meta(self, dataset, **kwd)
|
||||
try:
|
||||
flist = os.listdir(dataset.extra_files_path)
|
||||
except:
|
||||
except Exception:
|
||||
if verbose:
|
||||
gal_Log.debug('@@@rexpression set_meta failed - no dataset?')
|
||||
return False
|
||||
@@ -731,7 +731,7 @@ class RexpBase(Html):
|
||||
dataset.metadata.pheno_path = pp
|
||||
try:
|
||||
pf = open(pp, 'r').readlines() # read the basename.phenodata in the extra_files_path
|
||||
except:
|
||||
except Exception:
|
||||
pf = None
|
||||
if pf:
|
||||
h = pf[0].strip()
|
||||
|
||||
@@ -225,7 +225,7 @@ class Gmaj(data.Data):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "peek unavailable"
|
||||
|
||||
def get_mime(self):
|
||||
@@ -285,5 +285,5 @@ class Laj(data.Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "peek unavailable"
|
||||
|
||||
@@ -111,20 +111,20 @@ class Interval(Tabular):
|
||||
int(elems[1])
|
||||
if overwrite or not dataset.metadata.element_is_set('startCol'):
|
||||
dataset.metadata.startCol = 2
|
||||
except:
|
||||
except Exception:
|
||||
pass # Metadata default will be used
|
||||
try:
|
||||
int(elems[2])
|
||||
if overwrite or not dataset.metadata.element_is_set('endCol'):
|
||||
dataset.metadata.endCol = 3
|
||||
except:
|
||||
except Exception:
|
||||
pass # Metadata default will be used
|
||||
# we no longer want to guess that this column is the 'name', name must now be set manually for interval files
|
||||
# we will still guess at the strand, as we can make a more educated guess
|
||||
# if len( elems ) > 3:
|
||||
# try:
|
||||
# int( elems[3] )
|
||||
# except:
|
||||
# except Exception:
|
||||
# if overwrite or not dataset.metadata.element_is_set( 'nameCol' ):
|
||||
# dataset.metadata.nameCol = 4
|
||||
if len(elems) < 6 or elems[5] not in data.valid_strand:
|
||||
@@ -149,7 +149,7 @@ class Interval(Tabular):
|
||||
and dataset.metadata.chromCol \
|
||||
and dataset.metadata.startCol \
|
||||
and dataset.metadata.endCol
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_estimated_display_viewport(self, dataset, chrom_col=None, start_col=None, end_col=None):
|
||||
@@ -331,10 +331,10 @@ class Interval(Tabular):
|
||||
# respectively ( for 0 based columns )
|
||||
int(hdr[1])
|
||||
int(hdr[2])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_track_resolution(self, dataset, start, end):
|
||||
@@ -458,14 +458,14 @@ class Bed(Interval):
|
||||
fields2 = fields[11].rstrip(",").split(",") # remove trailing comma and split on comma
|
||||
for field in fields2:
|
||||
int(field)
|
||||
except:
|
||||
except Exception:
|
||||
return Interval.as_ucsc_display_file(self, dataset)
|
||||
# only check first line for proper form
|
||||
break
|
||||
|
||||
try:
|
||||
return open(dataset.file_name)
|
||||
except:
|
||||
except Exception:
|
||||
return "This item contains no content"
|
||||
|
||||
def sniff(self, filename):
|
||||
@@ -510,7 +510,7 @@ class Bed(Interval):
|
||||
try:
|
||||
int(hdr[1])
|
||||
int(hdr[2])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 4:
|
||||
# hdr[3] is a string, 'name', which defines the name of the BED line - difficult to test for this.
|
||||
@@ -518,7 +518,7 @@ class Bed(Interval):
|
||||
try:
|
||||
if int(hdr[4]) < 0 or int(hdr[4]) > 1000:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 5:
|
||||
# hdr[5] is strand
|
||||
@@ -528,48 +528,48 @@ class Bed(Interval):
|
||||
# hdr[6] is thickStart, the starting position at which the feature is drawn thickly.
|
||||
try:
|
||||
int(hdr[6])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 7:
|
||||
# hdr[7] is thickEnd, the ending position at which the feature is drawn thickly
|
||||
try:
|
||||
int(hdr[7])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 8:
|
||||
# hdr[8] is itemRgb, an RGB value of the form R,G,B (e.g. 255,0,0). However, this could also be an int (e.g., 0)
|
||||
try:
|
||||
int(hdr[8])
|
||||
except:
|
||||
except Exception:
|
||||
try:
|
||||
hdr[8].split(',')
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 9:
|
||||
# hdr[9] is blockCount, the number of blocks (exons) in the BED line.
|
||||
try:
|
||||
block_count = int(hdr[9])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 10:
|
||||
# hdr[10] is blockSizes - A comma-separated list of the block sizes.
|
||||
# Sometimes the blosck_sizes and block_starts lists end in extra commas
|
||||
try:
|
||||
block_sizes = hdr[10].rstrip(',').split(',')
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 11:
|
||||
# hdr[11] is blockStarts - A comma-separated list of block starts.
|
||||
try:
|
||||
block_starts = hdr[11].rstrip(',').split(',')
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(block_sizes) != block_count or len(block_starts) != block_count:
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -678,15 +678,15 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
# Try int.
|
||||
int(value)
|
||||
value_type = "int"
|
||||
except:
|
||||
except ValueError:
|
||||
try:
|
||||
# Try float.
|
||||
float(value)
|
||||
value_type = "float"
|
||||
except:
|
||||
except ValueError:
|
||||
pass
|
||||
attribute_types[name] = value_type
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if i + 1 == num_lines:
|
||||
break
|
||||
@@ -708,7 +708,7 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
int(elems[3])
|
||||
int(elems[4])
|
||||
break
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
Tabular.set_meta(self, dataset, overwrite=overwrite, skip=i)
|
||||
|
||||
@@ -771,7 +771,7 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
# Make sure we have not spanned chromosomes
|
||||
start = min(start, int(elems[3]))
|
||||
stop = max(stop, int(elems[4]))
|
||||
except:
|
||||
except Exception:
|
||||
# most likely start/stop is not an int or not enough fields
|
||||
pass
|
||||
# make sure we are at the next new line
|
||||
@@ -848,19 +848,19 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
try:
|
||||
int(hdr[3])
|
||||
int(hdr[4])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[5] != '.':
|
||||
try:
|
||||
float(hdr[5])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[6] not in data.valid_strand:
|
||||
return False
|
||||
if hdr[7] not in self.valid_gff_frame:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
# ------------- Dataproviders
|
||||
@@ -919,13 +919,13 @@ class Gff3(Gff):
|
||||
try:
|
||||
start = int(elems[3])
|
||||
valid_start = True
|
||||
except:
|
||||
except Exception:
|
||||
if elems[3] == '.':
|
||||
valid_start = True
|
||||
try:
|
||||
end = int(elems[4])
|
||||
valid_end = True
|
||||
except:
|
||||
except Exception:
|
||||
if elems[4] == '.':
|
||||
valid_end = True
|
||||
strand = elems[6]
|
||||
@@ -982,18 +982,18 @@ class Gff3(Gff):
|
||||
return False
|
||||
try:
|
||||
int(hdr[3])
|
||||
except:
|
||||
except Exception:
|
||||
if hdr[3] != '.':
|
||||
return False
|
||||
try:
|
||||
int(hdr[4])
|
||||
except:
|
||||
except Exception:
|
||||
if hdr[4] != '.':
|
||||
return False
|
||||
if hdr[5] != '.':
|
||||
try:
|
||||
float(hdr[5])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[6] not in self.valid_gff3_strand:
|
||||
return False
|
||||
@@ -1001,7 +1001,7 @@ class Gff3(Gff):
|
||||
return False
|
||||
parse_gff3_attributes(hdr[8])
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1055,12 +1055,12 @@ class Gtf(Gff):
|
||||
try:
|
||||
int(hdr[3])
|
||||
int(hdr[4])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[5] != '.':
|
||||
try:
|
||||
float(hdr[5])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[6] not in data.valid_strand:
|
||||
return False
|
||||
@@ -1077,7 +1077,7 @@ class Gtf(Gff):
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1140,7 +1140,7 @@ class Wiggle(Tabular, _RemoteCallMixin):
|
||||
start = min(int(fields[0]), start)
|
||||
end = max(end, int(fields[0]) + span)
|
||||
viewport_feature_count -= 1
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
# make sure we are at the next new line
|
||||
readline_count = VIEWPORT_MAX_READS_PER_LINE
|
||||
@@ -1199,7 +1199,7 @@ class Wiggle(Tabular, _RemoteCallMixin):
|
||||
try:
|
||||
float(elems[0]) # "Wiggle track data values can be integer or real, positive or negative values"
|
||||
break
|
||||
except:
|
||||
except Exception:
|
||||
do_break = False
|
||||
for col_startswith in data.col1_startswith:
|
||||
if elems[0].lower().startswith(col_startswith):
|
||||
@@ -1244,7 +1244,7 @@ class Wiggle(Tabular, _RemoteCallMixin):
|
||||
if len(hdr) > 1 and hdr[0] == 'track' and hdr[1].startswith('type=wiggle'):
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_track_resolution(self, dataset, start, end):
|
||||
@@ -1394,7 +1394,7 @@ class CustomTrack (Tabular):
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
else:
|
||||
try:
|
||||
@@ -1404,9 +1404,9 @@ class CustomTrack (Tabular):
|
||||
try:
|
||||
int(hdr[1])
|
||||
int(hdr[2])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -1539,7 +1539,7 @@ class ScIdx(Tabular):
|
||||
count += 1
|
||||
if count < 100 and count > 0:
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
finally:
|
||||
fh.close()
|
||||
|
||||
@@ -33,7 +33,7 @@ def count_special_lines(word, filename, invert=False):
|
||||
cmd.extend([word, filename])
|
||||
out = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
return int(out.communicate()[0].split()[0])
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return 0
|
||||
|
||||
@@ -48,7 +48,7 @@ def count_lines(filename, non_empty=False):
|
||||
else:
|
||||
out = subprocess.Popen(['wc', '-l', filename], stdout=subprocess.PIPE)
|
||||
return int(out.communicate()[0].split()[0])
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return 0
|
||||
|
||||
@@ -427,7 +427,7 @@ class OBFS(Binary):
|
||||
"""Create HTML content, used for displaying peek."""
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "OpenBabel Fastsearch Index"
|
||||
|
||||
def display_data(self, trans, data, preview=False, filename=None,
|
||||
@@ -702,7 +702,7 @@ class SMILES(Tabular):
|
||||
# if we have atoms, we have a molecule
|
||||
if not len(pybel.readstring('smi', smiles).atoms) > 0:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
# if convert fails its not a smiles string
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -26,7 +26,7 @@ class Hmmer(Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "HMMER database (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
@abc.abstractmethod
|
||||
@@ -77,7 +77,7 @@ class HmmerPress(Binary):
|
||||
"""Create HTML content, used for displaying peek."""
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "HMMER3 database (multiple files)"
|
||||
|
||||
def __init__(self, **kwd):
|
||||
|
||||
@@ -55,7 +55,7 @@ class BowtieIndex(Html):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Bowtie index file"
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class Smat(Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "ESTScan scores matrices (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -98,7 +98,7 @@ class PlantTribesKsComponents(Tabular):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Significant components in the Ks distribution (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def set_meta(self, dataset, **kwd):
|
||||
|
||||
@@ -285,7 +285,7 @@ class ThermoRAW(Binary):
|
||||
if header.find(finnigan) != -1:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -299,7 +299,7 @@ class ThermoRAW(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Thermo Finnigan RAW file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -464,3 +464,49 @@ class ImzML(Binary):
|
||||
rval.append('<li><a href="%s" type="text/plain">%s</a>%s</li>' % (fn, fn, opt_text))
|
||||
rval.append('</ul></div></html>')
|
||||
return "\n".join(rval)
|
||||
|
||||
|
||||
class Analyze75(Binary):
|
||||
"""
|
||||
Mayo Analyze 7.5 files
|
||||
http://www.imzml.org
|
||||
"""
|
||||
file_ext = 'analyze75'
|
||||
allow_datatype_change = False
|
||||
composite_type = 'auto_primary_file'
|
||||
|
||||
def __init__(self, **kwd):
|
||||
Binary.__init__(self, **kwd)
|
||||
|
||||
"""The header file. Provides information about dimensions, identification, and processing history."""
|
||||
self.add_composite_file(
|
||||
'hdr',
|
||||
description='The Analyze75 header file.',
|
||||
is_binary=False)
|
||||
|
||||
"""The image file. Image data, whose data type and ordering are described by the header file."""
|
||||
self.add_composite_file(
|
||||
'img',
|
||||
description='The Analyze75 image file.',
|
||||
is_binary=True)
|
||||
|
||||
"""The optional t2m file."""
|
||||
self.add_composite_file(
|
||||
't2m',
|
||||
description='The Analyze75 t2m file.',
|
||||
optional='True', is_binary=True)
|
||||
|
||||
def generate_primary_file(self, dataset=None):
|
||||
rval = ['<html><head><title>Analyze75 Composite Dataset.</title></head><p/>']
|
||||
rval.append('<div>This composite dataset is composed of the following files:<p/><ul>')
|
||||
for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems():
|
||||
fn = composite_name
|
||||
opt_text = ''
|
||||
if composite_file.optional:
|
||||
opt_text = ' (optional)'
|
||||
if composite_file.get('description'):
|
||||
rval.append('<li><a href="%s" type="text/plain">%s (%s)</a>%s</li>' % (fn, fn, composite_file.get('description'), opt_text))
|
||||
else:
|
||||
rval.append('<li><a href="%s" type="text/plain">%s</a>%s</li>' % (fn, fn, opt_text))
|
||||
rval.append('</ul></div></html>')
|
||||
return "\n".join(rval)
|
||||
|
||||
@@ -56,7 +56,7 @@ class QualityScoreSOLiD (QualityScore):
|
||||
if not(readlen):
|
||||
readlen = len(line.split())
|
||||
assert len(line.split()) == readlen # SOLiD reads should be of the same length
|
||||
except:
|
||||
except Exception:
|
||||
break
|
||||
goodblock += 1
|
||||
if goodblock > 10:
|
||||
@@ -64,7 +64,7 @@ class QualityScoreSOLiD (QualityScore):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -106,13 +106,13 @@ class QualityScore454 (QualityScore):
|
||||
break
|
||||
try:
|
||||
[int(x) for x in line.split()]
|
||||
except:
|
||||
except Exception:
|
||||
break
|
||||
return True
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class SequenceSplitLocations(data.Text):
|
||||
if 'start' not in section or 'end' not in section or 'sequences' not in section:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -376,7 +376,7 @@ class Fasta(Sequence):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a fasta header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -543,7 +543,7 @@ class csFasta(Sequence):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -634,7 +634,7 @@ class BaseFastq (Sequence):
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def display_data(self, trans, dataset, preview=False, filename=None, to_ext=None, **kwd):
|
||||
@@ -930,7 +930,7 @@ class Maf(Alignment):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -968,7 +968,7 @@ class MafCustomTrack(data.Text):
|
||||
dataset.metadata.vp_chromosome = chrom
|
||||
dataset.metadata.vp_start = forward_strand_start
|
||||
dataset.metadata.vp_end = forward_strand_end
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
@@ -1019,7 +1019,7 @@ class Axt(data.Text):
|
||||
return False
|
||||
try:
|
||||
map(int, [hdr[0], hdr[2], hdr[3], hdr[5], hdr[6], hdr[8]])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[7] not in data.valid_strand:
|
||||
return False
|
||||
@@ -1060,7 +1060,7 @@ class Lav(data.Text):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1205,7 +1205,7 @@ class Genbank(data.Text):
|
||||
try:
|
||||
with open(filename, 'r') as handle:
|
||||
return 'LOCUS ' == handle.read(6)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return False
|
||||
@@ -1236,7 +1236,7 @@ class MemePsp(Sequence):
|
||||
for item in l.split():
|
||||
try:
|
||||
float(item)
|
||||
except:
|
||||
except ValueError:
|
||||
return False
|
||||
return True
|
||||
try:
|
||||
@@ -1269,7 +1269,7 @@ class MemePsp(Sequence):
|
||||
# We found a non-empty line,
|
||||
# but it's not a psp id width.
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
# We've reached EOF in less than 100 lines.
|
||||
return True
|
||||
|
||||
@@ -54,7 +54,7 @@ def stream_to_open_named_file(stream, fd, filename, source_encoding=None, source
|
||||
is_multi_byte = False
|
||||
try:
|
||||
codecs.lookup(target_encoding)
|
||||
except:
|
||||
except Exception:
|
||||
target_encoding = util.DEFAULT_ENCODING # utf-8
|
||||
if not source_encoding:
|
||||
source_encoding = util.DEFAULT_ENCODING # sys.getdefaultencoding() would mimic old behavior (defaults to ascii)
|
||||
@@ -70,7 +70,7 @@ def stream_to_open_named_file(stream, fd, filename, source_encoding=None, source
|
||||
try:
|
||||
if text_type(chunk[:2]) == text_type(util.gzip_magic):
|
||||
is_compressed = True
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if not is_compressed:
|
||||
# See if we have a multi-byte character file
|
||||
@@ -408,7 +408,7 @@ def guess_ext(fname, sniff_order, is_multi_byte=False):
|
||||
if datatype.sniff(fname):
|
||||
file_ext = datatype.file_ext
|
||||
break
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
# Ugly hack for tsv vs tabular sniffing, we want to prefer tabular
|
||||
# to tsv but it doesn't have a sniffer - is TSV was sniffed just check
|
||||
|
||||
@@ -62,7 +62,7 @@ class TabularData(data.Text):
|
||||
and dataset.state == dataset.states.OK \
|
||||
and dataset.metadata.columns > 0 \
|
||||
and dataset.metadata.data_lines != 0
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_chunk(self, trans, dataset, offset=0, ck_size=None):
|
||||
@@ -156,7 +156,7 @@ class TabularData(data.Text):
|
||||
if isinstance(spec.param, metadata.ColumnParameter):
|
||||
try:
|
||||
i = int(getattr(dataset.metadata, name)) - 1
|
||||
except:
|
||||
except Exception:
|
||||
i = -1
|
||||
if 0 <= i < columns and column_headers[i] is None:
|
||||
column_headers[i] = column_parameter_alias.get(name, name)
|
||||
@@ -294,14 +294,14 @@ class Tabular(TabularData):
|
||||
try:
|
||||
int(column_text)
|
||||
return True
|
||||
except:
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def is_float(column_text):
|
||||
try:
|
||||
float(column_text)
|
||||
return True
|
||||
except:
|
||||
except ValueError:
|
||||
if column_text.strip().lower() == 'na':
|
||||
return True # na is special cased to be a float
|
||||
return False
|
||||
@@ -488,7 +488,7 @@ class Sam(Tabular):
|
||||
fh.close()
|
||||
if count < 5 and count > 0:
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -650,10 +650,10 @@ class Pileup(Tabular):
|
||||
chrom = int(hdr[1])
|
||||
assert chrom >= 0
|
||||
assert hdr[2] in ['A', 'C', 'G', 'T', 'N', 'a', 'c', 'g', 't', 'n']
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
# Dataproviders
|
||||
@@ -919,14 +919,14 @@ class BaseCSV(TabularData):
|
||||
try:
|
||||
int(column_text)
|
||||
return True
|
||||
except:
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def is_float(self, column_text):
|
||||
try:
|
||||
float(column_text)
|
||||
return True
|
||||
except:
|
||||
except ValueError:
|
||||
if column_text.strip().lower() == 'na':
|
||||
return True # na is special cased to be a float
|
||||
return False
|
||||
@@ -990,7 +990,7 @@ class BaseCSV(TabularData):
|
||||
if not csv.Sniffer().has_header(open(filename, 'r').read(self.big_peek_size)):
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
# Not readable by Python's csv using this dialect
|
||||
return False
|
||||
|
||||
@@ -1137,7 +1137,7 @@ class ConnectivityTable(Tabular):
|
||||
j += 1
|
||||
i += 1
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_chunk(self, trans, dataset, chunk):
|
||||
|
||||
@@ -55,7 +55,7 @@ class Html(Text):
|
||||
if hdr and hdr[0].lower().find('<html>') >= 0:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return True
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ class Json(Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "JSON file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ class Ipynb(Json):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def display_data(self, trans, dataset, preview=False, filename=None, to_ext=None, **kwd):
|
||||
@@ -420,7 +420,7 @@ class SnpEffDb(Text):
|
||||
if m:
|
||||
snpeff_version = m.groups()[0] + m.groups()[1]
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return snpeff_version
|
||||
|
||||
@@ -465,7 +465,7 @@ class SnpEffDb(Text):
|
||||
fh.write("annotations: %s\n" % ','.join(annotations))
|
||||
if regulations:
|
||||
fh.write("regulations: %s\n" % ','.join(regulations))
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class UCSCTrackHub(Html):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Track Hub structure: Visualization in UCSC Track Hub"
|
||||
|
||||
def sniff(self, filename):
|
||||
|
||||
@@ -14,6 +14,6 @@ def count_special_lines(word, filename, invert=False):
|
||||
cmd.extend([word, filename])
|
||||
out = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
return int(out.communicate()[0].split()[0])
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return 0
|
||||
|
||||
@@ -63,7 +63,7 @@ class ConditionalDependencies(object):
|
||||
try:
|
||||
name = name.replace('-', '_').replace('.', '_')
|
||||
return getattr(self, 'check_' + name)()
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def check_psycopg2(self):
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
nose
|
||||
NoseHTML
|
||||
twill==0.9.1
|
||||
testfixtures
|
||||
mock
|
||||
selenium
|
||||
watchdog
|
||||
|
||||
@@ -25,19 +25,18 @@ WebOb==1.4.1
|
||||
WebHelpers==1.3
|
||||
Mako==1.0.2
|
||||
pytz==2015.4
|
||||
Babel==2.4.0
|
||||
Babel==2.5.1
|
||||
Beaker==1.7.0
|
||||
dictobj==0.3.1
|
||||
nose==1.3.7
|
||||
Parsley==1.3
|
||||
six==1.10.0
|
||||
Whoosh==2.7.4
|
||||
testfixtures==4.10.0
|
||||
galaxy_sequence_utils==1.0.2
|
||||
h5py==2.7.1
|
||||
|
||||
# pykwalify and dependencies
|
||||
pykwalify==1.5.1
|
||||
pykwalify==1.6.0
|
||||
python-dateutil==2.5.3
|
||||
docopt==0.6.2
|
||||
|
||||
@@ -45,11 +44,18 @@ docopt==0.6.2
|
||||
Cheetah==2.4.4
|
||||
Markdown==2.6.3
|
||||
|
||||
# Requests and dependencies
|
||||
requests==2.18.4
|
||||
certifi==2017.7.27.1
|
||||
urllib3==1.22
|
||||
chardet==3.0.4
|
||||
idna==2.6
|
||||
|
||||
# BioBlend and dependencies
|
||||
bioblend==0.7.0
|
||||
boto==2.38.0
|
||||
requests==2.10.0
|
||||
requests-toolbelt==0.4.0
|
||||
requests-toolbelt==0.8.0
|
||||
|
||||
|
||||
# kombu and dependencies
|
||||
kombu==3.0.30
|
||||
|
||||
@@ -1166,7 +1166,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
# TODO: After failing here, consider returning from the function.
|
||||
try:
|
||||
self.reclaim_ownership()
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('(%s) Failed to change ownership of %s, failing' % (job.id, self.working_directory))
|
||||
return self.fail(job.info, stdout=stdout, stderr=stderr, exit_code=tool_exit_code)
|
||||
|
||||
@@ -1316,7 +1316,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
dataset.set_peek(line_count=context['line_count'], is_multi_byte=True)
|
||||
else:
|
||||
dataset.set_peek(line_count=context['line_count'])
|
||||
except:
|
||||
except Exception:
|
||||
if (not dataset.datatype.composite_type and dataset.dataset.is_multi_byte()) or self.tool.is_multi_byte:
|
||||
dataset.set_peek(is_multi_byte=True)
|
||||
else:
|
||||
@@ -1467,7 +1467,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
galaxy.tools.imp_exp.JobImportHistoryArchiveWrapper(self.app, self.job_id).cleanup_after_job()
|
||||
if delete_files:
|
||||
self.app.object_store.delete(self.get_job(), base_dir='job_work', entire_dir=True, dir_only=True, obj_dir=True)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Unable to cleanup job %d", self.job_id)
|
||||
|
||||
def _collect_extra_files(self, dataset, job_working_directory):
|
||||
@@ -1765,7 +1765,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
if external_chown_script and job.user is not None:
|
||||
try:
|
||||
self._change_ownership(self.user_system_pwent[0], str(self.user_system_pwent[3]))
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('(%s) Failed to change ownership of %s, making world-writable instead' % (job.id, self.working_directory))
|
||||
os.chmod(self.working_directory, 0o777)
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class DeferredJobQueue(object):
|
||||
module_name = 'galaxy.jobs.deferred.' + name
|
||||
try:
|
||||
module = __import__(module_name)
|
||||
except:
|
||||
except ImportError:
|
||||
log.exception('Deferred job plugin appears to exist but is not loadable: %s', module_name)
|
||||
continue
|
||||
for comp in module_name.split(".")[1:]:
|
||||
@@ -76,7 +76,7 @@ class DeferredJobQueue(object):
|
||||
while self.running:
|
||||
try:
|
||||
self.__monitor_step()
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Exception in monitor_step')
|
||||
self.sleeper.sleep(1)
|
||||
log.info('job queue stopped')
|
||||
@@ -100,7 +100,7 @@ class DeferredJobQueue(object):
|
||||
# Recovered jobs are passed in by ID
|
||||
assert type(job) is int
|
||||
job = self.sa_session.query(model.DeferredJob).get(job)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if job.is_check_time:
|
||||
try:
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
"""
|
||||
Galaxy job handler, prepares, runs, tracks, and finishes Galaxy jobs
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import time
|
||||
import logging
|
||||
import os
|
||||
import threading
|
||||
from Queue import Queue, Empty
|
||||
import time
|
||||
from Queue import (
|
||||
Empty,
|
||||
Queue
|
||||
)
|
||||
|
||||
from sqlalchemy.sql.expression import and_, or_, select, func, true, null
|
||||
from sqlalchemy.sql.expression import (
|
||||
and_,
|
||||
func,
|
||||
null,
|
||||
or_,
|
||||
select,
|
||||
true
|
||||
)
|
||||
|
||||
from galaxy import model
|
||||
from galaxy.util.sleeper import Sleeper
|
||||
from galaxy.jobs import JobWrapper, TaskWrapper, JobDestination
|
||||
from galaxy.jobs import (
|
||||
JobDestination,
|
||||
JobWrapper,
|
||||
TaskWrapper
|
||||
)
|
||||
from galaxy.jobs.mapper import JobNotReadyException
|
||||
from galaxy.util.sleeper import Sleeper
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -196,7 +209,7 @@ class JobHandlerQueue(object):
|
||||
# to the sleep.
|
||||
if not self.app.job_manager.job_lock:
|
||||
self.__monitor_step()
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Exception in monitor_step")
|
||||
# Sleep
|
||||
self.sleeper.sleep(1)
|
||||
@@ -703,7 +716,7 @@ class JobHandlerStopQueue(object):
|
||||
while self.running:
|
||||
try:
|
||||
self.monitor_step()
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Exception in monitor_step")
|
||||
# Sleep
|
||||
self.sleeper.sleep(1)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import re
|
||||
from .error_level import StdioErrorLevel
|
||||
import traceback
|
||||
|
||||
from logging import getLogger
|
||||
|
||||
from .error_level import StdioErrorLevel
|
||||
|
||||
log = getLogger(__name__)
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ def check_output(tool, stdout, stderr, tool_exit_code, job):
|
||||
success = True
|
||||
|
||||
# On any exception, return True.
|
||||
except:
|
||||
except Exception:
|
||||
tb = traceback.format_exc()
|
||||
log.warning("Tool check encountered unexpected exception; " +
|
||||
"assuming tool was successful: " + tb)
|
||||
|
||||
@@ -1,28 +1,34 @@
|
||||
"""
|
||||
Base classes for job runner plugins.
|
||||
"""
|
||||
|
||||
import os
|
||||
import time
|
||||
import string
|
||||
import logging
|
||||
import datetime
|
||||
import threading
|
||||
import logging
|
||||
import os
|
||||
import string
|
||||
import subprocess
|
||||
|
||||
from Queue import Queue, Empty
|
||||
import threading
|
||||
import time
|
||||
from Queue import (
|
||||
Empty,
|
||||
Queue
|
||||
)
|
||||
|
||||
import galaxy.jobs
|
||||
from galaxy.jobs.command_factory import build_command
|
||||
from galaxy import model
|
||||
from galaxy.util import DATABASE_MAX_STRING_SIZE, shrink_stream_by_size
|
||||
from galaxy.util import in_directory
|
||||
from galaxy.util import ParamsWithSpecs
|
||||
from galaxy.util import ExecutionTimer
|
||||
from galaxy.util.bunch import Bunch
|
||||
from galaxy.jobs.runners.util.job_script import write_script
|
||||
from galaxy.jobs.runners.util.job_script import job_script
|
||||
from galaxy.jobs.command_factory import build_command
|
||||
from galaxy.jobs.runners.util.env import env_to_statement
|
||||
from galaxy.jobs.runners.util.job_script import (
|
||||
job_script,
|
||||
write_script
|
||||
)
|
||||
from galaxy.util import (
|
||||
DATABASE_MAX_STRING_SIZE,
|
||||
ExecutionTimer,
|
||||
in_directory,
|
||||
ParamsWithSpecs,
|
||||
shrink_stream_by_size
|
||||
)
|
||||
from galaxy.util.bunch import Bunch
|
||||
|
||||
from .state_handler_factory import build_state_handlers
|
||||
|
||||
@@ -94,15 +100,15 @@ class BaseJobRunner(object):
|
||||
else:
|
||||
# arg should be a JobWrapper/TaskWrapper
|
||||
job_id = arg.get_id_tag()
|
||||
except:
|
||||
except Exception:
|
||||
job_id = 'unknown'
|
||||
try:
|
||||
name = method.__name__
|
||||
except:
|
||||
except Exception:
|
||||
name = 'unknown'
|
||||
try:
|
||||
method(arg)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("(%s) Unhandled exception calling %s" % (job_id, name))
|
||||
|
||||
# Causes a runner's `queue_job` method to be called from a worker thread
|
||||
@@ -366,7 +372,7 @@ class BaseJobRunner(object):
|
||||
handler(self.app, self, job_state)
|
||||
if job_state.runner_state_handled:
|
||||
break
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Caught exception in runner state handler')
|
||||
|
||||
def fail_job(self, job_state, exception=False):
|
||||
@@ -610,14 +616,14 @@ class AsynchronousJobRunner(BaseJobRunner):
|
||||
try:
|
||||
# This should be an 8-bit exit code, but read ahead anyway:
|
||||
exit_code_str = open(job_state.exit_code_file, "r").read(32)
|
||||
except:
|
||||
except Exception:
|
||||
# By default, the exit code is 0, which typically indicates success.
|
||||
exit_code_str = "0"
|
||||
|
||||
try:
|
||||
# Decode the exit code. If it's bogus, then just use 0.
|
||||
exit_code = int(exit_code_str)
|
||||
except:
|
||||
except ValueError:
|
||||
log.warning("(%s/%s) Exit code '%s' invalid. Using 0." % (galaxy_id_tag, external_job_id, exit_code_str))
|
||||
exit_code = 0
|
||||
|
||||
@@ -628,7 +634,7 @@ class AsynchronousJobRunner(BaseJobRunner):
|
||||
|
||||
try:
|
||||
job_state.job_wrapper.finish(stdout, stderr, exit_code)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("(%s/%s) Job wrapper finish method failed" % (galaxy_id_tag, external_job_id))
|
||||
job_state.job_wrapper.fail("Unable to finish job", exception=True)
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class ShellJobRunner(AsynchronousJobRunner):
|
||||
|
||||
try:
|
||||
self.write_executable_script(ajs.job_file, script)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("(%s) failure writing job script" % galaxy_id_tag)
|
||||
job_wrapper.fail("failure preparing job script", exception=True)
|
||||
return
|
||||
|
||||
@@ -105,7 +105,7 @@ class CondorJobRunner(AsynchronousJobRunner):
|
||||
)
|
||||
try:
|
||||
self.write_executable_script(executable, script)
|
||||
except:
|
||||
except Exception:
|
||||
job_wrapper.fail("failure preparing job script", exception=True)
|
||||
log.exception("(%s) failure preparing job script" % galaxy_id_tag)
|
||||
return
|
||||
|
||||
@@ -110,7 +110,7 @@ class DRMAAJobRunner(AsynchronousJobRunner):
|
||||
"""Get any native DRM arguments specified by the site configuration"""
|
||||
try:
|
||||
return url.split('/')[2] or None
|
||||
except:
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
def queue_job(self, job_wrapper):
|
||||
@@ -151,7 +151,7 @@ class DRMAAJobRunner(AsynchronousJobRunner):
|
||||
script = self.get_job_file(job_wrapper, exit_code_path=ajs.exit_code_file)
|
||||
try:
|
||||
self.write_executable_script(ajs.job_file, script)
|
||||
except:
|
||||
except Exception:
|
||||
job_wrapper.fail("failure preparing job script", exception=True)
|
||||
log.exception("(%s) failure writing job script" % galaxy_id_tag)
|
||||
return
|
||||
@@ -183,7 +183,7 @@ class DRMAAJobRunner(AsynchronousJobRunner):
|
||||
log.warning('(%s) drmaa.Session.runJob() failed, will retry: %s', galaxy_id_tag, e)
|
||||
fail_msg = "Unable to run this job due to a cluster error, please retry it later"
|
||||
time.sleep(5)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('(%s) drmaa.Session.runJob() failed unconditionally', galaxy_id_tag)
|
||||
trynum = 5
|
||||
else:
|
||||
|
||||
@@ -336,16 +336,16 @@ class GodockerJobRunner(AsynchronousJobRunner):
|
||||
job_destination = job_wrapper.job_destination
|
||||
try:
|
||||
docker_cpu = int(job_destination.params["docker_cpu"])
|
||||
except:
|
||||
except Exception:
|
||||
docker_cpu = 1
|
||||
try:
|
||||
docker_ram = int(job_destination.params["docker_memory"])
|
||||
except:
|
||||
except Exception:
|
||||
docker_ram = 1
|
||||
try:
|
||||
docker_image = self._find_container(job_wrapper).container_id
|
||||
log.debug("GoDocker runner using container %s.", docker_image)
|
||||
except:
|
||||
except Exception:
|
||||
log.error("Unable to find docker_image for job %s, failing." % job_wrapper.job_id)
|
||||
return False
|
||||
|
||||
@@ -367,7 +367,7 @@ class GodockerJobRunner(AsynchronousJobRunner):
|
||||
for i in volume:
|
||||
temp = dict({"name": i})
|
||||
volumes.append(temp)
|
||||
except:
|
||||
except Exception:
|
||||
log.debug("godocker_volume not set, using default.")
|
||||
|
||||
dt = datetime.now()
|
||||
@@ -379,7 +379,7 @@ class GodockerJobRunner(AsynchronousJobRunner):
|
||||
command = "#!/bin/bash\n" + "cd " + job_wrapper.working_directory + "\n" + venv + "\n" + job_wrapper.runner_command_line
|
||||
else:
|
||||
command = "#!/bin/bash\n" + "cd " + job_wrapper.working_directory + "\n" + job_wrapper.runner_command_line
|
||||
except:
|
||||
except Exception:
|
||||
command = "#!/bin/bash\n" + "cd " + job_wrapper.working_directory + "\n" + job_wrapper.runner_command_line
|
||||
|
||||
# GoDocker Job model schema
|
||||
|
||||
@@ -131,7 +131,7 @@ class KubernetesJobRunner(AsynchronousJobRunner):
|
||||
if "k8s_supplemental_group_id" in self.runner_params:
|
||||
try:
|
||||
return int(self.runner_params["k8s_supplemental_group_id"])
|
||||
except:
|
||||
except Exception:
|
||||
log.warning("Supplemental group passed for Kubernetes runner needs to be an integer, value "
|
||||
+ self.runner_params["k8s_supplemental_group_id"] + " passed is invalid")
|
||||
return None
|
||||
@@ -141,7 +141,7 @@ class KubernetesJobRunner(AsynchronousJobRunner):
|
||||
if "k8s_fs_group_id" in self.runner_params:
|
||||
try:
|
||||
return int(self.runner_params["k8s_fs_group_id"])
|
||||
except:
|
||||
except Exception:
|
||||
log.warning("FS group passed for Kubernetes runner needs to be an integer, value "
|
||||
+ self.runner_params["k8s_fs_group_id"] + " passed is invalid")
|
||||
return None
|
||||
|
||||
@@ -128,7 +128,7 @@ class LocalJobRunner(BaseJobRunner):
|
||||
# Finish the job!
|
||||
try:
|
||||
job_wrapper.finish(stdout, stderr, exit_code)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Job wrapper finish method failed")
|
||||
self._fail_job_local(job_wrapper, "Unable to finish job")
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ class PBSJobRunner(AsynchronousJobRunner):
|
||||
# stripping the - comes later (in parse_destination_params)
|
||||
for i, opt in enumerate(opts):
|
||||
opts[i] = '-' + opt
|
||||
except:
|
||||
except Exception:
|
||||
opts = []
|
||||
for opt in opts:
|
||||
param, value = opt.split(None, 1)
|
||||
@@ -168,7 +168,7 @@ class PBSJobRunner(AsynchronousJobRunner):
|
||||
arg = PBS_ARGMAP[arg]
|
||||
arg = arg.lstrip('-')
|
||||
args[arg] = value
|
||||
except:
|
||||
except Exception:
|
||||
log.warning('Unrecognized long argument in destination params: %s' % arg)
|
||||
return self.__args_to_attrs(args)
|
||||
|
||||
@@ -371,7 +371,7 @@ class PBSJobRunner(AsynchronousJobRunner):
|
||||
self.check_single_job(pbs_server_name, job_id)
|
||||
log.warning("(%s/%s) PBS job was not in state check list, but was found with individual state check" % (galaxy_job_id, job_id))
|
||||
new_watched.append(pbs_job_state)
|
||||
except:
|
||||
except Exception:
|
||||
errno, text = pbs.error()
|
||||
if errno == 15001:
|
||||
# 15001 == job not in queue
|
||||
@@ -525,7 +525,7 @@ class PBSJobRunner(AsynchronousJobRunner):
|
||||
pbs.pbs_deljob(c, job_id, '')
|
||||
log.debug("%s Removed from PBS queue before job completion"
|
||||
% job_tag)
|
||||
except:
|
||||
except Exception:
|
||||
e = traceback.format_exc()
|
||||
log.debug("%s Unable to stop job: %s" % (job_tag, e))
|
||||
finally:
|
||||
|
||||
@@ -104,7 +104,7 @@ class SlurmJobRunner(DRMAAJobRunner):
|
||||
try:
|
||||
self.queue_job(ajs.job_wrapper)
|
||||
return
|
||||
except:
|
||||
except Exception:
|
||||
ajs.fail_message = "This job failed due to a cluster node failure, and an attempt to resubmit the job failed."
|
||||
elif slurm_state == 'CANCELLED':
|
||||
# Check to see if the job was killed for exceeding memory consumption
|
||||
@@ -164,7 +164,7 @@ class SlurmJobRunner(DRMAAJobRunner):
|
||||
return 'This job was terminated because it used more memory than it was allocated.'
|
||||
elif any(_ in stripped_line for _ in SLURM_MEMORY_LIMIT_EXCEEDED_PARTIAL_WARNINGS):
|
||||
return 'This job was cancelled probably because it used more memory than it was allocated.'
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Error reading end of %s:', efile_path)
|
||||
|
||||
return False
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import logging
|
||||
|
||||
from galaxy.util.submodules import submodules
|
||||
|
||||
import galaxy.jobs.runners.state_handlers
|
||||
|
||||
from galaxy.util.submodules import submodules
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class TaskedJobRunner(BaseJobRunner):
|
||||
parallelism = job_wrapper.get_parallelism()
|
||||
try:
|
||||
splitter = getattr(__import__('galaxy.jobs.splitters', globals(), locals(), [parallelism.method]), parallelism.method)
|
||||
except:
|
||||
except Exception:
|
||||
job_wrapper.change_state(model.Job.states.ERROR)
|
||||
job_wrapper.fail("Job Splitting Failed, no match for '%s'" % parallelism)
|
||||
return
|
||||
@@ -125,7 +125,7 @@ class TaskedJobRunner(BaseJobRunner):
|
||||
# Finish the job
|
||||
try:
|
||||
job_wrapper.finish(stdout, stderr, job_exit_code)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Job wrapper finish method failed")
|
||||
job_wrapper.fail("Unable to finish job", exception=True)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class Slurm(BaseJobExec):
|
||||
if not k.startswith('-'):
|
||||
k = argmap[k]
|
||||
scriptargs[k] = v
|
||||
except:
|
||||
except Exception:
|
||||
log.warning('Unrecognized long argument passed to Slurm CLI plugin: %s' % k)
|
||||
|
||||
# Generated template.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user