BCFTOOLS STATS#
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.0.2/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#
The extra param allows for additional program arguments (not –threads, -f/–fasta-ref, or -o/–output).
For more information see, http://www.htslib.org/doc/bcftools.html#stats
Software dependencies#
bcftools=1.18
snakemake-wrapper-utils=0.6.2
Input/Output#
Input:
BCF, VCF, or VCF.gz input
Output:
stats text file
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=True, stderr=True)
shell(
"bcftools stats"
" {bcftools_opts}"
" {extra}"
" {snakemake.input[0]}"
" > {snakemake.output[0]}"
" {log}"
)