Snakemake“ X秒后丢失文件”错误

问题描述 投票:0回答:1

每次尝试运行snakemake脚本时,我都会收到以下错误:

    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

snakefile如下:

 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}
        """

目前,我仅在一个文件上运行管道,但是yaml文件如果是intest,则如下所示:

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

我知道当您在snakemake中使用某些标志时会发生错误,但我不相信我正在使用这些标志。提交来运行snakefile的命令是:

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

我已经尝试过-F标志来强制重新运行,但这似乎无济于事,就像增加--latency-wait数一样。任何帮助都将被申请:)

python pipeline snakemake
1个回答
0
投票

在规则pear中,我认为您想使用shell指令而不是run。使用run,您将执行python代码,在这种情况下,由于您只是简单地“执行”字符串,因此不会执行任何操作,因此不会出现错误,也不会产生文件。

© www.soinside.com 2019 - 2024. All rights reserved.