<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, <NAME>"
__email__ = "<EMAIL>"
__license__ = "MIT"

import os
import re
from snakemake.shell import shell
from snakemake.utils import logger

log = snakemake.log_fmt_shell(stdout=True, stderr=True)
config = snakemake.config

targets = snakemake.input.get("targets", "")
targets = f" -L {targets}" if targets else ""

gatk = "GATK"
options = snakemake.params.get("options", "")
java_opts = snakemake.params.get("java_opts", "")
annotation = snakemake.params.get("annotation", [])

ref = f"-R {snakemake.input.ref} "
db = "-V gendb://{}".format(snakemake.input.db)
annotation_opt = [f"--annotation {a}" for a in annotation]


if "mem_mb" in snakemake.resources.keys():
    java_opts += " -Xmx{}M".format(str(snakemake.resources["mem_mb"]))

shell(
    "gatk --java-options '{java_opts}' GenotypeGVCFs {options} "
    "{ref} {targets} {annotation_opt} --include-non-variant-sites true "
    "-O {snakemake.output.vcf} {db} {log}"
)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, <NAME>"
__email__ = "<EMAIL>"
__license__ = "MIT"

import os
import re
from snakemake.shell import shell
from snakemake.utils import logger

log = snakemake.log_fmt_shell(stdout=True, stderr=True)
config = snakemake.config

targets = snakemake.input.get("targets", "")
targets = f" -L {targets}" if targets else ""

gatk = "GATK"
options = snakemake.params.get("options", "")
java_opts = snakemake.params.get("java_opts", "")
annotation = snakemake.params.get("annotation", [])

ref = f"-R {snakemake.input.ref} "
db = "-V gendb://{}".format(snakemake.input.db)
annotation_opt = [f"--annotation {a}" for a in annotation]


if "mem_mb" in snakemake.resources.keys():
    java_opts += " -Xmx{}M".format(str(snakemake.resources["mem_mb"]))

shell(
    "gatk --java-options '{java_opts}' GenotypeGVCFs {options} "
    "{ref} {targets} {annotation_opt} --include-non-variant-sites true "
    "-O {snakemake.output.vcf} {db} {log}"
)
#!/usr/bin/env python3 # -*- coding: utf-8 -*-