.. _`bio/bcftools/call`: BCFTOOLS CALL ============= .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/bcftools/call?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/bcftools/call Call variants with `bcftools call`. **URL**: http://www.htslib.org/doc/bcftools.html#call Example ------- This wrapper can be used in the following way: .. code-block:: python rule bcftools_call: input: pileup="{sample}.pileup.bcf", output: calls="{sample}.calls.bcf", params: uncompressed_bcf=False, caller="-m", # valid options include -c/--consensus-caller or -m/--multiallelic-caller extra="--ploidy 1 --prior 0.001", log: "logs/bcftools_call/{sample}.log", wrapper: "v3.0.1/bio/bcftools/call" Note that input, output and log file paths can be chosen freely. When running with .. code-block:: bash snakemake --use-conda the software dependencies will be automatically deployed into an isolated environment before execution. Notes ----- * The `uncompressed_bcf` param allows to specify that a BCF output should be uncompressed (ignored otherwise). * The `extra` param allows for additional program arguments (not `--threads`, `-o/--output`, or `-O/--output-type`). Software dependencies --------------------- * ``bcftools=1.18`` * ``snakemake-wrapper-utils=0.6.2`` Authors ------- * Johannes Köster * Michael Hall * Filipe G. Vieira Code ---- .. code-block:: python __author__ = "Johannes Köster" __copyright__ = "Copyright 2016, Johannes Köster" __email__ = "koester@jimmy.harvard.edu" __license__ = "MIT" from snakemake.shell import shell from snakemake_wrapper_utils.bcftools import get_bcftools_opts bcftools_opts = get_bcftools_opts(snakemake, parse_ref=False, parse_memory=False) extra = snakemake.params.get("extra", "") log = snakemake.log_fmt_shell(stdout=True, stderr=True) class CallerOptionError(Exception): pass valid_caller_opts = {"-c", "--consensus-caller", "-m", "--multiallelic-caller"} caller_opt = snakemake.params.get("caller", "") if caller_opt.strip() not in valid_caller_opts: raise CallerOptionError( "bcftools call expects either -m/--multiallelic-caller or " "-c/--consensus-caller as caller option." ) shell( "bcftools call" " {bcftools_opts}" " {caller_opt}" " {extra}" " {snakemake.input[0]}" " {log}" ) .. |nl| raw:: html