DELLY

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

Call variants with delly.

URL: https://github.com/dellytools/delly

Example

This wrapper can be used in the following way:

rule delly_bcf:
    input:
        ref="genome.fasta",
        alns=["mapped/a.bam"],
        # optional
        exclude="human.hg19.excl.tsv",
    output:
        "sv/calls.bcf",
    params:
        uncompressed_bcf=True,
        extra="",  # optional parameters for delly (except -g, -x)
    log:
        "logs/delly.log",
    threads: 2  # It is best to use as many threads as samples
    wrapper:
        "v3.9.0-14-g476823b/bio/delly"


rule delly_vcfgz:
    input:
        ref="genome.fasta",
        alns=["mapped/a.bam"],
        # optional
        exclude="human.hg19.excl.tsv",
    output:
        "sv/calls.vcf.gz",
    params:
        extra="",  # optional parameters for delly (except -g, -x)
    log:
        "logs/delly.log",
    threads: 2  # It is best to use as many threads as samples
    wrapper:
        "v3.9.0-14-g476823b/bio/delly"

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 uncompressed_bcf param sets output to uncompressed BCF (ignored if output is vcf or vcf.gz)

  • The extra param allows for additional program arguments

Software dependencies

  • delly=1.2.6

  • bcftools=1.20

  • snakemake-wrapper-utils=0.6.2

Input/Output

Input:

  • BAM/CRAM file(s)

  • reference genome

  • BED file (optional)

Output:

  • VCF/BCF with SVs.

Authors

  • Johannes Köster

  • Filipe G. Vieira

Code

__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)


exclude = snakemake.input.get("exclude", "")
if exclude:
    exclude = f"-x {exclude}"


shell(
    "(OMP_NUM_THREADS={snakemake.threads} delly call"
    " -g {snakemake.input.ref}"
    " {exclude}"
    " {extra}"
    " {snakemake.input.alns} | "
    # Convert output to specified format
    "bcftools view"
    " {bcftools_opts}"
    ") {log}"
)