Ruffus Decorators

Note

See also:

Basic

Decorator Examples  

@follows

 

@files (see Manual)

  • I/O parameters
  • skips up-to-date jobs
  • @files( parameter_list )

  • @files( parameter_generating_function )

  • @files ( input_file, output_file, other_params, ... )

 

Core

Decorator Examples  

@split (see Manual)

  • Splits a single input into multiple output
  • Globs in output can specify an indeterminate number of files.
  • @split ( tasks_or_file_names, output_files, [extra_parameters,...] )

 

@transform (see Manual)

  • Applies the task function to transform input data to output.
  • @transform ( tasks_or_file_names, suffix(suffix_string), output_pattern, [extra_parameters,...] )

  • @transform ( tasks_or_file_names, regex(regex_pattern), output_pattern, [extra_parameters,...] )

 

@merge (see Manual)

  • Merges multiple input files into a single output.
  • @merge (tasks_or_file_names, output, [extra_parameters,...] )

 

@posttask

 

Advanced

Decorator Examples  

@collate (See Manual here and here)

  • Groups multiple input files using regular expression matching
  • Input resulting in the same output after substitution will be collated together.
  • @collate (tasks_or_file_names, regex(regex_pattern), output_pattern, [extra_parameters,...] )

  • @collate (tasks_or_file_names, regex(regex_pattern), inputs | add_inputs(input_pattern), output_pattern, [extra_parameters,...] )

 

@transform (Manual)

  • Infers input as well as output from regular expression substitutions
  • Useful for adding additional file dependencies
 

@split (see Manual)

  • Splits multiple input each further into many more output
  • Globs in output can specify an indeterminate number of files.
 

@jobs_limit (see Manual)

  • Limits the amount of multiprocessing for the specified task
  • Ensures that fewer than N jobs for this task are run in parallel
  • Overrides multiprocess parameter in pipeline_run(...)
 

Esoteric!

Decorator Examples  

@parallel

  • By default, does not check if jobs are up to date
  • Best used in conjuction with @check_if_uptodate
 

@check_if_uptodate (see Manual)

  • Custom function to determine if jobs need to be run
 

Tip

The use of this overly complicated function is discouraged.

@files_re

  • I/O file names via regular expressions
  • start from lists of file names or glob results
  • skips up-to-date jobs
  • @files_re ( tasks_or_file_names, matching_regex, [input_pattern,] output_pattern, ... )

    input_pattern/output_pattern are regex patterns used to create input/output file names from the starting list of either glob_str or file names