diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58f150a..3feaf88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,8 @@ jobs: steps: - name: Check out pipeline code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 - name: Set up Nextflow uses: nf-core/setup-nextflow@v2 diff --git a/.github/workflows/download_pipeline.yml b/.github/workflows/download_pipeline.yml index 13b51e2..ab06316 100644 --- a/.github/workflows/download_pipeline.yml +++ b/.github/workflows/download_pipeline.yml @@ -34,6 +34,17 @@ jobs: REPO_LOWERCASE: ${{ steps.get_repo_properties.outputs.REPO_LOWERCASE }} REPOTITLE_LOWERCASE: ${{ steps.get_repo_properties.outputs.REPOTITLE_LOWERCASE }} REPO_BRANCH: ${{ steps.get_repo_properties.outputs.REPO_BRANCH }} + steps: + - name: Get the repository name and current branch + id: get_repo_properties + run: | + echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT" + echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> "$GITHUB_OUTPUT" + echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> "$GITHUB_OUTPUT" + + download: + runs-on: ubuntu-latest + needs: configure steps: - name: Install Nextflow uses: nf-core/setup-nextflow@v2 @@ -56,21 +67,10 @@ jobs: python -m pip install --upgrade pip pip install git+https://github.com/nf-core/tools.git@dev - - name: Get the repository name and current branch set as environment variable - id: get_repo_properties - run: | - echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT" - echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> "$GITHUB_OUTPUT" - echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> "$GITHUB_OUTPUT" - - name: Make a cache directory for the container images run: | mkdir -p ./singularity_container_images - download: - runs-on: ubuntu-latest - needs: configure - steps: - name: Download the pipeline env: NXF_SINGULARITY_CACHEDIR: ./singularity_container_images @@ -87,6 +87,9 @@ jobs: - name: Inspect download run: tree ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }} + - name: Inspect container images + run: tree ./singularity_container_images | tee ./container_initial + - name: Count the downloaded number of container images id: count_initial run: | @@ -123,7 +126,8 @@ jobs: final_count=${{ steps.count_afterwards.outputs.IMAGE_COUNT_AFTER }} difference=$((final_count - initial_count)) echo "$difference additional container images were \n downloaded at runtime . The pipeline has no support for offline runs!" - tree ./singularity_container_images + tree ./singularity_container_images > ./container_afterwards + diff ./container_initial ./container_afterwards exit 1 else echo "The pipeline can be downloaded successfully!" diff --git a/.github/workflows/linting_comment.yml b/.github/workflows/linting_comment.yml index 0bed96d..95b6b6a 100644 --- a/.github/workflows/linting_comment.yml +++ b/.github/workflows/linting_comment.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download lint results - uses: dawidd6/action-download-artifact@80620a5d27ce0ae443b965134db88467fc607b43 # v7 + uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8 with: workflow: linting.yml workflow_conclusion: completed diff --git a/.github/workflows/release-announcements.yml b/.github/workflows/release-announcements.yml index 450b1d5..76a9e67 100644 --- a/.github/workflows/release-announcements.yml +++ b/.github/workflows/release-announcements.yml @@ -27,39 +27,6 @@ jobs: ${{ steps.get_topics.outputs.topics }} #nfcore #openscience #nextflow #bioinformatics - send-tweet: - runs-on: ubuntu-latest - - steps: - - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 - with: - python-version: "3.10" - - name: Install dependencies - run: pip install tweepy==4.14.0 - - name: Send tweet - shell: python - run: | - import os - import tweepy - - client = tweepy.Client( - access_token=os.getenv("TWITTER_ACCESS_TOKEN"), - access_token_secret=os.getenv("TWITTER_ACCESS_TOKEN_SECRET"), - consumer_key=os.getenv("TWITTER_CONSUMER_KEY"), - consumer_secret=os.getenv("TWITTER_CONSUMER_SECRET"), - ) - tweet = os.getenv("TWEET") - client.create_tweet(text=tweet) - env: - TWEET: | - Pipeline release! ${{ github.repository }} v${{ github.event.release.tag_name }} - ${{ github.event.release.name }}! - - Please see the changelog: ${{ github.event.release.html_url }} - TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} - TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} - TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} - TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} - bsky-post: runs-on: ubuntu-latest steps: diff --git a/.nf-core.yml b/.nf-core.yml index b5d8b80..04b9515 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1,4 +1,4 @@ -nf_core_version: 3.1.1 +nf_core_version: 3.2.0 repository_type: pipeline template: author: Danilo Di Leo, Emelie Nilsson and Daniel Lundin diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e9f0e1..1dec865 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - prettier@3.2.5 - repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: "3.0.3" + rev: "3.1.2" hooks: - id: editorconfig-checker alias: ec diff --git a/CITATIONS.md b/CITATIONS.md index 03c28dc..3020553 100644 --- a/CITATIONS.md +++ b/CITATIONS.md @@ -46,7 +46,7 @@ - [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/) - > Ewels P, Magnusson M, Lundin S, Käller M. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics. 2016 Oct 1;32(19):3047-8. doi: 10.1093/bioinformatics/btw354. Epub 2016 Jun 16. PubMed PMID: 27312411; PubMed Central PMCID: PMC5039924. +> Ewels P, Magnusson M, Lundin S, Käller M. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics. 2016 Oct 1;32(19):3047-8. doi: 10.1093/bioinformatics/btw354. Epub 2016 Jun 16. PubMed PMID: 27312411; PubMed Central PMCID: PMC5039924. ## Software packaging/containerisation tools diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index 58fd7f2..b83ec76 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -1,9 +1,5 @@ report_comment: > - This report has been generated by the nf-core/magmap analysis pipeline. - For information about how to interpret these results, please see the documentation. - + This report has been generated by the nf-core/magmap analysis pipeline. For information about how to interpret these results, please see the documentation. report_section_order: "nf-core-magmap-methods-description": order: -1000 diff --git a/docs/usage.md b/docs/usage.md index 2292827..82db31d 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -212,7 +212,7 @@ First, go to the [nf-core/magmap releases page](https://github.com/nf-core/magma This version number will be logged in reports when you run the pipeline, so that you'll know what you used when you look back in the future. For example, at the bottom of the MultiQC reports. -To further assist in reproducibility, you can use, share and re-use [parameter files](#running-the-pipeline) to repeat pipeline runs with the same settings without having to write out a command with every single parameter. +To further assist in reproducibility, you can use share and reuse [parameter files](#running-the-pipeline) to repeat pipeline runs with the same settings without having to write out a command with every single parameter. > [!TIP] > If you wish to share such profile (such as upload as supplementary material for academic publications), make sure to NOT include cluster specific paths to files, nor institutional specific profiles. diff --git a/modules.json b/modules.json index 2a0da92..6eb3bf0 100644 --- a/modules.json +++ b/modules.json @@ -7,7 +7,7 @@ "nf-core": { "bbmap/align": { "branch": "master", - "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "git_sha": "49780ab7ba87906103c8810044008a042748fd4f", "installed_by": ["modules"] }, "bbmap/bbduk": { @@ -17,7 +17,7 @@ }, "bbmap/index": { "branch": "master", - "git_sha": "a1abf90966a2a4016d3c3e41e228bfcbd4811ccc", + "git_sha": "49780ab7ba87906103c8810044008a042748fd4f", "installed_by": ["modules"] }, "cat/cat": { @@ -27,7 +27,7 @@ }, "cat/fastq": { "branch": "master", - "git_sha": "a1abf90966a2a4016d3c3e41e228bfcbd4811ccc", + "git_sha": "0e9cb409c32d3ec4f0d3804588e4778971c09b7e", "installed_by": ["modules"] }, "custom/dumpsoftwareversions": { @@ -42,17 +42,17 @@ }, "gunzip": { "branch": "master", - "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "git_sha": "ce35ce92566b3328b405253543b9b2b4d4e5f4f7", "installed_by": ["modules"] }, "multiqc": { "branch": "master", - "git_sha": "cf17ca47590cc578dfb47db1c2a44ef86f89976d", + "git_sha": "f0719ae309075ae4a291533883847c3f7c441dad", "installed_by": ["modules"] }, "prokka": { "branch": "master", - "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "git_sha": "bcfb2f7efd4444ab442ffc8a248afbd62bca5ae7", "installed_by": ["modules"] }, "samtools/flagstat": { @@ -102,7 +102,7 @@ }, "trimgalore": { "branch": "master", - "git_sha": "4c2d06a5e79abf08ba7f04c58e39c7dad75f094d", + "git_sha": "8d3e71002c5008e3f68a691ad8cd32c346356258", "installed_by": ["modules"] } } diff --git a/modules/nf-core/bbmap/align/main.nf b/modules/nf-core/bbmap/align/main.nf index e3fee17..c4e7acf 100644 --- a/modules/nf-core/bbmap/align/main.nf +++ b/modules/nf-core/bbmap/align/main.nf @@ -26,7 +26,7 @@ process BBMAP_ALIGN { input = meta.single_end ? "in=${fastq}" : "in=${fastq[0]} in2=${fastq[1]}" // Set the db variable to reflect the three possible types of reference input: 1) directory - // named 'ref', 2) directory named something else (containg a 'ref' subdir) or 3) a sequence + // named 'ref', 2) directory named something else (containing a 'ref' subdir) or 3) a sequence // file in fasta format if ( ref.isDirectory() ) { if ( ref ==~ /(.\/)?ref\/?/ ) { @@ -48,6 +48,19 @@ process BBMAP_ALIGN { -Xmx${task.memory.toGiga()}g \\ &> ${prefix}.bbmap.log + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bam + touch ${prefix}.bbmap.log + cat <<-END_VERSIONS > versions.yml "${task.process}": bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") diff --git a/modules/nf-core/bbmap/align/meta.yml b/modules/nf-core/bbmap/align/meta.yml index 38bd8e1..f842a49 100644 --- a/modules/nf-core/bbmap/align/meta.yml +++ b/modules/nf-core/bbmap/align/meta.yml @@ -31,7 +31,7 @@ input: description: | Either "ref" a directory containing an index, the name of another directory with a "ref" subdirectory containing an index or the name of a fasta formatted - nucleotide file containg the reference to map to. + nucleotide file containing the reference to map to. output: - bam: - meta: diff --git a/modules/nf-core/bbmap/align/tests/main.nf.test b/modules/nf-core/bbmap/align/tests/main.nf.test new file mode 100644 index 0000000..5763a58 --- /dev/null +++ b/modules/nf-core/bbmap/align/tests/main.nf.test @@ -0,0 +1,171 @@ +nextflow_process { + + name "Test Process BBMAP_ALIGN" + script "../main.nf" + process "BBMAP_ALIGN" + + tag "modules" + tag "modules_nfcore" + tag "bbmap" + tag "bbmap/align" + tag "bbmap/index" + + setup { + run("BBMAP_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + """ + } + } + } + + test("paired_end - fasta") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // 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/homo_sapiens/genome/genome.fasta', checkIfExists: true) + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + + test("paired_end - index") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // 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] = BBMAP_INDEX.out.index + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + + test("single_end - index") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:true ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ] + ] + input[1] = BBMAP_INDEX.out.index + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + + test("paired_end - index - pigz") { + config "./nextflow.config" + when { + params { + module_args = 'unpigz=t' + } + process { + """ + input[0] = [ [ id:'test', single_end:false ], // 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] = BBMAP_INDEX.out.index + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + + test("paired_end - index - stub") { + options "-stub" + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // 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] = BBMAP_INDEX.out.index + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + file(process.out.log[0][1]).name, + process.out.bam.collect { meta, bamfile -> bam(bamfile).getReadsMD5()}, + process.out.versions + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/bbmap/align/tests/main.nf.test.snap b/modules/nf-core/bbmap/align/tests/main.nf.test.snap new file mode 100644 index 0000000..2423ad4 --- /dev/null +++ b/modules/nf-core/bbmap/align/tests/main.nf.test.snap @@ -0,0 +1,82 @@ +{ + "single_end - index": { + "content": [ + "test.bbmap.log", + [ + "c17efa4ccc4e9018090792c71af92660" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:06:20.348251263" + }, + "paired_end - index": { + "content": [ + "test.bbmap.log", + [ + "88d78879c34214288644aec7ec3cb270" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:06:05.162378558" + }, + "paired_end - fasta": { + "content": [ + "test.bbmap.log", + [ + "88d78879c34214288644aec7ec3cb270" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:05:49.658797332" + }, + "paired_end - index - pigz": { + "content": [ + "test.bbmap.log", + [ + "88d78879c34214288644aec7ec3cb270" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:06:36.326962674" + }, + "paired_end - index - stub": { + "content": [ + "test.bbmap.log", + [ + "d41d8cd98f00b204e9800998ecf8427e" + ], + [ + "versions.yml:md5,7c9a1c72ae9ea9c54b7518e96f8f89bb" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-08T21:06:47.377762689" + } +} \ No newline at end of file diff --git a/modules/nf-core/bbmap/align/tests/nextflow.config b/modules/nf-core/bbmap/align/tests/nextflow.config new file mode 100644 index 0000000..1008888 --- /dev/null +++ b/modules/nf-core/bbmap/align/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: BBMAP_ALIGN { + ext.args = params.module_args + } +} diff --git a/modules/nf-core/bbmap/index/main.nf b/modules/nf-core/bbmap/index/main.nf index 0278555..e7b3eb1 100644 --- a/modules/nf-core/bbmap/index/main.nf +++ b/modules/nf-core/bbmap/index/main.nf @@ -26,6 +26,17 @@ process BBMAP_INDEX { threads=$task.cpus \\ -Xmx${task.memory.toGiga()}g + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") + END_VERSIONS + """ + stub: + """ + mkdir -p ref + touch ref/info.txt + touch ref/summary.txt + cat <<-END_VERSIONS > versions.yml "${task.process}": bbmap: \$(bbversion.sh | grep -v "Duplicate cpuset") diff --git a/modules/nf-core/cat/fastq/environment.yml b/modules/nf-core/cat/fastq/environment.yml index 71e04c3..ae4fa45 100644 --- a/modules/nf-core/cat/fastq/environment.yml +++ b/modules/nf-core/cat/fastq/environment.yml @@ -3,3 +3,8 @@ channels: - bioconda dependencies: - conda-forge::coreutils=9.5 + - conda-forge::grep=3.11 + - conda-forge::gzip=1.13 + - conda-forge::lbzip2=2.5 + - conda-forge::sed=4.8 + - conda-forge::tar=1.34 diff --git a/modules/nf-core/cat/fastq/main.nf b/modules/nf-core/cat/fastq/main.nf index 4364a38..7e6bafe 100644 --- a/modules/nf-core/cat/fastq/main.nf +++ b/modules/nf-core/cat/fastq/main.nf @@ -1,18 +1,18 @@ process CAT_FASTQ { - tag "$meta.id" + tag "${meta.id}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/c2/c262fc09eca59edb5a724080eeceb00fb06396f510aefb229c2d2c6897e63975/data' : - 'community.wave.seqera.io/library/coreutils:9.5--ae99c88a9b28c264' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/52/52ccce28d2ab928ab862e25aae26314d69c8e38bd41ca9431c67ef05221348aa/data' + : 'community.wave.seqera.io/library/coreutils_grep_gzip_lbzip2_pruned:838ba80435a629f8'}" input: tuple val(meta), path(reads, stageAs: "input*/*") output: tuple val(meta), path("*.merged.fastq.gz"), emit: reads - path "versions.yml" , emit: versions + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when @@ -20,7 +20,7 @@ process CAT_FASTQ { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def readList = reads instanceof List ? reads.collect{ it.toString() } : [reads.toString()] + def readList = reads instanceof List ? reads.collect { it.toString() } : [reads.toString()] if (meta.single_end) { if (readList.size >= 1) { """ @@ -32,11 +32,12 @@ process CAT_FASTQ { END_VERSIONS """ } - } else { + } + else { if (readList.size >= 2) { def read1 = [] def read2 = [] - readList.eachWithIndex{ v, ix -> ( ix & 1 ? read2 : read1 ) << v } + readList.eachWithIndex { v, ix -> (ix & 1 ? read2 : read1) << v } """ cat ${read1.join(' ')} > ${prefix}_1.merged.fastq.gz cat ${read2.join(' ')} > ${prefix}_2.merged.fastq.gz @@ -51,7 +52,7 @@ process CAT_FASTQ { stub: def prefix = task.ext.prefix ?: "${meta.id}" - def readList = reads instanceof List ? reads.collect{ it.toString() } : [reads.toString()] + def readList = reads instanceof List ? reads.collect { it.toString() } : [reads.toString()] if (meta.single_end) { if (readList.size >= 1) { """ @@ -63,7 +64,8 @@ process CAT_FASTQ { END_VERSIONS """ } - } else { + } + else { if (readList.size >= 2) { """ echo '' | gzip > ${prefix}_1.merged.fastq.gz diff --git a/modules/nf-core/cat/fastq/tests/main.nf.test b/modules/nf-core/cat/fastq/tests/main.nf.test index f88a78b..0de5e18 100644 --- a/modules/nf-core/cat/fastq/tests/main.nf.test +++ b/modules/nf-core/cat/fastq/tests/main.nf.test @@ -1,5 +1,3 @@ -// NOTE The version snaps may not be consistant -// https://github.com/nf-core/modules/pull/4087#issuecomment-1767948035 nextflow_process { name "Test Process CAT_FASTQ" diff --git a/modules/nf-core/gunzip/environment.yml b/modules/nf-core/gunzip/environment.yml index c779485..ae4fa45 100644 --- a/modules/nf-core/gunzip/environment.yml +++ b/modules/nf-core/gunzip/environment.yml @@ -2,6 +2,9 @@ channels: - conda-forge - bioconda dependencies: + - conda-forge::coreutils=9.5 - conda-forge::grep=3.11 + - conda-forge::gzip=1.13 + - conda-forge::lbzip2=2.5 - conda-forge::sed=4.8 - conda-forge::tar=1.34 diff --git a/modules/nf-core/gunzip/main.nf b/modules/nf-core/gunzip/main.nf index 5e67e3b..3ffc8e9 100644 --- a/modules/nf-core/gunzip/main.nf +++ b/modules/nf-core/gunzip/main.nf @@ -1,37 +1,37 @@ process GUNZIP { - tag "$archive" + tag "${archive}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ubuntu:22.04' : - 'nf-core/ubuntu:22.04' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/52/52ccce28d2ab928ab862e25aae26314d69c8e38bd41ca9431c67ef05221348aa/data' + : 'community.wave.seqera.io/library/coreutils_grep_gzip_lbzip2_pruned:838ba80435a629f8'}" input: tuple val(meta), path(archive) output: - tuple val(meta), path("$gunzip"), emit: gunzip - path "versions.yml" , emit: versions + tuple val(meta), path("${gunzip}"), emit: gunzip + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1] - def name = archive.toString() - '.gz' - ".$extension" - def prefix = task.ext.prefix ?: name - gunzip = prefix + ".$extension" + def args = task.ext.args ?: '' + def extension = (archive.toString() - '.gz').tokenize('.')[-1] + def name = archive.toString() - '.gz' - ".${extension}" + def prefix = task.ext.prefix ?: name + gunzip = prefix + ".${extension}" """ # Not calling gunzip itself because it creates files # with the original group ownership rather than the # default one for that user / the work directory gzip \\ -cd \\ - $args \\ - $archive \\ - > $gunzip + ${args} \\ + ${archive} \\ + > ${gunzip} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -40,13 +40,13 @@ process GUNZIP { """ stub: - def args = task.ext.args ?: '' - def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1] - def name = archive.toString() - '.gz' - ".$extension" - def prefix = task.ext.prefix ?: name - gunzip = prefix + ".$extension" + def args = task.ext.args ?: '' + def extension = (archive.toString() - '.gz').tokenize('.')[-1] + def name = archive.toString() - '.gz' - ".${extension}" + def prefix = task.ext.prefix ?: name + gunzip = prefix + ".${extension}" """ - touch $gunzip + touch ${gunzip} cat <<-END_VERSIONS > versions.yml "${task.process}": gunzip: \$(echo \$(gunzip --version 2>&1) | sed 's/^.*(gzip) //; s/ Copyright.*\$//') diff --git a/modules/nf-core/gunzip/meta.yml b/modules/nf-core/gunzip/meta.yml index 9066c03..69d3102 100644 --- a/modules/nf-core/gunzip/meta.yml +++ b/modules/nf-core/gunzip/meta.yml @@ -27,7 +27,7 @@ output: type: file description: Compressed/uncompressed file pattern: "*.*" - - $gunzip: + - ${gunzip}: type: file description: Compressed/uncompressed file pattern: "*.*" diff --git a/modules/nf-core/gunzip/tests/main.nf.test.snap b/modules/nf-core/gunzip/tests/main.nf.test.snap index 069967e..a0f0e67 100644 --- a/modules/nf-core/gunzip/tests/main.nf.test.snap +++ b/modules/nf-core/gunzip/tests/main.nf.test.snap @@ -11,7 +11,7 @@ ] ], "1": [ - "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + "versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c" ], "gunzip": [ [ @@ -22,15 +22,15 @@ ] ], "versions": [ - "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + "versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-06-25T11:35:10.861293" + "timestamp": "2024-12-13T11:48:22.080222697" }, "Should run without failures - stub": { "content": [ @@ -44,7 +44,7 @@ ] ], "1": [ - "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + "versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c" ], "gunzip": [ [ @@ -55,15 +55,15 @@ ] ], "versions": [ - "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + "versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-06-25T11:35:05.857145" + "timestamp": "2024-12-13T11:48:14.593020264" }, "Should run without failures": { "content": [ @@ -77,7 +77,7 @@ ] ], "1": [ - "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + "versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c" ], "gunzip": [ [ @@ -88,15 +88,15 @@ ] ], "versions": [ - "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + "versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2023-10-17T15:35:37.690477896" + "timestamp": "2024-12-13T11:48:01.295397925" }, "Should run without failures - prefix": { "content": [ @@ -110,7 +110,7 @@ ] ], "1": [ - "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + "versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c" ], "gunzip": [ [ @@ -121,14 +121,14 @@ ] ], "versions": [ - "versions.yml:md5,54376d32aca20e937a4ec26dac228e84" + "versions.yml:md5,d327e4a19a6d5c5e974136cef8999d8c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.2", + "nextflow": "24.10.2" }, - "timestamp": "2024-06-25T11:33:32.921739" + "timestamp": "2024-12-13T11:48:07.414271387" } } \ No newline at end of file diff --git a/modules/nf-core/multiqc/environment.yml b/modules/nf-core/multiqc/environment.yml index 6f5b867..a27122c 100644 --- a/modules/nf-core/multiqc/environment.yml +++ b/modules/nf-core/multiqc/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::multiqc=1.25.1 + - bioconda::multiqc=1.27 diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index cc0643e..58d9313 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -3,8 +3,8 @@ process MULTIQC { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.25.1--pyhdfd78af_0' : - 'biocontainers/multiqc:1.25.1--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.27--pyhdfd78af_0' : + 'biocontainers/multiqc:1.27--pyhdfd78af_0' }" input: path multiqc_files, stageAs: "?/*" diff --git a/modules/nf-core/multiqc/tests/main.nf.test.snap b/modules/nf-core/multiqc/tests/main.nf.test.snap index 261dc0f..7b7c132 100644 --- a/modules/nf-core/multiqc/tests/main.nf.test.snap +++ b/modules/nf-core/multiqc/tests/main.nf.test.snap @@ -2,14 +2,14 @@ "multiqc_versions_single": { "content": [ [ - "versions.yml:md5,41f391dcedce7f93ca188f3a3ffa0916" + "versions.yml:md5,8f3b8c1cec5388cf2708be948c9fa42f" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.4" }, - "timestamp": "2024-10-02T17:51:46.317523" + "timestamp": "2025-01-27T09:29:57.631982377" }, "multiqc_stub": { "content": [ @@ -17,25 +17,25 @@ "multiqc_report.html", "multiqc_data", "multiqc_plots", - "versions.yml:md5,41f391dcedce7f93ca188f3a3ffa0916" + "versions.yml:md5,8f3b8c1cec5388cf2708be948c9fa42f" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.4" }, - "timestamp": "2024-10-02T17:52:20.680978" + "timestamp": "2025-01-27T09:30:34.743726958" }, "multiqc_versions_config": { "content": [ [ - "versions.yml:md5,41f391dcedce7f93ca188f3a3ffa0916" + "versions.yml:md5,8f3b8c1cec5388cf2708be948c9fa42f" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.4" }, - "timestamp": "2024-10-02T17:52:09.185842" + "timestamp": "2025-01-27T09:30:21.44383553" } -} +} \ No newline at end of file diff --git a/modules/nf-core/prokka/environment.yml b/modules/nf-core/prokka/environment.yml index 7c9753f..1d1a019 100644 --- a/modules/nf-core/prokka/environment.yml +++ b/modules/nf-core/prokka/environment.yml @@ -3,3 +3,4 @@ channels: - bioconda dependencies: - bioconda::prokka=1.14.6 + - conda-forge::openjdk=8.0.412 diff --git a/modules/nf-core/prokka/main.nf b/modules/nf-core/prokka/main.nf index adfda03..bf5e64f 100644 --- a/modules/nf-core/prokka/main.nf +++ b/modules/nf-core/prokka/main.nf @@ -1,11 +1,11 @@ process PROKKA { - tag "$meta.id" + tag "${meta.id}" label 'process_low' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/prokka:1.14.6--pl5321hdfd78af_4' : - 'biocontainers/prokka:1.14.6--pl5321hdfd78af_4' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/3a/3af46b047c8fe84112adeaecf300878217c629b97f111f923ecf327656ddd141/data' : + 'community.wave.seqera.io/library/prokka_openjdk:10546cadeef11472' }" input: tuple val(meta), path(fasta) @@ -31,18 +31,49 @@ process PROKKA { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - def proteins_opt = proteins ? "--proteins ${proteins[0]}" : "" - def prodigal_tf = prodigal_tf ? "--prodigaltf ${prodigal_tf[0]}" : "" + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def input = fasta.toString() - ~/\.gz$/ + def decompress = fasta.getExtension() == "gz" ? "gunzip -c ${fasta} > ${input}" : "" + def cleanup = fasta.getExtension() == "gz" ? "rm ${input}" : "" + def proteins_opt = proteins ? "--proteins ${proteins}" : "" + def prodigal_tf_in = prodigal_tf ? "--prodigaltf ${prodigal_tf}" : "" """ + ${decompress} + prokka \\ - $args \\ - --cpus $task.cpus \\ - --prefix $prefix \\ - $proteins_opt \\ - $prodigal_tf \\ - $fasta + ${args} \\ + --cpus ${task.cpus} \\ + --prefix ${prefix} \\ + ${proteins_opt} \\ + ${prodigal_tf_in} \\ + ${input} + + ${cleanup} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + prokka: \$(echo \$(prokka --version 2>&1) | sed 's/^.*prokka //') + END_VERSIONS + """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir ${prefix} + touch ${prefix}/${prefix}.gff + touch ${prefix}/${prefix}.gbk + touch ${prefix}/${prefix}.fna + touch ${prefix}/${prefix}.faa + touch ${prefix}/${prefix}.ffn + touch ${prefix}/${prefix}.sqn + touch ${prefix}/${prefix}.fsa + touch ${prefix}/${prefix}.tbl + touch ${prefix}/${prefix}.err + touch ${prefix}/${prefix}.log + touch ${prefix}/${prefix}.txt + touch ${prefix}/${prefix}.tsv + touch ${prefix}/${prefix}.gff cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/prokka/tests/main.nf.test b/modules/nf-core/prokka/tests/main.nf.test index dca19bb..68150b3 100644 --- a/modules/nf-core/prokka/tests/main.nf.test +++ b/modules/nf-core/prokka/tests/main.nf.test @@ -47,4 +47,69 @@ nextflow_process { } + test("Prokka - sarscov2 - genome.fasta.gz") { + + when { + process { + """ + input[0] = Channel.fromList([ + tuple([ 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] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.gbk.get(0).get(1)).exists() }, + { assert path(process.out.log.get(0).get(1)).exists() }, + { assert path(process.out.sqn.get(0).get(1)).exists() }, + { assert snapshot( + process.out.gff, + process.out.fna, + process.out.faa, + process.out.ffn, + process.out.fsa, + process.out.tbl, + process.out.err, + process.out.txt, + process.out.tsv, + process.out.versions + ).match() + } + ) + } + + } + + test("Prokka - sarscov2 - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.fromList([ + tuple([ 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] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + } diff --git a/modules/nf-core/prokka/tests/main.nf.test.snap b/modules/nf-core/prokka/tests/main.nf.test.snap index 874c989..35713a8 100644 --- a/modules/nf-core/prokka/tests/main.nf.test.snap +++ b/modules/nf-core/prokka/tests/main.nf.test.snap @@ -91,5 +91,331 @@ "nextflow": "24.04.3" }, "timestamp": "2024-07-30T12:34:20.447734" + }, + "Prokka - sarscov2 - genome.fasta.gz": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test.gff:md5,5dbfb8fcf2db020564c16045976a0933" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fna:md5,787307f29a263e5657cc276ebbf7e2b3" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa:md5,a4ceda83262b3c222a6b1f508fb9e24b" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.ffn:md5,80f474b5367b7ea5ed23791935f65e34" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.fsa:md5,71bbefcb7f12046bcd3263f58cfd5404" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.tbl:md5,d8f816a066ced94b62d9618b13fb8add" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.err:md5,b3daedc646fddd422824e2b3e5e9229d" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,b40e485ffc8eaf1feacf8d79d9751a33" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,da7c720c3018c5081d6a70b517b7d450" + ] + ], + [ + "versions.yml:md5,e83a22fe02167e290d90853b45650db9" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2024-12-19T09:48:05.110188714" + }, + "Prokka - sarscov2 - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.gff:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + "versions.yml:md5,e83a22fe02167e290d90853b45650db9" + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fna:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ffn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sqn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fsa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tbl:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": false + }, + "test.err:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "9": [ + [ + { + "id": "test", + "single_end": false + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "err": [ + [ + { + "id": "test", + "single_end": false + }, + "test.err:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "faa": [ + [ + { + "id": "test", + "single_end": false + }, + "test.faa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "ffn": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ffn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fna": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fna:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "fsa": [ + [ + { + "id": "test", + "single_end": false + }, + "test.fsa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gbk": [ + [ + { + "id": "test", + "single_end": false + }, + "test.gbk:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gff": [ + [ + { + "id": "test", + "single_end": false + }, + "test.gff:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + "test.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "sqn": [ + [ + { + "id": "test", + "single_end": false + }, + "test.sqn:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbl": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tbl:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "txt": [ + [ + { + "id": "test", + "single_end": false + }, + "test.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e83a22fe02167e290d90853b45650db9" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-06T10:51:57.362187225" } } \ No newline at end of file diff --git a/modules/nf-core/trimgalore/main.nf b/modules/nf-core/trimgalore/main.nf index e55683c..5fe5366 100644 --- a/modules/nf-core/trimgalore/main.nf +++ b/modules/nf-core/trimgalore/main.nf @@ -11,12 +11,12 @@ process TRIMGALORE { tuple val(meta), path(reads) output: - tuple val(meta), path("*{3prime,5prime,trimmed,val}*.fq.gz"), emit: reads - tuple val(meta), path("*report.txt") , emit: log , optional: true - tuple val(meta), path("*unpaired*.fq.gz"), emit: unpaired, optional: true - tuple val(meta), path("*.html") , emit: html , optional: true - tuple val(meta), path("*.zip") , emit: zip , optional: true - path "versions.yml" , emit: versions + tuple val(meta), path("*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz"), emit: reads + tuple val(meta), path("*report.txt") , emit: log, optional: true + tuple val(meta), path("*unpaired{,_1,_2}.fq.gz") , emit: unpaired, optional: true + tuple val(meta), path("*.html") , emit: html, optional: true + tuple val(meta), path("*.zip") , emit: zip, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/trimgalore/meta.yml b/modules/nf-core/trimgalore/meta.yml index 576cb4c..bd79363 100644 --- a/modules/nf-core/trimgalore/meta.yml +++ b/modules/nf-core/trimgalore/meta.yml @@ -33,21 +33,24 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*{3prime,5prime,trimmed,val}*.fq.gz": - type: file + - "*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz": + type: map description: | - List of input adapter trimmed FastQ files of size 1 and 2 for - single-end and paired-end data, respectively. - pattern: "*{3prime,5prime,trimmed,val}*.fq.gz" + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz" - log: - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + pattern: "*_{report.txt}" - "*report.txt": - type: file - description: Trim Galore! trimming report + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] pattern: "*_{report.txt}" - unpaired: - meta: @@ -55,10 +58,11 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*unpaired*.fq.gz": - type: file + - "*unpaired{,_1,_2}.fq.gz": + type: map description: | - FastQ files containing unpaired reads from read 1 or read 2 + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] pattern: "*unpaired*.fq.gz" - html: - meta: @@ -66,9 +70,12 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + pattern: "*_{fastqc.html}" - "*.html": - type: file - description: FastQC report (optional) + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] pattern: "*_{fastqc.html}" - zip: - meta: @@ -76,9 +83,12 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + pattern: "*_{fastqc.zip}" - "*.zip": - type: file - description: FastQC report archive (optional) + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] pattern: "*_{fastqc.zip}" - versions: - versions.yml: diff --git a/modules/nf-core/trimgalore/tests/main.nf.test b/modules/nf-core/trimgalore/tests/main.nf.test index 37b054f..c01672c 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test +++ b/modules/nf-core/trimgalore/tests/main.nf.test @@ -126,6 +126,40 @@ nextflow_process { } } + test("test_trimgalore_paired_end_keep_unpaired") { + + config "./nextflow.config" + + when { + + params { + module_args = '--retain_unpaired --length 150' + } + + process { + """ + input[0] = [ [ id:'test', single_end:false ], // 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) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.versions.get(0)).yaml, + process.out.reads, + process.out.unpaired + ).match() }, + ) + } + } + test("test_trimgalore_paired_end - stub") { options "-stub" diff --git a/modules/nf-core/trimgalore/tests/main.nf.test.snap b/modules/nf-core/trimgalore/tests/main.nf.test.snap index 4c73180..c454ad5 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test.snap +++ b/modules/nf-core/trimgalore/tests/main.nf.test.snap @@ -11,9 +11,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-05T22:56:18.454197" + "timestamp": "2025-01-06T12:25:01.330769598" }, "test_trimgalore_single_end - stub": { "content": [ @@ -89,9 +89,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-05T22:56:22.085472" + "timestamp": "2025-01-06T12:25:15.582246999" }, "test_trimgalore_paired_end - stub": { "content": [ @@ -172,9 +172,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-05T22:44:33.751013" + "timestamp": "2025-01-06T12:26:05.201562315" }, "versions": { "content": [ @@ -188,9 +188,9 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-05T22:57:28.77107" + "timestamp": "2025-01-06T12:26:05.229598492" }, "test_trimgalore_paired_end": { "content": [ @@ -204,8 +204,48 @@ ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.2" + "nextflow": "24.10.3" }, - "timestamp": "2024-12-05T22:56:27.019872" + "timestamp": "2025-01-06T12:25:33.510924538" + }, + "test_trimgalore_paired_end_keep_unpaired": { + "content": [ + { + "TRIMGALORE": { + "trimgalore": "0.6.10", + "cutadapt": 4.9, + "pigz": 2.8 + } + }, + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_val_1.fq.gz:md5,75413e85910bbc2e1556e12f6479f935", + "test_2_val_2.fq.gz:md5,d3c588c12646ebd36a0812fe02d0bda6" + ] + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_unpaired_1.fq.gz:md5,17e0e878f6d0e93b9008a05f128660b6", + "test_2_unpaired_2.fq.gz:md5,b09a064368a867e099e66df5ef69b044" + ] + ] + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-06T12:25:46.461002981" } } \ No newline at end of file diff --git a/modules/nf-core/trimgalore/tests/nextflow.config b/modules/nf-core/trimgalore/tests/nextflow.config new file mode 100644 index 0000000..d8e3ac1 --- /dev/null +++ b/modules/nf-core/trimgalore/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: TRIMGALORE { + ext.args = params.module_args + } +} diff --git a/nextflow.config b/nextflow.config index 6a7f8ee..fad7829 100644 --- a/nextflow.config +++ b/nextflow.config @@ -201,6 +201,7 @@ profiles { includeConfig !System.getenv('NXF_OFFLINE') && params.custom_config_base ? "${params.custom_config_base}/nfcore_custom.config" : "/dev/null" // Load nf-core/magmap custom profiles from different institutions. +// includeConfig !System.getenv('NXF_OFFLINE') && params.custom_config_base ? "${params.custom_config_base}/pipeline/magmap.config" : "/dev/null" // Set default registry for Apptainer, Docker, Podman, Charliecloud and Singularity independent of -profile // Will not be used unless Apptainer / Docker / Podman / Charliecloud / Singularity are enabled @@ -223,14 +224,14 @@ env { } // Set bash options -process.shell = """\ -bash - -set -e # Exit if a tool returns a non-zero status/exit code -set -u # Treat unset variables and parameters as an error -set -o pipefail # Returns the status of the last command to exit with a non-zero status or zero if all successfully execute -set -C # No clobber - prevent output redirection from overwriting files. -""" +process.shell = [ + "bash", + "-C", // No clobber - prevent output redirection from overwriting files. + "-e", // Exit if a tool returns a non-zero status/exit code + "-u", // Treat unset variables and parameters as an error + "-o", // Returns the status of the last command to exit.. + "pipefail" // ..with a non-zero status or zero if all successfully execute +] // Disable process selector warnings by default. Use debug profile to enable warnings. nextflow.enable.configProcessNamesValidation = false @@ -292,7 +293,7 @@ manifest { // Nextflow plugins plugins { - id 'nf-schema@2.1.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet + id 'nf-schema@2.3.0' // Validation of pipeline parameters and creation of an input channel from a sample sheet } validation { diff --git a/ro-crate-metadata.json b/ro-crate-metadata.json index 9aa9e31..0162f88 100644 --- a/ro-crate-metadata.json +++ b/ro-crate-metadata.json @@ -22,8 +22,8 @@ "@id": "./", "@type": "Dataset", "creativeWorkStatus": "Stable", - "datePublished": "2025-01-17T11:22:57+00:00", - "description": "