From 471162eadb4408318db534c6d24f7685bedb29eb Mon Sep 17 00:00:00 2001
From: John Chilton
Date: Tue, 11 Sep 2018 14:01:36 -0400
Subject: [PATCH 01/17] [18.09] Fix new extract dataset to perserve collection
element identifier.
---
lib/galaxy/model/__init__.py | 15 +++++++++++++--
lib/galaxy/tools/__init__.py | 9 +++++----
lib/galaxy/tools/extract_dataset.xml | 12 +++++++++---
3 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py
index ed2c75ded0f..0724ed1bf39 100644
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -2599,7 +2599,7 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
self.version = self.version + 1 if self.version else 1
session.add(past_hda)
- def copy(self, parent_id=None, copy_tags=None, force_flush=True, copy_hid=True):
+ def copy(self, parent_id=None, copy_tags=None, force_flush=True, copy_hid=True, new_name=None):
"""
Create a copy of this HDA.
"""
@@ -2607,7 +2607,7 @@ class HistoryDatasetAssociation(DatasetInstance, HasTags, Dictifiable, UsesAnnot
if copy_hid:
hid = self.hid
hda = HistoryDatasetAssociation(hid=hid,
- name=self.name,
+ name=new_name or self.name,
info=self.info,
blurb=self.blurb,
peek=self.peek,
@@ -3451,6 +3451,17 @@ class DatasetCollection(Dictifiable, UsesAnnotations):
elements.append(element)
return elements
+ @property
+ def first_dataset_element(self):
+ for element in self.elements:
+ if element.is_collection:
+ first_element = element.child_collection.first_dataset_element
+ if first_element:
+ return first_element
+ else:
+ return element
+ return None
+
@property
def state(self):
# TODO: DatasetCollection state handling...
diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py
index bf83a5d640e..ef06bf71a49 100755
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2481,14 +2481,15 @@ class ExtractDatasetCollectionTool(DatabaseOperationTool):
assert collection_type in ["list", "paired"]
how = incoming["which"]["which_dataset"]
if how == "first":
- extracted = collection.dataset_instances[0]
+ extracted_element = collection.first_dataset_element
elif how == "by_identifier":
- extracted = collection[incoming["which"]["identifier"]].element_object
+ extracted_element = collection[incoming["which"]["identifier"]]
elif how == "by_index":
- extracted = collection[int(incoming["which"]["index"])].element_object
+ extracted_element = collection[int(incoming["which"]["index"])]
else:
raise Exception("Invalid tool parameters.")
- extracted_o = extracted.copy(copy_tags=tags)
+ extracted = extracted_element.element_object
+ extracted_o = extracted.copy(copy_tags=tags, new_name=extracted_element.element_identifier)
self._add_datasets_to_history(history, [extracted_o])
out_data["output"] = extracted_o
diff --git a/lib/galaxy/tools/extract_dataset.xml b/lib/galaxy/tools/extract_dataset.xml
index 368f3df3d59..f4dd795e8f2 100644
--- a/lib/galaxy/tools/extract_dataset.xml
+++ b/lib/galaxy/tools/extract_dataset.xml
@@ -50,7 +50,9 @@ This tool will create new history datasets from your collection but your quota u
-
+
@@ -63,7 +65,9 @@ This tool will create new history datasets from your collection but your quota u
-
+
@@ -76,7 +80,9 @@ This tool will create new history datasets from your collection but your quota u
-
+
From ba4e7d199b4bc080dcd741710d2241147bdbe745 Mon Sep 17 00:00:00 2001
From: mvdbeek
Date: Wed, 12 Sep 2018 08:12:52 +0200
Subject: [PATCH 02/17] Make gro and top datatypes tabular subclasses
I think that was the intention in https://github.com/galaxyproject/galaxy/commit/56d55399ebe2ecd614a7ba5a146739f58e917541
---
config/datatypes_conf.xml.sample | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/datatypes_conf.xml.sample b/config/datatypes_conf.xml.sample
index e11a7f2d435..3c7d183d191 100644
--- a/config/datatypes_conf.xml.sample
+++ b/config/datatypes_conf.xml.sample
@@ -576,10 +576,10 @@
-
+
-
+
From 1f8c234c2be8baac9db94e17f4727e6c3c6c55ef Mon Sep 17 00:00:00 2001
From: Daniel Blankenberg
Date: Wed, 12 Sep 2018 09:03:16 -0400
Subject: [PATCH 03/17] Make top datatype inherit from Text.
---
config/datatypes_conf.xml.sample | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/datatypes_conf.xml.sample b/config/datatypes_conf.xml.sample
index 3c7d183d191..bf49f95419a 100644
--- a/config/datatypes_conf.xml.sample
+++ b/config/datatypes_conf.xml.sample
@@ -576,7 +576,7 @@
-
+
From b4b49dc2028da2064fd34d7345b23b47150a1039 Mon Sep 17 00:00:00 2001
From: Dannon Baker
Date: Thu, 13 Sep 2018 12:52:20 -0400
Subject: [PATCH 04/17] Add self help to error reporting interface.
---
.../scripts/mvc/dataset/dataset-error.js | 27 +++++++++++++++----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/client/galaxy/scripts/mvc/dataset/dataset-error.js b/client/galaxy/scripts/mvc/dataset/dataset-error.js
index 74f735eab7e..9d14d8ea917 100644
--- a/client/galaxy/scripts/mvc/dataset/dataset-error.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-error.js
@@ -2,6 +2,12 @@ import _l from "utils/localization";
import Utils from "utils/utils";
import Ui from "mvc/ui/ui-misc";
import Form from "mvc/form/form-view";
+import Backbone from "backbone";
+import * as _ from "underscore";
+
+/* global Galaxy */
+/* global $ */
+
/** Dataset edit attributes view */
var View = Backbone.View.extend({
initialize: function() {
@@ -57,12 +63,23 @@ var View = Backbone.View.extend({
An error occured while running the tool ${job.tool_id}.
Tool execution generated the following messages:
${_.escape(job.stderr)}
-
Report This Error
+
+
Troubleshoot This Error
- Usually the local Galaxy administrators regularly review errors that occur on the server
- However, if you would like to provide additional information (such as what you were trying
- to do when the error occurred) and a contact e-mail address, we will be better able to
- investigate your problem and get back to you.
+ There are a number of help resources to self diagnose and
+ correct problems.
+ Start here: My job ended with an error. What can I do?
+
+
+
Report This Error
+
+ Usually the local Galaxy administrators regularly review errors
+ that occur on the server However, if you would like to provide
+ additional information (such as what you were trying to do when
+ the error occurred) and a contact e-mail address, we will be
+ better able to investigate your problem and get back to you.
`);
this.$el.append(this._getBugFormTemplate(dataset, job));
},
From 88bf3435775e94217bccfc46a5215311dea321aa Mon Sep 17 00:00:00 2001
From: Dannon Baker
Date: Thu, 13 Sep 2018 14:25:59 -0400
Subject: [PATCH 05/17] Import Backbone consistently across the app
---
client/galaxy/scripts/mvc/dataset/dataset-error.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/galaxy/scripts/mvc/dataset/dataset-error.js b/client/galaxy/scripts/mvc/dataset/dataset-error.js
index 9d14d8ea917..b64694532c6 100644
--- a/client/galaxy/scripts/mvc/dataset/dataset-error.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-error.js
@@ -2,7 +2,7 @@ import _l from "utils/localization";
import Utils from "utils/utils";
import Ui from "mvc/ui/ui-misc";
import Form from "mvc/form/form-view";
-import Backbone from "backbone";
+import * as Backbone from "backbone";
import * as _ from "underscore";
/* global Galaxy */
From 84d66bea6008dc534aa6a2331e824005b204da19 Mon Sep 17 00:00:00 2001
From: Dannon Baker
Date: Fri, 14 Sep 2018 10:23:34 -0400
Subject: [PATCH 06/17] h2!=h3
---
client/galaxy/scripts/mvc/dataset/dataset-error.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/galaxy/scripts/mvc/dataset/dataset-error.js b/client/galaxy/scripts/mvc/dataset/dataset-error.js
index b64694532c6..6a288277b51 100644
--- a/client/galaxy/scripts/mvc/dataset/dataset-error.js
+++ b/client/galaxy/scripts/mvc/dataset/dataset-error.js
@@ -73,7 +73,7 @@ var View = Backbone.View.extend({
target="_blank"> My job ended with an error. What can I do?