CNVKIT ANTITARGET
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.9.0/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.11
Input/Output
Input:
bed
: bed fileaccessible
: 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
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}"
)