gatk3 gatk3 baserecalibrator

gatk3 baserecalibrator

Version:
3.8
Identifier: TL_6ad060_11.80
Tool
1__author__ = "Patrik Smeds"
2__copyright__ = "Copyright 2019, Patrik Smeds"
3__email__ = "patrik.smeds@gmail.com.com"
4__license__ = "MIT"
5
6import os
7
8from snakemake.shell import shell
9from snakemake_wrapper_utils.java import get_java_opts
10
11extra = snakemake.params.get("extra", "")
12java_opts = get_java_opts(snakemake)
13
14input_bam = snakemake.input.bam
15input_known = snakemake.input.known
16input_ref = snakemake.input.ref
17bed = snakemake.params.get("bed", None)
18if bed is not None:
19    bed = "-L " + bed
20else:
21    bed = ""
22
23input_known_string = ""
24for known in input_known:
25    input_known_string = input_known_string + "  --knownSites {}".format(known)
26
27log = snakemake.log_fmt_shell(stdout=True, stderr=True)
28
29shell(
30    "gatk3 {java_opts} -T BaseRecalibrator"
31    " -nct {snakemake.threads}"
32    " {extra}"
33    " -I {input_bam}"
34    " -R {input_ref}"
35    " {input_known_string}"
36    " {bed}"
37    " -o {snakemake.output}"
38    " {log}"
39)
40