From 3d4d23f59ee2f9eb2993499d18510f41dc92f116 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 5 Mar 2026 15:57:50 +0100 Subject: [PATCH 01/10] strict syntax compatibility --- .github/workflows/nf-test.yml | 1 - main.nf | 13 +++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nf-test.yml b/.github/workflows/nf-test.yml index d77a1c64..0c18ee7a 100644 --- a/.github/workflows/nf-test.yml +++ b/.github/workflows/nf-test.yml @@ -90,7 +90,6 @@ jobs: - name: Run nf-test id: run_nf_test uses: ./.github/actions/nf-test - continue-on-error: ${{ matrix.NXF_VER == 'latest-everything' }} env: NFT_WORKDIR: ${{ env.NFT_WORKDIR }} NXF_VERSION: ${{ matrix.NXF_VER }} diff --git a/main.nf b/main.nf index c8d77c79..32ee9feb 100644 --- a/main.nf +++ b/main.nf @@ -154,16 +154,14 @@ output { } sample_vcfs { path { meta, vcf, tbi -> - def base = "${meta.id}/${meta.id}${meta.variant_type ? '.' + meta.variant_type : ''}" - vcf >> "${base}.vcf.gz" - tbi >> "${base}.vcf.gz.tbi" + vcf >> "${meta.id}/${meta.id}${meta.variant_type ? '.' + meta.variant_type : ''}" + ".vcf.gz" + tbi >> "${meta.id}/${meta.id}${meta.variant_type ? '.' + meta.variant_type : ''}" + ".vcf.gz.tbi" } } family_vcfs { path { meta, vcf, tbi -> - def base = "${meta.id}/${meta.id}${meta.variant_type ? '.' + meta.variant_type : ''}" - vcf >> "${base}.vcf.gz" - tbi >> "${base}.vcf.gz.tbi" + vcf >> "${meta.id}/${meta.id}${meta.variant_type ? '.' + meta.variant_type : ''}" + ".vcf.gz" + tbi >> "${meta.id}/${meta.id}${meta.variant_type ? '.' + meta.variant_type : ''}" + ".vcf.gz.tbi" } } qdnaseq_out { @@ -186,8 +184,7 @@ output { } bedpe { path { meta, bedpe -> - def base = "${meta.id}/${meta.id}${meta.variant_type ? '.' + meta.variant_type : ''}" - bedpe >> "${base}.bedpe" + bedpe >> "${meta.id}/${meta.id}${meta.variant_type ? '.' + meta.variant_type : ''}" + ".bedpe" } } multiqc { From fd489a31e49e98208e63ea777c0a6363e1ae7e7b Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Mon, 16 Mar 2026 13:49:24 +0100 Subject: [PATCH 02/10] fix issue with samtools faidx --- workflows/structural.nf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflows/structural.nf b/workflows/structural.nf index 1a56097a..45ab82ba 100644 --- a/workflows/structural.nf +++ b/workflows/structural.nf @@ -200,7 +200,8 @@ workflow STRUCTURAL { if(!fai){ SAMTOOLS_FAIDX( ch_fasta, - [[], []] + [[], []], + false ) ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions) From b802b4014322bbc22fe15dd1fae7e4311f61425d Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 9 Apr 2026 14:10:39 +0200 Subject: [PATCH 03/10] bump nf-test version --- .github/workflows/nf-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nf-test.yml b/.github/workflows/nf-test.yml index 0c18ee7a..2d015336 100644 --- a/.github/workflows/nf-test.yml +++ b/.github/workflows/nf-test.yml @@ -18,7 +18,7 @@ concurrency: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NFT_VER: "0.9.3" + NFT_VER: "0.9.5" NFT_WORKDIR: "~" NXF_ANSI_LOG: false NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity From a613242e344996b352a0e39c3277a3e004496a19 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 9 Apr 2026 14:16:57 +0200 Subject: [PATCH 04/10] fix version in snap --- tests/default.nf.test.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index a9ec0dde..d013860a 100644 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -73,7 +73,7 @@ "tabix": 1.21 }, "Workflow": { - "nf-cmgg/structural": "v0.3.0" + "nf-cmgg/structural": "v0.4.0dev" } }, [ From cf0aad0a9007f09bb192ff935a03166661782d90 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 9 Apr 2026 14:33:14 +0200 Subject: [PATCH 05/10] fix getRecursiveFileNames issue --- tests/lib/Utils.groovy | 18 ++++++++++++++++++ tests/pipeline/all_types/all.nf.test | 13 +++---------- tests/pipeline/bedpe/bedpe.nf.test | 8 ++++---- tests/pipeline/cnv/cnv.nf.test | 8 ++++---- tests/pipeline/duplicates/duplicates.nf.test | 6 +++--- tests/pipeline/families/families.nf.test | 12 ++++++------ tests/pipeline/repeats/repeats.nf.test | 6 +++--- tests/pipeline/sv/sv.nf.test | 8 ++++---- 8 files changed, 45 insertions(+), 34 deletions(-) create mode 100644 tests/lib/Utils.groovy diff --git a/tests/lib/Utils.groovy b/tests/lib/Utils.groovy new file mode 100644 index 00000000..c98fddbf --- /dev/null +++ b/tests/lib/Utils.groovy @@ -0,0 +1,18 @@ +import java.nio.file.Path +import groovy.transform.CompileStatic +import nextflow.Nextflow + +/** + * Utility functions for testing. + */ +@CompileStatic +class Utils { + + static String getRecursiveFileNames(Path fileOrDir, String outputDir) { + if (Nextflow.file(fileOrDir.toString()).directory) { + return fileOrDir.list().collect { file -> getRecursiveFileNames(file, outputDir) } + } + return fileOrDir.toString().replace("${outputDir}/", '') + } + +} diff --git a/tests/pipeline/all_types/all.nf.test b/tests/pipeline/all_types/all.nf.test index 7209442e..59771a36 100644 --- a/tests/pipeline/all_types/all.nf.test +++ b/tests/pipeline/all_types/all.nf.test @@ -27,7 +27,7 @@ nextflow_pipeline { path("$outputDir") .list() .findAll { !it.toString().endsWith("pipeline_info") } - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() ).match("all")} ) @@ -55,7 +55,7 @@ nextflow_pipeline { path("$outputDir") .list() .findAll { !it.toString().endsWith("pipeline_info") } - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() ).match("concat")} ) @@ -83,7 +83,7 @@ nextflow_pipeline { path("$outputDir") .list() .findAll { !it.toString().endsWith("pipeline_info") } - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() ).match("output callers")} ) @@ -92,10 +92,3 @@ nextflow_pipeline { } } - -def getRecursiveFileNames(fileOrDir, outputDir) { - if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { getRecursiveFileNames(it, outputDir) } - } - return fileOrDir.toString().replace("${outputDir}/", "") -} diff --git a/tests/pipeline/bedpe/bedpe.nf.test b/tests/pipeline/bedpe/bedpe.nf.test index 7a5635ff..168b94c6 100644 --- a/tests/pipeline/bedpe/bedpe.nf.test +++ b/tests/pipeline/bedpe/bedpe.nf.test @@ -27,7 +27,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -79,7 +79,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -92,9 +92,9 @@ nextflow_pipeline { } -def getRecursiveFileNames(fileOrDir, outputDir) { +def Utils.getRecursiveFileNames(fileOrDir, outputDir) { if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { getRecursiveFileNames(it, outputDir) } + return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } } return fileOrDir.toString().replace("${outputDir}/", "") } diff --git a/tests/pipeline/cnv/cnv.nf.test b/tests/pipeline/cnv/cnv.nf.test index 146dd6f6..88ba5934 100644 --- a/tests/pipeline/cnv/cnv.nf.test +++ b/tests/pipeline/cnv/cnv.nf.test @@ -26,7 +26,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -55,7 +55,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -68,9 +68,9 @@ nextflow_pipeline { } -def getRecursiveFileNames(fileOrDir, outputDir) { +def Utils.getRecursiveFileNames(fileOrDir, outputDir) { if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { getRecursiveFileNames(it, outputDir) } + return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } } return fileOrDir.toString().replace("${outputDir}/", "") } diff --git a/tests/pipeline/duplicates/duplicates.nf.test b/tests/pipeline/duplicates/duplicates.nf.test index e403463d..fa80b0d6 100644 --- a/tests/pipeline/duplicates/duplicates.nf.test +++ b/tests/pipeline/duplicates/duplicates.nf.test @@ -26,7 +26,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -39,9 +39,9 @@ nextflow_pipeline { } -def getRecursiveFileNames(fileOrDir, outputDir) { +def Utils.getRecursiveFileNames(fileOrDir, outputDir) { if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { getRecursiveFileNames(it, outputDir) } + return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } } return fileOrDir.toString().replace("${outputDir}/", "") } diff --git a/tests/pipeline/families/families.nf.test b/tests/pipeline/families/families.nf.test index a008142b..a11fdc6c 100644 --- a/tests/pipeline/families/families.nf.test +++ b/tests/pipeline/families/families.nf.test @@ -27,7 +27,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -58,7 +58,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -88,7 +88,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -119,7 +119,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -132,9 +132,9 @@ nextflow_pipeline { } -def getRecursiveFileNames(fileOrDir, outputDir) { +def Utils.getRecursiveFileNames(fileOrDir, outputDir) { if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { getRecursiveFileNames(it, outputDir) } + return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } } return fileOrDir.toString().replace("${outputDir}/", "") } diff --git a/tests/pipeline/repeats/repeats.nf.test b/tests/pipeline/repeats/repeats.nf.test index c12dc262..34dc8a47 100644 --- a/tests/pipeline/repeats/repeats.nf.test +++ b/tests/pipeline/repeats/repeats.nf.test @@ -26,7 +26,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -39,9 +39,9 @@ nextflow_pipeline { } -def getRecursiveFileNames(fileOrDir, outputDir) { +def Utils.getRecursiveFileNames(fileOrDir, outputDir) { if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { getRecursiveFileNames(it, outputDir) } + return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } } return fileOrDir.toString().replace("${outputDir}/", "") } diff --git a/tests/pipeline/sv/sv.nf.test b/tests/pipeline/sv/sv.nf.test index 77957627..40cc36c5 100644 --- a/tests/pipeline/sv/sv.nf.test +++ b/tests/pipeline/sv/sv.nf.test @@ -26,7 +26,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -55,7 +55,7 @@ nextflow_pipeline { { assert snapshot( path("${outputDir}") .list() - .collect { getRecursiveFileNames(it, "${outputDir}") } + .collect { Utils.getRecursiveFileNames(it, "${outputDir}") } .flatten() .findAll { !it.contains("pipeline_info/") @@ -68,9 +68,9 @@ nextflow_pipeline { } -def getRecursiveFileNames(fileOrDir, outputDir) { +def Utils.getRecursiveFileNames(fileOrDir, outputDir) { if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { getRecursiveFileNames(it, outputDir) } + return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } } return fileOrDir.toString().replace("${outputDir}/", "") } From a9b0127048abfba3e246b1b42cf5b3d7bb538c9f Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 9 Apr 2026 14:35:57 +0200 Subject: [PATCH 06/10] remove old defs --- tests/pipeline/bedpe/bedpe.nf.test | 7 ------- tests/pipeline/cnv/cnv.nf.test | 7 ------- tests/pipeline/duplicates/duplicates.nf.test | 7 ------- tests/pipeline/families/families.nf.test | 7 ------- tests/pipeline/repeats/repeats.nf.test | 7 ------- tests/pipeline/sv/sv.nf.test | 7 ------- 6 files changed, 42 deletions(-) diff --git a/tests/pipeline/bedpe/bedpe.nf.test b/tests/pipeline/bedpe/bedpe.nf.test index 168b94c6..f0159431 100644 --- a/tests/pipeline/bedpe/bedpe.nf.test +++ b/tests/pipeline/bedpe/bedpe.nf.test @@ -91,10 +91,3 @@ nextflow_pipeline { } } - -def Utils.getRecursiveFileNames(fileOrDir, outputDir) { - if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } - } - return fileOrDir.toString().replace("${outputDir}/", "") -} diff --git a/tests/pipeline/cnv/cnv.nf.test b/tests/pipeline/cnv/cnv.nf.test index 88ba5934..cd5a62c3 100644 --- a/tests/pipeline/cnv/cnv.nf.test +++ b/tests/pipeline/cnv/cnv.nf.test @@ -67,10 +67,3 @@ nextflow_pipeline { } } - -def Utils.getRecursiveFileNames(fileOrDir, outputDir) { - if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } - } - return fileOrDir.toString().replace("${outputDir}/", "") -} diff --git a/tests/pipeline/duplicates/duplicates.nf.test b/tests/pipeline/duplicates/duplicates.nf.test index fa80b0d6..8e36bba5 100644 --- a/tests/pipeline/duplicates/duplicates.nf.test +++ b/tests/pipeline/duplicates/duplicates.nf.test @@ -38,10 +38,3 @@ nextflow_pipeline { } } - -def Utils.getRecursiveFileNames(fileOrDir, outputDir) { - if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } - } - return fileOrDir.toString().replace("${outputDir}/", "") -} diff --git a/tests/pipeline/families/families.nf.test b/tests/pipeline/families/families.nf.test index a11fdc6c..e411af99 100644 --- a/tests/pipeline/families/families.nf.test +++ b/tests/pipeline/families/families.nf.test @@ -131,10 +131,3 @@ nextflow_pipeline { } } - -def Utils.getRecursiveFileNames(fileOrDir, outputDir) { - if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } - } - return fileOrDir.toString().replace("${outputDir}/", "") -} diff --git a/tests/pipeline/repeats/repeats.nf.test b/tests/pipeline/repeats/repeats.nf.test index 34dc8a47..cf42df68 100644 --- a/tests/pipeline/repeats/repeats.nf.test +++ b/tests/pipeline/repeats/repeats.nf.test @@ -38,10 +38,3 @@ nextflow_pipeline { } } - -def Utils.getRecursiveFileNames(fileOrDir, outputDir) { - if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } - } - return fileOrDir.toString().replace("${outputDir}/", "") -} diff --git a/tests/pipeline/sv/sv.nf.test b/tests/pipeline/sv/sv.nf.test index 40cc36c5..679ed811 100644 --- a/tests/pipeline/sv/sv.nf.test +++ b/tests/pipeline/sv/sv.nf.test @@ -67,10 +67,3 @@ nextflow_pipeline { } } - -def Utils.getRecursiveFileNames(fileOrDir, outputDir) { - if(file(fileOrDir.toString()).isDirectory()) { - return fileOrDir.list().collect { Utils.getRecursiveFileNames(it, outputDir) } - } - return fileOrDir.toString().replace("${outputDir}/", "") -} From 5573623208e51dea1fc932cd35544646e3a5d54d Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 9 Apr 2026 14:39:40 +0200 Subject: [PATCH 07/10] fix func --- tests/lib/Utils.groovy | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/lib/Utils.groovy b/tests/lib/Utils.groovy index c98fddbf..a9abf6fd 100644 --- a/tests/lib/Utils.groovy +++ b/tests/lib/Utils.groovy @@ -1,15 +1,14 @@ import java.nio.file.Path -import groovy.transform.CompileStatic -import nextflow.Nextflow +import groovy.transform.CompileDynamic /** * Utility functions for testing. */ -@CompileStatic +@CompileDynamic class Utils { static String getRecursiveFileNames(Path fileOrDir, String outputDir) { - if (Nextflow.file(fileOrDir.toString()).directory) { + if (Path.of(fileOrDir.toString()).toFile().directory()) { return fileOrDir.list().collect { file -> getRecursiveFileNames(file, outputDir) } } return fileOrDir.toString().replace("${outputDir}/", '') From fd9b2bb3df1cf8b3f1879cf4f7be9ddd8d1d080a Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 9 Apr 2026 14:45:03 +0200 Subject: [PATCH 08/10] directory() => isDirectory() --- tests/lib/Utils.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/lib/Utils.groovy b/tests/lib/Utils.groovy index a9abf6fd..b0387983 100644 --- a/tests/lib/Utils.groovy +++ b/tests/lib/Utils.groovy @@ -8,7 +8,8 @@ import groovy.transform.CompileDynamic class Utils { static String getRecursiveFileNames(Path fileOrDir, String outputDir) { - if (Path.of(fileOrDir.toString()).toFile().directory()) { + /* groovylint-disable-next-line UnnecessaryGetter */ + if (Path.of(fileOrDir.toString()).toFile().isDirectory()) { return fileOrDir.list().collect { file -> getRecursiveFileNames(file, outputDir) } } return fileOrDir.toString().replace("${outputDir}/", '') From 565ee111e715cfc66d920cdc41441df71ecb13b6 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 9 Apr 2026 14:52:11 +0200 Subject: [PATCH 09/10] fix return type --- tests/lib/Utils.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/Utils.groovy b/tests/lib/Utils.groovy index b0387983..5de44c1d 100644 --- a/tests/lib/Utils.groovy +++ b/tests/lib/Utils.groovy @@ -7,7 +7,7 @@ import groovy.transform.CompileDynamic @CompileDynamic class Utils { - static String getRecursiveFileNames(Path fileOrDir, String outputDir) { + static Object getRecursiveFileNames(Path fileOrDir, String outputDir) { /* groovylint-disable-next-line UnnecessaryGetter */ if (Path.of(fileOrDir.toString()).toFile().isDirectory()) { return fileOrDir.list().collect { file -> getRecursiveFileNames(file, outputDir) } From 9b1caa6526605b9947c4a97ad78618bd44a9b0e4 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Thu, 9 Apr 2026 14:59:02 +0200 Subject: [PATCH 10/10] update samtools/faidx --- modules.json | 2 +- .../nf-core/samtools/faidx/environment.yml | 4 +- modules/nf-core/samtools/faidx/main.nf | 23 +- modules/nf-core/samtools/faidx/meta.yml | 18 +- .../nf-core/samtools/faidx/tests/main.nf.test | 118 ++++--- .../samtools/faidx/tests/main.nf.test.snap | 329 ++---------------- .../samtools/faidx/tests/nextflow.config | 1 - workflows/structural.nf | 3 +- 8 files changed, 118 insertions(+), 380 deletions(-) diff --git a/modules.json b/modules.json index 319f98d6..4a0e9133 100644 --- a/modules.json +++ b/modules.json @@ -104,7 +104,7 @@ }, "samtools/faidx": { "branch": "master", - "git_sha": "9a48bce39a67e2cb34b8f125fc1d50f0ad98b616", + "git_sha": "156feda0cb6589cd29c04902004fa3b53bc00205", "installed_by": ["modules"] }, "samtools/index": { diff --git a/modules/nf-core/samtools/faidx/environment.yml b/modules/nf-core/samtools/faidx/environment.yml index 89e12a64..946bb362 100644 --- a/modules/nf-core/samtools/faidx/environment.yml +++ b/modules/nf-core/samtools/faidx/environment.yml @@ -5,6 +5,6 @@ channels: - bioconda dependencies: # renovate: datasource=conda depName=bioconda/htslib - - bioconda::htslib=1.22.1 + - bioconda::htslib=1.23.1 # renovate: datasource=conda depName=bioconda/samtools - - bioconda::samtools=1.22.1 + - bioconda::samtools=1.23.1 diff --git a/modules/nf-core/samtools/faidx/main.nf b/modules/nf-core/samtools/faidx/main.nf index 57a03497..4ff3fd70 100644 --- a/modules/nf-core/samtools/faidx/main.nf +++ b/modules/nf-core/samtools/faidx/main.nf @@ -1,22 +1,21 @@ process SAMTOOLS_FAIDX { - tag "$fasta" + tag "${fasta}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.22.1--h96c455f_0' : - 'biocontainers/samtools:1.22.1--h96c455f_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/8c/8c5d2818c8b9f58e1fba77ce219fdaf32087ae53e857c4a496402978af26e78c/data' + : 'community.wave.seqera.io/library/htslib_samtools:1.23.1--5b6bb4ede7e612e5'}" input: - tuple val(meta), path(fasta) - tuple val(meta2), path(fai) + tuple val(meta), path(fasta), path(fai) val get_sizes output: - tuple val(meta), path ("*.{fa,fasta}") , emit: fa, optional: true - tuple val(meta), path ("*.sizes") , emit: sizes, optional: true - tuple val(meta), path ("*.fai") , emit: fai, optional: true - tuple val(meta), path ("*.gzi") , emit: gzi, optional: true + tuple val(meta), path("*.{fa,fasta}"), emit: fa, optional: true + tuple val(meta), path("*.sizes"), emit: sizes, optional: true + tuple val(meta), path("*.fai"), emit: fai, optional: true + tuple val(meta), path("*.gzi"), emit: gzi, optional: true tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools when: @@ -28,8 +27,8 @@ process SAMTOOLS_FAIDX { """ samtools \\ faidx \\ - $fasta \\ - $args + ${fasta} \\ + ${args} ${get_sizes_command} """ diff --git a/modules/nf-core/samtools/faidx/meta.yml b/modules/nf-core/samtools/faidx/meta.yml index 163c3015..529f7a26 100644 --- a/modules/nf-core/samtools/faidx/meta.yml +++ b/modules/nf-core/samtools/faidx/meta.yml @@ -1,5 +1,6 @@ name: samtools_faidx -description: Index FASTA file, and optionally generate a file of chromosome sizes +description: Index FASTA file, and optionally generate a file of chromosome + sizes keywords: - index - fasta @@ -14,7 +15,8 @@ tools: homepage: http://www.htslib.org/ documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 - licence: ["MIT"] + licence: + - "MIT" identifier: biotools:samtools input: - - meta: @@ -27,11 +29,6 @@ input: description: FASTA file pattern: "*.{fa,fasta}" ontologies: [] - - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test' ] - fai: type: file description: FASTA index file @@ -40,7 +37,6 @@ input: - get_sizes: type: boolean description: use cut to get the sizes of the index (true) or not (false) - output: fa: - - meta: @@ -94,9 +90,8 @@ output: type: string description: The tool name - "samtools version | sed '1!d;s/.* //'": - type: string + type: eval description: The command used to generate the version of the tool - topics: versions: - - ${task.process}: @@ -106,7 +101,7 @@ topics: type: string description: The tool name - "samtools version | sed '1!d;s/.* //'": - type: string + type: eval description: The command used to generate the version of the tool authors: - "@drpatelh" @@ -115,3 +110,4 @@ authors: maintainers: - "@maxulysse" - "@phue" + - "@matthdsm" diff --git a/modules/nf-core/samtools/faidx/tests/main.nf.test b/modules/nf-core/samtools/faidx/tests/main.nf.test index 02ba5040..9a86db86 100644 --- a/modules/nf-core/samtools/faidx/tests/main.nf.test +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test @@ -18,10 +18,12 @@ nextflow_process { } process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - input[1] = [[],[]] - input[2] = false + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = false """ } } @@ -29,7 +31,7 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot(sanitizeOutput(process.out)).match()} ) } } @@ -42,10 +44,12 @@ nextflow_process { } process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)] - input[1] = [[],[]] - input[2] = false + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true), + [] + ] + input[1] = false """ } } @@ -53,7 +57,7 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot(sanitizeOutput(process.out)).match()} ) } } @@ -66,11 +70,12 @@ nextflow_process { } process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - input[1] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] - input[2] = false + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ] + input[1] = false """ } } @@ -78,7 +83,7 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot(sanitizeOutput(process.out)).match()} ) } } @@ -92,11 +97,12 @@ nextflow_process { } process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - input[1] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] - input[2] = false + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ] + input[1] = false """ } } @@ -104,7 +110,7 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot(sanitizeOutput(process.out)).match()} ) } } @@ -118,10 +124,12 @@ nextflow_process { } process { """ - input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - input[1] = [[],[]] - input[2] = false + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = false """ } } @@ -129,7 +137,7 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot(sanitizeOutput(process.out)).match()} ) } } @@ -142,12 +150,12 @@ nextflow_process { } process { """ - input[0] = Channel.of([ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ]) - input[1] = [[],[]] - input[2] = true + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = true """ } } @@ -155,7 +163,7 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot(sanitizeOutput(process.out)).match()} ) } } @@ -168,12 +176,12 @@ nextflow_process { } process { """ - input[0] = Channel.of([ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) - ]) - input[1] = [[],[]] - input[2] = true + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true), + [] + ] + input[1] = true """ } } @@ -181,7 +189,7 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot(sanitizeOutput(process.out)).match()} ) } } @@ -196,12 +204,12 @@ nextflow_process { } process { """ - input[0] = Channel.of([ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ]) - input[1] = [[],[]] - input[2] = true + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true), + [] + ] + input[1] = true """ } } @@ -209,7 +217,7 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot(sanitizeOutput(process.out)).match()} ) } } @@ -224,12 +232,12 @@ nextflow_process { } process { """ - input[0] = Channel.of([ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) - ]) - input[1] = [[],[]] - input[2] = true + input[0] = [ + [ id:'test' ], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true), + [] + ] + input[1] = true """ } } @@ -237,7 +245,7 @@ nextflow_process { then { assert process.success assertAll( - { assert snapshot(process.out).match()} + { assert snapshot(sanitizeOutput(process.out)).match()} ) } } diff --git a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap index 565d20e7..e879d962 100644 --- a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap @@ -2,39 +2,13 @@ "test_samtools_faidx": { "content": [ { - "0": [ - - ], - "1": [ - - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "3": [ - - ], - "4": [ - [ - "SAMTOOLS_FAIDX", - "samtools", - "1.22.1" - ] - ], "fa": [ ], "fai": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" ] @@ -49,54 +23,20 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2025-12-23T14:02:40.159309157" + "timestamp": "2026-03-19T08:57:29.747964" }, "test_samtools_faidx_get_sizes_bgzip - stub": { "content": [ { - "0": [ - - ], - "1": [ - [ - { - "id": "test" - }, - "genome.fasta.gz.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - [ - { - "id": "test" - }, - "genome.fasta.gz.fai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "3": [ - [ - { - "id": "test" - }, - "genome.fasta.gz.gzi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "4": [ - [ - "SAMTOOLS_FAIDX", - "samtools", - "1.22.1" - ] - ], "fa": [ ], @@ -128,49 +68,20 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2025-12-23T14:03:39.550619177" + "timestamp": "2026-03-19T08:58:10.04235" }, "test_samtools_faidx_get_sizes": { "content": [ { - "0": [ - - ], - "1": [ - [ - { - "id": "test" - }, - "genome.fasta.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" - ] - ], - "2": [ - [ - { - "id": "test" - }, - "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "3": [ - - ], - "4": [ - [ - "SAMTOOLS_FAIDX", - "samtools", - "1.22.1" - ] - ], "fa": [ ], @@ -197,59 +108,27 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2025-12-23T14:03:16.844965756" + "timestamp": "2026-03-19T08:57:55.552612" }, "test_samtools_faidx_bgzip": { "content": [ { - "0": [ - - ], - "1": [ - - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "3": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" - ] - ], - "4": [ - [ - "SAMTOOLS_FAIDX", - "samtools", - "1.22.1" - ] - ], "fa": [ ], "fai": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" ] @@ -257,8 +136,7 @@ "gzi": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" ] @@ -270,50 +148,24 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2025-12-23T14:02:47.301476131" + "timestamp": "2026-03-19T08:57:34.346045" }, "test_samtools_faidx_fasta": { "content": [ { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "extract.fa:md5,6a0774a0ad937ba0bfd2ac7457d90f36" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - [ - "SAMTOOLS_FAIDX", - "samtools", - "1.22.1" - ] - ], "fa": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "extract.fa:md5,6a0774a0ad937ba0bfd2ac7457d90f36" ] @@ -331,49 +183,20 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2025-12-23T09:44:40.559583279" + "timestamp": "2026-03-19T08:57:39.136814" }, "test_samtools_faidx_get_sizes - stub": { "content": [ { - "0": [ - - ], - "1": [ - [ - { - "id": "test" - }, - "genome.fasta.sizes:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - [ - { - "id": "test" - }, - "genome.fasta.fai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "3": [ - - ], - "4": [ - [ - "SAMTOOLS_FAIDX", - "samtools", - "1.22.1" - ] - ], "fa": [ ], @@ -400,50 +223,24 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2025-12-23T14:03:31.989929281" + "timestamp": "2026-03-19T08:58:05.200994" }, "test_samtools_faidx_stub_fasta": { "content": [ { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "extract.fa:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - [ - "SAMTOOLS_FAIDX", - "samtools", - "1.22.1" - ] - ], "fa": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "extract.fa:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -461,53 +258,27 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2025-12-23T09:44:48.295693103" + "timestamp": "2026-03-19T08:57:44.105654" }, "test_samtools_faidx_stub_fai": { "content": [ { - "0": [ - - ], - "1": [ - - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "genome.fasta.fai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "3": [ - - ], - "4": [ - [ - "SAMTOOLS_FAIDX", - "samtools", - "1.22.1" - ] - ], "fa": [ ], "fai": [ [ { - "id": "test", - "single_end": false + "id": "test" }, "genome.fasta.fai:md5,d41d8cd98f00b204e9800998ecf8427e" ] @@ -522,54 +293,20 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2025-12-23T14:03:09.784289542" + "timestamp": "2026-03-19T08:57:50.839162" }, "test_samtools_faidx_get_sizes_bgzip": { "content": [ { - "0": [ - - ], - "1": [ - [ - { - "id": "test" - }, - "genome.fasta.gz.sizes:md5,a57c401f27ae5133823fb09fb21c8a3c" - ] - ], - "2": [ - [ - { - "id": "test" - }, - "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" - ] - ], - "3": [ - [ - { - "id": "test" - }, - "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" - ] - ], - "4": [ - [ - "SAMTOOLS_FAIDX", - "samtools", - "1.22.1" - ] - ], "fa": [ ], @@ -601,15 +338,15 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2025-12-23T14:03:24.814967939" + "timestamp": "2026-03-19T08:58:00.460031" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/faidx/tests/nextflow.config b/modules/nf-core/samtools/faidx/tests/nextflow.config index 202c036e..b3c4d0cb 100644 --- a/modules/nf-core/samtools/faidx/tests/nextflow.config +++ b/modules/nf-core/samtools/faidx/tests/nextflow.config @@ -3,5 +3,4 @@ process { withName: SAMTOOLS_FAIDX { ext.args = params.module_args } - } diff --git a/workflows/structural.nf b/workflows/structural.nf index 45ab82ba..a2ee53e8 100644 --- a/workflows/structural.nf +++ b/workflows/structural.nf @@ -199,8 +199,7 @@ workflow STRUCTURAL { def ch_fai = channel.empty() if(!fai){ SAMTOOLS_FAIDX( - ch_fasta, - [[], []], + ch_fasta.map { meta, f -> [ meta, f, [] ]}, false )