以下是一段 Snakemake 脚本:
rule all:
input:
'test.done'
rule pipe:
output:
'test.done'
shell:
"""
seq 1 10000 | head > test.done
"""
出现以下错误:
snakemake -s test.snake
Provided cores: 1
Rules claiming more threads will be scaled down.
Job counts:
count jobs
1 all
1 pipe
2
rule pipe:
output: test.done
jobid: 1
Error in job pipe while creating output file test.done.
RuleException:
CalledProcessError in line 9 of /Users/db291g/Tritume/test.snake:
Command '
seq 1 10000 | head > test.done
' returned non-zero exit status 141.
File "/Users/db291g/Tritume/test.snake", line 9, in __rule_pipe
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 55, in run
Removing output files of failed job pipe since they might be corrupted:
test.done
Will exit after finishing currently running jobs.
Exiting because a job execution failed. Look above for error message
这里的解释返回非零退出状态141似乎表明,snakemake已经捕获了由head
发送的SIGPIPE故障。我认为严格地说,snakemake在捕获故障方面做得很对,但我想知道是否有可能忽略一些类似于这种错误的类型。我有一个使用head
命令的snakemake脚本,我正在尝试找到一种解决这个错误的方法。
set +o pipefail;
来针对特定命令取消激活它。 - Johannes Köster