0

我想为 bwa 对齐一些数据创建一个简单的蛇形文件。我在使用通配符和输入时遇到问题

配置.yml

samples:
    432:
      - "432_L001"
      - "432_L002"
units:

  432_L001:
         - "/illumina/RAW/432_CGATGT_L001_R1_001.fastq.gz"
         - "/illumina/RAW/432_CGATGT_L001_R2_001.fastq.gz"

这是snakemake文件和bwa规则

from snakemake.exceptions import MissingInputException

rule bwa_mem:
    input:
        lambda wildcards: config["units"][wildcards.unit]
    output:
        temp("mapped_reads/sam/{unit}.sam")
    params:
        sample=lambda wildcards: UNIT_TO_SAMPLE[wildcards.unit]
        #sample=lambda wildcards: units[wildcards.unit],
        #genome= config["reference"][genome_fasta]
    log:
        "mapped_reads/log/{unit}_bwa_mem.log"
    benchmark:
        "benchmarks/bwa/mem/{unit}.txt"
    threads: 8
    shell:
        '/illumina/software/PROG2/bwa-0.7.15/bwa mem {params.custom} '

        '-t {threads} {params.genome} {input} 2> {log} > {output}'

snakemake --configfile config.yaml  mapped_reads/sam/{unit}.sam
InputFunctionException in line 50 of /illumina/runs/FASTQ/pippo4/rules/bwa_mem.rules:
KeyError: '{unit}'
Wildcards:
unit={unit}

这个分析如何使用通配符?或者管理该配置文件的最佳方法是什么?

4

0 回答 0