snakemake list rules to execute in cluster and local

后端 未结 1 485
长发绾君心
长发绾君心 2021-01-29 01:49

I know there is way to declare rules that need to be executed on the local machine using localrules as:

localrules: all, foo

Is there a similar

1条回答
  •  温柔的废话
    2021-01-29 02:25

    I do not think this is supported unfortunately. I checked the snakemake source code, and one way to hack this is do to something like this:

    all_rules = [rule for rule in dir(rules) if not rule.startswith("__")]
    cluster_rules = ["my_cluster_rule1", "my_cluster_rule2"]
    
    workflow._localrules = set(rule for rule in all_rules if rule not in cluster_rules)
    

    I haven't tested it but I think this should work. This way we just overwrite what Snakemake parsed from the document. The problem with doing something like this is that it might not be stable between different snakemake versions.

    0 讨论(0)
提交回复
热议问题