CNVKIT ANTITARGET

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

Given a “target” BED file that lists the chromosomal coordinates of the tiled regions used for targeted resequencing, derive a BED file off-target/”antitarget” regions.

URL: https://cnvkit.readthedocs.io/en/stable/pipeline.html#antitarget

Example

This wrapper can be used in the following way:

rule cnvkit_antitarget:
    input:
        bed="test.bed",
    output:
        bed="test.antitarget.bed",
    log:
        "logs/test.target.log",
    params:
        extra = "" # optional
    wrapper:
        "v3.8.0-1-g149ef14/bio/cnvkit/antitarget"

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

  • cnvkit=0.9.10

Input/Output

Input:

  • bed: bed file

  • accessible: sequence-accessible coordinates in chromosomes from the given reference genome

Output:

  • bed: bed file

Params

  • extra: additional parameters that will be forwarded to cnvkit antitarget

Authors

  • Patrik Smeds

Code

__author__ = "Patrik Smeds"
__copyright__ = "Copyright 2023, Patrik Smeds"
__email__ = "patrik.smeds@gmail.com"
__license__ = "MIT"

from snakemake.shell import shell

log = snakemake.log_fmt_shell(stdout=False, stderr=True)

extra = snakemake.params.get("extra", "")

accessible = snakemake.input.get("accessible", "")
if accessible:
    accessible = f"-g {accessible}"

shell(
    "cnvkit.py antitarget "
    "{snakemake.input.bed} "
    "-o {snakemake.output.bed} "
    "{accessible} "
    "{extra} "
    "{log}"
)