BCFTOOLS STATS

https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/bcftools/stats?label=version%20update%20pull%20requests

Generate VCF stats using bcftools stats.

URL: http://www.htslib.org/doc/bcftools.html#stats

Example

This wrapper can be used in the following way:

rule bcf_stats:
    input:
        "{prefix}",
    output:
        "{prefix}.stats.txt",
    log:
        "{prefix}.bcftools.stats.log",
    params:
        "",
    wrapper:
        "v3.10.2-32-gf4e5b66/bio/bcftools/stats"

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

Software dependencies

  • bcftools=1.20

  • snakemake-wrapper-utils=0.6.2

Input/Output

Input:

  • BCF, VCF, or VCF.gz input

Output:

  • stats text file

Authors

  • William Rowell

  • Filipe G. Vieira

Code

__author__ = "William Rowell"
__copyright__ = "Copyright 2020, William Rowell"
__email__ = "wrowell@pacb.com"
__license__ = "MIT"


from snakemake.shell import shell
from snakemake_wrapper_utils.bcftools import get_bcftools_opts


bcftools_opts = get_bcftools_opts(
    snakemake, parse_output=False, parse_output_format=False, parse_memory=False
)
extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=False, stderr=True)


shell(
    "bcftools stats"
    " {bcftools_opts}"
    " {extra}"
    " {snakemake.input[0]}"
    " > {snakemake.output[0]}"
    " {log}"
)