pluto.tools.CWLRunner¶
- class pluto.tools.CWLRunner(cwl_file, input, CWL_ARGS=['--preserve-environment', 'PATH', '--preserve-environment', 'SINGULARITY_CACHEDIR', '--singularity'], print_stdout=False, dir=None, output_dir=None, input_json_file=None, input_is_file=False, verbose=True, testcase=None, engine='cwltool', print_command=False, restart=False, jobStore=None, debug=False, leave_tmpdir=False, leave_outputs=False, parallel=False)[source]¶
class for running a CWL File
- Parameters
cwl_file (str | CWLFile) – CWL file path or CWLFile object to run
input (dict) – data dict to be used as input to the CWL
CWL_ARGS (list) – list of extra command line arguments to include when running the CWL workflow
print_stdout (bool) – whether stdout from the CWL workflow should be printed to console
dir (str) – directory to run the CWL workflow in; if None, a temp dir will be created automatically
output_dir (str) – output directory for the CWL workflow; if None, defaults to ‘output’ inside the dir directory
input_json_file (str) – path to the input.json file to write CWL input data to
input_is_file (bool) – if the input arg should be treated as a pre-made JSON file path and not a Python dict object
verbose (bool) – include descriptive messages in console stdout when running CWL
testcase (unittest.TestCase) – unittest.TestCase object to use when making assertions when running as part of a unit test
engine (str) – run the CWL with cwl-runner (“cwltool”) or Toil (“toil”)
print_command (bool) – print the fully evaluated command to console before running
restart (bool) – enable “restart” or “resume” functionality when running the CWL workflow
jobStore (str) – Toil job store to use when restarting a pipeline
debug (bool) – whether to include the –debug arg with the CWL runner command for extra console output in case of error and debugging
leave_tmpdir (bool) – do not delete the tmp dir after the CWL workflow finishes
leave_outputs (bool) – do not delete the output dir after completion
parallel (bool) – run workflow jobs in parallel; NOTE: make sure all Singularity containers are cached first or it will break
Examples
Example usage:
runner = CWLRunner( cwl_file = "/path/to/tool.cwl", input = cwl_input, dir = "/run/workflow/here", verbose = True) output_json, output_dir, output_json_file = runner.run()
- __init__(cwl_file, input, CWL_ARGS=['--preserve-environment', 'PATH', '--preserve-environment', 'SINGULARITY_CACHEDIR', '--singularity'], print_stdout=False, dir=None, output_dir=None, input_json_file=None, input_is_file=False, verbose=True, testcase=None, engine='cwltool', print_command=False, restart=False, jobStore=None, debug=False, leave_tmpdir=False, leave_outputs=False, parallel=False)[source]¶
- Parameters
cwl_file (str | CWLFile) – CWL file path or CWLFile object to run
input (dict) – data dict to be used as input to the CWL
CWL_ARGS (list) – list of extra command line arguments to include when running the CWL workflow
print_stdout (bool) – whether stdout from the CWL workflow should be printed to console
dir (str) – directory to run the CWL workflow in; if None, a temp dir will be created automatically
output_dir (str) – output directory for the CWL workflow; if None, defaults to ‘output’ inside the dir directory
input_json_file (str) – path to the input.json file to write CWL input data to
input_is_file (bool) – if the input arg should be treated as a pre-made JSON file path and not a Python dict object
verbose (bool) – include descriptive messages in console stdout when running CWL
testcase (unittest.TestCase) – unittest.TestCase object to use when making assertions when running as part of a unit test
engine (str) – run the CWL with cwl-runner (“cwltool”) or Toil (“toil”)
print_command (bool) – print the fully evaluated command to console before running
restart (bool) – enable “restart” or “resume” functionality when running the CWL workflow
jobStore (str) – Toil job store to use when restarting a pipeline
debug (bool) – whether to include the –debug arg with the CWL runner command for extra console output in case of error and debugging
leave_tmpdir (bool) – do not delete the tmp dir after the CWL workflow finishes
leave_outputs (bool) – do not delete the output dir after completion
parallel (bool) – run workflow jobs in parallel; NOTE: make sure all Singularity containers are cached first or it will break
Examples
Example usage:
runner = CWLRunner( cwl_file = "/path/to/tool.cwl", input = cwl_input, dir = "/run/workflow/here", verbose = True) output_json, output_dir, output_json_file = runner.run()
Methods
__init__
(cwl_file, input[, CWL_ARGS, …])- param cwl_file
CWL file path or CWLFile object to run
run
()Run the CWL workflow object