From fcb552bc85fcce5e299637b6e4e90e62dc7bc4dc Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 3 Sep 2014 08:43:25 -0400 Subject: [PATCH] Small optimization for implicit collection creation from tool execution. Don't write out encode identifier, add to dict, and then reload object in dataset collection service - just pass through the object in the dictionary as is. --- lib/galaxy/dataset_collections/__init__.py | 6 +++++- lib/galaxy/dataset_collections/structure.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/dataset_collections/__init__.py b/lib/galaxy/dataset_collections/__init__.py index e50f3cab0f6..9419c5cc037 100644 --- a/lib/galaxy/dataset_collections/__init__.py +++ b/lib/galaxy/dataset_collections/__init__.py @@ -54,8 +54,12 @@ class DatasetCollectionsService( ): """ """ - if element_identifiers: + # Trust embedded, newly created objects created by tool subsystem. + trusted_identifiers = implicit_collection_info is not None + + if element_identifiers and not trusted_identifiers: validate_input_element_identifiers( element_identifiers ) + dataset_collection = self.__create_dataset_collection( trans=trans, collection_type=collection_type, diff --git a/lib/galaxy/dataset_collections/structure.py b/lib/galaxy/dataset_collections/structure.py index 917ec1698ff..c21bdc9327a 100644 --- a/lib/galaxy/dataset_collections/structure.py +++ b/lib/galaxy/dataset_collections/structure.py @@ -78,7 +78,7 @@ class Tree( object ): child_identifiers[ "name" ] = identifier element_identifiers.append( child_identifiers ) else: - element_identifiers.append( dict( name=identifier, src="hda", id=trans.security.encode_id( datasets[ 0 ].id ) ) ) + element_identifiers.append( dict( name=identifier, __object__=datasets[ 0 ] ) ) datasets = datasets[ len( child ): ]