有可能在 Snakefile 中覆盖的默认内存请求?

Default memory request with possibility of override in a Snakefile?

我有一个包含多个规则的 Snakefile,集群上只有少数需要超过 1 GB/core 到 运行。 resources 指令对此非常有用,但我找不到设置默认值的方法。我宁愿不必为每个不需要超过默认值的规则编写 resources: mem_per_cpu = 1024

我意识到我可以在 cluster config file 中使用 __default__ 并覆盖特定规则的 mem_per_cpu 值来获得我想要的东西。我犹豫是否要这样做,因为内存要求与平台无关,所以我更愿意将它们包含在 Snakefile 本身中。它还会阻止我使用 --resources 命令行选项指定本地资源限制。

是否有一个简单的 Snakemake 解决方案可以帮助我解决这个问题?谢谢!

我在阅读 Snakemake 的 changelog 时遇到了这个:

Add –default-resources flag, that allows to define default resources for jobs (e.g. mem_mb, disk_mb), see docs.