Snakemake “Missing files after X seconds” error

▼魔方 西西 提交于 2020-01-16 12:00:11

问题


I am getting the following error every time I try to run my snakemake script:

    Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 16
Rules claiming more threads will be scaled down.
Job counts:
        count   jobs
        1       pear
        1

[Wed Dec  4 17:32:54 2019]
rule pear:
    input: Unmap_41_1.fastq, Unmap_41_2.fastq
    output: merged_reads/Unmap_41.fastq
    jobid: 0
    wildcards: sample=Unmap_41, extension=fastq

Waiting at most 120 seconds for missing files.
MissingOutputException in line 14 of /faststorage/project/ABR/scripts/antismash.smk:
Missing files after 120 seconds:
merged_reads/Unmap_41.fastq
This might be due to filesystem latency. If that is the case, consider to increase the wait time with --latency-wait.
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message

The snakefile is the following:

 workdir: config["path_to_files"]
wildcard_constraints:
    separator = config["separator"],
    extension = config["file_extension"],
    sample = '|' .join(config["samples"])

rule all:
    input:
        expand("antismash-output/{sample}/{sample}.txt", sample = config["samples"])

# merging the paired end reads (either fasta or fastq) as prodigal only takes single end reads
rule pear:
    input:
        forward = f"{{sample}}{config['separator']}1.{{extension}}",
        reverse = f"{{sample}}{config['separator']}2.{{extension}}"

    output:
        "merged_reads/{sample}.{extension}"

    #conda:
        #"/home/lamma/env-export/antismash.yaml"

    run:
        """
        set+u; source activate antismash; set -u ;
        pear -f {input.forward} -r {input.reverse} -o {output} -t 21
        """

# If single end then move them to merged_reads directory
rule move:
    input:
        "{sample}.{extension}"

    output:
        "merged_reads/{sample}.{extension}"

    shell:
        "cp {path}/{sample}.{extension} {path}/merged_reads/"

# Setting the rule order on the 3 above rules which should be treated equally and only one run.
ruleorder: pear > move
# annotating the metagenome with prodigal#. Can be done inside antiSMASH but prefer to do it out
rule prodigal:
    input:
        f"merged_reads/{{sample}}.{config['file_extension']}"

    output:
        gbk_files = "annotated_reads/{sample}.gbk",
        protein_files = "protein_reads/{sample}.faa"

    #conda:
        #"/home/lamma/env-export/antismash.yaml"

    shell:
        """
        set+u; source activate antismash; set -u ;
        prodigal -i {input} -o {output.gbk_files} -a {output.protein_files} -p meta
        """

# running antiSMASH on the annotated metagenome
rule antiSMASH:
    input:
        "annotated_reads/{sample}.gbk"

    output:
        touch("antismash-output/{sample}/{sample}.txt")

    #conda:
        #"/home/lamma/env-export/antismash.yaml"

    shell:
        """
        set+u; source activate antismash; set -u ;
        antismash --knownclusterblast --subclusterblast --full-hmmer --smcog --outputfolder antismash-output/{wildcards.sample}/ {input}
        """

I am running the pipeline on only one file at the moment but the yaml file looks like this if it is of intest:

file_extension: fastq
path_to_files: /home/lamma/ABR/Each_reads
samples:
- Unmap_41
separator: _

I know the error can occure when you use certain flags in snakemake but I dont believe I am using those flags. The command being submited to run the snakefile is:

snakemake --latency-wait 120 --rerun-incomplete --keep-going --jobs 99 --cluster-status 'python /home/lamma/ABR/scripts/slurm-status.py' --cluster 'sbatch  -t {cluster.time} --mem={cluster.mem} --cpus-per-task={cluster.c} --error={cluster.error}  --job-name={cluster.name} --output={cluster.output}' --cluster-config antismash-config.json --configfile yaml-config-files/antismash-on-rawMetagenome.yaml -F --snakefile antismash.smk

I have tried to -F flag to force a rerun but this seems to do nothing, as does increasing the --latency-wait number. Any help would be appriciated :)


回答1:


In rule pear I think you want to use the shell directive instead of run. With run you execute python code which in this case does nothing as you simply "execute" a string so you get no error and no file produced.



来源:https://stackoverflow.com/questions/59191168/snakemake-missing-files-after-x-seconds-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!