snakemake yaml配置为配对bwa对齐

时间:2017-07-25 13:13:40

标签: snakemake

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

config.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}

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

0 个答案:

没有答案