diff --git a/lib/galaxy/tool_util/cwl/util.py b/lib/galaxy/tool_util/cwl/util.py index 990636db2c4..a4605653f18 100644 --- a/lib/galaxy/tool_util/cwl/util.py +++ b/lib/galaxy/tool_util/cwl/util.py @@ -171,6 +171,8 @@ def galactic_job_json( return replacement_record(value) def replacement_file(value): + if value.get('galaxy_id'): + return {"src": "hda", "id": value['galaxy_id']} file_path = value.get("location", None) or value.get("path", None) # format to match output definitions in tool, where did filetype come from? filetype = value.get("filetype", None) or value.get("format", None) @@ -278,6 +280,8 @@ def galactic_job_json( return collection_element_identifiers def replacement_collection(value): + if value.get('galaxy_id'): + return {"src": "hdca", "id": value['galaxy_id']} assert "collection_type" in value collection_type = value["collection_type"] elements = to_elements(value, collection_type) @@ -328,9 +332,10 @@ def _ensure_file_exists(file_path): class FileLiteralTarget: - def __init__(self, contents, **kwargs): + def __init__(self, contents, path=None, **kwargs): self.contents = contents self.properties = kwargs + self.path = path def __str__(self): return "FileLiteralTarget[path={}] with {}".format(self.path, self.properties)