.. _`bio/bcftools/mpileup`: BCFTOOLS MPILEUP ================ .. image:: https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/bcftools/mpileup?label=version%20update%20pull%20requests :target: https://github.com/snakemake/snakemake-wrappers/pulls?q=is%3Apr+is%3Aopen+label%3Abio/bcftools/mpileup Generate VCF or BCF containing genotype likelihoods for one or multiple alignment (BAM or CRAM) files. **URL**: http://www.htslib.org/doc/bcftools.html#mpileup Example ------- This wrapper can be used in the following way: .. code-block:: python rule bcftools_mpileup: input: alignments="mapped/{sample}.bam", ref="genome.fasta", # this can be left out if --no-reference is in options index="genome.fasta.fai", output: pileup="pileups/{sample}.pileup.bcf", params: uncompressed_bcf=False, extra="--max-depth 100 --min-BQ 15", log: "logs/bcftools_mpileup/{sample}.log", wrapper: "v3.0.1/bio/bcftools/mpileup" 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`, `-f/--fasta-ref`, `-o/--output`, or `-O/--output-type`). Software dependencies --------------------- * ``bcftools=1.18`` * ``snakemake-wrapper-utils=0.6.2`` Authors ------- * Michael Hall * Filipe G. Vieira Code ---- .. code-block:: python __author__ = "Michael Hall" __copyright__ = "Copyright 2020, Michael Hall" __email__ = "michael@mbh.sh" __license__ = "MIT" from snakemake.shell import shell from snakemake_wrapper_utils.bcftools import get_bcftools_opts extra = snakemake.params.get("extra", "") bcftools_opts = get_bcftools_opts( snakemake, parse_ref=("--no-reference" not in extra), parse_memory=False ) log = snakemake.log_fmt_shell(stdout=True, stderr=True) class MissingReferenceError(Exception): pass shell("bcftools mpileup {bcftools_opts} {extra} {snakemake.input[0]} {log}") .. |nl| raw:: html