-
Notifications
You must be signed in to change notification settings - Fork 4
/
wrapper.py
37 lines (30 loc) · 883 Bytes
/
wrapper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
__author__ = "Dohoon Lee"
__copyright__ = "Copyright 2018, Dohoon Lee"
__email__ = "dohlee.bioinfo@gmail.com"
__license__ = "MIT"
from os import path
from snakemake.shell import shell
# Extract log.
log = snakemake.log_fmt_shell(stdout=False, stderr=True)
# Extract parameters.
extra = snakemake.params.get('extra', '')
java_options = '--java-options ' + snakemake.params.get('java_options', '-Xmx32g')
# Extract required arguments.
input = snakemake.input.bam
reference = snakemake.input.reference
recalibration_table = snakemake.input.recalibration_table
output = snakemake.output[0]
# Execute shell command.
shell(
"("
"gatk "
"{java_options} "
"ApplyBQSR "
"--input {input} "
"--reference {reference} "
"--bqsr-recal-file {recalibration_table} "
"--output {output} "
"{extra}"
")"
"{log}"
)