以下snakemake腳本:處理SIGPIPE錯誤
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腳本,我試圖找到解決這個錯誤的方法。
是的,Snakemake在默認情況下會設置pipefail,因爲在大多數情況下,這是人們隱含期望的。您可以通過預先設置'set + o pipefail; '給shell命令。 –
謝謝!如果您將其作爲答案發布,我會接受它。 – dariober