From 77747eafe3b64a016852a352faa68f90884738ca Mon Sep 17 00:00:00 2001 From: Alexander Nater Date: Wed, 20 Mar 2024 18:22:34 +0100 Subject: [PATCH] Changed inputs to delly/call --- modules/nf-core/delly/call/main.nf | 23 +++++------- modules/nf-core/delly/call/meta.yml | 26 +++++++++---- modules/nf-core/delly/call/tests/main.nf.test | 37 +++++++------------ .../delly/call/tests/main.nf.test.snap | 6 +-- .../nf-core/delly/filter/tests/main.nf.test | 26 +++++-------- .../delly/filter/tests/main.nf.test.snap | 26 ++++++------- 6 files changed, 66 insertions(+), 78 deletions(-) diff --git a/modules/nf-core/delly/call/main.nf b/modules/nf-core/delly/call/main.nf index 68c6e41d39de..21446301756c 100644 --- a/modules/nf-core/delly/call/main.nf +++ b/modules/nf-core/delly/call/main.nf @@ -8,15 +8,14 @@ process DELLY_CALL { 'biocontainers/delly:1.2.6--hb7e2ac5_0' }" input: - tuple val(meta) , path(input) , path(input_index) - tuple val(meta2), path(input_control), path(control_index) - tuple val(meta3), path(fasta) , path(fai) - tuple val(meta4), 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(exclude_bed) + tuple val(ref_meta), path(fasta), path(fai) + tuple val(vcf_meta), path(vcf), path(vcf_index) output: - tuple val(new_meta), path("*.{bcf,vcf.gz}") , emit: bcf - tuple val(new_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 @@ -24,16 +23,15 @@ process DELLY_CALL { script: def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' - new_meta = meta2?.id ? meta + [ id:"${meta.id}_${meta2.id}" ] : meta - def prefix = task.ext.prefix ?: "${new_meta.id}" + 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 inputs = input_control ? "${input} ${input_control}" : "${input}" def genotype = vcf ? "--vcffile ${vcf}" : "" """ @@ -44,7 +42,7 @@ process DELLY_CALL { --genome ${fasta} \\ ${genotype} \\ ${exclude} \\ - ${inputs} \\ + ${input} \\ ${vcf_output} cat <<-END_VERSIONS > versions.yml @@ -54,8 +52,7 @@ process DELLY_CALL { """ stub: - new_meta = meta2?.id ? meta + [ id:"${meta.id}_${meta2.id}" ] : meta - def prefix = task.ext.prefix ?: "${new_meta.id}" + def prefix = task.ext.prefix ?: "${meta.id}" def suffix = task.ext.suffix ?: "bcf" def bcf_output = suffix == "bcf" ? "touch ${prefix}.bcf && touch ${prefix}.bcf.csi" : "" diff --git a/modules/nf-core/delly/call/meta.yml b/modules/nf-core/delly/call/meta.yml index eabb2ccd81c4..bca177c19a1e 100644 --- a/modules/nf-core/delly/call/meta.yml +++ b/modules/nf-core/delly/call/meta.yml @@ -18,24 +18,33 @@ input: 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_control: + - 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}" - - control_index: + - input_ctrl_idx: type: file description: Optional index of the control 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" + - ref_meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - fasta: type: file description: The reference fasta file @@ -44,6 +53,11 @@ input: type: file description: Index of reference fasta file to identify split-reads pattern: "*.fai" + - vcf_meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - vcf: type: file description: A BCF/VCF file to genotype with Delly. If this is supplied, the variant calling will be skipped @@ -52,10 +66,6 @@ input: type: file description: The index of the BCF/VCF file pattern: "*.{tbi,csi}" - - exclude_bed: - type: file - description: An optional bed file containing regions to exclude from the called VCF - pattern: "*.bed" output: - meta: type: map diff --git a/modules/nf-core/delly/call/tests/main.nf.test b/modules/nf-core/delly/call/tests/main.nf.test index ece184b79c7b..d53a5d6da7de 100644 --- a/modules/nf-core/delly/call/tests/main.nf.test +++ b/modules/nf-core/delly/call/tests/main.nf.test @@ -16,22 +16,19 @@ nextflow_process { input[0] = [ [ id:'tumor' ], // 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] = [ - [:], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], [], [] ] - input[2] = [ + input[1] = [ [ id:'human' ], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true), file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) ] - input[3] = [ + input[2] = [ [:], [], - [], [] ] """ @@ -57,22 +54,19 @@ nextflow_process { input[0] = [ [ id:'test' ], // meta map [], - [] - ] - input[1] = [ - [:], // meta map + [], + [], [], [] ] - input[2] = [ + input[1] = [ [:], [], [] ] - input[3] = [ + input[2] = [ [:], [], - [], [] ] """ @@ -94,24 +88,21 @@ nextflow_process { process { """ input[0] = [ - [ id:'tumor' ], // meta map + [ 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) - ] - input[1] = [ - [ id:'control' ], // meta map + 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_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [] ] - input[2] = [ + input[1] = [ [ id:'human' ], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true), file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) ] - input[3] = [ + input[2] = [ [:], [], - [], [] ] """ 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 44962ca05d44..7a6715ce7a81 100644 --- a/modules/nf-core/delly/call/tests/main.nf.test.snap +++ b/modules/nf-core/delly/call/tests/main.nf.test.snap @@ -46,7 +46,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T16:02:11.100010405" + "timestamp": "2024-03-20T18:14:52.433340193" }, "germline - stub": { "content": [ @@ -95,7 +95,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T16:10:34.874418672" + "timestamp": "2024-03-20T18:14:39.722070203" }, "germline - bcf": { "content": [ @@ -144,6 +144,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T16:01:54.827949185" + "timestamp": "2024-03-20T18:14:34.070601591" } } \ No newline at end of file diff --git a/modules/nf-core/delly/filter/tests/main.nf.test b/modules/nf-core/delly/filter/tests/main.nf.test index fe76e63d8fbd..047fa1bc4a21 100644 --- a/modules/nf-core/delly/filter/tests/main.nf.test +++ b/modules/nf-core/delly/filter/tests/main.nf.test @@ -19,22 +19,19 @@ nextflow_process { input[0] = [ [ id:'tumor' ], // 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] = [ - [:], // meta map + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [], [], [] ] - input[2] = [ + input[1] = [ [ id:'human' ], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true), file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) ] - input[3] = [ + input[2] = [ [:], [], - [], [] ] """ @@ -96,24 +93,21 @@ nextflow_process { process { """ input[0] = [ - [ id:'tumor' ], // meta map + [ 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) - ] - input[1] = [ - [ id:'control' ], // meta map + 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_paired_end_recalibrated_sorted_bam_bai'], checkIfExists: true), + [] ] - input[2] = [ + input[1] = [ [ id:'human' ], file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true), file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true) ] - input[3] = [ + input[2] = [ [:], [], - [], [] ] """ diff --git a/modules/nf-core/delly/filter/tests/main.nf.test.snap b/modules/nf-core/delly/filter/tests/main.nf.test.snap index 2e477e557315..aecd443feefe 100644 --- a/modules/nf-core/delly/filter/tests/main.nf.test.snap +++ b/modules/nf-core/delly/filter/tests/main.nf.test.snap @@ -13,7 +13,7 @@ "normal" ] }, - "tumor_control.filtered.bcf:md5,137b11511390742b837df463ae796e4b" + "tumor_control.filtered.bcf:md5,f800321d204cf1b9cf75b046d3d47966" ] ], "1": [ @@ -44,7 +44,7 @@ "normal" ] }, - "tumor_control.filtered.bcf:md5,137b11511390742b837df463ae796e4b" + "tumor_control.filtered.bcf:md5,f800321d204cf1b9cf75b046d3d47966" ] ], "csi": [ @@ -70,7 +70,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T14:25:58.99077644" + "timestamp": "2024-03-20T18:17:42.340979919" }, "germline - stub": { "content": [ @@ -78,8 +78,7 @@ "0": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.filtered.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -87,8 +86,7 @@ "1": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.filtered.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -99,8 +97,7 @@ "bcf": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.filtered.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -108,8 +105,7 @@ "csi": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "test.filtered.bcf.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -123,7 +119,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T14:25:48.459643485" + "timestamp": "2024-03-20T18:17:31.196989936" }, "germline - bcf": { "content": [ @@ -133,7 +129,7 @@ { "id": "tumor" }, - "tumor.filtered.bcf:md5,8c3275b2c3fc4e602d046dc48da821a6" + "tumor.filtered.bcf:md5,c55154b7df0c17582502c68f7e9fdeb7" ] ], "1": [ @@ -152,7 +148,7 @@ { "id": "tumor" }, - "tumor.filtered.bcf:md5,8c3275b2c3fc4e602d046dc48da821a6" + "tumor.filtered.bcf:md5,c55154b7df0c17582502c68f7e9fdeb7" ] ], "csi": [ @@ -172,6 +168,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T14:33:16.074500224" + "timestamp": "2024-03-20T18:17:25.604783015" } } \ No newline at end of file