Skip to content

Commit

Permalink
Preserve tags (ignoring collection handling for now) when running tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed Mar 2, 2017
1 parent d3840c5 commit 9f4764f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/galaxy/tools/actions/__init__.py
Expand Up @@ -214,6 +214,7 @@ def execute(self, tool, trans, incoming={}, return_job=False, set_output_hid=Tru
# format.
input_ext = 'data' if tool.profile < 16.04 else "input"
input_dbkey = incoming.get( "dbkey", "?" )
preserved_tags = []
for name, data in reversed(inp_data.items()):
if not data:
data = NoneDataset( datatypes_registry=app.datatypes_registry )
Expand All @@ -234,6 +235,9 @@ def execute(self, tool, trans, incoming={}, return_job=False, set_output_hid=Tru
if identifier is not None:
incoming[ "%s|__identifier__" % name ] = identifier

for tag in data.tags:
preserved_tags.append(tag)

# Collect chromInfo dataset and add as parameters to incoming
( chrom_info, db_dataset ) = app.genome_builds.get_chrom_info( input_dbkey, trans=trans, custom_build_hack_get_len_from_fasta_conversion=tool.id != 'CONVERTER_fasta_to_len' )
if db_dataset:
Expand Down Expand Up @@ -303,6 +307,9 @@ def handle_output( name, output, hidden=None ):
trans.sa_session.add( data )
trans.app.security_agent.set_all_dataset_permissions( data.dataset, output_permissions, new=True )

for tag in preserved_tags:
data.tags.append(tag.copy())

# Must flush before setting object store id currently.
# TODO: optimize this.
trans.sa_session.flush()
Expand Down

0 comments on commit 9f4764f

Please sign in to comment.