首页 > 解决方案 > 如何在不使用 {output} 的情况下让 Snakemake 确认远程文件

问题描述

感谢您继续为 Snakemake 付出如此多的努力!

snakemake  --no-shared-fs --default-remote-provider S3 --default-remote-prefix mybucket hellos3

所以这对我不起作用(MissingOutputException)

rule hellos3:
    output: "hello_s3.txt"
    shell:
        """
        echo "hello world" > hello_s3_tmp.txt
        aws s3 cp hello_s3_tmp.txt s3://mybucket/hello_s3.txt
        """

但这有效:

rule hellos3:
    output: "hello_s3.txt"
    shell:
        """
        echo "hello world" > hello_s3_tmp.txt
        cp hello_s3_tmp.txt {output}
        """

我怎样才能说服 Snakemake 文件出现在它们应该出现的位置,而不必让 Snakemake 将它们放在那里?如果某个远程进程将它们放在那里怎么办?

标签: amazon-s3snakemake

解决方案


touch作品

rule hellos3:
    output: "hello_s3.txt"
    shell:
        """
        echo "hello world" > hello_s3_tmp.txt
        aws s3 cp hello_s3_tmp.txt s3://mybucket/hello_s3.txt && touch {output}
        """

推荐阅读