From 44e975ae83ca76a0f399b0c4bdce5ac0ef0d5eaf Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 18 Nov 2024 10:26:25 +0100 Subject: [PATCH 01/13] update bcftools pluginsplit --- modules/nf-core/bcftools/pluginsplit/main.nf | 48 +++- .../bcftools/pluginsplit/tests/main.nf.test | 68 +++++- .../pluginsplit/tests/main.nf.test.snap | 231 ++++++++++++++++-- .../pluginsplit/tests/nextflow_suffix.config | 6 + 4 files changed, 322 insertions(+), 31 deletions(-) create mode 100644 modules/nf-core/bcftools/pluginsplit/tests/nextflow_suffix.config diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index 082802be709..24a374be4bf 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -15,10 +15,10 @@ process BCFTOOLS_PLUGINSPLIT { path(targets) output: - tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf - tuple val(meta), path("*.tbi") , emit: tbi, optional: true - tuple val(meta), path("*.csi") , emit: csi, optional: true - path "versions.yml" , emit: versions + tuple val(meta), path("*/*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf + tuple val(meta), path("*/*.tbi") , emit: tbi, optional: true + tuple val(meta), path("*/*.csi") , emit: csi, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -26,6 +26,7 @@ process BCFTOOLS_PLUGINSPLIT { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "" def samples_arg = samples ? "--samples-file ${samples}" : "" def groups_arg = groups ? "--groups-file ${groups}" : "" @@ -42,7 +43,17 @@ process BCFTOOLS_PLUGINSPLIT { ${targets_arg} \\ --output ${prefix} - mv ${prefix}/* . + for file in ${prefix}/*; do + # Extract the basename + base_name=\$(basename "\$file") + # Extract the part of the basename before the first dot + name_before_dot="\${base_name%%.*}" + # Extract the extension + extension="\${base_name#\${name_before_dot}}" + # Construct the new name + new_name="\${name_before_dot}${suffix}\${extension}" + mv "\$file" "${prefix}/\$new_name" + done cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -53,6 +64,7 @@ process BCFTOOLS_PLUGINSPLIT { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "" def extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" : args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : @@ -65,11 +77,29 @@ process BCFTOOLS_PLUGINSPLIT { "" def determination_file = samples ?: targets def create_cmd = extension.matches("vcf|bcf") ? "touch " : "echo '' | gzip > " - def create_files = "cut -f 3 ${determination_file} | sed -e 's/\$/.${extension}/' > files.txt; while IFS= read -r filename; do ${create_cmd} \"\$filename\"; done < files.txt" - def create_index = index.matches("csi|tbi") ? "cut -f 3 ${determination_file} | sed -e 's/\$/.${extension}.${index}/' > indices.txt; touch \$( files.txt + while IFS= read -r filename; + do ${create_cmd} "${prefix}/\$filename"; + if [ -n "${index}" ]; then + index_file=\$(sed -e 's/\$/.${index}/' <<< \$filename); + touch ${prefix}/\$index_file; + fi; + done < files.txt + + for file in ${prefix}/*; do + # Extract the basename + base_name=\$(basename "\$file") + # Extract the part of the basename before the first dot + name_before_dot="\${base_name%%.*}" + # Extract the extension + extension="\${base_name#\${name_before_dot}}" + # Construct the new name + new_name="\${name_before_dot}${suffix}\${extension}" + mv "\$file" "${prefix}/\$new_name" + done cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index e3160851893..786c545cd4b 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -90,17 +90,42 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.tbi.get(0).get(1).find { file(it).name.matches("normal.vcf.gz.tbi|tumor.vcf.gz.tbi") }, - ) } + { assert snapshot(process.out).match() } ) } } - test("homo_sapiens - [ vcf, tbi ], samples, [], [], [] -stub") { + test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix") { + config "./nextflow_suffix.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA24385_sv.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA24385_sv.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + input[2] = [] + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - [ vcf, tbi ], samples, [], [], [] -stub") { options "-stub" when { @@ -130,7 +155,6 @@ nextflow_process { } test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets -stub") { - options "-stub" when { @@ -160,7 +184,6 @@ nextflow_process { } test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi -stub") { - config "./nextflow.config" options "-stub" @@ -189,4 +212,35 @@ nextflow_process { } } + + test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix -stub") { + + config "./nextflow_suffix.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = Channel.of("normal\t-\tnormal", "tumour\t-\ttumour") + .collectFile(name:"samples.txt", newLine:true) + input[2] = [] + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } } diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap index 66c3c1dda5e..f5fe024b2a5 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap @@ -1,4 +1,75 @@ { + "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "normal.suffix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "tumour.suffix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "normal.suffix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", + "tumour.suffix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "normal.suffix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", + "tumour.suffix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "normal.suffix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "tumour.suffix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-18T10:22:56.93123902" + }, "homo_sapiens - [ vcf, tbi ], samples, [], [], [] -stub": { "content": [ { @@ -47,18 +118,148 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.1", + "nextflow": "24.10.0" }, - "timestamp": "2024-07-09T15:56:42.307673651" + "timestamp": "2024-11-18T10:14:37.188961484" + }, + "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "normal.vcf.gz:md5,78e962c3a724790b27041f28a4180600", + "tumour.vcf.gz:md5,3008a0a06a2f319897fa04ea0018fcdd" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "normal.vcf.gz.tbi:md5,e7180bb953d2bd657c420a5f76a7164d", + "tumour.vcf.gz.tbi:md5,e7180bb953d2bd657c420a5f76a7164d" + ] + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "normal.vcf.gz.tbi:md5,e7180bb953d2bd657c420a5f76a7164d", + "tumour.vcf.gz.tbi:md5,e7180bb953d2bd657c420a5f76a7164d" + ] + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "normal.vcf.gz:md5,78e962c3a724790b27041f28a4180600", + "tumour.vcf.gz:md5,3008a0a06a2f319897fa04ea0018fcdd" + ] + ] + ], + "versions": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-18T10:21:51.332969425" }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets": { "content": null, "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-18T10:13:57.286300359" + }, + "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "NA24385.suffix.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "NA24385.suffix.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "NA24385.suffix.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "NA24385.suffix.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" + ] + ], + "versions": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" }, - "timestamp": "2024-07-09T15:56:21.498991402" + "timestamp": "2024-11-18T10:22:03.743478849" }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi -stub": { "content": [ @@ -126,10 +327,10 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.1", + "nextflow": "24.10.0" }, - "timestamp": "2024-07-09T15:57:04.483688966" + "timestamp": "2024-11-18T10:15:04.70664725" }, "homo_sapiens - [ vcf, tbi ], samples, [], [], []": { "content": [ @@ -179,10 +380,10 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.1", + "nextflow": "24.10.0" }, - "timestamp": "2024-07-09T15:56:10.033818589" + "timestamp": "2024-11-18T10:13:43.126600204" }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets -stub": { "content": [ @@ -232,9 +433,9 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.1", + "nextflow": "24.10.0" }, - "timestamp": "2024-07-09T15:56:53.641165787" + "timestamp": "2024-11-18T10:14:51.588072251" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/pluginsplit/tests/nextflow_suffix.config b/modules/nf-core/bcftools/pluginsplit/tests/nextflow_suffix.config new file mode 100644 index 00000000000..97aeb549f6b --- /dev/null +++ b/modules/nf-core/bcftools/pluginsplit/tests/nextflow_suffix.config @@ -0,0 +1,6 @@ +process { + withName: 'BCFTOOLS_PLUGINSPLIT' { + ext.suffix = ".suffix" + ext.args = '--write-index=tbi --output-type z' + } +} From 13b4f2b775a6851909bd432819e347ff6acced1a Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 18 Nov 2024 11:03:37 +0100 Subject: [PATCH 02/13] Add error test --- modules/nf-core/bcftools/pluginsplit/main.nf | 48 ++++++++++--------- modules/nf-core/bcftools/pluginsplit/meta.yml | 6 +-- .../bcftools/pluginsplit/tests/main.nf.test | 32 ++++++++++++- 3 files changed, 60 insertions(+), 26 deletions(-) diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index 24a374be4bf..92b54ee96f2 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -43,17 +43,19 @@ process BCFTOOLS_PLUGINSPLIT { ${targets_arg} \\ --output ${prefix} - for file in ${prefix}/*; do - # Extract the basename - base_name=\$(basename "\$file") - # Extract the part of the basename before the first dot - name_before_dot="\${base_name%%.*}" - # Extract the extension - extension="\${base_name#\${name_before_dot}}" - # Construct the new name - new_name="\${name_before_dot}${suffix}\${extension}" - mv "\$file" "${prefix}/\$new_name" - done + if [ -n "${suffix}" ]; then + for file in ${prefix}/*; do + # Extract the basename + base_name=\$(basename "\$file") + # Extract the part of the basename before the first dot + name_before_dot="\${base_name%%.*}" + # Extract the extension + extension="\${base_name#\${name_before_dot}}" + # Construct the new name + new_name="\${name_before_dot}${suffix}\${extension}" + mv "\$file" "${prefix}/\$new_name" + done + fi cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -89,17 +91,19 @@ process BCFTOOLS_PLUGINSPLIT { fi; done < files.txt - for file in ${prefix}/*; do - # Extract the basename - base_name=\$(basename "\$file") - # Extract the part of the basename before the first dot - name_before_dot="\${base_name%%.*}" - # Extract the extension - extension="\${base_name#\${name_before_dot}}" - # Construct the new name - new_name="\${name_before_dot}${suffix}\${extension}" - mv "\$file" "${prefix}/\$new_name" - done + if [ -n "${suffix}" ]; then + for file in ${prefix}/*; do + # Extract the basename + base_name=\$(basename "\$file") + # Extract the part of the basename before the first dot + name_before_dot="\${base_name%%.*}" + # Extract the extension + extension="\${base_name#\${name_before_dot}}" + # Construct the new name + new_name="\${name_before_dot}${suffix}\${extension}" + mv "\$file" "${prefix}/\$new_name" + done + fi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/pluginsplit/meta.yml b/modules/nf-core/bcftools/pluginsplit/meta.yml index 41f766584fb..0c548858c5c 100644 --- a/modules/nf-core/bcftools/pluginsplit/meta.yml +++ b/modules/nf-core/bcftools/pluginsplit/meta.yml @@ -61,7 +61,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.{vcf,vcf.gz,bcf,bcf.gz}": + - "/*.{vcf,vcf.gz,bcf,bcf.gz}": type: file description: The resulting VCF files from the split pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" @@ -71,7 +71,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.tbi": + - "/*.tbi": type: file description: TBI file pattern: "*.tbi" @@ -81,7 +81,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.csi": + - "/*.csi": type: file description: CSI file pattern: "*.csi" diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index 786c545cd4b..baf9bb203f4 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -96,7 +96,7 @@ nextflow_process { } - test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix") { + test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with suffix") { config "./nextflow_suffix.config" @@ -125,6 +125,36 @@ nextflow_process { } + test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - error no sample") { + tag "test" + + config "./nextflow_suffix.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + input[2] = [] + input[3] = [] + input[4] = [] + """ + } + } + + then { + assertAll( + { assert process.failed }, + { assert process.errorReport.contains("No samples to split: dbsnp_146.hg38.vcf.gz") } + ) + } + + } + test("homo_sapiens - [ vcf, tbi ], samples, [], [], [] -stub") { options "-stub" From 3a0ffd90f8e52dcd71bf8a190831a9c8ccc6a516 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 18 Nov 2024 11:38:37 +0100 Subject: [PATCH 03/13] Fix test and meta --- modules/nf-core/bcftools/pluginsplit/meta.yml | 6 +++--- .../nf-core/bcftools/pluginsplit/tests/main.nf.test | 1 - .../bcftools/pluginsplit/tests/main.nf.test.snap | 10 +++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/nf-core/bcftools/pluginsplit/meta.yml b/modules/nf-core/bcftools/pluginsplit/meta.yml index 0c548858c5c..e9f6a6c4731 100644 --- a/modules/nf-core/bcftools/pluginsplit/meta.yml +++ b/modules/nf-core/bcftools/pluginsplit/meta.yml @@ -61,7 +61,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "/*.{vcf,vcf.gz,bcf,bcf.gz}": + - "*/*.{vcf,vcf.gz,bcf,bcf.gz}": type: file description: The resulting VCF files from the split pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" @@ -71,7 +71,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "/*.tbi": + - "*/*.tbi": type: file description: TBI file pattern: "*.tbi" @@ -81,7 +81,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "/*.csi": + - "*/*.csi": type: file description: CSI file pattern: "*.csi" diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index baf9bb203f4..95987c4e24f 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -126,7 +126,6 @@ nextflow_process { } test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - error no sample") { - tag "test" config "./nextflow_suffix.config" diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap index f5fe024b2a5..825f4815e2d 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap @@ -145,8 +145,8 @@ "single_end": false }, [ - "normal.vcf.gz.tbi:md5,e7180bb953d2bd657c420a5f76a7164d", - "tumour.vcf.gz.tbi:md5,e7180bb953d2bd657c420a5f76a7164d" + "normal.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905", + "tumour.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" ] ] ], @@ -166,8 +166,8 @@ "single_end": false }, [ - "normal.vcf.gz.tbi:md5,e7180bb953d2bd657c420a5f76a7164d", - "tumour.vcf.gz.tbi:md5,e7180bb953d2bd657c420a5f76a7164d" + "normal.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905", + "tumour.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" ] ] ], @@ -192,7 +192,7 @@ "nf-test": "0.9.1", "nextflow": "24.10.0" }, - "timestamp": "2024-11-18T10:21:51.332969425" + "timestamp": "2024-11-18T11:34:33.850283173" }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets": { "content": null, From e0fca182d9b38b2b110b3b70ef2d8ebb019a2292 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 18 Nov 2024 12:30:54 +0100 Subject: [PATCH 04/13] Fix test --- .../bcftools/pluginsplit/tests/main.nf.test | 5 +- .../pluginsplit/tests/main.nf.test.snap | 74 +++---------------- 2 files changed, 16 insertions(+), 63 deletions(-) diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index 95987c4e24f..e46ef43c774 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -90,7 +90,10 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.vcf.collect{ it[1].collect { file(it).name } }, + process.out.tbi.collect{ it[1].collect { file(it).name } }, + ).match() } ) } diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap index 825f4815e2d..6f05bbe8a76 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap @@ -125,74 +125,24 @@ }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "normal.vcf.gz:md5,78e962c3a724790b27041f28a4180600", - "tumour.vcf.gz:md5,3008a0a06a2f319897fa04ea0018fcdd" - ] - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "normal.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905", - "tumour.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" - ] - ] - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ], - "csi": [ - - ], - "tbi": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "normal.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905", - "tumour.vcf.gz.tbi:md5,4cb176febbc8c26d717a6c6e67b9c905" - ] - ] - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "normal.vcf.gz:md5,78e962c3a724790b27041f28a4180600", - "tumour.vcf.gz:md5,3008a0a06a2f319897fa04ea0018fcdd" - ] - ] - ], - "versions": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + [ + [ + "normal.vcf.gz", + "tumour.vcf.gz" ] - } + ], + [ + [ + "normal.vcf.gz.tbi", + "tumour.vcf.gz.tbi" + ] + ] ], "meta": { "nf-test": "0.9.1", "nextflow": "24.10.0" }, - "timestamp": "2024-11-18T11:34:33.850283173" + "timestamp": "2024-11-18T12:29:33.856016049" }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets": { "content": null, From b1e171bbfdda8cd37f8ebcae963aaf3c0cdccb21 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 18 Nov 2024 13:23:19 +0100 Subject: [PATCH 05/13] Change extension detection --- modules/nf-core/bcftools/pluginsplit/main.nf | 22 ++++--- .../bcftools/pluginsplit/tests/main.nf.test | 1 - .../pluginsplit/tests/main.nf.test.snap | 59 +++++++++++++++++++ 3 files changed, 73 insertions(+), 9 deletions(-) diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index 92b54ee96f2..896e9a74359 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -47,12 +47,15 @@ process BCFTOOLS_PLUGINSPLIT { for file in ${prefix}/*; do # Extract the basename base_name=\$(basename "\$file") - # Extract the part of the basename before the first dot - name_before_dot="\${base_name%%.*}" # Extract the extension - extension="\${base_name#\${name_before_dot}}" + extension="" + # Remove the extension if it exists + if [[ "\$base_name" =~ \\.(vcf|bcf)(\\.gz)?(\\.tbi|\\.csi)?\$ ]]; then + extension="\${BASH_REMATCH[0]}" + base_name="\${base_name%\$extension}" + fi # Construct the new name - new_name="\${name_before_dot}${suffix}\${extension}" + new_name="\${base_name}${suffix}\${extension}" mv "\$file" "${prefix}/\$new_name" done fi @@ -95,12 +98,15 @@ process BCFTOOLS_PLUGINSPLIT { for file in ${prefix}/*; do # Extract the basename base_name=\$(basename "\$file") - # Extract the part of the basename before the first dot - name_before_dot="\${base_name%%.*}" # Extract the extension - extension="\${base_name#\${name_before_dot}}" + extension="" + # Remove the extension if it exists + if [[ "\$base_name" =~ \\.(vcf|bcf)(\\.gz)?(\\.tbi|\\.csi)?\$ ]]; then + extension="\${BASH_REMATCH[0]}" + base_name="\${base_name%\$extension}" + fi # Construct the new name - new_name="\${name_before_dot}${suffix}\${extension}" + new_name="\${base_name}${suffix}\${extension}" mv "\$file" "${prefix}/\$new_name" done fi diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index e46ef43c774..6e201770614 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -100,7 +100,6 @@ nextflow_process { } test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with suffix") { - config "./nextflow_suffix.config" when { diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap index 6f05bbe8a76..afcfadd5879 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap @@ -1,4 +1,63 @@ { + "homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with suffix": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "NA24385.suffix.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "NA24385.suffix.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "NA24385.suffix.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "NA24385.suffix.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" + ] + ], + "versions": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-18T13:20:35.912534311" + }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix -stub": { "content": [ { From b790fe99d4b92581957eca9ba29fdd9d78f1ac86 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 18 Nov 2024 14:31:42 +0100 Subject: [PATCH 06/13] Change file renaming --- modules/nf-core/bcftools/pluginsplit/main.nf | 48 +++++-------------- .../bcftools/pluginsplit/tests/main.nf.test | 8 ++-- ...w_suffix.config => nextflow_prefix.config} | 1 + 3 files changed, 17 insertions(+), 40 deletions(-) rename modules/nf-core/bcftools/pluginsplit/tests/{nextflow_suffix.config => nextflow_prefix.config} (80%) diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index 896e9a74359..c38d414b1c8 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -25,8 +25,7 @@ process BCFTOOLS_PLUGINSPLIT { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = task.ext.suffix ?: "" + def prefix = task.ext.prefix ?: "" def samples_arg = samples ? "--samples-file ${samples}" : "" def groups_arg = groups ? "--groups-file ${groups}" : "" @@ -41,22 +40,11 @@ process BCFTOOLS_PLUGINSPLIT { ${groups_arg} \\ ${regions_arg} \\ ${targets_arg} \\ - --output ${prefix} + --output outputDir - if [ -n "${suffix}" ]; then - for file in ${prefix}/*; do - # Extract the basename - base_name=\$(basename "\$file") - # Extract the extension - extension="" - # Remove the extension if it exists - if [[ "\$base_name" =~ \\.(vcf|bcf)(\\.gz)?(\\.tbi|\\.csi)?\$ ]]; then - extension="\${BASH_REMATCH[0]}" - base_name="\${base_name%\$extension}" - fi - # Construct the new name - new_name="\${base_name}${suffix}\${extension}" - mv "\$file" "${prefix}/\$new_name" + if [ -n "${prefix}" ]; then + for file in outputDir/*; do + mv \$file outputDir/${prefix}\$file done fi @@ -68,8 +56,7 @@ process BCFTOOLS_PLUGINSPLIT { stub: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = task.ext.suffix ?: "" + def prefix = task.ext.prefix ?: "" def extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" : args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : @@ -83,31 +70,20 @@ process BCFTOOLS_PLUGINSPLIT { def determination_file = samples ?: targets def create_cmd = extension.matches("vcf|bcf") ? "touch " : "echo '' | gzip > " """ - mkdir -p ${prefix} + mkdir -p outputDir cut -f 3 ${determination_file} | sed -e 's/\$/.${extension}/' > files.txt while IFS= read -r filename; - do ${create_cmd} "${prefix}/\$filename"; + do ${create_cmd} "outputDir/\$filename"; if [ -n "${index}" ]; then index_file=\$(sed -e 's/\$/.${index}/' <<< \$filename); - touch ${prefix}/\$index_file; + touch outputDir/\$index_file; fi; done < files.txt - if [ -n "${suffix}" ]; then - for file in ${prefix}/*; do - # Extract the basename - base_name=\$(basename "\$file") - # Extract the extension - extension="" - # Remove the extension if it exists - if [[ "\$base_name" =~ \\.(vcf|bcf)(\\.gz)?(\\.tbi|\\.csi)?\$ ]]; then - extension="\${BASH_REMATCH[0]}" - base_name="\${base_name%\$extension}" - fi - # Construct the new name - new_name="\${base_name}${suffix}\${extension}" - mv "\$file" "${prefix}/\$new_name" + if [ -n "${prefix}" ]; then + for file in outputDir/*; do + mv \$file outputDir/${prefix}\$file done fi diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index 6e201770614..9aba68a8120 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -99,8 +99,8 @@ nextflow_process { } - test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with suffix") { - config "./nextflow_suffix.config" + test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with prefix") { + config "./nextflow_prefix.config" when { process { @@ -244,9 +244,9 @@ nextflow_process { } - test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix -stub") { + test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with prefix -stub") { - config "./nextflow_suffix.config" + config "./nextflow_prefix.config" options "-stub" when { diff --git a/modules/nf-core/bcftools/pluginsplit/tests/nextflow_suffix.config b/modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config similarity index 80% rename from modules/nf-core/bcftools/pluginsplit/tests/nextflow_suffix.config rename to modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config index 97aeb549f6b..9678fdef44f 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/nextflow_suffix.config +++ b/modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config @@ -1,5 +1,6 @@ process { withName: 'BCFTOOLS_PLUGINSPLIT' { + ext.prefix = "${meta.id}." ext.suffix = ".suffix" ext.args = '--write-index=tbi --output-type z' } From 4e25cd60a27574026815dbaf9c614220ad09c44d Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 18 Nov 2024 16:09:01 +0100 Subject: [PATCH 07/13] Fix renaming --- modules/nf-core/bcftools/pluginsplit/main.nf | 4 +- .../bcftools/pluginsplit/tests/main.nf.test | 4 +- .../pluginsplit/tests/main.nf.test.snap | 130 ++++++++++++++++++ .../pluginsplit/tests/nextflow_prefix.config | 3 +- 4 files changed, 136 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index c38d414b1c8..cc15c298171 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -44,7 +44,7 @@ process BCFTOOLS_PLUGINSPLIT { if [ -n "${prefix}" ]; then for file in outputDir/*; do - mv \$file outputDir/${prefix}\$file + mv \$file outputDir/${prefix}\${file##*/} done fi @@ -83,7 +83,7 @@ process BCFTOOLS_PLUGINSPLIT { if [ -n "${prefix}" ]; then for file in outputDir/*; do - mv \$file outputDir/${prefix}\$file + mv \$file outputDir/${prefix}\${file##*/} done fi diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index 9aba68a8120..009897b6393 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -100,6 +100,7 @@ nextflow_process { } test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with prefix") { + config "./nextflow_prefix.config" when { @@ -129,7 +130,7 @@ nextflow_process { test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - error no sample") { - config "./nextflow_suffix.config" + config "./nextflow_prefix.config" when { process { @@ -246,6 +247,7 @@ nextflow_process { test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with prefix -stub") { + tag "test" config "./nextflow_prefix.config" options "-stub" diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap index afcfadd5879..56728077a36 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap @@ -58,6 +58,77 @@ }, "timestamp": "2024-11-18T13:20:35.912534311" }, + "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with prefix -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_normal.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_tumour.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_normal.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_tumour.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_normal.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_tumour.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_normal.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_tumour.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-18T16:08:02.684907361" + }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix -stub": { "content": [ { @@ -129,6 +200,65 @@ }, "timestamp": "2024-11-18T10:22:56.93123902" }, + "homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with prefix": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_NA24385.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_NA24385.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_NA24385.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_NA24385.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" + ] + ], + "versions": [ + "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" + ] + } + ], + "meta": { + "nf-test": "0.9.1", + "nextflow": "24.10.0" + }, + "timestamp": "2024-11-18T15:21:56.957577603" + }, "homo_sapiens - [ vcf, tbi ], samples, [], [], [] -stub": { "content": [ { diff --git a/modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config b/modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config index 9678fdef44f..9715a649291 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config +++ b/modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config @@ -1,7 +1,6 @@ process { withName: 'BCFTOOLS_PLUGINSPLIT' { - ext.prefix = "${meta.id}." - ext.suffix = ".suffix" + ext.prefix = {"${meta.id}_"} // Add a prefix to the output files ext.args = '--write-index=tbi --output-type z' } } From 8e7eb1760022041a04283fc1cc8a9285a72cdbcf Mon Sep 17 00:00:00 2001 From: Louis LE NEZET <58640615+LouisLeNezet@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:31:55 +0100 Subject: [PATCH 08/13] Update modules/nf-core/bcftools/pluginsplit/main.nf Co-authored-by: Felix Lenner <52530259+fellen31@users.noreply.github.com> --- modules/nf-core/bcftools/pluginsplit/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index cc15c298171..0a757e6b2be 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -15,9 +15,9 @@ process BCFTOOLS_PLUGINSPLIT { path(targets) output: - tuple val(meta), path("*/*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf - tuple val(meta), path("*/*.tbi") , emit: tbi, optional: true - tuple val(meta), path("*/*.csi") , emit: csi, optional: true + tuple val(meta), path("outputDir/*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf + tuple val(meta), path("outputDir/*.tbi") , emit: tbi, optional: true + tuple val(meta), path("outputDir/*.csi") , emit: csi, optional: true path "versions.yml" , emit: versions when: From ee7edb5d6fd59f544aa756a2ccf83b65134e7dda Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Mon, 18 Nov 2024 16:40:45 +0100 Subject: [PATCH 09/13] Update bcftools pluginsplit --- modules/nf-core/bcftools/pluginsplit/main.nf | 12 +- modules/nf-core/bcftools/pluginsplit/meta.yml | 6 +- .../pluginsplit/tests/main.nf.test.snap | 227 ++---------------- 3 files changed, 29 insertions(+), 216 deletions(-) diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index 0a757e6b2be..df4145fe355 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -25,6 +25,8 @@ process BCFTOOLS_PLUGINSPLIT { script: def args = task.ext.args ?: '' + // Here the default prefix is an empty string as the filename is created by the plugin + // and the prefix is instead added to the output files in the script def prefix = task.ext.prefix ?: "" def samples_arg = samples ? "--samples-file ${samples}" : "" @@ -74,11 +76,11 @@ process BCFTOOLS_PLUGINSPLIT { cut -f 3 ${determination_file} | sed -e 's/\$/.${extension}/' > files.txt while IFS= read -r filename; - do ${create_cmd} "outputDir/\$filename"; - if [ -n "${index}" ]; then - index_file=\$(sed -e 's/\$/.${index}/' <<< \$filename); - touch outputDir/\$index_file; - fi; + do ${create_cmd} "outputDir/\$filename"; + if [ -n "${index}" ]; then + index_file=\$(sed -e 's/\$/.${index}/' <<< \$filename); + touch outputDir/\$index_file; + fi; done < files.txt if [ -n "${prefix}" ]; then diff --git a/modules/nf-core/bcftools/pluginsplit/meta.yml b/modules/nf-core/bcftools/pluginsplit/meta.yml index e9f6a6c4731..7fbc7d411eb 100644 --- a/modules/nf-core/bcftools/pluginsplit/meta.yml +++ b/modules/nf-core/bcftools/pluginsplit/meta.yml @@ -61,7 +61,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*/*.{vcf,vcf.gz,bcf,bcf.gz}": + - "outputDir/*.{vcf,vcf.gz,bcf,bcf.gz}": type: file description: The resulting VCF files from the split pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" @@ -71,7 +71,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*/*.tbi": + - "outputDir/*.tbi": type: file description: TBI file pattern: "*.tbi" @@ -81,7 +81,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*/*.csi": + - "outputDir/*.csi": type: file description: CSI file pattern: "*.csi" diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap index 56728077a36..64f55df7b01 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap @@ -1,63 +1,4 @@ { - "homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with suffix": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "NA24385.suffix.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "NA24385.suffix.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" - ] - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ], - "csi": [ - - ], - "tbi": [ - [ - { - "id": "test", - "single_end": false - }, - "NA24385.suffix.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" - ] - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - "NA24385.suffix.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" - ] - ], - "versions": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ] - } - ], - "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" - }, - "timestamp": "2024-11-18T13:20:35.912534311" - }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with prefix -stub": { "content": [ { @@ -86,13 +27,13 @@ ] ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ [ @@ -129,77 +70,6 @@ }, "timestamp": "2024-11-18T16:08:02.684907361" }, - "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix -stub": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "normal.suffix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "tumour.suffix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "normal.suffix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", - "tumour.suffix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ], - "csi": [ - - ], - "tbi": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "normal.suffix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", - "tumour.suffix.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "normal.suffix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "tumour.suffix.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ] - ], - "versions": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ] - } - ], - "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" - }, - "timestamp": "2024-11-18T10:22:56.93123902" - }, "homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with prefix": { "content": [ { @@ -222,13 +92,13 @@ ] ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ [ @@ -275,19 +145,19 @@ ] ], "1": [ - + ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ - + ], "vcf": [ [ @@ -341,65 +211,6 @@ }, "timestamp": "2024-11-18T10:13:57.286300359" }, - "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with suffix": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "NA24385.suffix.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "NA24385.suffix.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" - ] - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ], - "csi": [ - - ], - "tbi": [ - [ - { - "id": "test", - "single_end": false - }, - "NA24385.suffix.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" - ] - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - "NA24385.suffix.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" - ] - ], - "versions": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ] - } - ], - "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" - }, - "timestamp": "2024-11-18T10:22:03.743478849" - }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi -stub": { "content": [ { @@ -428,13 +239,13 @@ ] ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ [ @@ -487,19 +298,19 @@ ] ], "1": [ - + ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ - + ], "vcf": [ [ @@ -540,19 +351,19 @@ ] ], "1": [ - + ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ - + ], "vcf": [ [ @@ -577,4 +388,4 @@ }, "timestamp": "2024-11-18T10:14:51.588072251" } -} \ No newline at end of file +} From 8e9cde653ecf4064a77f9856df649bf03212c748 Mon Sep 17 00:00:00 2001 From: LouisLeNezet Date: Wed, 20 Nov 2024 15:02:49 +0100 Subject: [PATCH 10/13] Stage input in folder --- modules/nf-core/bcftools/pluginsplit/main.nf | 34 +-- .../bcftools/pluginsplit/tests/main.nf.test | 67 +----- .../pluginsplit/tests/main.nf.test.snap | 196 +++--------------- .../pluginsplit/tests/nextflow_prefix.config | 6 - 4 files changed, 43 insertions(+), 260 deletions(-) delete mode 100644 modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index df4145fe355..1ab7943f9e4 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -8,26 +8,23 @@ process BCFTOOLS_PLUGINSPLIT { 'biocontainers/bcftools:1.20--h8b25389_0' }" input: - tuple val(meta), path(vcf), path(tbi) + tuple val(meta), path(vcf, stageAs: "?/*"), path(tbi, stageAs: "?/*") path(samples) path(groups) path(regions) path(targets) output: - tuple val(meta), path("outputDir/*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf - tuple val(meta), path("outputDir/*.tbi") , emit: tbi, optional: true - tuple val(meta), path("outputDir/*.csi") , emit: csi, optional: true - path "versions.yml" , emit: versions + tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi, optional: true + tuple val(meta), path("*.csi") , emit: csi, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' - // Here the default prefix is an empty string as the filename is created by the plugin - // and the prefix is instead added to the output files in the script - def prefix = task.ext.prefix ?: "" def samples_arg = samples ? "--samples-file ${samples}" : "" def groups_arg = groups ? "--groups-file ${groups}" : "" @@ -42,13 +39,7 @@ process BCFTOOLS_PLUGINSPLIT { ${groups_arg} \\ ${regions_arg} \\ ${targets_arg} \\ - --output outputDir - - if [ -n "${prefix}" ]; then - for file in outputDir/*; do - mv \$file outputDir/${prefix}\${file##*/} - done - fi + --output . cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -58,7 +49,6 @@ process BCFTOOLS_PLUGINSPLIT { stub: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "" def extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" : args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : @@ -72,23 +62,15 @@ process BCFTOOLS_PLUGINSPLIT { def determination_file = samples ?: targets def create_cmd = extension.matches("vcf|bcf") ? "touch " : "echo '' | gzip > " """ - mkdir -p outputDir - cut -f 3 ${determination_file} | sed -e 's/\$/.${extension}/' > files.txt while IFS= read -r filename; - do ${create_cmd} "outputDir/\$filename"; + do ${create_cmd} "./\$filename"; if [ -n "${index}" ]; then index_file=\$(sed -e 's/\$/.${index}/' <<< \$filename); - touch outputDir/\$index_file; + touch ./\$index_file; fi; done < files.txt - if [ -n "${prefix}" ]; then - for file in outputDir/*; do - mv \$file outputDir/${prefix}\${file##*/} - done - fi - cat <<-END_VERSIONS > versions.yml "${task.process}": bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index 009897b6393..c1d93453923 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -67,7 +67,6 @@ nextflow_process { } test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi") { - config "./nextflow.config" when { @@ -99,38 +98,8 @@ nextflow_process { } - test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with prefix") { - - config "./nextflow_prefix.config" - - when { - process { - """ - input[0] = [ - [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA24385_sv.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/NA24385_sv.vcf.gz.tbi', checkIfExists: true) - ] - input[1] = [] - input[2] = [] - input[3] = [] - input[4] = [] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - test("homo_sapiens - [ vcf, tbi ], [], [], [], [], - error no sample") { - - config "./nextflow_prefix.config" + config "./nextflow.config" when { process { @@ -151,7 +120,7 @@ nextflow_process { then { assertAll( { assert process.failed }, - { assert process.errorReport.contains("No samples to split: dbsnp_146.hg38.vcf.gz") } + { assert process.errorReport.contains("No samples to split: 1/dbsnp_146.hg38.vcf.gz") } ) } @@ -244,36 +213,4 @@ nextflow_process { } } - - test("homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with prefix -stub") { - - tag "test" - config "./nextflow_prefix.config" - options "-stub" - - when { - process { - """ - input[0] = [ - [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi', checkIfExists: true) - ] - input[1] = Channel.of("normal\t-\tnormal", "tumour\t-\ttumour") - .collectFile(name:"samples.txt", newLine:true) - input[2] = [] - input[3] = [] - input[4] = [] - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } } diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap index 64f55df7b01..b915b7cf24f 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test.snap @@ -1,134 +1,4 @@ { - "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi with prefix -stub": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "test_normal.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test_tumour.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "test_normal.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", - "test_tumour.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ], - "csi": [ - - ], - "tbi": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "test_normal.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", - "test_tumour.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - [ - "test_normal.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", - "test_tumour.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" - ] - ] - ], - "versions": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ] - } - ], - "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" - }, - "timestamp": "2024-11-18T16:08:02.684907361" - }, - "homo_sapiens - [ vcf, tbi ], [], [], [], [], - tbi with prefix": { - "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test_NA24385.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test_NA24385.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" - ] - ], - "2": [ - - ], - "3": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ], - "csi": [ - - ], - "tbi": [ - [ - { - "id": "test", - "single_end": false - }, - "test_NA24385.vcf.gz.tbi:md5,7848669b7da31c6a5f680c0b4f4857d2" - ] - ], - "vcf": [ - [ - { - "id": "test", - "single_end": false - }, - "test_NA24385.vcf.gz:md5,a35bd27152b5a9bd9ce5bb3127c68693" - ] - ], - "versions": [ - "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" - ] - } - ], - "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" - }, - "timestamp": "2024-11-18T15:21:56.957577603" - }, "homo_sapiens - [ vcf, tbi ], samples, [], [], [] -stub": { "content": [ { @@ -145,19 +15,19 @@ ] ], "1": [ - + ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ - + ], "vcf": [ [ @@ -177,10 +47,10 @@ } ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.1" }, - "timestamp": "2024-11-18T10:14:37.188961484" + "timestamp": "2024-11-20T14:56:54.383979416" }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi": { "content": [ @@ -198,18 +68,18 @@ ] ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.1" }, - "timestamp": "2024-11-18T12:29:33.856016049" + "timestamp": "2024-11-20T14:56:44.796391578" }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets": { "content": null, "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.1" }, - "timestamp": "2024-11-18T10:13:57.286300359" + "timestamp": "2024-11-20T14:56:36.709842966" }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets - tbi -stub": { "content": [ @@ -239,13 +109,13 @@ ] ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ [ @@ -277,10 +147,10 @@ } ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.1" }, - "timestamp": "2024-11-18T10:15:04.70664725" + "timestamp": "2024-11-20T14:57:11.163588435" }, "homo_sapiens - [ vcf, tbi ], samples, [], [], []": { "content": [ @@ -298,19 +168,19 @@ ] ], "1": [ - + ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ - + ], "vcf": [ [ @@ -330,10 +200,10 @@ } ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.1" }, - "timestamp": "2024-11-18T10:13:43.126600204" + "timestamp": "2024-11-20T14:56:27.978161766" }, "homo_sapiens - [ vcf, tbi ], [], groups, regions, targets -stub": { "content": [ @@ -351,19 +221,19 @@ ] ], "1": [ - + ], "2": [ - + ], "3": [ "versions.yml:md5,8625f8c08503e47d029d48430c0bfccc" ], "csi": [ - + ], "tbi": [ - + ], "vcf": [ [ @@ -383,9 +253,9 @@ } ], "meta": { - "nf-test": "0.9.1", - "nextflow": "24.10.0" + "nf-test": "0.9.2", + "nextflow": "24.10.1" }, - "timestamp": "2024-11-18T10:14:51.588072251" + "timestamp": "2024-11-20T14:57:02.456908152" } -} +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config b/modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config deleted file mode 100644 index 9715a649291..00000000000 --- a/modules/nf-core/bcftools/pluginsplit/tests/nextflow_prefix.config +++ /dev/null @@ -1,6 +0,0 @@ -process { - withName: 'BCFTOOLS_PLUGINSPLIT' { - ext.prefix = {"${meta.id}_"} // Add a prefix to the output files - ext.args = '--write-index=tbi --output-type z' - } -} From 2b5ca280c7ca3ac0aca32eca51a0c3f2fccf22d6 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 20 Nov 2024 17:32:06 +0100 Subject: [PATCH 11/13] Fix meta.yml --- modules/nf-core/bcftools/pluginsplit/meta.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/bcftools/pluginsplit/meta.yml b/modules/nf-core/bcftools/pluginsplit/meta.yml index 7fbc7d411eb..41f766584fb 100644 --- a/modules/nf-core/bcftools/pluginsplit/meta.yml +++ b/modules/nf-core/bcftools/pluginsplit/meta.yml @@ -61,7 +61,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "outputDir/*.{vcf,vcf.gz,bcf,bcf.gz}": + - "*.{vcf,vcf.gz,bcf,bcf.gz}": type: file description: The resulting VCF files from the split pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" @@ -71,7 +71,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "outputDir/*.tbi": + - "*.tbi": type: file description: TBI file pattern: "*.tbi" @@ -81,7 +81,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "outputDir/*.csi": + - "*.csi": type: file description: CSI file pattern: "*.csi" From c7b507af5bef14b4baef3df8e013331c5bf0b9a3 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 21 Nov 2024 11:38:17 +0100 Subject: [PATCH 12/13] Update input --- modules/nf-core/bcftools/pluginsplit/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/bcftools/pluginsplit/main.nf b/modules/nf-core/bcftools/pluginsplit/main.nf index 1ab7943f9e4..e541df114ed 100644 --- a/modules/nf-core/bcftools/pluginsplit/main.nf +++ b/modules/nf-core/bcftools/pluginsplit/main.nf @@ -8,7 +8,7 @@ process BCFTOOLS_PLUGINSPLIT { 'biocontainers/bcftools:1.20--h8b25389_0' }" input: - tuple val(meta), path(vcf, stageAs: "?/*"), path(tbi, stageAs: "?/*") + tuple val(meta), path(vcf, stageAs: "input/*"), path(tbi, stageAs: "input/*") path(samples) path(groups) path(regions) From eb6154e279e8894c42e27e342e85374c5ca70f6a Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 21 Nov 2024 11:59:11 +0100 Subject: [PATCH 13/13] Update error report --- modules/nf-core/bcftools/pluginsplit/tests/main.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test index c1d93453923..e7ae574e1b6 100644 --- a/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test +++ b/modules/nf-core/bcftools/pluginsplit/tests/main.nf.test @@ -120,7 +120,7 @@ nextflow_process { then { assertAll( { assert process.failed }, - { assert process.errorReport.contains("No samples to split: 1/dbsnp_146.hg38.vcf.gz") } + { assert process.errorReport.contains("No samples to split: input/dbsnp_146.hg38.vcf.gz") } ) }