我正在尝试在snakemake中建立makeblastdb数据库:
workdir: "/path/to/workdir/"
(SAMPLES,) =glob_wildcards('/path/to/workdir/{sample}.fasta')
rule all:
input:
expand("{sample}.fasta.{ext}", sample=SAMPLES, ext=["nhr", "nin", "nsq"])
rule makeblastdb:
input:
reference = "/path/to/workdir/{sample}.fasta"
output:
out = "{sample}.fasta.{ext}"
shell:
/Tools/ncbi-blast-2.9.0+/bin/makeblastdb -in {input.reference} -out {output.out} -dbtype nucl"
我收到此错误:
MissingOutputException in line 11:
Missing files after 10 seconds:
This might be due to filesystem latency. If that is the case, consider to increase the wait time with --latency-wait.
出什么问题了?
答案 0 :(得分:2)
正如您在注释中指出的那样,您不知道输出了多少文件。有两种选择:
未经测试,但可能会起作用:
规则makeblastdb: 输入: 参考=“ /path/to/workdir/{sample}.fasta” 输出: out =“ {sample} .fasta。{ext}” 贝壳: /Tools/ncbi-blast-2.9.0+/bin/makeblastdb -in {input.reference} -out {output.out} -dbtype nucl“
在这里,我们将输出标记为名为sample-ext的输出目录,而ncbi-blast的输出将在此目录中称为sample.ext。
修改:
如果我们不希望所有这些输出目录,我们可以做的就是说,我们期望至少有1个输出,如果存在,则假定一切正常:
rule makeblastdb:
input:
reference = "/path/to/workdir/{sample}.fasta"
output:
out = "{sample}.fasta.00.{ext}
shell:
/Tools/ncbi-blast-2.9.0+/bin/makeblastdb -in {input.reference} -out {wildcards.sample}.fasta.{wildcards.ext} -dbtype nucl"
答案 1 :(得分:2)
makeblastdb
完成后,我将触摸一个文件,并将该文件用作需要blast数据库的规则的虚拟输入。这样,您就可以让blast处理后缀和附件文件。例如
rule makeblastdb:
input:
reference = "/path/to/workdir/{sample}.fasta",
output:
done = touch("{sample}.makeblastdb.done"),
shell:
r"""
/Tools/ncbi-blast-2.9.0+/bin/makeblastdb -in {input.reference} -out {wildcards.sample} -dbtype nucl"
"""
rule blast:
input:
db_done= "{sample}.makeblastdb.done",
...
output:
...
shell:
r"""
blast -db {wildcards.sample} ...
"""