Search code examples
pythonpython-3.xsnakemakedirected-acyclic-graphs

Multiline ruleorder in Snakemake


I have 3 rules and their names are somewhat long. When using ruleorder, the line goes over my desired 80 character limit. Is it possible break up the ruleorder into multiple lines in such a way that the behaviour is exactly the same as if I wrote it all in one line?

Example:

ruleorder: long_rule_1 > long_rule_2 > long_rule_3

I would like to reformat it into something like this:

ruleorder: (
    long_rule_1 
    > long_rule_2 
    > long_rule_3
)

Solution

  • After looking at ways to do this, I believe the best way is pretty simple:

    ruleorder:
        long_rule_1
        > long_rule_2
        > long_rule_3
    

    The other answers are good too, but this is the one that I'm using