pipeline.nextflow
pipeline.nextflow
Run Nextflow workflows in local and HPC environments.
- init(output, pipeline_name=‘pipeline’, **kwargs) Initialize the launch directory by copying the system default config files.
- run(nextfile_path=None, nextflow_args=None, mode=“local”, pipeline_name=None, debug=False, hpc_options={}) Run a Nextflow workflow.
Functions
| Name | Description |
|---|---|
| init | Initialize the launch directory by copying the system default config files |
| run | Runs a Nextflow workflow with support for local or SLURM (HPC) execution modes. |
init
pipeline.nextflow.init(output, repo_base, pipeline_name='pipeline')Initialize the launch directory by copying the system default config files
run
pipeline.nextflow.run(
nextfile_path,
mode='local',
force_all=False,
pipeline_name=None,
nextflow_args=None,
debug=False,
hpc=get_hpc(),
hpc_modules='nextflow',
hpc_walltime='1-00:00:00',
hpc_memory='1G',
)Runs a Nextflow workflow with support for local or SLURM (HPC) execution modes.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| nextfile_path | str | Path to the Nextflow workflow file (main.nf), or GitHub repo (CCBR/CHAMPAGNE). | required |
| mode | str | Execution mode, either “local” or “slurm”. Defaults to “local”. | 'local' |
| force_all | bool | If True, disables the Nextflow ‘-resume’ flag to force all processes to rerun. Defaults to False. | False |
| pipeline_name | str | Name of the pipeline for reporting/logging. Defaults to None. | None |
| nextflow_args | list | Additional command-line arguments for Nextflow. Defaults to None. | None |
| debug | bool | If True, prints commands without executing them. Defaults to False. | False |
| hpc | object | HPC environment object, used for SLURM execution and module loading. Defaults to result of ~ccbr_tools.pipeline.hpc.get_hpc(). |
get_hpc() |
| hpc_modules | str | Name(s) of modules to load for Nextflow execution on HPC. Defaults to “nextflow”. | 'nextflow' |
| hpc_walltime | str | Walltime for SLURM job submission. Defaults to “1-00:00:00”. | '1-00:00:00' |
| hpc_memory | str | Memory allocation for SLURM job submission. Defaults to “1G”. | '1G' |
Behavior
- Constructs the Nextflow command with appropriate arguments and profiles.
- Adds or removes the ‘-resume’ flag based on force_all.
- For SLURM mode, generates a SLURM submission script and submits it via sbatch.
- For local mode, optionally loads modules and environment variables before running Nextflow.
- Shows a preview of the pipeline execution before running.
- Executes the constructed command (unless debug is True).
See also
~ccbr_tools.pipeline.hpc.get_hpc: Retrieves the HPC environment object.~ccbr_tools.shell.shell_run: Executes shell commands.~ccbr_tools.templates.use_template: Generates files from templates.