diff --git a/modules/cnvkit/antitarget/main.nf b/modules/cnvkit/antitarget/main.nf new file mode 100644 index 00000000..bf6461bd --- /dev/null +++ b/modules/cnvkit/antitarget/main.nf @@ -0,0 +1,36 @@ +process CNVKIT_ANTITARGET { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::cnvkit=0.9.9" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cnvkit:0.9.9--pyhdfd78af_0': + 'quay.io/biocontainers/cnvkit:0.9.9--pyhdfd78af_0' }" + + input: + tuple val(meta), path(targets) + + output: + tuple val(meta), path("*.bed"), emit: bed + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + cnvkit.py \\ + antitarget \\ + $targets \\ + --output ${prefix}.antitarget.bed \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvkit: \$(cnvkit.py version | sed -e "s/cnvkit v//g") + END_VERSIONS + """ +} diff --git a/modules/cnvkit/antitarget/meta.yml b/modules/cnvkit/antitarget/meta.yml new file mode 100644 index 00000000..28a2bfa4 --- /dev/null +++ b/modules/cnvkit/antitarget/meta.yml @@ -0,0 +1,44 @@ +name: cnvkit_antitarget +description: +keywords: + - cvnkit + - antitarget +tools: + - cnvkit: + description: | + CNVkit is a Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data. + It is designed for use with hybrid capture, including both whole-exome and custom target panels, and short-read sequencing platforms such as Illumina and Ion Torrent. + homepage: https://cnvkit.readthedocs.io/en/stable/index.html + documentation: https://cnvkit.readthedocs.io/en/stable/index.html + tool_dev_url: "https://github.com/etal/cnvkit" + doi: 10.1371/journal.pcbi.1004873 + licence: ["Apache-2.0"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - targets: + type: file + description: File containing genomic regions + pattern: "*.{bed}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bed: + type: file + description: File containing off-target regions + pattern: "*.{bed}" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@SusiJo" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 78e85487..2131445c 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -447,6 +447,10 @@ cmseq/polymut: - modules/cmseq/polymut/** - tests/modules/cmseq/polymut/** +cnvkit/antitarget: + - modules/cnvkit/antitarget/** + - tests/modules/cnvkit/antitarget/** + cnvkit/batch: - modules/cnvkit/batch/** - tests/modules/cnvkit/batch/** diff --git a/tests/modules/cnvkit/antitarget/main.nf b/tests/modules/cnvkit/antitarget/main.nf new file mode 100644 index 00000000..44e49eb2 --- /dev/null +++ b/tests/modules/cnvkit/antitarget/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CNVKIT_ANTITARGET } from '../../../../modules/cnvkit/antitarget/main.nf' + +workflow test_cnvkit_antitarget { + + input = [ + [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + + CNVKIT_ANTITARGET ( input ) +} + diff --git a/tests/modules/cnvkit/antitarget/nextflow.config b/tests/modules/cnvkit/antitarget/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/cnvkit/antitarget/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/cnvkit/antitarget/test.yml b/tests/modules/cnvkit/antitarget/test.yml new file mode 100644 index 00000000..e1c3d0c8 --- /dev/null +++ b/tests/modules/cnvkit/antitarget/test.yml @@ -0,0 +1,8 @@ +- name: cnvkit antitarget test_cnvkit_antitarget + command: nextflow run ./tests/modules/cnvkit/antitarget -entry test_cnvkit_antitarget -c ./tests/config/nextflow.config -c ./tests/modules/cnvkit/antitarget/nextflow.config + tags: + - cnvkit + - cnvkit/antitarget + files: + - path: output/cnvkit/test.antitarget.bed + md5sum: 3d4d20f9f23b39970865d29ef239d20b