Snakefile 996 Bytes
Newer Older
Kenzo-Hugo Hillion's avatar
Kenzo-Hugo Hillion committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
__bedtools_bamtofastq_pairs_bedtools_exec_command = config.get(
    'bedtools_bamtofastq_pairs', {}
).get('bedtools_exec_command', 'bedtools')
__bedtools_bamtofastq_pairs_modules = config.get('bedtools_bamtofastq_pairs', {}).get('modules')

rule bedtools_bamtofastq_pairs:
    input:
        __bedtools_bamtofastq_pairs_input
    output:
        forward = __bedtools_bamtofastq_pairs_output_forward,
        reverse = __bedtools_bamtofastq_pairs_output_reverse
    params:
        exec_command = __bedtools_bamtofastq_pairs_bedtools_exec_command,
        modules = __bedtools_bamtofastq_pairs_modules
    run:
        command = []
        if params.modules:
        	command.append("module load {params.modules}")
        command.append(
            "{params.exec_command} bamtofastq -i {input} -fq {output.forward}.fastq -fq2 {output.reverse}.fastq"
        )
        command.append("gunzip {output}_1.fastq")
        command.append("gunzip {output}_2.fastq")
        shell(" && ".join(command))