Snakemake基本问题

时间:2018-10-03 16:44:34

标签: snakemake

我试图在本地计算机上运行Snakemake命令。即使我使用了最简单的代码结构,它也不起作用,就像这样:

rule fastqc_raw:
input:
    "raw/A.fastq"
output:
    "output/fastqc_raw/A.html"
shell:
    "fastqc {input} -o {output} -t 4"

它显示了此错误:

Error in rule fastqc_raw:
jobid: 1
output: output/fastqc_raw/A.html   RuleException: CalledProcessError in line 13 of
/Users/01/Desktop/Snakemake/Snakefile: Command ' set -euo pipefail; 
fastqc raw/A.fastq -o output/fastqc_raw/A.html -t 4 ' returned
non-zero exit status 2.   File
"/Users/01/Desktop/Snakemake/Snakefile", line 13, in __rule_fastqc_raw
File "/Users/01/miniconda3/lib/python3.6/concurrent/futures/thread.py",line 56, in run

但是,snakemake程序确实创建了看上去正常的DAG文件,并且当我使用“ snakemake --np”命令时,它没有显示任何错误。

我也确实使用相同的命令在没有Snakemake的情况下在本地运行了fastqc,并且效果很好。

我希望有人可以帮助我

谢谢!!

3 个答案:

答案 0 :(得分:0)

Snakemake似乎完成了工作。它运行了命令:

fastqc raw/A.fastq -o output/fastqc_raw/A.html -t 4 

但是命令返回了错误:

Command ' set -euo pipefail; 
fastqc raw/A.fastq -o output/fastqc_raw/A.html -t 4 ' returned
non-zero exit status 2.

调试的下一步是手动运行fastqc命令以查看是否提供错误。

答案 1 :(得分:0)

我希望您现在已经得到答案,但是我有完全相同的问题,所以我将提供解决方案。

错误出在

shell: "fastqc {input} -o {output} -t 4"

FastQC标志-o期望输出目录,并且您已经为其指定了输出文件。您的代码应为:

shell: "fastqc {input} -o output/fastqc_raw/ -t 4"

您的错误与以下事实有关:输出文件已输出到其他位置(很可能是输入目录),并且规则all:结果失败。

此外,如果尚未创建目录,则FastQC会给出错误消息,因此您需要先执行该操作。

奇怪的是,我见过在fastqc shell中没有-o标志的Snakemake脚本,并且运行良好,但是我并不幸运。

答案 2 :(得分:0)

附加说明:我可以看到您在那里使用了 4 个带有“-t 4”参数的线程。您应该指定此项,以便 Snakemake 为其提供 4 个线程,否则我相信它将以 1 个线程运行并且可能由于内存不足而失败。可以这样做:

rule fastqc_raw:
input:
    "raw/A.fastq"
output:
    "output/fastqc_raw/A.html"
threads: 4
shell:
    "fastqc {input} -o {output} -t 4"