我的Snakemake管道断言,每当我运行任何规则时,我的代码都会引发一个非零退出代码,即使如果我手动运行相同的代码,我的代码会返回错误代码0,而且当在snakemake中运行时,它可以正常工作。
根据this question的建议,我尝试在snakemake规则中将|| true
附加到外壳命令,将我的规则从如下所示改为
rule rulename:
input:
"input/file"
output:
"output/file"
shell:
"python3.7 scripts/script.py {input} {output}"
至
rule rulename:
input:
"input/file"
output:
"output/file"
shell:
"python3.7 scripts/script.py {input} {output} || true"
然而,当我重新运行流水线时,snakemake仍然出错并说:(exited with non-zero exit code)
,即使最后的|| true
将确保此命令始终返回退出代码0。
snakemake在做什么来导致这种情况呢?作为参考,我使用的是带有python 3.7.0的snakemake 5.5.0,如果相关的话,我使用的服务器是Ubuntu 16.04.5。
发布于 2019-10-01 14:00:51
当我在Snakemake中运行docker而没有将我的userid传播到容器时,我遇到了这个问题。脚本可以运行,但是如果Snakemake不能以用户的身份访问输出,它将返回这个隐秘的错误。
rule helloworld:
output: "output_10/test"
shell:
"""
docker run -v $PWD:/work -w /work someimage somecommand > output_10/test'
"""
(exited with non-zero exit code)
rule helloworld:
output: "output_10/test"
shell:
"""
docker run --user $(id -u):$(id -g) -v $PWD:/work -w /work someimage somecommand > output_10/test'
"""
作品
https://stackoverflow.com/questions/56693699
复制