snakemake - Snakemake 5.5.4 中的 ImproperOutputException

标签 snakemake

我是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 版本时,我没有收到该错误

ImproperOutputException in line 10 of /home/FASTQC.snakefile: Outputs of incorrect type (directories when expecting files or vice versa). Output directories must be flagged with directory(). for rule do_fastqc_raw:

最佳答案

我认为您的目录位于规则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))

关于snakemake - Snakemake 5.5.4 中的 ImproperOutputException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57493701/

相关文章:

python - 在snakemake中使用expand()从目录列表中输入任何文件

snakemake 同时使用 --keep-going 和 --stats

python - 如何在 snakemake 输出中执行简单的字符串操作

wildcard - 如何获取snakemake输出规则中通配符值的基本名称?

yaml - Snakemake 在命令行上从嵌套的 config.yaml 文件指定配置参数

python - snakemake:规则的可选输入

snakemake - 具有不同文件名的多个目录上的 glob_wildcards

python - 通配Snakemake规则的预处理

python - 使用 subprocess.run 运行 Snakemake

shell - “通配符”对象没有属性 'output'