diff --git a/modules/nf-core/delly/call/main.nf b/modules/nf-core/delly/call/main.nf index 7c2197349dc..da54ba2cbb8 100644 --- a/modules/nf-core/delly/call/main.nf +++ b/modules/nf-core/delly/call/main.nf @@ -1,6 +1,6 @@ process DELLY_CALL { tag "$meta.id" - label 'process_medium' + label 'process_single' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? @@ -8,14 +8,14 @@ process DELLY_CALL { 'biocontainers/delly:1.2.6--hb7e2ac5_1' }" input: - tuple val(meta), path(input), path(input_index), path(vcf), path(vcf_index), path(exclude_bed) + tuple val(meta), path(input_1), path(input_1_idx), path(input_ctrl), path(input_ctrl_idx), path(vcf), path(vcf_index), path(exclude_bed) tuple val(meta2), path(fasta) tuple val(meta3), path(fai) output: - tuple val(meta), path("*.{bcf,vcf.gz}") , emit: bcf - tuple val(meta), path("*.{csi,tbi}") , emit: csi - path "versions.yml" , emit: versions + tuple val(meta), path("*.{bcf,vcf.gz}"), emit: bcf + tuple val(meta), path("*.{csi,tbi}") , emit: csi + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -23,13 +23,15 @@ process DELLY_CALL { script: def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def suffix = task.ext.suffix ?: "bcf" + def input = input_ctrl ? "${input_1} ${input_ctrl}" : "${input_1}" def exclude = exclude_bed ? "--exclude ${exclude_bed}" : "" def bcf_output = suffix == "bcf" ? "--outfile ${prefix}.bcf" : "" - def vcf_output = suffix == "vcf" ? "| bgzip ${args2} --threads ${task.cpus} --stdout > ${prefix}.vcf.gz && tabix ${prefix}.vcf.gz" : "" + def vcf_output = suffix == "vcf" ? "| bgzip ${args2} --threads ${task.cpus} --stdout > ${prefix}.vcf.gz && tabix ${args3} ${prefix}.vcf.gz" : "" def genotype = vcf ? "--vcffile ${vcf}" : "" diff --git a/modules/nf-core/delly/call/meta.yml b/modules/nf-core/delly/call/meta.yml index cc378ffd62a..a7b08caad48 100644 --- a/modules/nf-core/delly/call/meta.yml +++ b/modules/nf-core/delly/call/meta.yml @@ -12,20 +12,45 @@ tools: documentation: https://github.com/dellytools/delly/blob/master/README.md doi: "10.1093/bioinformatics/bts378" licence: ["BSD-3-Clause"] + args_id: "$args" + - bgzip: + description: Bgzip compresses or decompresses files in a similar manner to, and compatible with, gzip. + homepage: https://www.htslib.org/doc/tabix.html + documentation: http://www.htslib.org/doc/bgzip.html + doi: 10.1093/bioinformatics/btp352 + licence: ["MIT"] + args_id: "$args2" + - tabix: + description: Generic indexer for TAB-delimited genome position files. + homepage: https://www.htslib.org/doc/tabix.html + documentation: https://www.htslib.org/doc/tabix.1.html + doi: 10.1093/bioinformatics/btq671 + licence: ["MIT"] + args_id: "$args3" input: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - input: + - input_1: type: file description: BAM/CRAM file from alignment must be sorted, indexed, and duplicate marked pattern: "*.{bam,cram}" - - input_index: + - input_1_idx: type: file description: Index of the BAM/CRAM file pattern: "*.{bai,crai}" + - input_ctrl: + type: file + description: | + Optional BAM/CRAM file of matched control sample for somatic variant calling. + Must be sorted, indexed, and duplicate marked. + pattern: "*.{bam,cram}" + - input_ctrl_idx: + type: file + description: Optional index of the control BAM/CRAM file + pattern: "*.{bai,crai}" - vcf: type: file description: A BCF/VCF file to genotype with Delly. If this is supplied, the variant calling will be skipped @@ -77,6 +102,8 @@ output: authors: - "@projectoriented" - "@nvnieuwk" + - "@alexnater" maintainers: - "@projectoriented" - "@nvnieuwk" + - "@alexnater" diff --git a/modules/nf-core/delly/call/tests/main.nf.test b/modules/nf-core/delly/call/tests/main.nf.test index 80cad20d553..f9749ed5281 100644 --- a/modules/nf-core/delly/call/tests/main.nf.test +++ b/modules/nf-core/delly/call/tests/main.nf.test @@ -3,35 +3,77 @@ nextflow_process { name "Test Process DELLY_CALL" script "../main.nf" process "DELLY_CALL" + config "./nextflow.config" tag "modules" tag "modules_nfcore" tag "delly" tag "delly/call" - test("homo_sapiens - bam, bai, [], [], [], fasta, fai") { + test("germline, in:bam, out:bcf") { + when { + params { + suffix = 'bcf' + } + process { + """ + input[0] = [ + [ id:'control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + [], + [], + [] + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + """ + } + } - config "./vcf.config" + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.versions } + ) + } + } + test("germline, in:bam, out:vcf") { when { + params { + suffix = 'vcf' + } + process { """ input[0] = [ - [ id:'test'], // meta map - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam", checkIfExists:true), - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai", checkIfExists:true), + [ id:'control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], [], [], [] - ] + ] input[1] = [ - [ id:'fasta' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta", checkIfExists:true) - ] + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] input[2] = [ - [ id:'fai' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true) - ] + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] """ } } @@ -39,33 +81,42 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match("bam") } + { assert snapshot( + process.out.bcf, + file(process.out.csi[0][1]).name, + process.out.versions + ).match() + }, + { assert process.out.versions } ) } - } - test("homo_sapiens - cram, crai, [], [], [], fasta, fai") { - + test("germline, in:cram, out:bcf") { when { + params { + suffix = 'bcf' + } process { """ input[0] = [ - [ id:'test'], // meta map - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram", checkIfExists:true), - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai", checkIfExists:true), + [ id:'control' ], // 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), + [], + [], [], [], [] - ] + ] input[1] = [ - [ id:'fasta' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta", checkIfExists:true) - ] + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] input[2] = [ - [ id:'fai' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true) - ] + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + ] """ } } @@ -73,33 +124,81 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match("cram") } + { assert snapshot(process.out).match() }, + { assert process.out.versions } ) } - } - test("homo_sapiens - cram, crai, [], [], bed, fasta, fai") { + test("germline, in:cram, out:vcf") { + when { + params { + suffix = 'vcf' + } + + process { + """ + input[0] = [ + [ id:'control' ], // 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), + [], + [], + [], + [], + [] + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.bcf, + file(process.out.csi[0][1]).name, + process.out.versions + ).match() + }, + { assert process.out.versions } + ) + } + } + test("germline, exclude regions, in:bam, out:bcf") { when { + params { + suffix = 'bcf' + } process { """ input[0] = [ - [ id:'test'], // meta map - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram", checkIfExists:true), - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai", checkIfExists:true), + [ id:'control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), [], [], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed", checkIfExists:true) - ] + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] input[1] = [ - [ id:'fasta' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta", checkIfExists:true) - ] + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] input[2] = [ - [ id:'fai' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true) - ] + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] """ } } @@ -107,32 +206,77 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match("bed") } + { assert snapshot(process.out).match() }, + { assert process.out.versions } ) } + } + + test("germline, genotype, in:bam, out:bcf") { + when { + params { + suffix = 'bcf' + } + process { + """ + input[0] = [ + [ id:'control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true), + [] + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.versions } + ) + } } - test("homo_sapiens - cram, crai, vcf, tbi, [], fasta, fai") { + test("germline, out:bcf - stub") { + + options "-stub" when { + params { + suffix = 'bcf' + } process { """ input[0] = [ - [ id:'test'], // meta map - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram", checkIfExists:true), - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/cram/test2.paired_end.recalibrated.sorted.cram.crai", checkIfExists:true), - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz", checkIfExists:true), - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi", checkIfExists:true), + [ id:'test' ], // meta map + [], + [], + [], + [], + [], + [], [] - ] + ] input[1] = [ - [ id:'fasta' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta", checkIfExists:true) - ] + [:], + [] + ] input[2] = [ - [ id:'fai' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true) + [:], + [] ] """ } @@ -141,36 +285,77 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match("genotype") } + { assert snapshot(process.out).match() }, + { assert process.out.versions } ) } } - test("homo_sapiens - bam, bai, [], [], [], fasta, fai - stub") { + test("somatic, in:bam, out:bcf") { + when { + params { + suffix = 'bcf' + } + process { + """ + input[0] = [ + [ id:'tumor_control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + [] + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + """ + } + } - config "./vcf.config" - options "-stub" + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.versions } + ) + } + } + test("somatic, in:bam, out:vcf") { when { + params { + suffix = 'vcf' + } + process { """ input[0] = [ - [ id:'test'], // meta map - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam", checkIfExists:true), - file(params.modules_testdata_base_path + "genomics/homo_sapiens/illumina/bam/test2.paired_end.recalibrated.sorted.bam.bai", checkIfExists:true), + [ id:'tumor_control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), [], [], [] - ] + ] input[1] = [ - [ id:'fasta' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta", checkIfExists:true) - ] + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] input[2] = [ - [ id:'fai' ], - file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai", checkIfExists:true) - ] + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] """ } } @@ -178,10 +363,90 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match("stub") } + { assert snapshot( + process.out.bcf, + file(process.out.csi[0][1]).name, + process.out.versions + ).match() + }, + { assert process.out.versions } ) } + } + + test("somatic, exclude regions, in:bam, out:bcf") { + when { + params { + suffix = 'bcf' + } + process { + """ + input[0] = [ + [ id:'tumor_control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true) + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.versions } + ) + } } + test("somatic, genotype, in:bam, out:bcf") { + when { + params { + suffix = 'bcf' + } + process { + """ + input[0] = [ + [ id:'tumor_control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true), + [] + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.versions } + ) + } + } } diff --git a/modules/nf-core/delly/call/tests/main.nf.test.snap b/modules/nf-core/delly/call/tests/main.nf.test.snap index c89636d9e99..d30d9d6d3d6 100644 --- a/modules/nf-core/delly/call/tests/main.nf.test.snap +++ b/modules/nf-core/delly/call/tests/main.nf.test.snap @@ -1,21 +1,21 @@ { - "bed": { + "germline, exclude regions, in:bam, out:bcf": { "content": [ { "0": [ [ { - "id": "test" + "id": "control" }, - "test.bcf:md5,592702d7765f246cd0f7f32f23b607b9" + "control.bcf:md5,847ab56fe3d70e01857c71d7203af913" ] ], "1": [ [ { - "id": "test" + "id": "control" }, - "test.bcf.csi:md5,c198abfc14584c5ac69c004057927e0b" + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" ] ], "2": [ @@ -24,17 +24,17 @@ "bcf": [ [ { - "id": "test" + "id": "control" }, - "test.bcf:md5,592702d7765f246cd0f7f32f23b607b9" + "control.bcf:md5,847ab56fe3d70e01857c71d7203af913" ] ], "csi": [ [ { - "id": "test" + "id": "control" }, - "test.bcf.csi:md5,c198abfc14584c5ac69c004057927e0b" + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" ] ], "versions": [ @@ -44,27 +44,27 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.03.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-05-06T11:38:15.181069181" + "timestamp": "2024-04-03T15:50:51.214081941" }, - "cram": { + "germline, genotype, in:bam, out:bcf": { "content": [ { "0": [ [ { - "id": "test" + "id": "control" }, - "test.bcf:md5,592702d7765f246cd0f7f32f23b607b9" + "control.bcf:md5,847ab56fe3d70e01857c71d7203af913" ] ], "1": [ [ { - "id": "test" + "id": "control" }, - "test.bcf.csi:md5,c198abfc14584c5ac69c004057927e0b" + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" ] ], "2": [ @@ -73,17 +73,17 @@ "bcf": [ [ { - "id": "test" + "id": "control" }, - "test.bcf:md5,592702d7765f246cd0f7f32f23b607b9" + "control.bcf:md5,847ab56fe3d70e01857c71d7203af913" ] ], "csi": [ [ { - "id": "test" + "id": "control" }, - "test.bcf.csi:md5,c198abfc14584c5ac69c004057927e0b" + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" ] ], "versions": [ @@ -93,27 +93,27 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.03.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-05-06T11:38:01.798279112" + "timestamp": "2024-04-03T15:51:00.5735754" }, - "stub": { + "germline - vcf": { "content": [ { "0": [ [ { - "id": "test" + "id": "control" }, - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "control.vcf.gz:md5,1460fde017e7ab7c8aa333246475b37d" ] ], "1": [ [ { - "id": "test" + "id": "control" }, - "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "control.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" ] ], "2": [ @@ -122,17 +122,17 @@ "bcf": [ [ { - "id": "test" + "id": "control" }, - "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + "control.vcf.gz:md5,1460fde017e7ab7c8aa333246475b37d" ] ], "csi": [ [ { - "id": "test" + "id": "control" }, - "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + "control.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" ] ], "versions": [ @@ -142,11 +142,11 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.03.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-05-06T11:38:44.135939928" + "timestamp": "2024-03-28T16:17:08.945129254" }, - "bam": { + "germline, out:bcf - stub": { "content": [ { "0": [ @@ -154,7 +154,7 @@ { "id": "test" }, - "test.vcf.gz:md5,021dae61db384dae43a46386a66d1408" + "test.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -162,7 +162,7 @@ { "id": "test" }, - "test.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" + "test.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "2": [ @@ -173,7 +173,7 @@ { "id": "test" }, - "test.vcf.gz:md5,021dae61db384dae43a46386a66d1408" + "test.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "csi": [ @@ -181,7 +181,511 @@ { "id": "test" }, - "test.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" + "test.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-02T14:38:32.89939847" + }, + "somatic - vcf": { + "content": [ + { + "0": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.vcf.gz:md5,761d7f427a4f8119343d1aab1d3f5642" + ] + ], + "1": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" + ] + ], + "2": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ], + "bcf": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.vcf.gz:md5,761d7f427a4f8119343d1aab1d3f5642" + ] + ], + "csi": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" + ] + ], + "versions": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-28T16:17:43.10253227" + }, + "germline, in:bam, out:vcf": { + "content": [ + [ + [ + { + "id": "control" + }, + "control.vcf.gz:md5,681158f860e9aa801c197b5ebf4742eb" + ] + ], + "control.vcf.gz.tbi", + [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T15:50:28.605707686" + }, + "germline - bcf": { + "content": [ + { + "0": [ + [ + { + "id": "control" + }, + "control.bcf:md5,6e2d79f69afc702a08511cb929da6943" + ] + ], + "1": [ + [ + { + "id": "control" + }, + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ], + "bcf": [ + [ + { + "id": "control" + }, + "control.bcf:md5,6e2d79f69afc702a08511cb929da6943" + ] + ], + "csi": [ + [ + { + "id": "control" + }, + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-28T16:16:59.976411614" + }, + "germline, in:cram, out:bcf": { + "content": [ + { + "0": [ + [ + { + "id": "control" + }, + "control.bcf:md5,fb284989139b6b7a86049dc7f084e462" + ] + ], + "1": [ + [ + { + "id": "control" + }, + "control.bcf.csi:md5,a2ba4f0b32a6ea857ec8a5b3068f168f" + ] + ], + "2": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ], + "bcf": [ + [ + { + "id": "control" + }, + "control.bcf:md5,fb284989139b6b7a86049dc7f084e462" + ] + ], + "csi": [ + [ + { + "id": "control" + }, + "control.bcf.csi:md5,a2ba4f0b32a6ea857ec8a5b3068f168f" + ] + ], + "versions": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T15:50:36.531751261" + }, + "somatic, in:bam, out:bcf": { + "content": [ + { + "0": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf:md5,9f15c148df32709a67e0bf44d6c704ba" + ] + ], + "1": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ], + "bcf": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf:md5,9f15c148df32709a67e0bf44d6c704ba" + ] + ], + "csi": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T15:51:22.461691094" + }, + "somatic - bcf": { + "content": [ + { + "0": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf:md5,ab52d577db09a1e500607c124eacf511" + ] + ], + "1": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ], + "bcf": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf:md5,ab52d577db09a1e500607c124eacf511" + ] + ], + "csi": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-28T16:17:32.903383226" + }, + "germline, in:cram, out:vcf": { + "content": [ + [ + [ + { + "id": "control" + }, + "control.vcf.gz:md5,42c4f91d40334139ea56a9c0e0824f41" + ] + ], + "control.vcf.gz.tbi", + [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T15:50:43.580758846" + }, + "germline, in:bam, out:bcf": { + "content": [ + { + "0": [ + [ + { + "id": "control" + }, + "control.bcf:md5,847ab56fe3d70e01857c71d7203af913" + ] + ], + "1": [ + [ + { + "id": "control" + }, + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ], + "bcf": [ + [ + { + "id": "control" + }, + "control.bcf:md5,847ab56fe3d70e01857c71d7203af913" + ] + ], + "csi": [ + [ + { + "id": "control" + }, + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T15:50:19.100132232" + }, + "germline - genotyping": { + "content": [ + { + "0": [ + [ + { + "id": "control" + }, + "control.bcf:md5,6e2d79f69afc702a08511cb929da6943" + ] + ], + "1": [ + [ + { + "id": "control" + }, + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ], + "bcf": [ + [ + { + "id": "control" + }, + "control.bcf:md5,6e2d79f69afc702a08511cb929da6943" + ] + ], + "csi": [ + [ + { + "id": "control" + }, + "control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-28T16:51:43.202596735" + }, + "somatic, in:bam, out:vcf": { + "content": [ + [ + [ + { + "id": "tumor_control" + }, + "tumor_control.vcf.gz:md5,10ada5fa3a46dfaf59a87959354ac392" + ] + ], + "tumor_control.vcf.gz.tbi", + [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T15:51:31.81185897" + }, + "somatic, exclude regions, in:bam, out:bcf": { + "content": [ + { + "0": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf:md5,9f15c148df32709a67e0bf44d6c704ba" + ] + ], + "1": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ], + "bcf": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf:md5,9f15c148df32709a67e0bf44d6c704ba" + ] + ], + "csi": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T15:51:40.61756269" + }, + "somatic, genotype, in:bam, out:bcf": { + "content": [ + { + "0": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf:md5,9f15c148df32709a67e0bf44d6c704ba" + ] + ], + "1": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,cf72d737ee881a7cd7eab87abf93b94c" + ], + "bcf": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf:md5,9f15c148df32709a67e0bf44d6c704ba" + ] + ], + "csi": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" ] ], "versions": [ @@ -191,11 +695,11 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.03.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-05-06T11:37:45.689766253" + "timestamp": "2024-04-03T15:51:50.44863729" }, - "genotype": { + "germline - stub": { "content": [ { "0": [ @@ -203,7 +707,7 @@ { "id": "test" }, - "test.bcf:md5,592702d7765f246cd0f7f32f23b607b9" + "test.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ @@ -211,7 +715,7 @@ { "id": "test" }, - "test.bcf.csi:md5,c198abfc14584c5ac69c004057927e0b" + "test.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "2": [ @@ -222,7 +726,7 @@ { "id": "test" }, - "test.bcf:md5,592702d7765f246cd0f7f32f23b607b9" + "test.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "csi": [ @@ -230,7 +734,7 @@ { "id": "test" }, - "test.bcf.csi:md5,c198abfc14584c5ac69c004057927e0b" + "test.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "versions": [ @@ -240,8 +744,8 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.03.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-05-06T11:38:29.129594523" + "timestamp": "2024-03-21T16:54:36.024035492" } } \ No newline at end of file diff --git a/modules/nf-core/delly/call/tests/nextflow.config b/modules/nf-core/delly/call/tests/nextflow.config new file mode 100644 index 00000000000..ae81082b359 --- /dev/null +++ b/modules/nf-core/delly/call/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + + withName: DELLY_CALL { + ext.suffix = { params.suffix ?: '' } + } +} \ No newline at end of file diff --git a/modules/nf-core/delly/filter/environment.yml b/modules/nf-core/delly/filter/environment.yml new file mode 100644 index 00000000000..1b073fdfe7b --- /dev/null +++ b/modules/nf-core/delly/filter/environment.yml @@ -0,0 +1,7 @@ +name: delly_filter +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::delly=1.2.6 diff --git a/modules/nf-core/delly/filter/main.nf b/modules/nf-core/delly/filter/main.nf new file mode 100644 index 00000000000..f27017f512e --- /dev/null +++ b/modules/nf-core/delly/filter/main.nf @@ -0,0 +1,84 @@ +process DELLY_FILTER { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/delly:1.2.6--hb7e2ac5_0': + 'biocontainers/delly:1.2.6--hb7e2ac5_0' }" + + input: + tuple val(meta), path(bcf), path(csi) + val(mode) + path(samples) + val(tumor_samples) + val(control_samples) + + output: + tuple val(meta), path("${prefix}.{bcf,vcf.gz}") , emit: bcf + tuple val(meta), path("${prefix}.{bcf.csi,vcf.gz.tbi}"), emit: csi + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "bcf" + if ("$bcf" == "${prefix}.${suffix}") error "Input and output names are the same, set prefix in module configuration to disambiguate!" + def samples_arg = '' + def sample_list = '' + if (mode == 'somatic') { + if (!samples && tumor_samples && control_samples) { + sample_list = tumor_samples.collect {"${it}\ttumor"}.join('\n') + sample_list += '\n' + control_samples.collect {"${it}\tcontrol"}.join('\n') + } + else { + error "For somatic mode, either lists of sample ids for tumor and control samples or a sample description file must be provided." + } + samples_arg = '-s samples.tsv' + } else if (mode != 'germline') { + error "Mode must be one of 'germline' or 'somatic'." + } + + bcf_output = suffix == "bcf" ? "--outfile ${prefix}.bcf" : "" + vcf_output = suffix == "vcf" ? "| bgzip ${args2} --threads ${task.cpus} --stdout > ${prefix}.vcf.gz && tabix ${args3} ${prefix}.vcf.gz" : "" + + """ + if [ "$samples_arg" ]; then echo "$sample_list" > samples.tsv; fi + + delly \\ + filter \\ + $args \\ + -f $mode \\ + $bcf_output \\ + $samples_arg \\ + $bcf \\ + $vcf_output + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + delly: \$( echo \$(delly --version 2>&1) | sed 's/^.*Delly version: v//; s/ using.*\$//') + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "bcf" + + def bcf_output = suffix == "bcf" ? "touch ${prefix}.bcf && touch ${prefix}.bcf.csi" : "" + def vcf_output = suffix == "vcf" ? "touch ${prefix}.vcf.gz && touch ${prefix}.vcf.gz.tbi" : "" + + """ + ${bcf_output} + ${vcf_output} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + delly: \$( echo \$(delly --version 2>&1) | sed 's/^.*Delly version: v//; s/ using.*\$//') + END_VERSIONS + """ +} diff --git a/modules/nf-core/delly/filter/meta.yml b/modules/nf-core/delly/filter/meta.yml new file mode 100644 index 00000000000..38b648ecd5e --- /dev/null +++ b/modules/nf-core/delly/filter/meta.yml @@ -0,0 +1,89 @@ +name: delly_filter +description: Filter structural variants +keywords: + - genome + - structural + - variants + - bcf +tools: + - delly: + description: Structural variant discovery by integrated paired-end and split-read analysis + homepage: https://github.com/dellytools/delly + documentation: https://github.com/dellytools/delly/blob/master/README.md + doi: "10.1093/bioinformatics/bts378" + licence: ["BSD-3-Clause"] + args_id: "$args" + - bgzip: + description: Bgzip compresses or decompresses files in a similar manner to, and compatible with, gzip. + homepage: https://www.htslib.org/doc/tabix.html + documentation: http://www.htslib.org/doc/bgzip.html + doi: 10.1093/bioinformatics/btp352 + licence: ["MIT"] + args_id: "$args2" + - tabix: + description: Generic indexer for TAB-delimited genome position files. + homepage: https://www.htslib.org/doc/tabix.html + documentation: https://www.htslib.org/doc/tabix.1.html + doi: 10.1093/bioinformatics/btq671 + licence: ["MIT"] + args_id: "$args3" +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bcf: + type: file + description: BCF file with structural variants + pattern: "*.bcf" + - csi: + type: file + description: A csi index that matches the bcf input + pattern: "*.bcf.csi" + - mode: + type: string + description: The working mode of Delly filter + pattern: "germline|somatic" + - samples: + type: file + description: | + A TSV sample description file where the first column + is sample id (matching sample names in the BCF file) + and the second column is either tumor or control. + Only needed for somatic mode. Alternatively, sample desciptions + can be added the meta map as lists of sample ids in the + fields 'tumor_samples' and 'control_samples'. + pattern: "*.tsv" + - tumor_samples: + type: list + description: | + List of sample ids for tumor samples (matching sample names in the BCF file). + Only needed for somatic mode and if no sample description file is provided. + - control_samples: + type: list + description: | + List of sample ids for control samples (matching sample names in the BCF file). + Only needed for somatic mode and if no sample description file is provided. +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'sample1', single_end:false ] + - bcf: + type: file + description: Filtered variants in BCF format + pattern: "*.bcf" + - csi: + type: file + description: A generated csi index that matches the bcf output + pattern: "*.bcf.csi" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@alexnater" +maintainers: + - "@alexnater" diff --git a/modules/nf-core/delly/filter/tests/main.nf.test b/modules/nf-core/delly/filter/tests/main.nf.test new file mode 100644 index 00000000000..1b5364f57d5 --- /dev/null +++ b/modules/nf-core/delly/filter/tests/main.nf.test @@ -0,0 +1,270 @@ +nextflow_process { + + name "Test Process DELLY_FILTER" + script "../main.nf" + process "DELLY_FILTER" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "delly" + tag "delly/call" + tag "delly/filter" + + test("germline, out:bcf") { + setup { + run("DELLY_CALL") { + script "../../call/main.nf" + process { + """ + input[0] = [ + [ id:'control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + [], + [], + [] + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + """ + } + } + } + + when { + params { + suffix = 'bcf' + } + process { + """ + input[0] = DELLY_CALL.out.bcf.join(DELLY_CALL.out.csi) + input[1] = "germline" + input[2] = [] + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.versions } + ) + } + } + + test("germline, out:vcf") { + setup { + run("DELLY_CALL") { + script "../../call/main.nf" + process { + """ + input[0] = [ + [ id:'control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + [], + [], + [] + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + """ + } + } + } + + when { + params { + suffix = 'vcf' + } + process { + """ + input[0] = DELLY_CALL.out.bcf.join(DELLY_CALL.out.csi) + input[1] = "germline" + input[2] = [] + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.bcf, + file(process.out.csi[0][1]).name, + process.out.versions + ).match() + }, + { assert process.out.versions } + ) + } + } + + test("germline, out:bcf - stub") { + + options "-stub" + + when { + params { + suffix = 'bcf' + } + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [], + [] + ] + input[1] = "germline" + input[2] = [] + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.versions } + ) + } + + } + + test("somatic, out:bcf") { + setup { + run("DELLY_CALL") { + script "../../call/main.nf" + process { + """ + input[0] = [ + [ id:'tumor_control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + [] + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + """ + } + } + } + when { + params { + suffix = 'bcf' + } + process { + """ + ch_input = DELLY_CALL.out.bcf + .join(DELLY_CALL.out.csi) + input[0] = ch_input + input[1] = "somatic" + input[2] = [] + input[3] = ['tumour'] + input[4] = ['normal'] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.versions } + ) + } + } + + test("somatic, out:vcf") { + setup { + run("DELLY_CALL") { + script "../../call/main.nf" + process { + """ + input[0] = [ + [ id:'tumor_control' ], // meta map + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam'], checkIfExists: true), + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], + [], + [] + ] + input[1] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) + ] + input[2] = [ + [ id:'human' ], + file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) + ] + """ + } + } + } + when { + params { + suffix = 'vcf' + } + process { + """ + ch_input = DELLY_CALL.out.bcf + .join(DELLY_CALL.out.csi) + input[0] = ch_input + input[1] = "somatic" + input[2] = [] + input[3] = ['tumour'] + input[4] = ['normal'] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.bcf, + file(process.out.csi[0][1]).name, + process.out.versions + ).match() + }, + { assert process.out.versions } + ) + } + } +} diff --git a/modules/nf-core/delly/filter/tests/main.nf.test.snap b/modules/nf-core/delly/filter/tests/main.nf.test.snap new file mode 100644 index 00000000000..e287d50f631 --- /dev/null +++ b/modules/nf-core/delly/filter/tests/main.nf.test.snap @@ -0,0 +1,436 @@ +{ + "germline - vcf": { + "content": [ + { + "0": [ + [ + { + "id": "control" + }, + "control.filtered.vcf.gz:md5,5ad9b88451652e7016f868afff34663d" + ] + ], + "1": [ + [ + { + "id": "control" + }, + "control.filtered.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" + ] + ], + "2": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ], + "bcf": [ + [ + { + "id": "control" + }, + "control.filtered.vcf.gz:md5,5ad9b88451652e7016f868afff34663d" + ] + ], + "csi": [ + [ + { + "id": "control" + }, + "control.filtered.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" + ] + ], + "versions": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-28T17:12:10.446267262" + }, + "germline, out:vcf": { + "content": [ + [ + [ + { + "id": "control" + }, + "control.filtered.vcf.gz:md5,ea9954c30161573c866117e9c270543f" + ] + ], + "control.filtered.vcf.gz.tbi", + [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T16:52:24.481427707" + }, + "somatic - bcf": { + "content": [ + { + "0": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.bcf:md5,95aa415128c8e9806e3415f9e2598e4a" + ] + ], + "1": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,f67ef5fd2fa49a82ccea58f0d3d5ad0f" + ], + "bcf": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.bcf:md5,95aa415128c8e9806e3415f9e2598e4a" + ] + ], + "csi": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,f67ef5fd2fa49a82ccea58f0d3d5ad0f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-28T17:01:49.506842172" + }, + "germline, out:bcf": { + "content": [ + { + "0": [ + [ + { + "id": "control" + }, + "control.filtered.bcf:md5,9e59a224ae0be4d2fa07c3742b4143dc" + ] + ], + "1": [ + [ + { + "id": "control" + }, + "control.filtered.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ], + "bcf": [ + [ + { + "id": "control" + }, + "control.filtered.bcf:md5,9e59a224ae0be4d2fa07c3742b4143dc" + ] + ], + "csi": [ + [ + { + "id": "control" + }, + "control.filtered.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T16:52:13.714416817" + }, + "germline, out:bcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.filtered.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.filtered.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ], + "bcf": [ + [ + { + "id": "test" + }, + "test.filtered.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + [ + { + "id": "test" + }, + "test.filtered.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-02T15:01:00.391495451" + }, + "somatic, out:bcf": { + "content": [ + { + "0": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.bcf:md5,6ddf6991c652e7a8728363c901fa728b" + ] + ], + "1": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,f67ef5fd2fa49a82ccea58f0d3d5ad0f" + ], + "bcf": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.bcf:md5,6ddf6991c652e7a8728363c901fa728b" + ] + ], + "csi": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,f67ef5fd2fa49a82ccea58f0d3d5ad0f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T16:52:42.486375101" + }, + "somatic - vcf": { + "content": [ + { + "0": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.vcf.gz:md5,462cf52ecf899b3e5fa29beacaf15eb6" + ] + ], + "1": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" + ] + ], + "2": [ + "versions.yml:md5,f67ef5fd2fa49a82ccea58f0d3d5ad0f" + ], + "bcf": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.vcf.gz:md5,462cf52ecf899b3e5fa29beacaf15eb6" + ] + ], + "csi": [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" + ] + ], + "versions": [ + "versions.yml:md5,f67ef5fd2fa49a82ccea58f0d3d5ad0f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-28T17:15:30.448939231" + }, + "somatic, out:vcf": { + "content": [ + [ + [ + { + "id": "tumor_control" + }, + "tumor_control.filtered.vcf.gz:md5,a85a88fec57b657d9fed01e2a65199e4" + ] + ], + "tumor_control.filtered.vcf.gz.tbi", + [ + "versions.yml:md5,f67ef5fd2fa49a82ccea58f0d3d5ad0f" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-03T16:52:53.78719012" + }, + "germline - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.filtered.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.filtered.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ], + "bcf": [ + [ + { + "id": "test" + }, + "test.filtered.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + [ + { + "id": "test" + }, + "test.filtered.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-21T17:17:18.241522976" + }, + "germline - bcf": { + "content": [ + { + "0": [ + [ + { + "id": "control" + }, + "control.filtered.bcf:md5,e34200aa9681cfa2ffd4d62aa7714c70" + ] + ], + "1": [ + [ + { + "id": "control" + }, + "control.filtered.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "2": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ], + "bcf": [ + [ + { + "id": "control" + }, + "control.filtered.bcf:md5,e34200aa9681cfa2ffd4d62aa7714c70" + ] + ], + "csi": [ + [ + { + "id": "control" + }, + "control.filtered.bcf.csi:md5,66545c77fc791a02dadc7fc252d04635" + ] + ], + "versions": [ + "versions.yml:md5,f45104c406e3750e1f09c3ead45a8829" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-28T17:07:24.711897762" + } +} \ No newline at end of file diff --git a/modules/nf-core/delly/filter/tests/nextflow.config b/modules/nf-core/delly/filter/tests/nextflow.config new file mode 100644 index 00000000000..8b440dbd88a --- /dev/null +++ b/modules/nf-core/delly/filter/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: DELLY_FILTER { + ext.prefix = { "${meta.id}.filtered" } + ext.suffix = { params.suffix ?: '' } + } +} \ No newline at end of file diff --git a/modules/nf-core/delly/filter/tests/tags.yml b/modules/nf-core/delly/filter/tests/tags.yml new file mode 100644 index 00000000000..5acc4a869d6 --- /dev/null +++ b/modules/nf-core/delly/filter/tests/tags.yml @@ -0,0 +1,2 @@ +delly/filter: + - "modules/nf-core/delly/filter/**"