From bc6e7472ba6054b13422fd0d93f848e0fb8f42c7 Mon Sep 17 00:00:00 2001 From: Matthijs van der Wild <matthijs.van-der-wild@durham.ac.uk> Date: Fri, 21 Jun 2024 19:56:22 +0000 Subject: [PATCH] Write results to cwl.output.json to bypass size restrictions --- steps/filter_ms_group.cwl | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/steps/filter_ms_group.cwl b/steps/filter_ms_group.cwl index 73ae7909..83c41c61 100644 --- a/steps/filter_ms_group.cwl +++ b/steps/filter_ms_group.cwl @@ -21,19 +21,16 @@ outputs: - id: output type: Directory[] outputBinding: - loadContents: true - glob: 'selected_ms.json' - outputEval: '$(JSON.parse(self[0].contents))' + glob: $(runtime.outdir)/cwl.output.json + outputEval: $(self.output) - id: selected_ms type: string[] outputBinding: - loadContents: true - glob: 'out.json' - outputEval: $(JSON.parse(self[0].contents).selected_ms) + glob: $(runtime.outdir)/cwl.output.json + outputEval: $(self.selected_ms) label: filter_ms_group requirements: - - class: InlineJavascriptRequirement - class: InitialWorkDirRequirement listing: - entryname: filter_ms_group.py @@ -50,23 +47,18 @@ requirements: ms_by_name = { ms.split(os.path.sep)[-1]: {'class':'Directory', 'path': ms} for ms in ms_list} - output_file = 'selected_ms.json' - with open(json_file, 'r') as f_stream: selected_ms = json.load(f_stream)[group_id] selected_ms = [os.path.basename(ms_name) for ms_name in selected_ms] - cwl_output = {'selected_ms': selected_ms} + selected_ms_names = [ms_by_name[ms_name] for ms_name in selected_ms + if ms_name != 'dummy.ms'] + cwl_output = {'selected_ms': selected_ms, + 'output': selected_ms_names} - with open('./out.json', 'w') as fp: + with open('./cwl.output.json', 'w') as fp: json.dump(cwl_output, fp) - selected_ms = [ms_by_name[ms_name] for ms_name in selected_ms if ms_name != 'dummy.ms'] - - - with open(output_file, 'w') as f_stream: - json.dump(selected_ms, f_stream) - hints: - class: InitialWorkDirRequirement listing: -- GitLab