【发布时间】:2022-07-28 11:45:18
【问题描述】:
当我在 snakemake 中使用 run 指令(使用 python 代码)时,它不会产生任何类型的错误消息以进行故障排除。 这是期望的行为吗?我错过了什么吗?
这是一个使用snakemake 7.8.3 和python 3.9.13 的最小示例。
我使用-p 选项调用了snakemake,该选项在shell 指令中输出传递给shell 的确切代码(但我猜对run 指令没有做任何事情)。
蛇文件:
def useless_function():
return[thisVariableAlsoDoesntExist]
rule all:
input: \"final.txt\"
rule test:
output: \"final.txt\"
run:
print(thisVariableDoesNotExist)
useless_function()
标准输出:
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Job stats:
job count min threads max threads
----- ------- ------------- -------------
all 1 1 1
test 1 1 1
total 2 1 1
Select jobs to execute...
[Mon Jul 25 18:59:13 2022]
rule test:
output: final.txt
jobid: 1
reason: Missing output files: final.txt
resources: tmpdir=/tmp
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2022-07-25T185913.188760.snakemake.log
预期的错误消息(当函数和打印命令直接在 python 控制台上执行时):
>>> print(thisVariableDoesNotExist)
Traceback (most recent call last):
File \"<stdin>\", line 1, in <module>
NameError: name \'thisVariableDoesNotExist\' is not defined
>>> useless_function()
Traceback (most recent call last):
File \"<stdin>\", line 1, in <module>
File \"<stdin>\", line 2, in useless_function
NameError: name \'thisVariableAlsoDoesntExist\' is not defined
标签: python python-3.x error-handling snakemake