Snakemake与倍数规则全部

时间:2018-05-21 19:56:29

标签: python snakemake

我想在我的规则中输入多个输入,但我不确定如何编码。 这是我的代码:

include:
    'config.py'
rule all:
    input:
        expand(WORK_DIR +"/trimmed/TFB{sample}_R{read_no}.fastq.gz.good",
        sample=SAMPLE_TFB ,read_no=['1', '2']),
        expand(WORK_DIR +"/kallisto/TFB/{sample}", sample=SAMPLE_TFB)
rule fastp:
    input:
        R1= SAMPLES_DIR + "/TFB{sample}_R1.fastq.gz",
        R2= SAMPLES_DIR + "/TFB{sample}_R2.fastq.gz"
    output:
        R1out= WORK_DIR + "/trimmed/TFB{sample}_R1.fastq.gz.good",
        R2out= WORK_DIR + "/trimmed/TFB{sample}_R2.fastq.gz.good"
    shell:
        "fastp -i {input.R1} -I {input.R2} -o {output.R1out} -O {output.R2out}"
rule kallisto_index:
    input:
        file = REF_DIR + "/gencode.v28.transcripts.fa"
    shell:
        "nice -n 19 kallisto index -i {input.file}"
rule kallisto_TFB:
    input:
        index = REF_DIR + "/gencode.v28.transcripts.idx",
        R1trimmed = TRIMMED_DIR + "/TFB{sample}_R1.fastq.gz.good",
        R2trimmed = TRIMMED_DIR + "/TFB{sample}_R2.fastq.gz.good"
    output:
        kall_Out = WORK_DIR + "/kallisto/TFB/{sample}"
    threads: 14
    log: KALLISTO_LOG + "/{sample}"
    shell:
        "nice -n 19 kallisto quant -i {index} -o {output.kallOut} --bias \
        -b 100 --rf-stranded -t {threads} {R1trimmed} {R2trimmed} >& {log}"

当我尝试运行时,我收到此错误:

SyntaxError in line 8 of /work/users/leboralli/trofoZikaLincRNAs/scripts/Snakefile:
Unexpected keyword expand in rule definition (Snakefile, line 8)

我想我并不完全明白规则是如何运作的。 谁能开导我?

1 个答案:

答案 0 :(得分:0)

这样的错误通常是由混合空格和缩进标签引起的。确保只使用空格。