diff --git a/.github/actions/get-shards/action.yml b/.github/actions/get-shards/action.yml index c2b511c2672..3669d0d88ef 100644 --- a/.github/actions/get-shards/action.yml +++ b/.github/actions/get-shards/action.yml @@ -17,7 +17,6 @@ outputs: total_shards: description: "Total number of shards" value: ${{ steps.shards.outputs.total_shards }} - runs: using: "composite" steps: @@ -26,22 +25,24 @@ runs: with: version: ${{ env.NFT_VER }} install-pdiff: true - - name: Get number of shards id: shards shell: bash run: | - # Prepare tag parameter if tags are provided TAGS=$([ -n "${{ inputs.tags }}" ] && echo "--tag ${{ inputs.tags }}" || echo "") - # Run nf-test with dynamic tag parameter + + # Run nf-test with dynamic parameter nftest_output=$(nf-test test \ --dry-run \ --profile docker \ ${TAGS} \ --filter process,workflow \ - ${{ inputs.paths }}) - + ${{ inputs.paths }}) || { + echo "nf-test command failed with exit code $?" + echo "Full output: $nftest_output" + exit 1 + } echo "nf-test dry-run output: $nftest_output" # Default values for shard and total_shards diff --git a/.github/workflows/nf-test.yml b/.github/workflows/nf-test.yml index 7417d0961b7..289b55084fd 100644 --- a/.github/workflows/nf-test.yml +++ b/.github/workflows/nf-test.yml @@ -193,3 +193,11 @@ jobs: echo "DEBUG: toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}" echo "DEBUG: needs.nf-test.outputs.filtered_paths = ${{ needs.nf-test.outputs.filtered_paths }}" echo "::endgroup::" + + - name: Clean Workspace # Purge the workspace in case it's running on a self-hosted runner + if: always() + run: | + ls -la ./ + rm -rf ./* || true + rm -rf ./.??* || true + ls -la ./ diff --git a/modules/nf-core/anota2seq/anota2seqrun/templates/anota2seqrun.r b/modules/nf-core/anota2seq/anota2seqrun/templates/anota2seqrun.r index 82fef8d8346..49ae853e5ab 100644 --- a/modules/nf-core/anota2seq/anota2seqrun/templates/anota2seqrun.r +++ b/modules/nf-core/anota2seq/anota2seqrun/templates/anota2seqrun.r @@ -327,12 +327,11 @@ ads <- do.call(anota2seqDataSetFromMatrix, anota2seqDataSetFromMatrix_args) # Run anota2seqRun contrast_matrix <- matrix( - nrow=2, - ncol=1, - dimnames=list(c(opt\$reference_level, opt\$target_level),c()), - c(-1,1) + c(-1, 1), + nrow = 2, + dimnames = list(sort(c(opt$reference_level, opt$target_level)), NULL) ) - + ads <- anota2seqRun( ads, contrasts = contrast_matrix, diff --git a/modules/nf-core/antismash/antismashlite/main.nf b/modules/nf-core/antismash/antismashlite/main.nf index 422e7be0499..3a5215575cb 100644 --- a/modules/nf-core/antismash/antismashlite/main.nf +++ b/modules/nf-core/antismash/antismashlite/main.nf @@ -1,44 +1,45 @@ process ANTISMASH_ANTISMASHLITE { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/antismash-lite:7.1.0--pyhdfd78af_0' : - 'biocontainers/antismash-lite:7.1.0--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/antismash-lite:7.1.0--pyhdfd78af_0' + : 'biocontainers/antismash-lite:7.1.0--pyhdfd78af_0'}" containerOptions { - workflow.containerEngine == 'singularity' ? - "-B $antismash_dir:/usr/local/lib/python3.10/site-packages/antismash" : - workflow.containerEngine == 'docker' ? - "-v \$PWD/$antismash_dir:/usr/local/lib/python3.10/site-packages/antismash" : - '' - } + ['singularity', 'apptainer'].contains(workflow.containerEngine) + ? "-B ${antismash_dir}:/usr/local/lib/python3.10/site-packages/antismash" + : workflow.containerEngine == 'docker' + ? "-v \$PWD/${antismash_dir}:/usr/local/lib/python3.10/site-packages/antismash" + : '' + } input: tuple val(meta), path(sequence_input) - path(databases) - path(antismash_dir) // Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml). - path(gff) + path databases + path antismash_dir + // Optional input: AntiSMASH installation folder. It is not needed for using this module with conda, but required for docker/singularity (see meta.yml). + path gff output: - tuple val(meta), path("${prefix}/clusterblast/*_c*.txt") , optional: true, emit: clusterblast_file - tuple val(meta), path("${prefix}/{css,images,js}") , emit: html_accessory_files - tuple val(meta), path("${prefix}/knownclusterblast/region*/ctg*.html") , optional: true, emit: knownclusterblast_html - tuple val(meta), path("${prefix}/knownclusterblast/") , optional: true, emit: knownclusterblast_dir - tuple val(meta), path("${prefix}/knownclusterblast/*_c*.txt") , optional: true, emit: knownclusterblast_txt - tuple val(meta), path("${prefix}/svg/clusterblast*.svg") , optional: true, emit: svg_files_clusterblast - tuple val(meta), path("${prefix}/svg/knownclusterblast*.svg") , optional: true, emit: svg_files_knownclusterblast - tuple val(meta), path("${prefix}/*.gbk") , emit: gbk_input - tuple val(meta), path("${prefix}/*.json") , emit: json_results - tuple val(meta), path("${prefix}/*.log") , emit: log - tuple val(meta), path("${prefix}/*.zip") , emit: zip - tuple val(meta), path("${prefix}/*region*.gbk") , optional: true, emit: gbk_results - tuple val(meta), path("${prefix}/clusterblastoutput.txt") , optional: true, emit: clusterblastoutput - tuple val(meta), path("${prefix}/index.html") , emit: html - tuple val(meta), path("${prefix}/knownclusterblastoutput.txt") , optional: true, emit: knownclusterblastoutput - tuple val(meta), path("${prefix}/regions.js") , emit: json_sideloading - path "versions.yml" , emit: versions + tuple val(meta), path("${prefix}/clusterblast/*_c*.txt"), optional: true, emit: clusterblast_file + tuple val(meta), path("${prefix}/{css,images,js}"), emit: html_accessory_files + tuple val(meta), path("${prefix}/knownclusterblast/region*/ctg*.html"), optional: true, emit: knownclusterblast_html + tuple val(meta), path("${prefix}/knownclusterblast/"), optional: true, emit: knownclusterblast_dir + tuple val(meta), path("${prefix}/knownclusterblast/*_c*.txt"), optional: true, emit: knownclusterblast_txt + tuple val(meta), path("${prefix}/svg/clusterblast*.svg"), optional: true, emit: svg_files_clusterblast + tuple val(meta), path("${prefix}/svg/knownclusterblast*.svg"), optional: true, emit: svg_files_knownclusterblast + tuple val(meta), path("${prefix}/*.gbk"), emit: gbk_input + tuple val(meta), path("${prefix}/*.json"), emit: json_results + tuple val(meta), path("${prefix}/*.log"), emit: log + tuple val(meta), path("${prefix}/*.zip"), emit: zip + tuple val(meta), path("${prefix}/*region*.gbk"), optional: true, emit: gbk_results + tuple val(meta), path("${prefix}/clusterblastoutput.txt"), optional: true, emit: clusterblastoutput + tuple val(meta), path("${prefix}/index.html"), emit: html + tuple val(meta), path("${prefix}/knownclusterblastoutput.txt"), optional: true, emit: knownclusterblastoutput + tuple val(meta), path("${prefix}/regions.js"), emit: json_sideloading + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -53,25 +54,24 @@ process ANTISMASH_ANTISMASHLITE { ## this should be run as a separate module for versioning purposes antismash \\ - $args \\ - $gff_flag \\ - -c $task.cpus \\ - --output-dir $prefix \\ - --output-basename $prefix \\ + ${args} \\ + ${gff_flag} \\ + -c ${task.cpus} \\ + --output-dir ${prefix} \\ + --output-basename ${prefix} \\ --genefinding-tool none \\ - --logfile $prefix/${prefix}.log \\ - --databases $databases \\ - $sequence_input + --logfile ${prefix}/${prefix}.log \\ + --databases ${databases} \\ + ${sequence_input} cat <<-END_VERSIONS > versions.yml "${task.process}": - antismash-lite: \$(echo \$(antismash --version) | sed 's/antiSMASH //') + antismash-lite: \$(echo \$(antismash --version) | sed 's/antiSMASH //;s/-.*//g') END_VERSIONS """ stub: prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}" - def VERSION = '7.1.0' // WARN: Version information not provided by tool during stub run. Please update this string when bumping container versions. """ mkdir -p ${prefix}/css mkdir ${prefix}/images @@ -91,7 +91,7 @@ process ANTISMASH_ANTISMASHLITE { cat <<-END_VERSIONS > versions.yml "${task.process}": - antismash-lite: $VERSION + antismash-lite: \$(echo \$(antismash --version) | sed 's/antiSMASH //;s/-.*//g') END_VERSIONS """ } diff --git a/modules/nf-core/antismash/antismashlite/tests/main.nf.test b/modules/nf-core/antismash/antismashlite/tests/main.nf.test index 5ee21d6ded4..d58fcc4c910 100644 --- a/modules/nf-core/antismash/antismashlite/tests/main.nf.test +++ b/modules/nf-core/antismash/antismashlite/tests/main.nf.test @@ -3,6 +3,7 @@ nextflow_process { name "Test Process ANTISMASH_ANTISMASHLITE" script "../main.nf" process "ANTISMASH_ANTISMASHLITE" + config './nextflow.config' tag "modules" tag "modules_nfcore" @@ -96,7 +97,11 @@ nextflow_process { { assert path(process.out.html.get(0).get(1)).text.contains("https://antismash.secondarymetabolites.org/") }, { assert path(process.out.json_sideloading.get(0).get(1)).text.contains("\"seq_id\": \"NZ_CP069563.1\"") }, { assert path(process.out.log.get(0).get(1)).text.contains("antiSMASH status: SUCCESS") }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot( + path(process.out.versions[0]).yaml, + file(process.out.versions[0]).name, + ).match("versions") + } ) } } @@ -119,7 +124,10 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + file(process.out.versions[0]).name, + ).match("versions_stub") + } ) } } diff --git a/modules/nf-core/antismash/antismashlite/tests/main.nf.test.snap b/modules/nf-core/antismash/antismashlite/tests/main.nf.test.snap index 618b06f965a..7d2febc93f7 100644 --- a/modules/nf-core/antismash/antismashlite/tests/main.nf.test.snap +++ b/modules/nf-core/antismash/antismashlite/tests/main.nf.test.snap @@ -1,15 +1,28 @@ { + "versions_stub": { + "content": [ + "versions.yml" + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-01-30T14:55:41.041351955" + }, "versions": { "content": [ - [ - "versions.yml:md5,2a1c54c017741b59c057a05453fc067d" - ] + { + "ANTISMASH_ANTISMASHLITE": { + "antismash-lite": "7.1.0" + } + }, + "versions.yml" ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "24.10.4" }, - "timestamp": "2024-02-09T17:06:08.439031477" + "timestamp": "2025-01-30T13:48:51.158220245" }, "html_accessory_files": { "content": [ @@ -64,238 +77,9 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-09T17:06:08.392236617" - }, - "antismashlite - bacteroides_fragilis - genome - stub": { - "content": [ - { - "0": [ - - ], - "1": [ - [ - { - "id": "test" - }, - [ - [ - "bacteria.css:md5,d41d8cd98f00b204e9800998ecf8427e" - ], - [ - "about.svg:md5,d41d8cd98f00b204e9800998ecf8427e" - ], - [ - "antismash.js:md5,d41d8cd98f00b204e9800998ecf8427e", - "jquery.js:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ] - ], - "10": [ - [ - { - "id": "test" - }, - "genome.zip:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "11": [ - [ - { - "id": "test" - }, - [ - "NZ_CP069563.1.region001.gbk:md5,d41d8cd98f00b204e9800998ecf8427e", - "NZ_CP069563.1.region002.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ], - "12": [ - - ], - "13": [ - [ - { - "id": "test" - }, - "index.html:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "14": [ - - ], - "15": [ - [ - { - "id": "test" - }, - "regions.js:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "16": [ - "versions.yml:md5,2a1c54c017741b59c057a05453fc067d" - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - - ], - "5": [ - - ], - "6": [ - - ], - "7": [ - [ - { - "id": "test" - }, - [ - "NZ_CP069563.1.region001.gbk:md5,d41d8cd98f00b204e9800998ecf8427e", - "NZ_CP069563.1.region002.gbk:md5,d41d8cd98f00b204e9800998ecf8427e", - "genome.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ], - "8": [ - [ - { - "id": "test" - }, - "genome.json:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "9": [ - [ - { - "id": "test" - }, - "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "clusterblast_file": [ - - ], - "clusterblastoutput": [ - - ], - "gbk_input": [ - [ - { - "id": "test" - }, - [ - "NZ_CP069563.1.region001.gbk:md5,d41d8cd98f00b204e9800998ecf8427e", - "NZ_CP069563.1.region002.gbk:md5,d41d8cd98f00b204e9800998ecf8427e", - "genome.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ], - "gbk_results": [ - [ - { - "id": "test" - }, - [ - "NZ_CP069563.1.region001.gbk:md5,d41d8cd98f00b204e9800998ecf8427e", - "NZ_CP069563.1.region002.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ], - "html": [ - [ - { - "id": "test" - }, - "index.html:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "html_accessory_files": [ - [ - { - "id": "test" - }, - [ - [ - "bacteria.css:md5,d41d8cd98f00b204e9800998ecf8427e" - ], - [ - "about.svg:md5,d41d8cd98f00b204e9800998ecf8427e" - ], - [ - "antismash.js:md5,d41d8cd98f00b204e9800998ecf8427e", - "jquery.js:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - ] - ], - "json_results": [ - [ - { - "id": "test" - }, - "genome.json:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "json_sideloading": [ - [ - { - "id": "test" - }, - "regions.js:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "knownclusterblast_dir": [ - - ], - "knownclusterblast_html": [ - - ], - "knownclusterblast_txt": [ - - ], - "knownclusterblastoutput": [ - - ], - "log": [ - [ - { - "id": "test" - }, - "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "svg_files_clusterblast": [ - - ], - "svg_files_knownclusterblast": [ - - ], - "versions": [ - "versions.yml:md5,2a1c54c017741b59c057a05453fc067d" - ], - "zip": [ - [ - { - "id": "test" - }, - "genome.zip:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ] - } - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.4" }, - "timestamp": "2024-07-11T16:35:51.079804" + "timestamp": "2025-01-30T14:47:32.466485783" } } \ No newline at end of file diff --git a/modules/nf-core/antismash/antismashlite/tests/nextflow.config b/modules/nf-core/antismash/antismashlite/tests/nextflow.config new file mode 100644 index 00000000000..eedb39ae891 --- /dev/null +++ b/modules/nf-core/antismash/antismashlite/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: ANTISMASH_ANTISMASHLITE { + memory = 7.GB + } +} diff --git a/modules/nf-core/antismash/antismashlitedownloaddatabases/main.nf b/modules/nf-core/antismash/antismashlitedownloaddatabases/main.nf index e63f20d2ea6..52452dc279e 100644 --- a/modules/nf-core/antismash/antismashlitedownloaddatabases/main.nf +++ b/modules/nf-core/antismash/antismashlitedownloaddatabases/main.nf @@ -2,9 +2,9 @@ process ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/antismash-lite:7.1.0--pyhdfd78af_0' : - 'biocontainers/antismash-lite:7.1.0--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/antismash-lite:7.1.0--pyhdfd78af_0' + : 'biocontainers/antismash-lite:7.1.0--pyhdfd78af_0'}" /* These files are normally downloaded/created by download-antismash-databases itself, and must be retrieved for input by manually running the command with conda or a standalone installation of antiSMASH. Therefore we do not recommend using this module for production pipelines, but rather require users to specify their own local copy of the antiSMASH database in pipelines. This is solely for use for CI tests of the nf-core/module version of antiSMASH. @@ -13,12 +13,12 @@ process ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { */ containerOptions { - workflow.containerEngine == 'singularity' ? - "-B $database_css:/usr/local/lib/python3.10/site-packages/antismash/outputs/html/css,$database_detection:/usr/local/lib/python3.10/site-packages/antismash/detection,$database_modules:/usr/local/lib/python3.10/site-packages/antismash/modules" : - workflow.containerEngine == 'docker' ? - "-v \$PWD/$database_css:/usr/local/lib/python3.10/site-packages/antismash/outputs/html/css -v \$PWD/$database_detection:/usr/local/lib/python3.10/site-packages/antismash/detection -v \$PWD/$database_modules:/usr/local/lib/python3.10/site-packages/antismash/modules" : - '' - } + ['singularity', 'apptainer'].contains(workflow.containerEngine) + ? "-B ${database_css}:/usr/local/lib/python3.10/site-packages/antismash/outputs/html/css,${database_detection}:/usr/local/lib/python3.10/site-packages/antismash/detection,${database_modules}:/usr/local/lib/python3.10/site-packages/antismash/modules" + : workflow.containerEngine == 'docker' + ? "-v \$PWD/${database_css}:/usr/local/lib/python3.10/site-packages/antismash/outputs/html/css -v \$PWD/${database_detection}:/usr/local/lib/python3.10/site-packages/antismash/detection -v \$PWD/${database_modules}:/usr/local/lib/python3.10/site-packages/antismash/modules" + : '' + } input: path database_css @@ -26,8 +26,8 @@ process ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { path database_modules output: - path("antismash_db") , emit: database - path("antismash_dir"), emit: antismash_dir + path ("antismash_db"), emit: database + path ("antismash_dir"), emit: antismash_dir path "versions.yml", emit: versions when: @@ -35,35 +35,34 @@ process ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { script: def args = task.ext.args ?: '' - cp_cmd = ( session.config.conda && session.config.conda.enabled ) ? "cp -r \$(python -c 'import antismash;print(antismash.__file__.split(\"/__\")[0])') antismash_dir;" : "cp -r /usr/local/lib/python3.10/site-packages/antismash antismash_dir;" + cp_cmd = session.config.conda && session.config.conda.enabled ? "cp -r \$(python -c 'import antismash;print(antismash.__file__.split(\"/__\")[0])') antismash_dir;" : "cp -r /usr/local/lib/python3.10/site-packages/antismash antismash_dir;" """ download-antismash-databases \\ --database-dir antismash_db \\ - $args + ${args} - $cp_cmd + ${cp_cmd} cat <<-END_VERSIONS > versions.yml "${task.process}": - antismash-lite: \$(antismash --version | sed 's/antiSMASH //') + antismash-lite: \$(echo \$(antismash --version) | sed 's/antiSMASH //;s/-.*//g') END_VERSIONS """ stub: def args = task.ext.args ?: '' - cp_cmd = (session.config.conda && session.config.conda.enabled ) ? "cp -r \$(python -c 'import antismash;print(antismash.__file__.split(\"/__\")[0])') antismash_dir;" : "cp -r /usr/local/lib/python3.10/site-packages/antismash antismash_dir;" - def VERSION = '7.1.0' // WARN: Version information not provided by tool during stub run. Please update this string when bumping container versions. + cp_cmd = session.config.conda && session.config.conda.enabled ? "cp -r \$(python -c 'import antismash;print(antismash.__file__.split(\"/__\")[0])') antismash_dir;" : "cp -r /usr/local/lib/python3.10/site-packages/antismash antismash_dir;" """ - echo "download-antismash-databases --database-dir antismash_db $args" + echo "download-antismash-databases --database-dir antismash_db ${args}" - echo "$cp_cmd" + echo "${cp_cmd}" mkdir antismash_dir mkdir antismash_db cat <<-END_VERSIONS > versions.yml "${task.process}": - antismash-lite: $VERSION + antismash-lite: \$(echo \$(antismash --version) | sed 's/antiSMASH //;s/-.*//g') END_VERSIONS """ } diff --git a/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/main.nf.test b/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/main.nf.test index 55f5f2f50a1..72e5d7dd833 100644 --- a/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/main.nf.test +++ b/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/main.nf.test @@ -3,6 +3,7 @@ nextflow_process { name "Test Process ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES" script "../main.nf" process "ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES" + config './nextflow.config' tag "modules" tag "modules_nfcore" @@ -64,10 +65,12 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot ( + { assert snapshot( file(process.out.database.get(0)).list().sort(), - process.out.versions, - ).match() } + path(process.out.versions[0]).yaml, + file(process.out.versions[0]).name, + ).match() + } ) } } @@ -128,7 +131,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + file(process.out.database.get(0)).list().sort(), + file(process.out.versions[0]).name, + ).match() + } ) } } diff --git a/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/main.nf.test.snap b/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/main.nf.test.snap index 21ee9d410f5..04f98af8497 100644 --- a/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/main.nf.test.snap +++ b/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/main.nf.test.snap @@ -1,40 +1,16 @@ { "antiSMASH-lite downloaddatabases - stub": { "content": [ - { - "0": [ - [ - - ] - ], - "1": [ - [ - - ] - ], - "2": [ - "versions.yml:md5,9eccc775a12d25ca5dfe334e8874f12a" - ], - "antismash_dir": [ - [ - - ] - ], - "database": [ - [ - - ] - ], - "versions": [ - "versions.yml:md5,9eccc775a12d25ca5dfe334e8874f12a" - ] - } + [ + + ], + "versions.yml" ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.4" }, - "timestamp": "2024-07-12T13:41:29.456143" + "timestamp": "2025-01-30T13:47:43.854140981" }, "antiSMASH-lite downloaddatabases": { "content": [ @@ -49,14 +25,17 @@ "resfam", "tigrfam" ], - [ - "versions.yml:md5,9eccc775a12d25ca5dfe334e8874f12a" - ] + { + "ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES": { + "antismash-lite": "7.1.0" + } + }, + "versions.yml" ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.4" }, - "timestamp": "2024-07-12T13:41:08.116244" + "timestamp": "2025-01-30T13:57:10.845020955" } } \ No newline at end of file diff --git a/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/nextflow.config b/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/nextflow.config new file mode 100644 index 00000000000..972dd7b04f2 --- /dev/null +++ b/modules/nf-core/antismash/antismashlitedownloaddatabases/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: ANTISMASH_ANTISMASHLITEDOWNLOADDATABASES { + memory = 7.GB + } +} diff --git a/modules/nf-core/cadd/main.nf b/modules/nf-core/cadd/main.nf index 0af87f6e5b6..9675e2932cd 100644 --- a/modules/nf-core/cadd/main.nf +++ b/modules/nf-core/cadd/main.nf @@ -1,23 +1,23 @@ process CADD { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' conda "${moduleDir}/environment.yml" container 'docker.io/biocontainers/cadd-scripts-with-envs:1.6.post1_cv1' containerOptions { - (workflow.containerEngine == 'singularity') ? - "-B ${annotation_dir}:/opt/CADD-scripts-1.6.post1/data/annotations" : - "-v ${annotation_dir}:/opt/CADD-scripts-1.6.post1/data/annotations" - } + ['singularity', 'apptainer'].contains(workflow.containerEngine) + ? "-B ${annotation_dir}:/opt/CADD-scripts-1.6.post1/data/annotations" + : "-v ${annotation_dir}:/opt/CADD-scripts-1.6.post1/data/annotations" + } input: tuple val(meta), path(vcf) - path(annotation_dir) + path annotation_dir output: tuple val(meta), path("*.tsv.gz"), emit: tsv - path "versions.yml" , emit: versions + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -25,29 +25,31 @@ process CADD { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = "1.6.post1" // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + def VERSION = "1.6.post1" + // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. """ cadd.sh \\ -o ${prefix}.tsv.gz \\ - $args \\ - $vcf + ${args} \\ + ${vcf} cat <<-END_VERSIONS > versions.yml "${task.process}": - cadd: $VERSION + cadd: ${VERSION} END_VERSIONS """ stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = "1.6.post1" // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + def VERSION = "1.6.post1" + // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. """ touch ${prefix}.tsv.gz cat <<-END_VERSIONS > versions.yml "${task.process}": - cadd: $VERSION + cadd: ${VERSION} END_VERSIONS """ } diff --git a/modules/nf-core/custom/sratoolsncbisettings/meta.yml b/modules/nf-core/custom/sratoolsncbisettings/meta.yml index 2938a35dc84..71def424494 100644 --- a/modules/nf-core/custom/sratoolsncbisettings/meta.yml +++ b/modules/nf-core/custom/sratoolsncbisettings/meta.yml @@ -14,7 +14,10 @@ tools: documentation: https://github.com/ncbi/sra-tools/wiki tool_dev_url: https://github.com/ncbi/sra-tools licence: ["Public Domain"] - identifier: "" +input: + - - ids: + type: string + description: List of id settings output: - ncbi_settings: - "*.mkfg": diff --git a/modules/nf-core/custom/sratoolsncbisettings/tests/nextflow.config b/modules/nf-core/custom/sratoolsncbisettings/tests/nextflow.config index df5def04a0d..3c9471c5727 100644 --- a/modules/nf-core/custom/sratoolsncbisettings/tests/nextflow.config +++ b/modules/nf-core/custom/sratoolsncbisettings/tests/nextflow.config @@ -6,9 +6,9 @@ env.NCBI_SETTINGS = params.settings_file process { withName: CUSTOM_SRATOOLSNCBISETTINGS { containerOptions = { - (workflow.containerEngine == 'singularity') ? - "-B ${params.settings_path}:${params.settings_path}" : - "-v ${params.settings_path}:${params.settings_path}" + ['singularity', 'apptainer'].contains(workflow.containerEngine) + ? "-B ${params.settings_path}:${params.settings_path}" + : "-v ${params.settings_path}:${params.settings_path}" } } -} \ No newline at end of file +} diff --git a/modules/nf-core/deeparg/downloaddata/main.nf b/modules/nf-core/deeparg/downloaddata/main.nf index 787c0027968..7f17ebab890 100644 --- a/modules/nf-core/deeparg/downloaddata/main.nf +++ b/modules/nf-core/deeparg/downloaddata/main.nf @@ -2,32 +2,33 @@ process DEEPARG_DOWNLOADDATA { label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/deeparg:1.0.4--pyhdfd78af_0' : - 'biocontainers/deeparg:1.0.4--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/deeparg:1.0.4--pyhdfd78af_0' + : 'biocontainers/deeparg:1.0.4--pyhdfd78af_0'}" /* We have to force docker/singularity to mount a fake file to allow reading of a problematic file with borked read-write permissions in an upstream dependency (theanos). Original report: https://github.com/nf-core/funcscan/issues/23 */ containerOptions { - "${workflow.containerEngine}" == 'singularity' ? '-B $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' : - "${workflow.containerEngine}" == 'docker' ? '-v $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' : - '' + ['singularity', 'apptainer'].contains(workflow.containerEngine) + ? '-B $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' + : "${workflow.containerEngine}" == 'docker' + ? '-v $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' + : '' } - input: - output: - path "db/" , emit: db - path "versions.yml" , emit: versions + path "db/", emit: db + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' - def VERSION='1.0.4' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.0.4' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ # Theano needs a writable space and uses the home directory by default, @@ -38,24 +39,30 @@ process DEEPARG_DOWNLOADDATA { deeparg \\ download_data \\ - $args \\ + ${args} \\ -o db/ cat <<-END_VERSIONS > versions.yml "${task.process}": - deeparg: $VERSION + deeparg: ${VERSION} END_VERSIONS """ stub: def args = task.ext.args ?: '' - def VERSION='1.0.4' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.0.4' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ + echo "deeparg \\ + download_data \\ + ${args} \\ + -o db/" + mkdir db/ cat <<-END_VERSIONS > versions.yml "${task.process}": - deeparg: $VERSION + deeparg: ${VERSION} END_VERSIONS """ } diff --git a/modules/nf-core/deeparg/predict/main.nf b/modules/nf-core/deeparg/predict/main.nf index 20fd0a937b0..2ac258a87d3 100644 --- a/modules/nf-core/deeparg/predict/main.nf +++ b/modules/nf-core/deeparg/predict/main.nf @@ -1,32 +1,34 @@ process DEEPARG_PREDICT { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/deeparg:1.0.4--pyhdfd78af_0' : - 'biocontainers/deeparg:1.0.4--pyhdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/deeparg:1.0.4--pyhdfd78af_0' + : 'biocontainers/deeparg:1.0.4--pyhdfd78af_0'}" /* We have to force docker/singularity to mount a fake file to allow reading of a problematic file with borked read-write permissions in an upstream dependency (theanos). Original report: https://github.com/nf-core/funcscan/issues/23 */ containerOptions { - "${workflow.containerEngine}" == 'singularity' ? '-B $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' : - "${workflow.containerEngine}" == 'docker' ? '-v $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' : - '' + ['singularity', 'apptainer'].contains(workflow.containerEngine) + ? '-B $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' + : "${workflow.containerEngine}" == 'docker' + ? '-v $(which bash):/usr/local/lib/python2.7/site-packages/Theano-0.8.2-py2.7.egg-info/PKG-INFO' + : '' } input: tuple val(meta), path(fasta), val(model) - path(db) + path db output: - tuple val(meta), path("*.align.daa") , emit: daa - tuple val(meta), path("*.align.daa.tsv") , emit: daa_tsv - tuple val(meta), path("*.mapping.ARG") , emit: arg + tuple val(meta), path("*.align.daa"), emit: daa + tuple val(meta), path("*.align.daa.tsv"), emit: daa_tsv + tuple val(meta), path("*.mapping.ARG"), emit: arg tuple val(meta), path("*.mapping.potential.ARG"), emit: potential_arg - path "versions.yml" , emit: versions + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -34,9 +36,10 @@ process DEEPARG_PREDICT { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION='1.0.4' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.0.4' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ - DATABASE=`find -L $db -type d -name "database" | sed 's/database//'` + DATABASE=`find -L ${db} -type d -name "database" | sed 's/database//'` # Theano needs a writable space and uses the home directory by default, # but the latter is not always writable, for instance when Singularity @@ -46,22 +49,23 @@ process DEEPARG_PREDICT { deeparg \\ predict \\ - $args \\ - -i $fasta \\ + ${args} \\ + -i ${fasta} \\ -o ${prefix} \\ -d \$DATABASE \\ - --model $model + --model ${model} cat <<-END_VERSIONS > versions.yml "${task.process}": - deeparg: $VERSION + deeparg: ${VERSION} END_VERSIONS """ stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION='1.0.4' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def VERSION = '1.0.4' + // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}.align.daa touch ${prefix}.align.daa.tsv @@ -70,7 +74,7 @@ process DEEPARG_PREDICT { cat <<-END_VERSIONS > versions.yml "${task.process}": - deeparg: $VERSION + deeparg: ${VERSION} END_VERSIONS """ } diff --git a/modules/nf-core/diamond/blastp/environment.yml b/modules/nf-core/diamond/blastp/environment.yml index 950c3c5c55e..f19483fe91b 100644 --- a/modules/nf-core/diamond/blastp/environment.yml +++ b/modules/nf-core/diamond/blastp/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::diamond=2.1.8 + - bioconda::diamond=2.1.11 diff --git a/modules/nf-core/diamond/blastp/main.nf b/modules/nf-core/diamond/blastp/main.nf index dc01cdcc08c..6dd8d3925ad 100644 --- a/modules/nf-core/diamond/blastp/main.nf +++ b/modules/nf-core/diamond/blastp/main.nf @@ -1,27 +1,27 @@ process DIAMOND_BLASTP { tag "$meta.id" - label 'process_medium' + label 'process_high' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/diamond:2.1.8--h43eeafb_0' : - 'biocontainers/diamond:2.1.8--h43eeafb_0' }" + 'https://depot.galaxyproject.org/singularity/diamond:2.1.11--h5ca1c30_0' : + 'biocontainers/diamond:2.1.11--h5ca1c30_0' }" input: tuple val(meta) , path(fasta) tuple val(meta2), path(db) - val out_ext + val outfmt val blast_columns output: - tuple val(meta), path('*.blast'), optional: true, emit: blast - tuple val(meta), path('*.xml') , optional: true, emit: xml - tuple val(meta), path('*.txt') , optional: true, emit: txt - tuple val(meta), path('*.daa') , optional: true, emit: daa - tuple val(meta), path('*.sam') , optional: true, emit: sam - tuple val(meta), path('*.tsv') , optional: true, emit: tsv - tuple val(meta), path('*.paf') , optional: true, emit: paf - path "versions.yml" , emit: versions + tuple val(meta), path('*.{blast,blast.gz}'), optional: true, emit: blast + tuple val(meta), path('*.{xml,xml.gz}') , optional: true, emit: xml + tuple val(meta), path('*.{txt,txt.gz}') , optional: true, emit: txt + tuple val(meta), path('*.{daa,daa.gz}') , optional: true, emit: daa + tuple val(meta), path('*.{sam,sam.gz}') , optional: true, emit: sam + tuple val(meta), path('*.{tsv,tsv.gz}') , optional: true, emit: tsv + tuple val(meta), path('*.{paf,paf.gz}') , optional: true, emit: paf + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -29,35 +29,38 @@ process DIAMOND_BLASTP { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def is_compressed = fasta.getExtension() == "gz" ? true : false - def fasta_name = is_compressed ? fasta.getBaseName() : fasta + def columns = blast_columns ? "${blast_columns}" : '' - switch ( out_ext ) { - case "blast": outfmt = 0; break - case "xml": outfmt = 5; break - case "txt": outfmt = 6; break - case "daa": outfmt = 100; break - case "sam": outfmt = 101; break - case "tsv": outfmt = 102; break - case "paf": outfmt = 103; break - default: - outfmt = '6'; - out_ext = 'txt'; - log.warn("Unknown output file format provided (${out_ext}): selecting DIAMOND default of tabular BLAST output (txt)"); - break + def out_ext = "" + + if (outfmt == 0) { + out_ext = "blast" + } else if (outfmt == 5) { + out_ext = "xml" + } else if (outfmt == 6) { + out_ext = "txt" + } else if (outfmt == 100) { + out_ext = "daa" + } else if (outfmt == 101) { + out_ext = "sam" + } else if (outfmt == 102) { + out_ext = "tsv" + } else if (outfmt == 103) { + out_ext = "paf" + } else { + log.warn("Unknown output file format provided (${outfmt}): selecting DIAMOND default of tabular BLAST output (txt)") + outfmt = 6 + out_ext = 'txt' } - """ - if [ "${is_compressed}" == "true" ]; then - gzip -c -d ${fasta} > ${fasta_name} - fi - DB=`find -L ./ -name "*.dmnd" | sed 's/\\.dmnd\$//'` + if ( args =~ /--compress\s+1/ ) out_ext += '.gz' + """ diamond \\ blastp \\ --threads ${task.cpus} \\ - --db \$DB \\ - --query ${fasta_name} \\ + --db ${db} \\ + --query ${fasta} \\ --outfmt ${outfmt} ${columns} \\ ${args} \\ --out ${prefix}.${out_ext} @@ -69,23 +72,32 @@ process DIAMOND_BLASTP { """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - switch ( out_ext ) { - case "blast": outfmt = 0; break - case "xml": outfmt = 5; break - case "txt": outfmt = 6; break - case "daa": outfmt = 100; break - case "sam": outfmt = 101; break - case "tsv": outfmt = 102; break - case "paf": outfmt = 103; break - default: - outfmt = '6'; - out_ext = 'txt'; - log.warn("Unknown output file format provided (${out_ext}): selecting DIAMOND default of tabular BLAST output (txt)"); - break + + def out_ext = "" + + if (outfmt == 0) { + out_ext = "blast" + } else if (outfmt == 5) { + out_ext = "xml" + } else if (outfmt == 6) { + out_ext = "txt" + } else if (outfmt == 100) { + out_ext = "daa" + } else if (outfmt == 101) { + out_ext = "sam" + } else if (outfmt == 102) { + out_ext = "tsv" + } else if (outfmt == 103) { + out_ext = "paf" + } else { + log.warn("Unknown output file format provided (${outfmt}): selecting DIAMOND default of tabular BLAST output (txt)") + outfmt = 6 + out_ext = 'txt' } + if ( args =~ /--compress\s+1/ ) out_ext += '.gz' + """ touch ${prefix}.${out_ext} diff --git a/modules/nf-core/diamond/blastp/meta.yml b/modules/nf-core/diamond/blastp/meta.yml index fbddfbd00f1..6518aa9aedd 100644 --- a/modules/nf-core/diamond/blastp/meta.yml +++ b/modules/nf-core/diamond/blastp/meta.yml @@ -33,19 +33,24 @@ input: type: file description: File of the indexed DIAMOND database pattern: "*.dmnd" - - - out_ext: - type: string + - - outfmt: + type: integer description: | - Specify the type of output file to be generated. `blast` corresponds to - BLAST pairwise format. `xml` corresponds to BLAST xml format. - `txt` corresponds to to BLAST tabular format. `tsv` corresponds to - taxonomic classification format. - pattern: "blast|xml|txt|daa|sam|tsv|paf" + Specify the type of output file to be generated. + 0, .blast, BLAST pairwise format. + 5, .xml, BLAST XML format. + 6, .txt, BLAST tabular format (default). This format can be customized, the 6 may be followed by a space-separated list of the blast_columns keywords, each specifying a field of the output. + 100, .daa, DIAMOND alignment archive (DAA). The DAA format is a proprietary binary format that can subsequently be used to generate other output formats using the view command. It is also supported by MEGAN and allows a quick import of results. + 101, .sam, SAM format. + 102, .tsv, Taxonomic classification. This format will not print alignments but only a taxonomic classification for each query using the LCA algorithm. + 103, .paf, PAF format. The custom fields in the format are AS (bit score), ZR (raw score) and ZE (e-value). + pattern: "0|5|6|100|101|102|103" - - blast_columns: type: string description: | Optional space separated list of DIAMOND tabular BLAST output keywords - used for in conjunction with the 'txt' out_ext option (--outfmt 6). Options: + used in conjunction with the --outfmt 6 option (txt). + Options: qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore output: - blast: @@ -54,70 +59,77 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.blast": - type: file + pattern: "*.{blast,blast.gz}" + - "*.{blast,blast.gz}": + type: map description: File containing blastp hits - pattern: "*.{blast}" + pattern: "*.{blast,blast.gz}" - xml: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.xml": - type: file + pattern: "*.{xml,xml.gz}" + - "*.{xml,xml.gz}": + type: map description: File containing blastp hits - pattern: "*.{xml}" + pattern: "*.{xml,xml.gz}" - txt: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.txt": - type: file + pattern: "*.{txt,txt.gz}" + - "*.{txt,txt.gz}": + type: map description: File containing hits in tabular BLAST format. - pattern: "*.{txt}" + pattern: "*.{txt,txt.gz}" - daa: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.daa": - type: file + pattern: "*.{daa,daa.gz}" + - "*.{daa,daa.gz}": + type: map description: File containing hits DAA format - pattern: "*.{daa}" + pattern: "*.{daa,daa.gz}" - sam: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.sam": - type: file + pattern: "*.{sam,sam.gz}" + - "*.{sam,sam.gz}": + type: map description: File containing aligned reads in SAM format - pattern: "*.{sam}" + pattern: "*.{sam,sam.gz}" - tsv: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.tsv": - type: file + pattern: "*.{tsv,tsv.gz}" + - "*.{tsv,tsv.gz}": + type: map description: Tab separated file containing taxonomic classification of hits - pattern: "*.{tsv}" + pattern: "*.{tsv,tsv.gz}" - paf: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.paf": - type: file + pattern: "*.{paf,paf.gz}" + - "*.{paf,paf.gz}": + type: map description: File containing aligned reads in pairwise mapping format format - pattern: "*.{paf}" + pattern: "*.{paf,paf.gz}" - versions: - versions.yml: type: file diff --git a/modules/nf-core/diamond/blastp/tests/main.nf.test b/modules/nf-core/diamond/blastp/tests/main.nf.test index f21e926de9d..9211915173c 100644 --- a/modules/nf-core/diamond/blastp/tests/main.nf.test +++ b/modules/nf-core/diamond/blastp/tests/main.nf.test @@ -23,17 +23,14 @@ nextflow_process { } } - test("Should search for protein hits against a DIAMOND db and return a tab separated output file of hits") { + test("sarscov2 - proteome - txt") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] input[1] = DIAMOND_MAKEDB.out.db - input[2] = 'txt' + input[2] = 6 input[3] = 'qseqid qlen' """ } @@ -42,27 +39,20 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.txt, - process.out.versions - ).match() - } + { assert snapshot(process.out).match() } ) } } - test("Should search for zipped protein hits against a DIAMOND db and return a tab separated output file of hits") { + test("sarscov2 - proteome - gz - txt") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta.gz', checkIfExists: true) ] input[1] = DIAMOND_MAKEDB.out.db - input[2] = 'txt' + input[2] = 6 input[3] = 'qseqid qlen' """ } @@ -71,27 +61,20 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.txt, - process.out.versions - ).match("gz_txt") - } + { assert snapshot(process.out).match("gz_txt")} ) } } - test("Should search for protein hits against a DIAMOND db and return a daa format file of hits") { + test("sarscov2 - proteome - daa") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] input[1] = DIAMOND_MAKEDB.out.db - input[2] = 'daa' + input[2] = 100 input[3] = [] """ } @@ -101,7 +84,55 @@ nextflow_process { assertAll( { assert process.success }, { assert process.out.daa }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(process.out.versions).match("daa") } + ) + } + + } + + test("sarscov2 - proteome - txt - gz") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] + input[1] = DIAMOND_MAKEDB.out.db + input[2] = 6 + input[3] = 'qseqid qlen' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("txt_gz") } + ) + } + + } + + test("sarscov2 - proteome - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ] + input[1] = DIAMOND_MAKEDB.out.db + input[2] = 6 + input[3] = 'qseqid qlen' + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("stub") } ) } diff --git a/modules/nf-core/diamond/blastp/tests/main.nf.test.snap b/modules/nf-core/diamond/blastp/tests/main.nf.test.snap index e323c8b89c1..44d504337b1 100644 --- a/modules/nf-core/diamond/blastp/tests/main.nf.test.snap +++ b/modules/nf-core/diamond/blastp/tests/main.nf.test.snap @@ -1,54 +1,290 @@ { - "Should search for protein hits against a DIAMOND db and return a tab separated output file of hits": { + "sarscov2 - proteome - txt": { "content": [ - [ - [ - { - "id": "test" - }, - "test.txt:md5,8131b1afd717f3d5f2f2417c5b562e6e" + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.txt:md5,8131b1afd717f3d5f2f2417c5b562e6e" + ] + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + + ], + "7": [ + "versions.yml:md5,5f638327037bee3c00e17521c04a652f" + ], + "blast": [ + + ], + "daa": [ + + ], + "paf": [ + + ], + "sam": [ + + ], + "tsv": [ + + ], + "txt": [ + [ + { + "id": "test" + }, + "test.txt:md5,8131b1afd717f3d5f2f2417c5b562e6e" + ] + ], + "versions": [ + "versions.yml:md5,5f638327037bee3c00e17521c04a652f" + ], + "xml": [ + ] - ], - [ - "versions.yml:md5,57a0ebeb0a8a732c941ae0102639a9d0" - ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2025-01-28T10:25:13.48912978" + }, + "txt_gz": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.txt.gz:md5,8131b1afd717f3d5f2f2417c5b562e6e" + ] + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + + ], + "7": [ + "versions.yml:md5,5f638327037bee3c00e17521c04a652f" + ], + "blast": [ + + ], + "daa": [ + + ], + "paf": [ + + ], + "sam": [ + + ], + "tsv": [ + + ], + "txt": [ + [ + { + "id": "test" + }, + "test.txt.gz:md5,8131b1afd717f3d5f2f2417c5b562e6e" + ] + ], + "versions": [ + "versions.yml:md5,5f638327037bee3c00e17521c04a652f" + ], + "xml": [ + + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-07-29T14:40:23.906848" + "timestamp": "2025-01-28T10:36:04.361504205" }, "gz_txt": { "content": [ - [ - [ - { - "id": "test" - }, - "test.txt:md5,8131b1afd717f3d5f2f2417c5b562e6e" + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.txt:md5,8131b1afd717f3d5f2f2417c5b562e6e" + ] + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + + ], + "7": [ + "versions.yml:md5,5f638327037bee3c00e17521c04a652f" + ], + "blast": [ + + ], + "daa": [ + + ], + "paf": [ + + ], + "sam": [ + + ], + "tsv": [ + + ], + "txt": [ + [ + { + "id": "test" + }, + "test.txt:md5,8131b1afd717f3d5f2f2417c5b562e6e" + ] + ], + "versions": [ + "versions.yml:md5,5f638327037bee3c00e17521c04a652f" + ], + "xml": [ + ] - ], - [ - "versions.yml:md5,57a0ebeb0a8a732c941ae0102639a9d0" - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-07-29T14:40:29.865487" + "timestamp": "2025-01-28T10:25:20.993203497" }, - "Should search for protein hits against a DIAMOND db and return a daa format file of hits": { + "daa": { "content": [ [ - "versions.yml:md5,57a0ebeb0a8a732c941ae0102639a9d0" + "versions.yml:md5,5f638327037bee3c00e17521c04a652f" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.3" + "nf-test": "0.9.2", + "nextflow": "24.10.2" + }, + "timestamp": "2025-01-28T10:25:28.126992812" + }, + "stub": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + + ], + "6": [ + + ], + "7": [ + "versions.yml:md5,5f638327037bee3c00e17521c04a652f" + ], + "blast": [ + + ], + "daa": [ + + ], + "paf": [ + + ], + "sam": [ + + ], + "tsv": [ + + ], + "txt": [ + [ + { + "id": "test" + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,5f638327037bee3c00e17521c04a652f" + ], + "xml": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-07-29T14:40:35.362027" + "timestamp": "2025-01-28T10:25:34.911633513" } } \ No newline at end of file diff --git a/modules/nf-core/diamond/blastp/tests/nextflow.config b/modules/nf-core/diamond/blastp/tests/nextflow.config new file mode 100644 index 00000000000..bd28cb1d433 --- /dev/null +++ b/modules/nf-core/diamond/blastp/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: DIAMOND_BLASTP { + ext.args = '--compress 1' + } + +} diff --git a/modules/nf-core/fast2q/environment.yml b/modules/nf-core/fast2q/environment.yml new file mode 100644 index 00000000000..59071599504 --- /dev/null +++ b/modules/nf-core/fast2q/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - bioconda::fast2q=2.7.2 diff --git a/modules/nf-core/fast2q/main.nf b/modules/nf-core/fast2q/main.nf new file mode 100644 index 00000000000..6ecd725162f --- /dev/null +++ b/modules/nf-core/fast2q/main.nf @@ -0,0 +1,67 @@ +process FAST2Q { + + tag "2FAST2Q" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/fast2q:2.7.2--pyh7e72e81_0' : + 'biocontainers/fast2q:2.7.2--pyh7e72e81_0' }" + + input: + tuple val(meta), path(fastq) + tuple val(meta2), path(library) + + output: + tuple val(meta), path("${prefix}.csv") , emit: count_matrix + tuple val(meta), path("${prefix}_stats.csv") , emit: stats + tuple val(meta), path("${prefix}_distribution_plot.png") , emit: distribution_plot + tuple val(meta), path("${prefix}_reads_plot.png") , emit: reads_plot + tuple val(meta), path("${prefix}_reads_plot_percentage.png"), emit: reads_plot_percentage + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def input_file = (fastq instanceof Path && fastq.exists()) ? "--s ${fastq}" : '' + def library_file = (library instanceof Path && library.exists()) ? "--g ${library}" : '' + + """ + export MPLCONFIGDIR=\$PWD + 2fast2q \\ + -c \\ + --o ./ \\ + --fn ${prefix} \\ + --cp ${task.cpus} \\ + $input_file \\ + $library_file \\ + $args + + mv **/${prefix}* . + + cat <<-END_VERSIONS > versions.yml + ${task.process}: + 2FAST2Q version: \$(2fast2q -v | grep 'Version:' | sed 's/Version: //g') + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + + """ + touch ${prefix}.csv + touch ${prefix}_stats.csv + touch ${prefix}_distribution_plot.png + touch ${prefix}_reads_plot.png + touch ${prefix}_reads_plot_percentage.png + + cat <<-END_VERSIONS > versions.yml + ${task.process}: + 2FAST2Q version: \$(2fast2q -v | grep 'Version:' | sed 's/Version: //g') + END_VERSIONS + """ + +} diff --git a/modules/nf-core/fast2q/meta.yml b/modules/nf-core/fast2q/meta.yml new file mode 100644 index 00000000000..93619bde89a --- /dev/null +++ b/modules/nf-core/fast2q/meta.yml @@ -0,0 +1,98 @@ +name: fast2q +description: A program that counts sequence occurrences in FASTQ files. +keywords: + - CRISPRi + - FASTQ + - genomics +tools: + - 2FAST2Q: + description: | + 2FAST2Q is ideal for CRISPRi-Seq, and for extracting and counting any kind of information from reads in the fastq format, such as barcodes in Bar-seq experiments. + 2FAST2Q can work with sequence mismatches, Phred-score, and be used to find and extract unknown sequences delimited by known sequences. + 2FAST2Q can extract multiple features per read using either fixed positions or delimiting search sequences. + homepage: https://github.com/afombravo/2FAST2Q + doi: 10.7717/peerj.14041 + licence: ["GPL-3.0-or-later"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing output name. + e.g. [ id:'test'] + - fastq: + type: directory + description: Folder with FASTQ file(s). 2FAST2Q automatically picks up all the FASTQ files inside the provided folder. + pattern: "*.{fastq,gz}" + + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'library_name', multiple_features_per_read:false ] + - library: + type: file + description: .csv library file following the ´Feature_name,sequence´ or ´Feature_name,sequence1:sequence2´ format. See 2FAST2Q instructions for more information. + pattern: "*.csv" + +output: + - count_matrix: + - meta: + type: map + description: | + Groovy Map containing output name. + e.g. [ id:'test' ] + - ${prefix}.csv: + type: file + description: | + Count matrix csv file + - stats: + - meta: + type: map + description: | + Groovy Map containing output name. + e.g. [ id:'test' ] + - ${prefix}_stats.csv: + type: file + description: | + File containing all the relevant statistics such as quality passing reads, aligned reads, total reads, and sample run times. + - distribution_plot: + - meta: + type: map + description: | + Groovy Map containing output name. + e.g. [ id:'test' ] + - ${prefix}_distribution_plot.png: + type: file + description: | + Violin plot of the distribution of reads per feature across all samples. + - reads_plot: + - meta: + type: map + description: | + Groovy Map containing output name. + e.g. [ id:'test' ] + - ${prefix}_reads_plot.png: + type: file + description: | + Bar plot with the distribution of reads, in absolute numbers, binned to the different quality metrics indicated in the statistics.csv + - reads_plot_percentage: + - meta: + type: map + description: | + Groovy Map containing output name. + e.g. [ id:'test' ] + - ${prefix}_reads_plot_percentage.png: + type: file + description: | + Bar plot with the distribution of reads, in percentage, binned to the different quality metrics indicated in the statistics.csv + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@afombravo" +maintainers: + - "@afombravo" diff --git a/modules/nf-core/fast2q/tests/main.nf.test b/modules/nf-core/fast2q/tests/main.nf.test new file mode 100644 index 00000000000..b0f985f1779 --- /dev/null +++ b/modules/nf-core/fast2q/tests/main.nf.test @@ -0,0 +1,165 @@ +nextflow_process { + + name "Test Process 2FAST2Q" + script "../main.nf" + process "FAST2Q" + + tag "modules" + tag "modules_nfcore" + tag "fast2q" + + config './nextflow.config' + + test("2FAST2Q self-test") { + + when { + + params { + module_args = '-t' + } + + process { + """ + input[0] = [ + [ id:'test1' ], // meta map + [] + ] + input[1] = [ + [ id:'library_name', multiple_features_per_read:false ], // meta map for second input + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.count_matrix, + file(process.out.stats[0][1]).name, + file(process.out.distribution_plot[0][1]).name, + file(process.out.reads_plot[0][1]).name, + file(process.out.reads_plot_percentage[0][1]).name, + process.out.versions, // versions file + path(process.out.versions[0]).yaml // Validate against the versions snapshot + ).match() + } + ) + } + } + + test("Extracting and counting all features at position=0 with default length of 20bp from a FASTQ file (without optional library.csv)") { + + when { + + params { + module_args = '--mo EC' + } + + process { + """ + input[0] = [ + [ id:'test1' ], // meta map + file(params.test_data_base + '/data/genomics/mus_musculus/mageck/ERR376998.small.fastq.gz', checkIfExists: true) // FASTQ file + ] + input[1] = [ + [ id:'library_name', multiple_features_per_read:false ], // meta map for second input + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, // Ensure process ran successfully + { assert snapshot( + process.out.count_matrix, + file(process.out.stats[0][1]).name, + file(process.out.distribution_plot[0][1]).name, + file(process.out.reads_plot[0][1]).name, + file(process.out.reads_plot_percentage[0][1]).name, + process.out.versions, // versions file + path(process.out.versions[0]).yaml // Validate against the versions snapshot + ).match() + } + ) + } + } + + test("Extracting all features at position=0 with default length of 20bp from a FASTQ file, and respective alignment to a file with DNA features (library.csv)") { + + when { + + params { + module_args = '' + } + + process { + """ + input[0] = [ + [ id:'test1' ], // meta map + file(params.test_data_base + '/data/genomics/mus_musculus/mageck/ERR376998.small.fastq.gz', checkIfExists: true) // FASTQ file + ] + input[1] = [ + [ id:'library_name', multiple_features_per_read:false ], // meta map for second input + file(params.test_data_base + '/data/genomics/mus_musculus/mageck/yusa_library.csv', checkIfExists: true) // library file + ] + """ + } + } + + then { + assertAll( + { assert process.success }, // Ensure process ran successfully + { assert snapshot( + process.out.count_matrix, + file(process.out.stats[0][1]).name, + file(process.out.distribution_plot[0][1]).name, + file(process.out.reads_plot[0][1]).name, + file(process.out.reads_plot_percentage[0][1]).name, + process.out.versions, // versions file + path(process.out.versions[0]).yaml // Validate against the versions snapshot + ).match() + } + ) + } + } + + test("2FAST2Q self-test - stub") { + options "-stub" + when { + + params { + module_args = '-t' + } + + process { + """ + input[0] = [ + [ id:'test1' ], // meta map + [] + ] + input[1] = [ + [ id:'library_name', multiple_features_per_read:false ], // meta map for second input + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml // Validate against the versions snapshot + ).match() + } + ) + } + } + + +} diff --git a/modules/nf-core/fast2q/tests/main.nf.test.snap b/modules/nf-core/fast2q/tests/main.nf.test.snap new file mode 100644 index 00000000000..2e3220584de --- /dev/null +++ b/modules/nf-core/fast2q/tests/main.nf.test.snap @@ -0,0 +1,191 @@ +{ + "2FAST2Q self-test - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test1" + }, + "test1.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test1" + }, + "test1_stats.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test1" + }, + "test1_distribution_plot.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test1" + }, + "test1_reads_plot.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test1" + }, + "test1_reads_plot_percentage.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + "versions.yml:md5,996f5cbd9c8055ac57bd83b5278c20a7" + ], + "count_matrix": [ + [ + { + "id": "test1" + }, + "test1.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "distribution_plot": [ + [ + { + "id": "test1" + }, + "test1_distribution_plot.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads_plot": [ + [ + { + "id": "test1" + }, + "test1_reads_plot.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads_plot_percentage": [ + [ + { + "id": "test1" + }, + "test1_reads_plot_percentage.png:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "stats": [ + [ + { + "id": "test1" + }, + "test1_stats.csv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,996f5cbd9c8055ac57bd83b5278c20a7" + ] + }, + { + "FAST2Q": { + "2FAST2Q version": "2.7.2" + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-01-28T20:56:17.951393012" + }, + "Extracting and counting all features at position=0 with default length of 20bp from a FASTQ file (without optional library.csv)": { + "content": [ + [ + [ + { + "id": "test1" + }, + "test1.csv:md5,a1ead6bcda7e3de46ae53846aca71a41" + ] + ], + "test1_stats.csv", + "test1_distribution_plot.png", + "test1_reads_plot.png", + "test1_reads_plot_percentage.png", + [ + "versions.yml:md5,996f5cbd9c8055ac57bd83b5278c20a7" + ], + { + "FAST2Q": { + "2FAST2Q version": "2.7.2" + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-01-28T21:03:48.898136957" + }, + "Extracting all features at position=0 with default length of 20bp from a FASTQ file, and respective alignment to a file with DNA features (library.csv)": { + "content": [ + [ + [ + { + "id": "test1" + }, + "test1.csv:md5,caae8adb0277f74259f2b39c407909a8" + ] + ], + "test1_stats.csv", + "test1_distribution_plot.png", + "test1_reads_plot.png", + "test1_reads_plot_percentage.png", + [ + "versions.yml:md5,996f5cbd9c8055ac57bd83b5278c20a7" + ], + { + "FAST2Q": { + "2FAST2Q version": "2.7.2" + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-01-28T21:04:15.318640256" + }, + "2FAST2Q self-test": { + "content": [ + [ + [ + { + "id": "test1" + }, + "test1.csv:md5,22686579ca39d81107b7889cc87c3865" + ] + ], + "test1_stats.csv", + "test1_distribution_plot.png", + "test1_reads_plot.png", + "test1_reads_plot_percentage.png", + [ + "versions.yml:md5,996f5cbd9c8055ac57bd83b5278c20a7" + ], + { + "FAST2Q": { + "2FAST2Q version": "2.7.2" + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-01-28T21:03:27.680008475" + } +} diff --git a/modules/nf-core/fast2q/tests/nextflow.config b/modules/nf-core/fast2q/tests/nextflow.config new file mode 100644 index 00000000000..ecb6df3b52c --- /dev/null +++ b/modules/nf-core/fast2q/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'FAST2Q' { + ext.args = params.module_args + } +} diff --git a/modules/nf-core/fast2q/tests/tags.yml b/modules/nf-core/fast2q/tests/tags.yml new file mode 100644 index 00000000000..67a35fe3b5e --- /dev/null +++ b/modules/nf-core/fast2q/tests/tags.yml @@ -0,0 +1,2 @@ +fast2q: + - "modules/nf-core/fast2q/**" \ No newline at end of file diff --git a/modules/nf-core/last/train/main.nf b/modules/nf-core/last/train/main.nf index 259415a5578..dad722e99f9 100644 --- a/modules/nf-core/last/train/main.nf +++ b/modules/nf-core/last/train/main.nf @@ -32,15 +32,15 @@ process LAST_TRAIN { $fastx \\ > ${prefix}.train - echo "id\tsubstitution_percent_identity\tlast -t\tlast -a\tlast -A\tlast -b\tlast -B\tlast -S" > ${prefix}.train.tsv - printf "\$(basename ${prefix}.train .target.train)\t" >> ${prefix}.train.tsv - grep 'substitution percent identity' ${prefix}.train | tail -n 1 | awk '{print \$5}' | tr '\n' '\t' >> ${prefix}.train.tsv - grep 'last -t' ${prefix}.train | tail -n 1 | awk '{print \$2}' | sed -e 's/-t//' | tr '\n' '\t' >> ${prefix}.train.tsv - grep 'last -a' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\n' '\t' >> ${prefix}.train.tsv - grep 'last -A' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\n' '\t' >> ${prefix}.train.tsv - grep 'last -b' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\n' '\t' >> ${prefix}.train.tsv - grep 'last -B' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\n' '\t' >> ${prefix}.train.tsv - grep 'last -S' ${prefix}.train | tail -n 1 | awk '{print \$3}' >> ${prefix}.train.tsv + echo "id\tsubstitution_percent_identity\tlast -t\tlast -a\tlast -A\tlast -b\tlast -B\tlast -S" > ${prefix}.train.tsv + printf "\$(basename ${prefix}.train .target.train)\t" >> ${prefix}.train.tsv + grep 'substitution percent identity' ${prefix}.train | tail -n 1 | awk '{print \$5}' | tr '\\n' '\\t' >> ${prefix}.train.tsv + grep 'last -t' ${prefix}.train | tail -n 1 | awk '{print \$2}' | sed -e 's/-t//' | tr '\\n' '\\t' >> ${prefix}.train.tsv + grep 'last -a' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\\n' '\\t' >> ${prefix}.train.tsv + grep 'last -A' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\\n' '\\t' >> ${prefix}.train.tsv + grep 'last -b' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\\n' '\\t' >> ${prefix}.train.tsv + grep 'last -B' ${prefix}.train | tail -n 1 | awk '{print \$3}' | tr '\\n' '\\t' >> ${prefix}.train.tsv + grep 'last -S' ${prefix}.train | tail -n 1 | awk '{print \$3}' >> ${prefix}.train.tsv cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/last/train/tests/main.nf.test.snap b/modules/nf-core/last/train/tests/main.nf.test.snap index db0a002dcfa..537efdbb2ec 100644 --- a/modules/nf-core/last/train/tests/main.nf.test.snap +++ b/modules/nf-core/last/train/tests/main.nf.test.snap @@ -74,7 +74,7 @@ ] ], "2": [ - "versions.yml:md5,c1f06f4162a8b4ee1b8094d967f6678d" + "versions.yml:md5,b2d4a4fce93a910c90768053127969b3" ], "multiqc": [ [ @@ -95,14 +95,14 @@ ] ], "versions": [ - "versions.yml:md5,c1f06f4162a8b4ee1b8094d967f6678d" + "versions.yml:md5,b2d4a4fce93a910c90768053127969b3" ] } ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.3" + "nextflow": "24.10.4" }, - "timestamp": "2025-01-22T10:22:21.360808" + "timestamp": "2025-01-30T18:37:11.305733" } } \ No newline at end of file diff --git a/modules/nf-core/sylph/profile/environment.yml b/modules/nf-core/sylph/profile/environment.yml new file mode 100644 index 00000000000..fd9d6bf1294 --- /dev/null +++ b/modules/nf-core/sylph/profile/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::sylph=0.7.0" diff --git a/modules/nf-core/sylph/profile/main.nf b/modules/nf-core/sylph/profile/main.nf new file mode 100644 index 00000000000..ae85e9198fd --- /dev/null +++ b/modules/nf-core/sylph/profile/main.nf @@ -0,0 +1,49 @@ +process SYLPH_PROFILE { + tag "$meta.id" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/sylph:0.7.0--h919a2d8_0' : + 'biocontainers/sylph:0.7.0--h919a2d8_0' }" + + input: + tuple val(meta), path(reads) + path(database) + + output: + tuple val(meta), path('*.tsv'), emit: profile_out + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + sylph profile \\ + -t $task.cpus \\ + $args \\ + $reads \\ + $database\\ + -o ${prefix}.tsv + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sylph: \$(sylph -V | awk '{print \$2}') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.tsv + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sylph: \$(sylph -V | awk '{print \$2}') + END_VERSIONS + """ + +} diff --git a/modules/nf-core/sylph/profile/meta.yml b/modules/nf-core/sylph/profile/meta.yml new file mode 100644 index 00000000000..ce41070719c --- /dev/null +++ b/modules/nf-core/sylph/profile/meta.yml @@ -0,0 +1,51 @@ +name: "sylph_profile" +description: Sylph profile command for taxonoming profiling +keywords: + - profile + - metagenomics + - sylph + - classification +tools: + - sylph: + description: Sylph quickly enables querying of genomes against even low-coverage + shotgun metagenomes to find nearest neighbour ANI. + homepage: https://github.com/bluenote-1577/sylph + documentation: https://github.com/bluenote-1577/sylph + tool_dev_url: https://github.com/bluenote-1577/sylph + doi: 10.1038/s41587-024-02412-y + licence: ["MIT"] + identifier: biotools:sylph +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - reads: + type: file + description: | + List of input FastQ/FASTA files of size 1 and 2 for single-end and paired-end data, + respectively. They are automatically sketched to .sylsp/.syldb + - - database: + type: file + description: Pre-sketched *.syldb/*.sylsp files. Raw single-end fastq/fasta are allowed and will be automatically sketched to .sylsp/.syldb. + pattern: "*.{syldb,sylsp,fasta,fastq}" +output: + - profile_out: + - meta: + type: map + description: Groovy Map containing sample information + - "*.tsv": + type: file + description: Output file of species-level taxonomic profiling with abundances and ANIs. + pattern: "*tsv" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@jiahang1234" + - "@sofstam" +maintainers: + - "@sofstam" diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test b/modules/nf-core/sylph/profile/tests/main.nf.test new file mode 100644 index 00000000000..8d1993e20ec --- /dev/null +++ b/modules/nf-core/sylph/profile/tests/main.nf.test @@ -0,0 +1,80 @@ +nextflow_process { + + name "Test Process SYLPH_PROFILE" + script "../main.nf" + process "SYLPH_PROFILE" + tag "modules" + tag "modules_nfcore" + tag "sylph" + tag "sylph/profile" + + test("sarscov2 illumina single-end [fastq_gz]") { + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + ] + input[1] = file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + """ + } + } + + then { + assert process.success + assert snapshot( + process.out.versions, + file(process.out.profile_out[0][1]).readLines()[0] + ).match() + } + } + + test("sarscov2 illumina paired-end [fastq_gz]") { + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + """ + } + } + + then { + assert process.success + assert snapshot( + process.out.versions, + file(process.out.profile_out[0][1]).readLines()[0] + ).match() + } + } + + test("sarscov2 illumina paired-end [fastq_gz]-stub") { + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true) + ] + ] + input[1] = file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + """ + } + } + + then { + assert process.success + assert snapshot(process.out).match() + } + } +} diff --git a/modules/nf-core/sylph/profile/tests/main.nf.test.snap b/modules/nf-core/sylph/profile/tests/main.nf.test.snap new file mode 100644 index 00000000000..d7a487c401e --- /dev/null +++ b/modules/nf-core/sylph/profile/tests/main.nf.test.snap @@ -0,0 +1,61 @@ +{ + "sarscov2 illumina paired-end [fastq_gz]": { + "content": [ + [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ], + "Sample_file\tGenome_file\tTaxonomic_abundance\tSequence_abundance\tAdjusted_ANI\tEff_cov\tANI_5-95_percentile\tEff_lambda\tLambda_5-95_percentile\tMedian_cov\tMean_cov_geq1\tContainment_ind\tNaive_ANI\tkmers_reassigned\tContig_name" + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-01-27T15:47:59.374481624" + }, + "sarscov2 illumina single-end [fastq_gz]": { + "content": [ + [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ], + "Sample_file\tGenome_file\tTaxonomic_abundance\tSequence_abundance\tAdjusted_ANI\tEff_cov\tANI_5-95_percentile\tEff_lambda\tLambda_5-95_percentile\tMedian_cov\tMean_cov_geq1\tContainment_ind\tNaive_ANI\tkmers_reassigned\tContig_name" + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-01-27T15:47:53.556942841" + }, + "sarscov2 illumina paired-end [fastq_gz]-stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ], + "profile_out": [ + [ + { + "id": "test" + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,7b5a545483277cc0ff9189f8891e737f" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-01-27T15:48:04.991824868" + } +} \ No newline at end of file diff --git a/modules/nf-core/sylph/sketch/meta.yml b/modules/nf-core/sylph/sketch/meta.yml index 7a9abdf85b1..a7278db68be 100644 --- a/modules/nf-core/sylph/sketch/meta.yml +++ b/modules/nf-core/sylph/sketch/meta.yml @@ -34,8 +34,7 @@ output: type: map description: | Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - pattern: "my_sketches/*.sylsp" + e.g. [ id:'test'] - my_sketches/*.sylsp: type: map description: | diff --git a/modules/yaml-schema.json b/modules/yaml-schema.json deleted file mode 120000 index d84030e9dc3..00000000000 --- a/modules/yaml-schema.json +++ /dev/null @@ -1 +0,0 @@ -meta-schema.json \ No newline at end of file diff --git a/modules/yaml-schema.json b/modules/yaml-schema.json new file mode 100644 index 00000000000..d84030e9dc3 --- /dev/null +++ b/modules/yaml-schema.json @@ -0,0 +1 @@ +meta-schema.json \ No newline at end of file