From 5a30294eec8eb30c8c3d569cdcdb04a4cfbe150d Mon Sep 17 00:00:00 2001 From: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com> Date: Mon, 5 Sep 2022 12:09:55 +0200 Subject: [PATCH] Update for the delly/call module (#2008) * updated the delly/call module * Update modules/delly/call/meta.yml Co-authored-by: James A. Fellows Yates Co-authored-by: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Co-authored-by: James A. Fellows Yates --- modules/delly/call/main.nf | 13 ++++++++----- modules/delly/call/meta.yml | 19 +++++++++++++++---- tests/modules/delly/call/main.nf | 19 +++++++++++++++++-- tests/modules/delly/call/test.yml | 19 +++++++++++++++---- 4 files changed, 55 insertions(+), 15 deletions(-) diff --git a/modules/delly/call/main.nf b/modules/delly/call/main.nf index b23ee01e..2cfbcffd 100644 --- a/modules/delly/call/main.nf +++ b/modules/delly/call/main.nf @@ -8,7 +8,8 @@ process DELLY_CALL { 'quay.io/biocontainers/delly:1.1.3--h358d541_0' }" input: - tuple val(meta), path(bam), path(bai) + tuple val(meta), path(input), path(input_index) + path exclude_bed path fasta path fai @@ -23,13 +24,15 @@ process DELLY_CALL { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def exclude = exclude_bed ? "--exclude ${exclude_bed}" : "" """ delly \\ call \\ - $args \\ - -o ${prefix}.bcf \\ - -g $fasta \\ - $bam \\ + ${args} \\ + --outfile ${prefix}.bcf \\ + --genome ${fasta} \\ + ${exclude} \\ + ${input} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/delly/call/meta.yml b/modules/delly/call/meta.yml index 642e095d..cdcdbe75 100644 --- a/modules/delly/call/meta.yml +++ b/modules/delly/call/meta.yml @@ -21,16 +21,26 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - bam: + - input: type: file - description: BAM file from alignment must be sorted, indexed, and duplicate marked - pattern: "*.{bam}" + description: BAM/CRAM file from alignment must be sorted, indexed, and duplicate marked + pattern: "*.{bam,cram}" + - bai: + type: file + description: Index of the BAM/CRAM file + pattern: "*.{bai,crai}" + - exclude_bed: + type: file + description: An optional bed file containing regions to exclude from the called VCF + pattern: "*.bed" - fasta: type: file description: The reference fasta file + pattern: "*.{fasta,fa}" - fai: type: file description: Index of reference fasta file to identify split-reads + pattern: "*.fai" output: - meta: @@ -44,7 +54,7 @@ output: pattern: "versions.yml" - bcf: type: file - description: BCF format + description: Called variants in BCF format pattern: "*.{bcf}" - csi: type: file @@ -53,3 +63,4 @@ output: authors: - "@projectoriented" + - "@nvnieuwk" diff --git a/tests/modules/delly/call/main.nf b/tests/modules/delly/call/main.nf index caa311ae..29d2d3f8 100644 --- a/tests/modules/delly/call/main.nf +++ b/tests/modules/delly/call/main.nf @@ -10,10 +10,11 @@ workflow test_delly_call_bam { file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), ] + exclude_regions = [] fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) - DELLY_CALL ( input, fasta, fai ) + DELLY_CALL ( input, exclude_regions, fasta, fai ) } workflow test_delly_call_cram { @@ -22,8 +23,22 @@ workflow test_delly_call_cram { file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), ] + exclude_regions = [] fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) - DELLY_CALL ( input, fasta, fai ) + DELLY_CALL ( input, exclude_regions, fasta, fai ) +} + +workflow test_delly_call_exclude_regions { + input = [ [ id:'test' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), + ] + + exclude_regions = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + + DELLY_CALL ( input, exclude_regions, fasta, fai ) } diff --git a/tests/modules/delly/call/test.yml b/tests/modules/delly/call/test.yml index 0d0ddfe8..3b6b7cc4 100644 --- a/tests/modules/delly/call/test.yml +++ b/tests/modules/delly/call/test.yml @@ -1,21 +1,32 @@ - name: delly call test_delly_call_bam command: nextflow run ./tests/modules/delly/call -entry test_delly_call_bam -c ./tests/config/nextflow.config -c ./tests/modules/delly/call/nextflow.config tags: - - delly/call - delly + - delly/call files: - path: output/delly/test.bcf - md5sum: 9d036b140c1bdeab08b7ee6781940fb4 + md5sum: b5cdb79b69c8254d22fb69173437f9c7 - path: output/delly/test.bcf.csi md5sum: c198abfc14584c5ac69c004057927e0b - name: delly call test_delly_call_cram command: nextflow run ./tests/modules/delly/call -entry test_delly_call_cram -c ./tests/config/nextflow.config -c ./tests/modules/delly/call/nextflow.config tags: - - delly/call - delly + - delly/call files: - path: output/delly/test.bcf - md5sum: 6c1ec4cfb05ffe9fd93316d2209608ae + md5sum: 64980a713438f39d14cffa8458b6a184 + - path: output/delly/test.bcf.csi + md5sum: 19e0cdf06c415f4942f6d4dbd5fb7271 + +- name: delly call test_delly_call_exclude_regions + command: nextflow run ./tests/modules/delly/call -entry test_delly_call_exclude_regions -c ./tests/config/nextflow.config -c ./tests/modules/delly/call/nextflow.config + tags: + - delly + - delly/call + files: + - path: output/delly/test.bcf + md5sum: 64980a713438f39d14cffa8458b6a184 - path: output/delly/test.bcf.csi md5sum: 19e0cdf06c415f4942f6d4dbd5fb7271