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?
Asked
Active
Viewed 63 times
2

SultanOrazbayev
- 14,900
- 3
- 16
- 46

sonderkar
- 21
- 2
1 Answers
1
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.

SultanOrazbayev
- 14,900
- 3
- 16
- 46