diff --git a/modules/cnvkit/reference/main.nf b/modules/cnvkit/reference/main.nf new file mode 100644 index 00000000..1f0b20d8 --- /dev/null +++ b/modules/cnvkit/reference/main.nf @@ -0,0 +1,39 @@ +process CNVKIT_REFERENCE { + tag "$reference" + 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: + path fasta + path targets + path antitargets + + output: + path("*.cnn") , emit: cnn + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + cnvkit.py \\ + reference \\ + --fasta $fasta \\ + --targets $targets \\ + --antitargets $antitargets \\ + --output reference.cnn \\ + $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/reference/meta.yml b/modules/cnvkit/reference/meta.yml new file mode 100644 index 00000000..2e0fef1a --- /dev/null +++ b/modules/cnvkit/reference/meta.yml @@ -0,0 +1,47 @@ +name: cnvkit_reference +description: +keywords: + - cnvkit + - reference +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: + - fasta: + type: file + description: File containing reference genome + pattern: "*.{fasta}" + - targets: + type: file + description: File containing genomic regions + pattern: "*.{bed}" + - antitargets: + type: file + description: File containing off-target genomic regions + pattern: "*.{bed}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reference: + type: file + description: File containing a copy-number reference (required for CNV calling in tumor_only mode) + pattern: "*.{cnn}" + - 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..0e5a1815 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -451,6 +451,10 @@ cnvkit/batch: - modules/cnvkit/batch/** - tests/modules/cnvkit/batch/** +cnvkit/reference: + - modules/cnvkit/reference/** + - tests/modules/cnvkit/reference/** + controlfreec/assesssignificance: - modules/controlfreec/assesssignificance/** - tests/modules/controlfreec/assesssignificance/** diff --git a/tests/modules/cnvkit/reference/main.nf b/tests/modules/cnvkit/reference/main.nf new file mode 100644 index 00000000..bd7009c0 --- /dev/null +++ b/tests/modules/cnvkit/reference/main.nf @@ -0,0 +1,14 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { CNVKIT_REFERENCE } from '../../../../modules/cnvkit/reference/main.nf' + +workflow test_cnvkit_reference { + + fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + targets = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + antitargets = file("/Users/susanne/Documents/repos/forks/modules/test_antitarget/output/cnvkit/test.antitarget.bed", checkIfExists: true) + + CNVKIT_REFERENCE ( fasta, targets, antitargets ) +} diff --git a/tests/modules/cnvkit/reference/nextflow.config b/tests/modules/cnvkit/reference/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/cnvkit/reference/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/reference/test.yml b/tests/modules/cnvkit/reference/test.yml new file mode 100644 index 00000000..b1b8c896 --- /dev/null +++ b/tests/modules/cnvkit/reference/test.yml @@ -0,0 +1,8 @@ +- name: cnvkit reference test_cnvkit_reference + command: nextflow run ./tests/modules/cnvkit/reference -entry test_cnvkit_reference -c ./tests/config/nextflow.config -c ./tests/modules/cnvkit/reference/nextflow.config + tags: + - cnvkit/reference + - cnvkit + files: + - path: output/cnvkit/reference.cnn + md5sum: 7c4a7902f5ab101b1f9d6038d331b3d9