GATK APPLYBQSR¶
Run gatk ApplyBQSR.
Software dependencies¶
- gatk4 ==4.1.4.1
- openjdk =8
Example¶
This wrapper can be used in the following way:
rule gatk_applybqsr:
input:
bam="mapped/{sample}.bam",
ref="genome.fasta",
dict="genome.dict",
recal_table="recal/{sample}.grp"
output:
bam="recal/{sample}.bam"
log:
"logs/gatk/gatk_applybqsr/{sample}.log"
params:
extra="", # optional
java_opts="", # optional
wrapper:
"0.65.0/bio/gatk/applybqsr"
Note that input, output and log file paths can be chosen freely. When running with
snakemake --use-conda
the software dependencies will be automatically deployed into an isolated environment before execution.
Notes¶
- The java_opts param allows for additional arguments to be passed to the java compiler, e.g. “-Xmx4G” for one, and “-Xmx4G -XX:ParallelGCThreads=10” for two options.
- The extra param allows for additional program arguments for ApplyBSQR.
- For more information see, https://gatk.broadinstitute.org/hc/en-us/articles/360037055712-ApplyBQSR
Authors¶
- Christopher Schröder
- Johannes Köster
- Jake VanCampen
Code¶
__author__ = "Christopher Schröder"
__copyright__ = "Copyright 2020, Christopher Schröder"
__email__ = "christopher.schroeder@tu-dortmund.de"
__license__ = "MIT"
from snakemake.shell import shell
extra = snakemake.params.get("extra", "")
java_opts = snakemake.params.get("java_opts", "")
log = snakemake.log_fmt_shell(stdout=True, stderr=True, append=True)
shell(
"gatk --java-options '{java_opts}' ApplyBQSR {extra} -R {snakemake.input.ref} -I {snakemake.input.bam} "
"--bqsr-recal-file {snakemake.input.recal_table} "
"-O {snakemake.output.bam} {log}"
)