Runner

This module contains the main function for running a pipeline; it is intended to be called from the easylink.cli module.

easylink.runner.main(command, pipeline_specification, input_data, computing_environment, results_dir, images_dir, schema_name='main', debug=False)[source]

Runs an EasyLink command.

This function is used to run an EasyLink job and is intended to be accessed via the easylink.cli module’s command line interface (CLI) commands. It configures the run and sets up the pipeline based on the user-provided specification files and then calls on Snakemake to act as the workflow manager.

Return type:

None

Parameters:
  • command (str) – The command to run. Current supported commands include “run” and “generate_dag”.

  • pipeline_specification (str | Path) – The filepath to the pipeline specification file.

  • input_data (str | Path) – The filepath to the input data specification file (_not_ the paths to the input data themselves).

  • computing_environment (str | Path | None) – The filepath to the specification file defining the computing environment to run the pipeline on. If None, the pipeline will be run locally.

  • results_dir (str | Path) – The directory to write results and incidental files (logs, etc.) to.

  • images_dir (str | None) – The directory containing the images or to download the images to if they don’t exist. If None, will default to ~/.easylink_images.

  • schema_name (str) – The name of the schema to validate the pipeline configuration against.

  • debug (bool) – If False (the default), will suppress some of the workflow output. This is intended to only be used for testing and development purposes.

easylink.runner._run_snakemake_with_filtered_output(argv, results_dir)[source]

Runs Snakemake with simplified log filtering.

Return type:

None

Parameters:
  • argv (list[str]) – Snakemake command line arguments.

  • results_dir (Path) – Directory to save the full Snakemake log.

easylink.runner._filter_snakemake_output(line)[source]

Filter for Snakemake output.

Return type:

str

Parameters:

line (str) – A single line of Snakemake output.

Returns:

The filtered line for display.

easylink.runner._get_singularity_args(config)[source]

Gets the required singularity arguments.

Return type:

str

Parameters:

config (Config)

easylink.runner._get_environment_args(config)[source]

Gets the required environment arguments.

Return type:

list[str]

Parameters:

config (Config)

easylink.runner._save_dag_image(snakefile, results_dir)[source]

Saves the directed acyclic graph (DAG) of the pipeline to an image file.

Return type:

None

easylink.runner.snakefile

The path to the snakefile.

easylink.runner.results_dir

The directory to save the DAG image to.