Rule-specific scattergather directive

76 views Asked by At

In the Snakemake documentation on defining scatter gather rules, the scattergather directive is set globally. Is it possible to set the specific value for each rule? For example, rule a splits into 8, and rule b split into 4?

1

There are 1 answers

0
SultanOrazbayev On

It's possible to define custom names for specific scatter-gather processes, e.g.:

scattergather:
    split_a=8,
    split_b=4,

Where you would use scatter.split, use scatter.split_a or scatter.split_b, and similarly replace gather.split. A full example Snakefile is provided here.

Edit: note that there is currently a bug in snakemake as of 7.12.0) that doesn't handle this case properly. There is a fix available in this PR, but it might take some time before it's integrated into the main version.

Edit: to use this feature, make sure that your snakemake is updated to version 7.12.1 or later.