wfcommons.wfbench
wfcommons.wfbench.bench
wfcommons.wfbench.translator.nextflow
- class wfcommons.wfbench.translator.nextflow.NextflowTranslator(workflow: Workflow | Path, logger: Logger | None = None)
Bases:
Translator
A WfFormat parser for creating Nextflow workflow applications.
- Parameters:
workflow (Union[Workflow, pathlib.Path],) – Workflow benchmark object or path to the workflow benchmark JSON instance.
logger (Logger) – The logger where to log information/warning or errors (optional).
- _abc_impl = <_abc._abc_data object>
- static _create_task_script(output_folder: Path, task: Task)
Generate the bash script for invoking a task.
- Parameters:
output_folder (pathlib.Path) – The path to the output folder.
task (Task) – The task.
- Returns:
The code.
- Return type:
str
- _create_workflow_script(tasks: list[Task])
Create the Nextflow script.
- Parameters:
tasks (list[Task]) – The (sorted) list of tasks.
- _generate_arg_parsing_code()
Generate the code to parse command-line argument.
- Returns:
The code.
- Return type:
str
- _generate_task_code(task: Task) str
Generate the code for a task, as a Nextflow process.
- Parameters:
task (Task) – The task.
- Returns:
The code.
- Return type:
str
- _generate_task_function(task: Task) str
Generate the code for a starting a task’s Nextflow process, as a Nextflow function.
- Parameters:
task (Task) – The task.
- Returns:
The code.
- Return type:
str
- _generate_workflow_code(sorted_tasks: List[Task]) str
Generate the code for the workflow.
- Parameters:
sorted_tasks (List[Task]) – The task.
- Returns:
The code.
- Return type:
str
- _get_tasks_in_topological_order() List[Task]
Sort the workflow tasks in topological order.
- Returns:
A sorted list of tasks.
- Return type:
List[Task]
- _write_readme_file(output_folder: Path) None
Write the README file.
- Parameters:
output_folder (pathlib.Path) – The path of the output folder.
- translate(output_folder: Path) None
Translate a workflow benchmark description(WfFormat) into a Nextflow workflow application.
- Parameters:
output_folder (pathlib.Path) – The path to the folder in which the workflow benchmark will be generated.