Snakemake wildcards in the path input/output

1

Hi everyone,

I wrote a snakefile to check the quality of several fastq files and put the report in a results directory. I thought to use wildcards as explained in the snakemake readthedocs. But it's return an invalid syntax at the first line in the code below. Where I did a mistake? Maybe I should use the aggregation function.

TUMORS, SAMPLES, = glob_wildcards(../Data/{tumor}/{sample}.fastq.gz)

rule all:
    input:
        ["../Data/{tumor}/{sample}.fastq.gz".format(tumor=tumor) for tumor in TUMORS]

rule fastqc_before_trim:
    input:
        "../Data/{tumor}/{sample}.fastq.gz"
    output:
        "../Results/QC/Before_trimming/{tumor}/{sample}_fastqc.html"
    threads:
        4
    shell:
        "fastqc -t {threads} {input} -o {output}"

My working directory is organized as below.

------ Script 
|           |
|           |------Script_01.smk
|           |------Script_02.smk
|
|------Data
|           |
|           |------Tumor_01
|           |           |
|           |           |------Lane01.fastq.gz
|           |           |------Lane02.fastq.gz
|           |------Tumor_02
|                       |
|                       |------Lane01.fastq.gz
|                       |------Lane02.fastq.gz
|
|------Results
|           |
|           |--------QC
|           |        |
|           |        |------Before_Trimming 
|           |        |             |
|           |        |             |------Tumor_01
|           |        |             |             |
|           |        |             |             |------Tumor_01_Lane01_fastqc.html
|           |        |             |             |------Tumor_01_Lane02_fastqc.html
|           |        |             |
|           |        |             |------Tumor_02
|           |        |                           |
|           |        |                           |------Tumor_02_Lane01_fastqc.html
|           |        |                           |------Tumor_02_Lane02_fastqc.html
|           |        |                                        
|           |        |------After_Trimming 
|           |                      |
|           |                      |------Tumor_01
|           |                      |             |
|           |                      |             |------Tumor_01_Lane01_cleaned_fastqc.html
|           |                      |             |------Tumor_01_Lane02_cleaned_fastqc.html
|           |                      |
|           |                      |------Tumor_02
|           |                                    |
|           |                                    |------Tumor_02_Lane01_cleaned_fastqc.html
|           |                                    |------Tumor_02_Lane02_cleaned_fastqc.html
|           |                                                             
|           |------Mapping
|
|

Thank you for your help.


Snakemake

• 128 views



Source link