9 this_job = arvados.current_job()
10 this_task = arvados.current_task()
11 fasta_path = arvados.util.collection_extract(
12 collection = this_job['script_parameters']['input'],
15 fasta_files = filter(lambda f: f != '.locator', os.listdir(fasta_path))
16 out_dir = os.path.join(arvados.current_task().tmpdir, 'ref-sdf')
17 arvados.util.run_command(['rm', '-rf', out_dir], stderr=sys.stderr)
19 pyrtg.run_rtg('format', out_dir,
20 map(lambda f: os.path.join(fasta_path, f), fasta_files))
22 out = arvados.CollectionWriter()
23 out.write_directory_tree(out_dir, max_manifest_depth=0)
24 this_task.set_output(out.finish())