首页 > 解决方案 > snakemake 5.5.4 中的不正确输出异常

问题描述

我是snakemake的新手,最近我遇到了一个新错误,我只能从最新版本的snakemake中得到。这是我的蛇制造规则

rule fastqc_raw:
    input:
        expand(directory("{fastqc_dir}/{samples}_fastqc/"),fastqc_dir = FASTQC_DIR, samples = SAMPLES_wo_extension)

rule do_fastqc_raw:
    input:
        expand("{fastq_dir}/{{samples}}.fastq.gz", fastq_dir =  inputDir)
    output:
        expand(directory("{fastqc_dir}/{{samples}}_fastqc/"),fastqc_dir = FASTQC_DIR)
    log:
        expand("{fastqc_dir}/{{samples}}.log", fastqc_dir = FASTQC_DIR)
    threads:
        10
    message:
        "performing fastQC of the sample : {wildcards.samples}"
    shell:
        """mkdir -p {output} && fastqc -q -t {threads} --outdir {output} --contaminants /home/Contaminants/idot.txt {input} 2> {log}"""

当我使用低于 5.2.0 的 snakemake 版本时,我收到以下错误

/home/FASTQC.snakefile 第 10 行中的 ImproperOutputException:输出类型不正确(期望文件时的目录,反之亦然)。输出目录必须用 directory() 标记。对于规则 do_fastqc_raw:

标签: snakemake

解决方案


我认为您directory在规则中处于错误的位置do_fastqc_raw

这个:

output:
    expand(directory("{fastqc_dir}/{{samples}}_fastqc/"),fastqc_dir = FASTQC_DIR)

应该:

output:
    directory(expand("{fastqc_dir}/{{samples}}_fastqc/", fastqc_dir = FASTQC_DIR))

推荐阅读