BCFTOOLS VIEW

View vcf/bcf file in a different format. For more information see BCFtools documentation.

Example

This wrapper can be used in the following way:

rule bcf_to_vcf:
    input:
        bcf="{prefix}.bcf"
    output:
        vcf="{prefix}.vcf"
    params:
        ""  # optional parameters for bcftools view (except -o)
    log:
        "logs/{prefix}.log"
    wrapper:
        "0.68.0/bio/bcftools/view"

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.

Software dependencies

  • bcftools==1.11

Authors

  • Johannes Köster

Code

__author__ = "Johannes Köster"
__copyright__ = "Copyright 2016, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"


from snakemake.shell import shell

extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=True, stderr=True)

shell(
    "bcftools view {extra} --threads {snakemake.threads} {snakemake.input} "
    "-o {snakemake.output} {log}"
)