I am trying to makeblastdb database in snakemake:
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"
I get this error:
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.
What is the problem?
I would touch a file when makeblastdb
completes and use that file as dummy input for the rules that need the blast database. This way you let blast deal with suffixes and accessory files. E.g.
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} ...
"""