首页 > 解决方案 > Snakefile 中没有扩展的硬编码输出

问题描述

我的 Snakefile 如下:

SAMPLES, = glob_wildcards("data/{sample}_R1.fq.gz")
rule all: 
    input:
        expand("samtools_sorted_out/{sample}.raw.snps.indels.g.vcf", sample=SAMPLES), 
        expand("samtools_sorted_out/combined_gvcf")
rule combine_gvcf:
    input: "samtools_sorted_out/{sample}.raw.snps.indels.g.vcf"
    output:directory("samtools_sorted_out/combined_gvcf")
    params: gvcf_file_list="gvcf_files.list",
            gatk4="/storage/anaconda3/envs/exome/share/gatk4-4.1.0.0-0/gatk-package-4.1.0.0-local.jar"
    shell:"""
        java -DGATK_STACKTRACE_ON_USER_EXCEPTION=true \
            -jar {params.gatk4} GenomicsDBImport \
            -V {params.gvcf_file_list} \
            --genomicsdb-workspace-path {output}
       """

当我用空运行测试它时,我得到了错误:

RuleException in line 335 of /data/yifangt/exomecapture/Snakefile:
Wildcards in input, params, log or benchmark file of rule combine_gvcf cannot be determined from output files:
'sample'

有两个地方需要帮助:

  1. {output} 是将由 shell 部分创建的文件夹;
  2. {output} 文件夹是命令行手动要求的硬编码(并且内容提前未知)。

与 {input} 相比,问题似乎在于没有扩展的 {output}。我应该如何处理这种情况?非常感谢!

标签: outputdirectorysnakemakeexpansion

解决方案


推荐阅读