一个输入文件产生多个输出文件

发布于 2025-01-10 16:05:05 字数 178 浏览 4 评论 0原文

这是 Snakemake 的一种向后方法,其主要范例是“一项工作 -> 一项输出”,但我需要在 slurm 批处理作业提交集群上的同一输入矩阵上并行重新运行我的脚本。我该如何实现这一目标?

我尝试指定多个线程、多个节点,每次都指示每个任务一个 cpu,但它从不提交一组包含许多作业的数组,而只是提交一组包含一个作业的数组。

This is a bit of a backwards approach to snakemake whose main paradigm is "one job -> one output", but i need many reruns in parallel of my script on the same input matrix on the slurm batch job submission cluster. How do I achieve that?

I tried specifying multiple threads, multiple nodes, each time indicating one cpu per task, but it never submits an array of many jobs, just an array of one job.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁与争疯 2025-01-17 16:05:05

我认为没有一个好的方法来提交这样的数组作业。在snakemake中,您需要为每个作业指定唯一的输出。但你可以有相同的输入。如果您想要运行 1000 次作业:

ids = range(1000)
rule all:
    input: expand('output_{sample}_{id}', sample=samples, id=ids)

rule simulation:
    input: 'input_{sample}'
    output: 'output_{sample}_{id}'
    shell: echo {input} > {output}

如果这没有帮助,请提供有关您尝试运行的规则/作业的更多信息。

I don't think there is a nice way to submit an array job like that. In snakemake, you need to specify a unique output for each job. But you can have the same input. If you want 1000 runs of a job:

ids = range(1000)
rule all:
    input: expand('output_{sample}_{id}', sample=samples, id=ids)

rule simulation:
    input: 'input_{sample}'
    output: 'output_{sample}_{id}'
    shell: echo {input} > {output}

If that doesn't help, provide more information about the rule/job you are trying to run.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文