我的 Snakemake 管道断言,每当我运行任何规则时,我的代码都会引发非零退出代码,即使我的代码在我手动运行相同的代码时返回错误代码 0,并且在 Snakemake 中运行时它可以正常工作。
根据建议这个问题 https://stackoverflow.com/questions/45613881/what-would-be-an-elegant-way-of-preventing-snakemake-from-failing-upon-shell-r-e,我尝试附加|| true
到snakemake规则中的shell命令,将我的规则从看起来像这样
rule rulename:
input:
"input/file"
output:
"output/file"
shell:
"python3.7 scripts/script.py {input} {output}"
to
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 做了什么导致这种情况?作为参考,我使用 Snakemake 5.5.0 和 python 3.7.0,并且我使用的服务器有 Ubuntu 16.04.5(如果相关的话)。
我在 Snakemake 中运行 docker 时遇到了这个问题,而没有将我的用户 ID 传播到容器。该脚本可以运行,但如果 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'
"""
works
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)