diff --git a/.github/workflows/nf-test.yml b/.github/workflows/nf-test.yml index d77a1c64..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 @@ -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 { diff --git a/modules.json b/modules.json index 9c5d969b..6466f4ea 100644 --- a/modules.json +++ b/modules.json @@ -99,7 +99,7 @@ }, "samtools/faidx": { "branch": "master", - "git_sha": "b2e78932ef01165fd85829513eaca29eff8e640a", + "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 97bfb578..4ff3fd70 100644 --- a/modules/nf-core/samtools/faidx/main.nf +++ b/modules/nf-core/samtools/faidx/main.nf @@ -1,21 +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), 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: @@ -27,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 80aae1da..529f7a26 100644 --- a/modules/nf-core/samtools/faidx/meta.yml +++ b/modules/nf-core/samtools/faidx/meta.yml @@ -110,3 +110,4 @@ authors: maintainers: - "@maxulysse" - "@phue" + - "@matthdsm" 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 41697444..e879d962 100644 --- a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap @@ -23,16 +23,16 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.3" + "nextflow": "25.10.4" }, - "timestamp": "2026-02-10T15:39:12.541649151" + "timestamp": "2026-03-19T08:57:29.747964" }, "test_samtools_faidx_get_sizes_bgzip - stub": { "content": [ @@ -68,16 +68,16 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.3" + "nextflow": "25.10.4" }, - "timestamp": "2026-02-10T15:41:44.040426987" + "timestamp": "2026-03-19T08:58:10.04235" }, "test_samtools_faidx_get_sizes": { "content": [ @@ -108,16 +108,16 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.3" + "nextflow": "25.10.4" }, - "timestamp": "2026-02-10T15:47:03.653912015" + "timestamp": "2026-03-19T08:57:55.552612" }, "test_samtools_faidx_bgzip": { "content": [ @@ -148,16 +148,16 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.3" + "nextflow": "25.10.4" }, - "timestamp": "2026-02-10T15:50:04.023566795" + "timestamp": "2026-03-19T08:57:34.346045" }, "test_samtools_faidx_fasta": { "content": [ @@ -183,16 +183,16 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.3" + "nextflow": "25.10.4" }, - "timestamp": "2026-02-10T15:39:23.529404162" + "timestamp": "2026-03-19T08:57:39.136814" }, "test_samtools_faidx_get_sizes - stub": { "content": [ @@ -223,16 +223,16 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.3" + "nextflow": "25.10.4" }, - "timestamp": "2026-02-10T15:41:39.039834304" + "timestamp": "2026-03-19T08:58:05.200994" }, "test_samtools_faidx_stub_fasta": { "content": [ @@ -258,16 +258,16 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.3" + "nextflow": "25.10.4" }, - "timestamp": "2026-02-10T15:39:28.961701609" + "timestamp": "2026-03-19T08:57:44.105654" }, "test_samtools_faidx_stub_fai": { "content": [ @@ -293,16 +293,16 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.3" + "nextflow": "25.10.4" }, - "timestamp": "2026-02-10T15:39:34.471028474" + "timestamp": "2026-03-19T08:57:50.839162" }, "test_samtools_faidx_get_sizes_bgzip": { "content": [ @@ -338,15 +338,15 @@ [ "SAMTOOLS_FAIDX", "samtools", - "1.22.1" + "1.23.1" ] ] } ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.3" + "nextflow": "25.10.4" }, - "timestamp": "2026-02-10T15:39:45.439016495" + "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/tests/lib/Utils.groovy b/tests/lib/Utils.groovy new file mode 100644 index 00000000..5de44c1d --- /dev/null +++ b/tests/lib/Utils.groovy @@ -0,0 +1,18 @@ +import java.nio.file.Path +import groovy.transform.CompileDynamic + +/** + * Utility functions for testing. + */ +@CompileDynamic +class Utils { + + 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) } + } + 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..f0159431 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/") @@ -91,10 +91,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/cnv/cnv.nf.test b/tests/pipeline/cnv/cnv.nf.test index 146dd6f6..cd5a62c3 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/") @@ -67,10 +67,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/duplicates/duplicates.nf.test b/tests/pipeline/duplicates/duplicates.nf.test index e403463d..8e36bba5 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/") @@ -38,10 +38,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/families/families.nf.test b/tests/pipeline/families/families.nf.test index a008142b..e411af99 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/") @@ -131,10 +131,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/repeats/repeats.nf.test b/tests/pipeline/repeats/repeats.nf.test index c12dc262..cf42df68 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/") @@ -38,10 +38,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/sv/sv.nf.test b/tests/pipeline/sv/sv.nf.test index 77957627..679ed811 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/") @@ -67,10 +67,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/workflows/structural.nf b/workflows/structural.nf index 384036ca..ed99d1fc 100644 --- a/workflows/structural.nf +++ b/workflows/structural.nf @@ -196,8 +196,8 @@ workflow STRUCTURAL { def ch_fai = channel.empty() if(!fai){ SAMTOOLS_FAIDX( - ch_fasta, - [[], []] + ch_fasta.map { meta, f -> [ meta, f, [] ]}, + false ) ch_fai = SAMTOOLS_FAIDX.out.fai.collect { fai_file -> [[id:'reference'], fai_file] } }