From c799e4a455562ba3ccc7058a6c7ec6ec6755eaef Mon Sep 17 00:00:00 2001 From: Simon Bray Date: Tue, 20 Apr 2021 17:42:51 +0200 Subject: [PATCH 1/6] expose StoredWorkflowId in invocation API --- lib/galaxy/model/__init__.py | 1 + lib/galaxy/webapps/galaxy/api/workflows.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 65314db1c7d..3b1e3deba6e 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -5514,6 +5514,7 @@ class WorkflowInvocation(UsesCreateAndUpdateTime, Dictifiable, RepresentById): def to_dict(self, view='collection', value_mapper=None, step_details=False, legacy_job_state=False): rval = super().to_dict(view=view, value_mapper=value_mapper) + rval['stored_workflow_id'] = self.workflow.stored_workflow.id if view == 'element': steps = [] for step in self.steps: diff --git a/lib/galaxy/webapps/galaxy/api/workflows.py b/lib/galaxy/webapps/galaxy/api/workflows.py index 0d7ca77cb8a..b48bd350d71 100644 --- a/lib/galaxy/webapps/galaxy/api/workflows.py +++ b/lib/galaxy/webapps/galaxy/api/workflows.py @@ -835,7 +835,7 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn :func:`galaxy.webapps.galaxy.api.workflows.WorkflowsAPIController.create` above. """ # Get workflow + accessibility check. - stored_workflow = self.__get_stored_accessible_workflow(trans, workflow_id) + stored_workflow = self.__get_stored_accessible_workflow(trans, workflow_id, instance=kwd.get('instance', False)) workflow = stored_workflow.latest_workflow run_configs = build_workflow_run_configs(trans, workflow, payload) is_batch = payload.get('batch') @@ -880,6 +880,10 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn :param workflow_id: an encoded stored workflow id to restrict query to :type workflow_id: str + :param instance: true if fetch by Workflow ID instead of StoredWorkflow id, false + by default. + :type instance: boolean + :param history_id: an encoded history id to restrict query to :type history_id: str @@ -895,7 +899,7 @@ class WorkflowsAPIController(BaseAPIController, UsesStoredWorkflowMixin, UsesAnn :raises: exceptions.MessageException, exceptions.ObjectNotFound """ if workflow_id is not None: - stored_workflow_id = self.__get_stored_workflow(trans, workflow_id).id + stored_workflow_id = self.__get_stored_workflow(trans, workflow_id, instance=kwd.get('instance', False)).id else: stored_workflow_id = None From ba1f4a3f7a43f83b61c052549438264864f358f8 Mon Sep 17 00:00:00 2001 From: scholtalbers Date: Thu, 22 Apr 2021 14:51:37 +0200 Subject: [PATCH 2/6] Update lib/galaxy/model/__init__.py Co-authored-by: Simon Bray <32272674+simonbray@users.noreply.github.com> --- lib/galaxy/model/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 3b1e3deba6e..65314db1c7d 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -5514,7 +5514,6 @@ class WorkflowInvocation(UsesCreateAndUpdateTime, Dictifiable, RepresentById): def to_dict(self, view='collection', value_mapper=None, step_details=False, legacy_job_state=False): rval = super().to_dict(view=view, value_mapper=value_mapper) - rval['stored_workflow_id'] = self.workflow.stored_workflow.id if view == 'element': steps = [] for step in self.steps: From e15ec9173c8378c39143458705877a1cf4e5b016 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 27 Apr 2021 13:29:43 -0400 Subject: [PATCH 3/6] Use full page context (not just the short embed chunk) when injecting a viz in an iframe --- templates/webapps/galaxy/visualization/display_in_frame.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/webapps/galaxy/visualization/display_in_frame.mako b/templates/webapps/galaxy/visualization/display_in_frame.mako index f4fc1aec632..ec7d787c50e 100644 --- a/templates/webapps/galaxy/visualization/display_in_frame.mako +++ b/templates/webapps/galaxy/visualization/display_in_frame.mako @@ -49,7 +49,7 @@ <%def name="render_item( visualization, config )">
From 6a209388ee0f9f638f00a015faf06470f0eb193c Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 29 Apr 2021 22:37:41 +0200 Subject: [PATCH 4/6] Use keep_original in pysam.tabix_index to not remove original data --- lib/galaxy/datatypes/tabular.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/datatypes/tabular.py b/lib/galaxy/datatypes/tabular.py index 9d50a523433..04518492853 100644 --- a/lib/galaxy/datatypes/tabular.py +++ b/lib/galaxy/datatypes/tabular.py @@ -823,7 +823,7 @@ class VcfGz(BaseVcf, binary.Binary): index_file = dataset.metadata.spec['tabix_index'].param.new_file(dataset=dataset) try: - pysam.tabix_index(dataset.file_name, index=index_file.file_name, preset='vcf', force=True) + pysam.tabix_index(dataset.file_name, index=index_file.file_name, preset='vcf', keep_original=True, force=True) except Exception as e: raise Exception('Error setting VCF.gz metadata: %s' % (util.unicodify(e))) dataset.metadata.tabix_index = index_file From f4ec1bac831f6df572cb62fe90798e996c230696 Mon Sep 17 00:00:00 2001 From: cat-bro Date: Tue, 4 May 2021 18:47:24 +1000 Subject: [PATCH 5/6] update legacy_framework.grids.StateColumn: model_class.states is Enum now instead of Bunch --- lib/galaxy/web/legacy_framework/grids.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/galaxy/web/legacy_framework/grids.py b/lib/galaxy/web/legacy_framework/grids.py index f1bf7c1232c..d0a0a0c1f4a 100644 --- a/lib/galaxy/web/legacy_framework/grids.py +++ b/lib/galaxy/web/legacy_framework/grids.py @@ -390,9 +390,6 @@ class DeletedColumn(GridColumn): class StateColumn(GridColumn): """ Column that tracks and filters for items with state attribute. - - IMPORTANT NOTE: self.model_class must have a states Bunch or dict if - this column type is used in the grid. """ def get_value(self, trans, grid, item): @@ -402,7 +399,7 @@ class StateColumn(GridColumn): """Modify query to filter self.model_class by state.""" if column_filter == "All": pass - elif column_filter in [v for k, v in self.model_class.states.items()]: + elif column_filter in [state.value for state in self.model_class.states]: query = query.filter(self.model_class.state == column_filter) return query @@ -410,9 +407,9 @@ class StateColumn(GridColumn): """Returns a list of accepted filters for this column.""" all = GridColumnFilter('all', {self.key: 'All'}) accepted_filters = [all] - for v in self.model_class.states.values(): - args = {self.key: v} - accepted_filters.append(GridColumnFilter(v, args)) + for state in self.model_class.states: + args = {self.key: state.value} + accepted_filters.append(GridColumnFilter(state.value, args)) return accepted_filters From 4f8503be2910a6e8997312db8d3c8b130866374e Mon Sep 17 00:00:00 2001 From: cat-bro Date: Tue, 4 May 2021 22:13:01 +1000 Subject: [PATCH 6/6] Update lib/galaxy/web/legacy_framework/grids.py Co-authored-by: Marius van den Beek --- lib/galaxy/web/legacy_framework/grids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/web/legacy_framework/grids.py b/lib/galaxy/web/legacy_framework/grids.py index d0a0a0c1f4a..da77a2b27ee 100644 --- a/lib/galaxy/web/legacy_framework/grids.py +++ b/lib/galaxy/web/legacy_framework/grids.py @@ -399,7 +399,7 @@ class StateColumn(GridColumn): """Modify query to filter self.model_class by state.""" if column_filter == "All": pass - elif column_filter in [state.value for state in self.model_class.states]: + elif column_filter in list(self.model_class.states): query = query.filter(self.model_class.state == column_filter) return query