From 4f9d672e55bc42d24fcc9e197e1ea7d86c1d2dd0 Mon Sep 17 00:00:00 2001 From: SusiJo Date: Mon, 23 May 2022 16:52:06 +0200 Subject: [PATCH 1/5] added new module cnvkit/antitarget --- modules/cnvkit/antitarget/main.nf | 40 +++++++++++++++++ modules/cnvkit/antitarget/meta.yml | 44 +++++++++++++++++++ tests/config/pytest_modules.yml | 4 ++ tests/modules/cnvkit/antitarget/main.nf | 16 +++++++ .../modules/cnvkit/antitarget/nextflow.config | 5 +++ tests/modules/cnvkit/antitarget/test.yml | 8 ++++ 6 files changed, 117 insertions(+) create mode 100644 modules/cnvkit/antitarget/main.nf create mode 100644 modules/cnvkit/antitarget/meta.yml create mode 100644 tests/modules/cnvkit/antitarget/main.nf create mode 100644 tests/modules/cnvkit/antitarget/nextflow.config create mode 100644 tests/modules/cnvkit/antitarget/test.yml diff --git a/modules/cnvkit/antitarget/main.nf b/modules/cnvkit/antitarget/main.nf new file mode 100644 index 00000000..af2d7558 --- /dev/null +++ b/modules/cnvkit/antitarget/main.nf @@ -0,0 +1,40 @@ + +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 c1aeb0c6..7aa4b64d 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 From ddb964a4bf33b4026a31a25778a7ee26df0da1d6 Mon Sep 17 00:00:00 2001 From: SusiJo <43847534+SusiJo@users.noreply.github.com> Date: Mon, 23 May 2022 18:48:04 +0200 Subject: [PATCH 2/5] rm line Co-authored-by: FriederikeHanssen --- modules/cnvkit/antitarget/main.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/cnvkit/antitarget/main.nf b/modules/cnvkit/antitarget/main.nf index af2d7558..f0516eeb 100644 --- a/modules/cnvkit/antitarget/main.nf +++ b/modules/cnvkit/antitarget/main.nf @@ -1,4 +1,3 @@ - process CNVKIT_ANTITARGET { tag "$meta.id" label 'process_low' From 24905e26e2dcf8cacadee54c7b280d8bda511da4 Mon Sep 17 00:00:00 2001 From: SusiJo <43847534+SusiJo@users.noreply.github.com> Date: Mon, 23 May 2022 18:48:13 +0200 Subject: [PATCH 3/5] rm line Co-authored-by: FriederikeHanssen --- modules/cnvkit/antitarget/main.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/cnvkit/antitarget/main.nf b/modules/cnvkit/antitarget/main.nf index f0516eeb..6c092a31 100644 --- a/modules/cnvkit/antitarget/main.nf +++ b/modules/cnvkit/antitarget/main.nf @@ -8,7 +8,6 @@ process CNVKIT_ANTITARGET { 'quay.io/biocontainers/cnvkit:0.9.9--pyhdfd78af_0' }" input: - tuple val(meta), path(targets) output: From 86b5951c14eaf5a11376f2fd8abd6a912bdfb214 Mon Sep 17 00:00:00 2001 From: SusiJo <43847534+SusiJo@users.noreply.github.com> Date: Mon, 23 May 2022 18:48:30 +0200 Subject: [PATCH 4/5] rm line Co-authored-by: FriederikeHanssen --- modules/cnvkit/antitarget/main.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/cnvkit/antitarget/main.nf b/modules/cnvkit/antitarget/main.nf index 6c092a31..a3181daa 100644 --- a/modules/cnvkit/antitarget/main.nf +++ b/modules/cnvkit/antitarget/main.nf @@ -11,7 +11,6 @@ process CNVKIT_ANTITARGET { tuple val(meta), path(targets) output: - tuple val(meta), path("*.bed"), emit: bed path "versions.yml" , emit: versions From 58c5ec2f4eb44eff1fb7cc9e02df07bd448c6aaf Mon Sep 17 00:00:00 2001 From: SusiJo <43847534+SusiJo@users.noreply.github.com> Date: Mon, 23 May 2022 18:53:28 +0200 Subject: [PATCH 5/5] rm line Co-authored-by: FriederikeHanssen --- modules/cnvkit/antitarget/main.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/cnvkit/antitarget/main.nf b/modules/cnvkit/antitarget/main.nf index a3181daa..bf6461bd 100644 --- a/modules/cnvkit/antitarget/main.nf +++ b/modules/cnvkit/antitarget/main.nf @@ -12,7 +12,6 @@ process CNVKIT_ANTITARGET { output: tuple val(meta), path("*.bed"), emit: bed - path "versions.yml" , emit: versions when: