diff --git a/.editorconfig b/.editorconfig index dd1c214..3bb8f5d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,7 @@ charset = utf-8 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -indent_size = 2 +indent_size = 4 indent_style = space [*.diff] @@ -32,7 +32,7 @@ indent_style = unset indent_size = unset # ignore python and markdown -[*.{py,md}] +[*.{py,md,cff}] indent_style = unset # ignore ro-crate metadata files diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cf584d..1b0655d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,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 f2faee6..ab06316 100644 --- a/.github/workflows/download_pipeline.yml +++ b/.github/workflows/download_pipeline.yml @@ -28,8 +28,23 @@ env: NXF_ANSI_LOG: false jobs: + configure: + runs-on: ubuntu-latest + outputs: + 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 @@ -52,12 +67,6 @@ 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 - run: | - echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} - echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV} - echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> ${GITHUB_ENV} - - name: Make a cache directory for the container images run: | mkdir -p ./singularity_container_images @@ -66,24 +75,27 @@ jobs: env: NXF_SINGULARITY_CACHEDIR: ./singularity_container_images run: | - nf-core pipelines download ${{ env.REPO_LOWERCASE }} \ - --revision ${{ env.REPO_BRANCH }} \ - --outdir ./${{ env.REPOTITLE_LOWERCASE }} \ + nf-core pipelines download ${{ needs.configure.outputs.REPO_LOWERCASE }} \ + --revision ${{ needs.configure.outputs.REPO_BRANCH }} \ + --outdir ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }} \ --compress "none" \ --container-system 'singularity' \ - --container-library "quay.io" -l "docker.io" -l "community.wave.seqera.io" \ + --container-library "quay.io" -l "docker.io" -l "community.wave.seqera.io/library/" \ --container-cache-utilisation 'amend' \ --download-configuration 'yes' - name: Inspect download - run: tree ./${{ env.REPOTITLE_LOWERCASE }} + 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: | image_count=$(ls -1 ./singularity_container_images | wc -l | xargs) echo "Initial container image count: $image_count" - echo "IMAGE_COUNT_INITIAL=$image_count" >> ${GITHUB_ENV} + echo "IMAGE_COUNT_INITIAL=$image_count" >> "$GITHUB_OUTPUT" - name: Run the downloaded pipeline (stub) id: stub_run_pipeline @@ -91,30 +103,31 @@ jobs: env: NXF_SINGULARITY_CACHEDIR: ./singularity_container_images NXF_SINGULARITY_HOME_MOUNT: true - run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results + run: nextflow run ./${{needs.configure.outputs.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results - name: Run the downloaded pipeline (stub run not supported) id: run_pipeline - if: ${{ job.steps.stub_run_pipeline.status == failure() }} + if: ${{ steps.stub_run_pipeline.outcome == 'failure' }} env: NXF_SINGULARITY_CACHEDIR: ./singularity_container_images NXF_SINGULARITY_HOME_MOUNT: true - run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -profile test,singularity --outdir ./results + run: nextflow run ./${{ needs.configure.outputs.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ needs.configure.outputs.REPO_BRANCH }}) -profile test,singularity --outdir ./results - name: Count the downloaded number of container images id: count_afterwards run: | image_count=$(ls -1 ./singularity_container_images | wc -l | xargs) echo "Post-pipeline run container image count: $image_count" - echo "IMAGE_COUNT_AFTER=$image_count" >> ${GITHUB_ENV} + echo "IMAGE_COUNT_AFTER=$image_count" >> "$GITHUB_OUTPUT" - name: Compare container image counts run: | - if [ "${{ env.IMAGE_COUNT_INITIAL }}" -ne "${{ env.IMAGE_COUNT_AFTER }}" ]; then - initial_count=${{ env.IMAGE_COUNT_INITIAL }} - final_count=${{ env.IMAGE_COUNT_AFTER }} + if [ "${{ steps.count_initial.outputs.IMAGE_COUNT_INITIAL }}" -ne "${{ steps.count_afterwards.outputs.IMAGE_COUNT_AFTER }}" ]; then + initial_count=${{ steps.count_initial.outputs.IMAGE_COUNT_INITIAL }} + 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/.nf-core.yml b/.nf-core.yml index 4b5dfe7..e8e8c58 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1,6 +1,6 @@ repository_type: pipeline -nf_core_version: 3.1.1 +nf_core_version: 3.1.2 lint: files_unchanged: @@ -45,6 +45,12 @@ lint: pipeline_todos: False pipeline_name_conventions: False +update: + https://github.com/nf-core/modules.git: + nf-core: + snpeff/snpeff: False + snpeff/download: False + template: org: cnr-ibba name: nf-resequencing-mem diff --git a/.prettierignore b/.prettierignore index 5e1ddff..a753023 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,3 +8,4 @@ testing/ testing* *.pyc .vscode/ +*.diff diff --git a/CHANGELOG.md b/CHANGELOG.md index fcc074e..a8f24b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 0.6.2 - dev +- Solve linter issues related to VScode and _nextflow languageserver_ plugin ([#86](https://github.com/cnr-ibba/nf-resequencing-mem/issues/86)) +- Update `.editorconfig` +- Update modules +- Restructure `modules.config` +- Move functions inside workflows - Convert freebayes specific parameters in pipeline parameters ([#80](https://github.com/cnr-ibba/nf-resequencing-mem/issues/80)) - Update `nextflow.config` - Support for institutional configuration @@ -20,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` +- Add `pipeline_initialization` local subworkflow - Add institutional configuration custom repository - Add `bcftools/concat` process - Add `bcftools_filltags` process diff --git a/CITATION.cff b/CITATION.cff index 017666c..13e837e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,32 +1,6 @@ cff-version: 1.2.0 message: "If you use `nf-core tools` in your work, please cite the `nf-core` publication" authors: - - family-names: Ewels - given-names: Philip - - family-names: Peltzer - given-names: Alexander - - family-names: Fillinger - given-names: Sven - - family-names: Patel - given-names: Harshil - - family-names: Alneberg - given-names: Johannes - - family-names: Wilm - given-names: Andreas - - family-names: Garcia - given-names: Maxime Ulysse - - family-names: Di Tommaso - given-names: Paolo - - family-names: Nahnsen - given-names: Sven -title: "The nf-core framework for community-curated bioinformatics pipelines." -version: 2.4.1 -doi: 10.1038/s41587-020-0439-x -date-released: 2022-05-16 -url: https://github.com/nf-core/tools -prefered-citation: - type: article - authors: - family-names: Ewels given-names: Philip - family-names: Peltzer @@ -45,12 +19,38 @@ prefered-citation: given-names: Paolo - family-names: Nahnsen given-names: Sven - doi: 10.1038/s41587-020-0439-x - journal: nature biotechnology - start: 276 - end: 278 - title: "The nf-core framework for community-curated bioinformatics pipelines." - issue: 3 - volume: 38 - year: 2020 - url: https://dx.doi.org/10.1038/s41587-020-0439-x +title: "The nf-core framework for community-curated bioinformatics pipelines." +version: 2.4.1 +doi: 10.1038/s41587-020-0439-x +date-released: 2022-05-16 +url: https://github.com/nf-core/tools +prefered-citation: + type: article + authors: + - family-names: Ewels + given-names: Philip + - family-names: Peltzer + given-names: Alexander + - family-names: Fillinger + given-names: Sven + - family-names: Patel + given-names: Harshil + - family-names: Alneberg + given-names: Johannes + - family-names: Wilm + given-names: Andreas + - family-names: Garcia + given-names: Maxime Ulysse + - family-names: Di Tommaso + given-names: Paolo + - family-names: Nahnsen + given-names: Sven + doi: 10.1038/s41587-020-0439-x + journal: nature biotechnology + start: 276 + end: 278 + title: "The nf-core framework for community-curated bioinformatics pipelines." + issue: 3 + volume: 38 + year: 2020 + url: https://dx.doi.org/10.1038/s41587-020-0439-x diff --git a/conf/awsbatch.config b/conf/awsbatch.config index a882f00..d879e75 100644 --- a/conf/awsbatch.config +++ b/conf/awsbatch.config @@ -1,25 +1,25 @@ //Nextflow config file for running on AWS batch params { - config_profile_description = 'AWSBATCH Cloud Profile' - config_profile_contact = 'Alexander Peltzer (@apeltzer)' - config_profile_url = 'https://aws.amazon.com/batch/' + config_profile_description = 'AWSBATCH Cloud Profile' + config_profile_contact = 'Alexander Peltzer (@apeltzer)' + config_profile_url = 'https://aws.amazon.com/batch/' - awsqueue = false - awsregion = 'eu-west-1' - awscli = '/home/ec2-user/miniconda/bin/aws' + awsqueue = false + awsregion = 'eu-west-1' + awscli = '/home/ec2-user/miniconda/bin/aws' } timeline { - overwrite = true + overwrite = true } report { - overwrite = true + overwrite = true } trace { - overwrite = true + overwrite = true } dag { - overwrite = true + overwrite = true } process.executor = 'awsbatch' diff --git a/conf/modules.config b/conf/modules.config index 9f29873..e507856 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -172,7 +172,7 @@ process { ] } - withName: FREEBAYES_TABIX { + withName: FREEBAYES_CONCAT_TABIX { publishDir = [ path: { "${params.outdir}/freebayes" }, mode: params.publish_dir_mode, @@ -181,13 +181,6 @@ process { ] } - withName: REMOVE_OVERLAP { - ext.prefix = { "${meta.id}.no-overlap" } - publishDir = [ - enabled: false - ] - } - withName: FREEBAYES_NORM { ext.prefix = { "${meta.id}.freebayes-normalized" } publishDir = [ @@ -195,39 +188,27 @@ process { ] } - withName: BCFTOOLS_SORT { + withName: "BCFTOOLS_SORT|BCFTOOLS_SORT_TABIX" { ext.prefix = { "${meta.id}.sorted" } publishDir = [ enabled: false ] } - withName: BCFTOOLS_SORT_TABIX { - publishDir = [ - enabled: false - ] - } - - withName: BCFTOOLS_NORM { + withName: "BCFTOOLS_NORM|BCFTOOLS_NORM_TABIX" { ext.prefix = { "${meta.id}.bcftools-normalized" } publishDir = [ enabled: false ] } - withName: BCFTOOLS_NORM_TABIX { - publishDir = [ - enabled: false - ] - } - - withName: BCFTOOLS_FILLTAGS { + withName: "BCFTOOLS_FILLTAGS|BCFTOOLS_FILLTAGS_TABIX" { publishDir = [ enabled: false ] } - withName: BCFTOOLS_CONCAT { + withName: "BCFTOOLS_CONCAT|BCFTOOLS_CONCAT_TABIX" { publishDir = [ path: { "${params.outdir}/normalized-vcf" }, mode: params.publish_dir_mode, diff --git a/main.nf b/main.nf index d2c46ae..85c35a7 100644 --- a/main.nf +++ b/main.nf @@ -15,23 +15,8 @@ nextflow.enable.dsl = 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { validateParameters; paramsHelp } from 'plugin/nf-validation' - -// Print help message if needed -if (params.help) { - def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs) - def citation = '\n' + WorkflowMain.citation(workflow) + '\n' - def String command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome_fasta /path/to/genome.fasta -profile docker" - log.info logo + paramsHelp(command) + citation + NfcoreTemplate.dashedLine(params.monochrome_logs) - System.exit(0) -} - -// Validate input parameters -if (params.validate_params) { - validateParameters() -} - -WorkflowMain.initialise(workflow, params, log) +include { validateParameters; paramsHelp } from 'plugin/nf-validation' +include { PIPELINE_INITIALIZATION } from './subworkflows/local/pipeline_initialization.nf' /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -45,7 +30,16 @@ include { RESEQUENCING_MEM } from './workflows/resequencing-mem' // WORKFLOW: Run main cnr-ibba/nf-resequencing-mem analysis pipeline // workflow CNR_IBBA { - RESEQUENCING_MEM () + take: + samplesheet // channel: samplesheet read in from --input + + main: + RESEQUENCING_MEM ( + samplesheet + ) + + emit: + multiqc_report = RESEQUENCING_MEM.out.multiqc_report // channel: /path/to/multiqc_report.html } /* @@ -59,7 +53,37 @@ workflow CNR_IBBA { // See: https://github.com/nf-core/rnaseq/issues/619 // workflow { - CNR_IBBA () + main: + + // Print help message if needed + if (params.help) { + def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs) + def citation = '\n' + WorkflowMain.citation(workflow) + '\n' + def String command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome_fasta /path/to/genome.fasta -profile docker" + log.info logo + paramsHelp(command) + citation + NfcoreTemplate.dashedLine(params.monochrome_logs) + System.exit(0) + } + + // Validate input parameters + if (params.validate_params) { + validateParameters() + } + + WorkflowMain.initialise(workflow, params, log) + + // + // SUBWORKFLOW: Run initializations tasks + // + PIPELINE_INITIALIZATION ( + params.input, + params.multiqc_config, + params.genome_fasta, + params.genome_bwa_index + ) + + CNR_IBBA ( + PIPELINE_INITIALIZATION.out.samplesheet + ) } /* diff --git a/modules.json b/modules.json index 5b4ff68..af8e608 100644 --- a/modules.json +++ b/modules.json @@ -1,152 +1,153 @@ { - "name": "nf-resequencing-mem", - "homePage": "https://github.com/cnr-ibba/nf-resequencing-mem", - "repos": { - "https://github.com/cnr-ibba/nf-modules.git": { - "modules": { - "cnr-ibba": { - "bcftools/concat": { - "branch": "master", - "git_sha": "4405d06441e7a1afc1f0ddd1b337e564e404c0ca", - "installed_by": ["modules"] - }, - "freebayes/chunk": { - "branch": "master", - "git_sha": "03189b5139b1112cc869e8b78b3b6f82c595d4df", - "installed_by": ["modules"], - "patch": "modules/cnr-ibba/freebayes/chunk/freebayes-chunk.diff" - }, - "seqkit/rmdup": { - "branch": "master", - "git_sha": "c101f87859323fe184912c12a17404149a2a9ddd", - "installed_by": ["modules"] - } + "name": "nf-resequencing-mem", + "homePage": "https://github.com/cnr-ibba/nf-resequencing-mem", + "repos": { + "https://github.com/cnr-ibba/nf-modules.git": { + "modules": { + "cnr-ibba": { + "bcftools/concat": { + "branch": "master", + "git_sha": "4405d06441e7a1afc1f0ddd1b337e564e404c0ca", + "installed_by": ["modules"], + "patch": "modules/cnr-ibba/bcftools/concat/bcftools-concat.diff" + }, + "freebayes/chunk": { + "branch": "master", + "git_sha": "03189b5139b1112cc869e8b78b3b6f82c595d4df", + "installed_by": ["modules"], + "patch": "modules/cnr-ibba/freebayes/chunk/freebayes-chunk.diff" + }, + "seqkit/rmdup": { + "branch": "master", + "git_sha": "c101f87859323fe184912c12a17404149a2a9ddd", + "installed_by": ["modules"] + } + } + } + }, + "https://github.com/nf-core/modules.git": { + "modules": { + "nf-core": { + "bcftools/concat": { + "branch": "master", + "git_sha": "d1e0ec7670fa77905a378627232566ce54c3c26d", + "installed_by": ["modules"] + }, + "bcftools/norm": { + "branch": "master", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "installed_by": ["modules"] + }, + "bcftools/sort": { + "branch": "master", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "installed_by": ["modules"] + }, + "bcftools/stats": { + "branch": "master", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "installed_by": ["modules"] + }, + "bwa/index": { + "branch": "master", + "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", + "installed_by": ["modules"] + }, + "bwa/mem": { + "branch": "master", + "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", + "installed_by": ["modules"] + }, + "cat/fastq": { + "branch": "master", + "git_sha": "0e9cb409c32d3ec4f0d3804588e4778971c09b7e", + "installed_by": ["modules"] + }, + "custom/dumpsoftwareversions": { + "branch": "master", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "installed_by": ["modules"] + }, + "fastqc": { + "branch": "master", + "git_sha": "08108058ea36a63f141c25c4e75f9f872a5b2296", + "installed_by": ["modules"] + }, + "multiqc": { + "branch": "master", + "git_sha": "f80914f78fb7fa1c00b14cfeb29575ee12240d9c", + "installed_by": ["modules"] + }, + "picard/markduplicates": { + "branch": "master", + "git_sha": "49f4e50534fe4b64101e62ea41d5dc43b1324358", + "installed_by": ["modules"] + }, + "samtools/coverage": { + "branch": "master", + "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", + "installed_by": ["modules"] + }, + "samtools/depth": { + "branch": "master", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", + "installed_by": ["modules"], + "patch": "modules/nf-core/samtools/depth/samtools-depth.diff" + }, + "samtools/faidx": { + "branch": "master", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", + "installed_by": ["modules"] + }, + "samtools/flagstat": { + "branch": "master", + "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", + "installed_by": ["modules"] + }, + "samtools/idxstats": { + "branch": "master", + "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", + "installed_by": ["modules"] + }, + "samtools/index": { + "branch": "master", + "git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208", + "installed_by": ["modules"] + }, + "samtools/stats": { + "branch": "master", + "git_sha": "2d20463181b1c38981a02e90d3084b5f9fa8d540", + "installed_by": ["modules"] + }, + "snpeff/download": { + "branch": "master", + "git_sha": "214d575774c172062924ad3564b4f66655600730", + "installed_by": ["modules"], + "patch": "modules/nf-core/snpeff/download/snpeff-download.diff" + }, + "snpeff/snpeff": { + "branch": "master", + "git_sha": "2f3db6f45147ebbb56b371536e31bdf622b5bfee", + "installed_by": ["modules"], + "patch": "modules/nf-core/snpeff/snpeff/snpeff-snpeff.diff" + }, + "tabix/bgzip": { + "branch": "master", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "installed_by": ["modules"] + }, + "tabix/tabix": { + "branch": "master", + "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", + "installed_by": ["modules"] + }, + "trimgalore": { + "branch": "master", + "git_sha": "8d3e71002c5008e3f68a691ad8cd32c346356258", + "installed_by": ["modules"] + } + } + } } - } - }, - "https://github.com/nf-core/modules.git": { - "modules": { - "nf-core": { - "bcftools/concat": { - "branch": "master", - "git_sha": "d1e0ec7670fa77905a378627232566ce54c3c26d", - "installed_by": ["modules"] - }, - "bcftools/norm": { - "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", - "installed_by": ["modules"] - }, - "bcftools/sort": { - "branch": "master", - "git_sha": "666652151335353eef2fcd58880bcef5bc2928e1", - "installed_by": ["modules"] - }, - "bcftools/stats": { - "branch": "master", - "git_sha": "618364f55cb88f6c283f6c6c45c24d5f9f08f998", - "installed_by": ["modules"] - }, - "bwa/index": { - "branch": "master", - "git_sha": "6278bf9afd4a4b2d00fa6052250e73da3d91546f", - "installed_by": ["modules"] - }, - "bwa/mem": { - "branch": "master", - "git_sha": "b97197968ac12dde2463fa54541f6350c46f2035", - "installed_by": ["modules"] - }, - "cat/fastq": { - "branch": "master", - "git_sha": "0997b47c93c06b49aa7b3fefda87e728312cf2ca", - "installed_by": ["modules"] - }, - "custom/dumpsoftwareversions": { - "branch": "master", - "git_sha": "de45447d060b8c8b98575bc637a4a575fd0638e1", - "installed_by": ["modules"] - }, - "fastqc": { - "branch": "master", - "git_sha": "f4ae1d942bd50c5c0b9bd2de1393ce38315ba57c", - "installed_by": ["modules"] - }, - "multiqc": { - "branch": "master", - "git_sha": "b7ebe95761cd389603f9cc0e0dc384c0f663815a", - "installed_by": ["modules"] - }, - "picard/markduplicates": { - "branch": "master", - "git_sha": "0dee12b56ccecc416d6f7a1ccd85fd571eab3307", - "installed_by": ["modules"] - }, - "samtools/coverage": { - "branch": "master", - "git_sha": "38afbe42f7db7f19c7a89607c0a71c68f3be3131", - "installed_by": ["modules"] - }, - "samtools/depth": { - "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", - "installed_by": ["modules"], - "patch": "modules/nf-core/samtools/depth/samtools-depth.diff" - }, - "samtools/faidx": { - "branch": "master", - "git_sha": "aeb02a39d4c463598bfdcb2d964dbb7acbcf1298", - "installed_by": ["modules"] - }, - "samtools/flagstat": { - "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", - "installed_by": ["modules"] - }, - "samtools/idxstats": { - "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", - "installed_by": ["modules"] - }, - "samtools/index": { - "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", - "installed_by": ["modules"] - }, - "samtools/stats": { - "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", - "installed_by": ["modules"] - }, - "snpeff/download": { - "branch": "master", - "git_sha": "214d575774c172062924ad3564b4f66655600730", - "installed_by": ["modules"], - "patch": "modules/nf-core/snpeff/download/snpeff-download.diff" - }, - "snpeff/snpeff": { - "branch": "master", - "git_sha": "2f3db6f45147ebbb56b371536e31bdf622b5bfee", - "installed_by": ["modules"], - "patch": "modules/nf-core/snpeff/snpeff/snpeff-snpeff.diff" - }, - "tabix/bgzip": { - "branch": "master", - "git_sha": "09d3c8c29b31a2dfd610305b10550f0e1dbcd4a9", - "installed_by": ["modules"] - }, - "tabix/tabix": { - "branch": "master", - "git_sha": "9502adb23c0b97ed8e616bbbdfa73b4585aec9a1", - "installed_by": ["modules"] - }, - "trimgalore": { - "branch": "master", - "git_sha": "a98418419ae6c9df3cf6cf108d1e1aba71037d5a", - "installed_by": ["modules"] - } - } - } } - } } diff --git a/modules/cnr-ibba/bcftools/concat/bcftools-concat.diff b/modules/cnr-ibba/bcftools/concat/bcftools-concat.diff new file mode 100644 index 0000000..cfe5b54 --- /dev/null +++ b/modules/cnr-ibba/bcftools/concat/bcftools-concat.diff @@ -0,0 +1,28 @@ +Changes in component 'cnr-ibba/bcftools/concat' +Changes in 'bcftools/concat/main.nf': +--- modules/cnr-ibba/bcftools/concat/main.nf ++++ modules/cnr-ibba/bcftools/concat/main.nf +@@ -4,8 +4,8 @@ + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? +- 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': +- 'biocontainers/bcftools:1.18--h8b25389_0' }" ++ 'https://depot.galaxyproject.org/singularity/bcftools:1.20--h8b25389_0': ++ 'biocontainers/bcftools:1.20--h8b25389_0' }" + + input: + tuple val(meta), path(vcfs), path(tbi) + +Changes in 'bcftools/concat/environment.yml': +--- modules/cnr-ibba/bcftools/concat/environment.yml ++++ modules/cnr-ibba/bcftools/concat/environment.yml +@@ -4,4 +4,4 @@ + - bioconda + - defaults + dependencies: +- - bioconda::bcftools=1.18 ++ - bioconda::bcftools=1.20 + +'modules/cnr-ibba/bcftools/concat/meta.yml' is unchanged +************************************************************ diff --git a/modules/cnr-ibba/bcftools/concat/environment.yml b/modules/cnr-ibba/bcftools/concat/environment.yml index ff0200d..6544e94 100644 --- a/modules/cnr-ibba/bcftools/concat/environment.yml +++ b/modules/cnr-ibba/bcftools/concat/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/cnr-ibba/bcftools/concat/main.nf b/modules/cnr-ibba/bcftools/concat/main.nf index a5830a2..da8182f 100644 --- a/modules/cnr-ibba/bcftools/concat/main.nf +++ b/modules/cnr-ibba/bcftools/concat/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_CONCAT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': - 'biocontainers/bcftools:1.18--h8b25389_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.20--h8b25389_0': + 'biocontainers/bcftools:1.20--h8b25389_0' }" input: tuple val(meta), path(vcfs), path(tbi) diff --git a/modules/local/bcftools_filltags.nf b/modules/local/bcftools_filltags.nf index f5469f0..24a03ac 100644 --- a/modules/local/bcftools_filltags.nf +++ b/modules/local/bcftools_filltags.nf @@ -2,10 +2,10 @@ process BCFTOOLS_FILLTAGS { tag "$meta.id" label 'process_single' - conda "${moduleDir}/environment.yml" + conda "bioconda::bcftools=1.20" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': - 'biocontainers/bcftools:1.18--h8b25389_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.20--h8b25389_0': + 'biocontainers/bcftools:1.20--h8b25389_0' }" input: tuple val(meta), path(vcf), path(index) diff --git a/modules/local/freebayes_norm.nf b/modules/local/freebayes_norm.nf index dc958e6..c2be2b3 100644 --- a/modules/local/freebayes_norm.nf +++ b/modules/local/freebayes_norm.nf @@ -4,13 +4,13 @@ process FREEBAYES_NORM { label 'process_low' label 'error_retry' - conda "${moduleDir}/environment.yml" + conda "bioconda::freebayes=1.3.6" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/freebayes:1.3.6--hb089aa1_0': 'biocontainers/freebayes:1.3.6--hb089aa1_0' }" input: - tuple val(meta), path(vcf) + tuple val(meta), path(vcf), path(tbi) output: tuple val(meta), path("*.vcf.gz") , emit: vcf @@ -21,15 +21,15 @@ process FREEBAYES_NORM { script: def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - tabix ${vcf} - vcfallelicprimitives \\ $args \\ -kg \\ ${vcf} \\ | bgzip \\ + $args2 \\ --threads $task.cpus \\ --stdout > ${prefix}.vcf.gz diff --git a/modules/nf-core/bcftools/norm/environment.yml b/modules/nf-core/bcftools/norm/environment.yml index fe80e4e..5c00b11 100644 --- a/modules/nf-core/bcftools/norm/environment.yml +++ b/modules/nf-core/bcftools/norm/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_norm channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/norm/main.nf b/modules/nf-core/bcftools/norm/main.nf index 47d3dab..bd7a250 100644 --- a/modules/nf-core/bcftools/norm/main.nf +++ b/modules/nf-core/bcftools/norm/main.nf @@ -4,16 +4,18 @@ process BCFTOOLS_NORM { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': - 'biocontainers/bcftools:1.18--h8b25389_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.20--h8b25389_0': + 'biocontainers/bcftools:1.20--h8b25389_0' }" input: tuple val(meta), path(vcf), path(tbi) tuple val(meta2), path(fasta) output: - tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}") , emit: vcf - path "versions.yml" , emit: versions + tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf + tuple val(meta), path("*.tbi") , emit: tbi, optional: true + tuple val(meta), path("*.csi") , emit: csi, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -30,7 +32,7 @@ process BCFTOOLS_NORM { """ bcftools norm \\ --fasta-ref ${fasta} \\ - --output ${prefix}.${extension}\\ + --output ${prefix}.${extension} \\ $args \\ --threads $task.cpus \\ ${vcf} @@ -49,8 +51,16 @@ process BCFTOOLS_NORM { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf.gz" + def index = args.contains("--write-index=tbi") || args.contains("-W=tbi") ? "tbi" : + args.contains("--write-index=csi") || args.contains("-W=csi") ? "csi" : + args.contains("--write-index") || args.contains("-W") ? "csi" : + "" + def create_cmd = extension.endsWith(".gz") ? "echo '' | gzip >" : "touch" + def create_index = extension.endsWith(".gz") && index.matches("csi|tbi") ? "touch ${prefix}.${extension}.${index}" : "" + """ - touch ${prefix}.${extension} + ${create_cmd} ${prefix}.${extension} + ${create_index} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/norm/meta.yml b/modules/nf-core/bcftools/norm/meta.yml index 1f3e1b6..b6edeb4 100644 --- a/modules/nf-core/bcftools/norm/meta.yml +++ b/modules/nf-core/bcftools/norm/meta.yml @@ -13,46 +13,70 @@ tools: documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: | - The vcf file to be normalized - e.g. 'file1.vcf' - pattern: "*.{vcf,vcf.gz}" - - tbi: - type: file - description: | - An optional index of the VCF file (for when the VCF is compressed) - pattern: "*.vcf.gz.tbi" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: FASTA reference file - pattern: "*.{fasta,fa}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + The vcf file to be normalized + e.g. 'file1.vcf' + pattern: "*.{vcf,vcf.gz}" + - tbi: + type: file + description: | + An optional index of the VCF file (for when the VCF is compressed) + pattern: "*.vcf.gz.tbi" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: FASTA reference file + pattern: "*.{fasta,fa}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - vcf: - type: file - description: One of uncompressed VCF (.vcf), compressed VCF (.vcf.gz), compressed BCF (.bcf.gz) or uncompressed BCF (.bcf) normalized output file - pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{vcf,vcf.gz,bcf,bcf.gz}": + type: file + description: One of uncompressed VCF (.vcf), compressed VCF (.vcf.gz), compressed + BCF (.bcf.gz) or uncompressed BCF (.bcf) normalized output file + pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + - tbi: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tbi": + type: file + description: Alternative VCF file index + pattern: "*.tbi" + - csi: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: Default VCF file index + pattern: "*.csi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@abhi18av" - "@ramprasadn" diff --git a/modules/nf-core/bcftools/norm/tests/main.nf.test b/modules/nf-core/bcftools/norm/tests/main.nf.test new file mode 100644 index 0000000..dbc4150 --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/main.nf.test @@ -0,0 +1,563 @@ +nextflow_process { + + name "Test Process BCFTOOLS_NORM" + script "../main.nf" + process "BCFTOOLS_NORM" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/norm" + + test("sarscov2 - [ vcf, [] ], fasta") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, [] ], fasta - vcf_gz_index") { + + config "./vcf_gz_index.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } } + ).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [ vcf, [] ], fasta - vcf_gz_index_csi") { + + config "./vcf_gz_index_csi.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } } + ).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [ vcf, [] ], fasta - vcf_gz_index_tbi") { + + config "./vcf_gz_index_tbi.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } } + ).match() }, + { assert process.out.tbi[0][1].endsWith(".tbi") } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta - vcf output") { + + config "./nextflow.vcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta - vcf_gz output") { + + config "./nextflow.vcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.tbi.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta - bcf output") { + + config "./nextflow.bcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta - bcf_gz output") { + + config "./nextflow.bcf_gz.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, [] ], fasta - stub") { + + config "./nextflow.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta -stub") { + + config "./nextflow.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta - vcf output -stub") { + + config "./nextflow.vcf.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta - vcf_gz output - stub") { + + config "./nextflow.vcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta - bcf output - stub") { + + config "./nextflow.bcf.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, tbi ], fasta - bcf_gz output - stub") { + + config "./nextflow.bcf_gz.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [ vcf, [] ], fasta - vcf_gz_index - stub") { + + config "./vcf_gz_index.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [ vcf, [] ], fasta - vcf_gz_index_csi - stub") { + + config "./vcf_gz_index_csi.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [ vcf, [] ], fasta - vcf_gz_index_tbi - stub") { + + config "./vcf_gz_index_tbi.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.tbi[0][1].endsWith(".tbi") } + ) + } + + } + + +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/norm/tests/main.nf.test.snap b/modules/nf-core/bcftools/norm/tests/main.nf.test.snap new file mode 100644 index 0000000..3be5211 --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/main.nf.test.snap @@ -0,0 +1,758 @@ +{ + "sarscov2 - [ vcf, tbi ], fasta - vcf_gz output - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.vcf:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.vcf:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:38:42.639095032" + }, + "sarscov2 - [ vcf, [] ], fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:38:05.448449893" + }, + "sarscov2 - [ vcf, tbi ], fasta - vcf output": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.vcf:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.vcf:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:37:12.741719961" + }, + "sarscov2 - [ vcf, [] ], fasta - vcf_gz_index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:39:22.875147941" + }, + "sarscov2 - [ vcf, tbi ], fasta - vcf_gz output": { + "content": [ + [ + [ + { + "id": "test" + }, + "test_norm.vcf:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T08:15:23.38765384" + }, + "sarscov2 - [ vcf, [] ], fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.vcf.gz:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.vcf.gz:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:36:21.519977754" + }, + "sarscov2 - [ vcf, tbi ], fasta - vcf output -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:38:27.8230994" + }, + "sarscov2 - [ vcf, tbi ], fasta - bcf_gz output": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.bcf:md5,f35545c26a788b5eb697d9c0490339d9" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.bcf:md5,f35545c26a788b5eb697d9c0490339d9" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:37:53.942403192" + }, + "sarscov2 - [ vcf, [] ], fasta - vcf_gz_index_csi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T13:56:05.3799488" + }, + "sarscov2 - [ vcf, [] ], fasta - vcf_gz_index_tbi": { + "content": [ + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + [ + + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T13:53:28.356741947" + }, + "sarscov2 - [ vcf, tbi ], fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.vcf.gz:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.vcf.gz:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:36:58.39445154" + }, + "sarscov2 - [ vcf, tbi ], fasta -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:38:16.259516142" + }, + "sarscov2 - [ vcf, tbi ], fasta - bcf_gz output - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.bcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:39:10.503208929" + }, + "sarscov2 - [ vcf, [] ], fasta - vcf_gz_index": { + "content": [ + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T07:52:58.381931979" + }, + "sarscov2 - [ vcf, tbi ], fasta - bcf output - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.bcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.bcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:38:59.121377258" + }, + "sarscov2 - [ vcf, [] ], fasta - vcf_gz_index_tbi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T13:56:16.404380471" + }, + "sarscov2 - [ vcf, [] ], fasta - vcf_gz_index_csi": { + "content": [ + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,63e5adbaf3dd94550e9e3d7935dd28db" + ] + ], + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T13:53:09.808834237" + }, + "sarscov2 - [ vcf, tbi ], fasta - bcf output": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_norm.bcf.gz:md5,638c3c25bdd495c90ecbccb69ee77f07" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_norm.bcf.gz:md5,638c3c25bdd495c90ecbccb69ee77f07" + ] + ], + "versions": [ + "versions.yml:md5,ff760495922469e56d0fc3372773000d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:37:42.141945244" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/norm/tests/nextflow.bcf.config b/modules/nf-core/bcftools/norm/tests/nextflow.bcf.config new file mode 100644 index 0000000..b79af86 --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/nextflow.bcf.config @@ -0,0 +1,4 @@ +process { + ext.args = '-m -any --output-type b --no-version' + ext.prefix = "test_norm" +} diff --git a/modules/nf-core/bcftools/norm/tests/nextflow.bcf_gz.config b/modules/nf-core/bcftools/norm/tests/nextflow.bcf_gz.config new file mode 100644 index 0000000..f36f397 --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/nextflow.bcf_gz.config @@ -0,0 +1,4 @@ +process { + ext.args = '-m -any --output-type u --no-version' + ext.prefix = "test_norm" +} diff --git a/modules/nf-core/bcftools/norm/tests/nextflow.config b/modules/nf-core/bcftools/norm/tests/nextflow.config new file mode 100644 index 0000000..510803b --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/nextflow.config @@ -0,0 +1,4 @@ +process { + ext.args = '-m -any --no-version' + ext.prefix = "test_norm" +} diff --git a/modules/nf-core/bcftools/norm/tests/nextflow.vcf.config b/modules/nf-core/bcftools/norm/tests/nextflow.vcf.config new file mode 100644 index 0000000..10bf93e --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/nextflow.vcf.config @@ -0,0 +1,4 @@ +process { + ext.args = '-m -any --output-type v --no-version' + ext.prefix = "test_norm" +} diff --git a/modules/nf-core/bcftools/norm/tests/nextflow.vcf_gz.config b/modules/nf-core/bcftools/norm/tests/nextflow.vcf_gz.config new file mode 100644 index 0000000..b31dd2d --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/nextflow.vcf_gz.config @@ -0,0 +1,4 @@ +process { + ext.args = '-m -any --output-type z ---no-version' + ext.prefix = "test_norm" +} diff --git a/modules/nf-core/bcftools/norm/tests/tags.yml b/modules/nf-core/bcftools/norm/tests/tags.yml new file mode 100644 index 0000000..f6f5e35 --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/norm: + - "modules/nf-core/bcftools/norm/**" diff --git a/modules/nf-core/bcftools/norm/tests/vcf_gz_index.config b/modules/nf-core/bcftools/norm/tests/vcf_gz_index.config new file mode 100644 index 0000000..7dd696e --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/vcf_gz_index.config @@ -0,0 +1,4 @@ +process { + ext.prefix = { "${meta.id}_vcf" } + ext.args = "--output-type z --write-index --no-version" +} diff --git a/modules/nf-core/bcftools/norm/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/norm/tests/vcf_gz_index_csi.config new file mode 100644 index 0000000..aebffb6 --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/vcf_gz_index_csi.config @@ -0,0 +1,4 @@ +process { + ext.prefix = { "${meta.id}_vcf" } + ext.args = "--output-type z --write-index=csi --no-version" +} diff --git a/modules/nf-core/bcftools/norm/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/norm/tests/vcf_gz_index_tbi.config new file mode 100644 index 0000000..b192ae7 --- /dev/null +++ b/modules/nf-core/bcftools/norm/tests/vcf_gz_index_tbi.config @@ -0,0 +1,4 @@ +process { + ext.prefix = { "${meta.id}_vcf" } + ext.args = "--output-type z --write-index=tbi --no-version" +} diff --git a/modules/nf-core/bcftools/stats/environment.yml b/modules/nf-core/bcftools/stats/environment.yml index 7bb40dc..93357b4 100644 --- a/modules/nf-core/bcftools/stats/environment.yml +++ b/modules/nf-core/bcftools/stats/environment.yml @@ -1,8 +1,6 @@ -name: bcftools_stats channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=1.18 - - bioconda::htslib=1.18 + - bioconda::bcftools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/bcftools/stats/main.nf b/modules/nf-core/bcftools/stats/main.nf index ffa1df6..20e5da7 100644 --- a/modules/nf-core/bcftools/stats/main.nf +++ b/modules/nf-core/bcftools/stats/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_STATS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': - 'biocontainers/bcftools:1.18--h8b25389_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.20--h8b25389_0': + 'biocontainers/bcftools:1.20--h8b25389_0' }" input: tuple val(meta), path(vcf), path(tbi) diff --git a/modules/nf-core/bcftools/stats/meta.yml b/modules/nf-core/bcftools/stats/meta.yml index 7ea2103..655a61c 100644 --- a/modules/nf-core/bcftools/stats/meta.yml +++ b/modules/nf-core/bcftools/stats/meta.yml @@ -13,58 +13,86 @@ tools: documentation: http://www.htslib.org/doc/bcftools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:bcftools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: VCF input file - pattern: "*.{vcf}" - - tbi: - type: file - description: | - The tab index for the VCF file to be inspected. Optional: only required when parameter regions is chosen. - pattern: "*.tbi" - - regions: - type: file - description: | - Optionally, restrict the operation to regions listed in this file. (VCF, BED or tab-delimited) - - targets: - type: file - description: | - Optionally, restrict the operation to regions listed in this file (doesn't rely upon tbi index files) - - samples: - type: file - description: | - Optional, file of sample names to be included or excluded. - e.g. 'file.tsv' - - exons: - type: file - description: | - Tab-delimited file with exons for indel frameshifts (chr,beg,end; 1-based, inclusive, optionally bgzip compressed). - e.g. 'exons.tsv.gz' - - fasta: - type: file - description: | - Faidx indexed reference sequence file to determine INDEL context. - e.g. 'reference.fa' + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF input file + pattern: "*.{vcf}" + - tbi: + type: file + description: | + The tab index for the VCF file to be inspected. Optional: only required when parameter regions is chosen. + pattern: "*.tbi" + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - regions: + type: file + description: | + Optionally, restrict the operation to regions listed in this file. (VCF, BED or tab-delimited) + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - targets: + type: file + description: | + Optionally, restrict the operation to regions listed in this file (doesn't rely upon tbi index files) + - - meta4: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - samples: + type: file + description: | + Optional, file of sample names to be included or excluded. + e.g. 'file.tsv' + - - meta5: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - exons: + type: file + description: | + Tab-delimited file with exons for indel frameshifts (chr,beg,end; 1-based, inclusive, optionally bgzip compressed). + e.g. 'exons.tsv.gz' + - - meta6: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: | + Faidx indexed reference sequence file to determine INDEL context. + e.g. 'reference.fa' output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - stats: - type: file - description: Text output file containing stats - pattern: "*_{stats.txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*stats.txt": + type: file + description: Text output file containing stats + pattern: "*_{stats.txt}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/bcftools/stats/tests/main.nf.test b/modules/nf-core/bcftools/stats/tests/main.nf.test index f027f6b..be618b0 100644 --- a/modules/nf-core/bcftools/stats/tests/main.nf.test +++ b/modules/nf-core/bcftools/stats/tests/main.nf.test @@ -29,7 +29,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("version") }, + { assert snapshot(process.out.versions).match("versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } @@ -57,7 +57,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("regions_version") }, + { assert snapshot(process.out.versions).match("regions_versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } @@ -86,7 +86,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("targets_version") }, + { assert snapshot(process.out.versions).match("targets_versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } @@ -114,7 +114,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("exon_version") }, + { assert snapshot(process.out.versions).match("exon_versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } @@ -143,7 +143,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("ref_version") }, + { assert snapshot(process.out.versions).match("ref_versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } diff --git a/modules/nf-core/bcftools/stats/tests/main.nf.test.snap b/modules/nf-core/bcftools/stats/tests/main.nf.test.snap index 30691c3..cd8cff6 100644 --- a/modules/nf-core/bcftools/stats/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/stats/tests/main.nf.test.snap @@ -2,7 +2,7 @@ "sarscov2 - vcf_gz - reference": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats --fasta-ref genome.fasta test.vcf.gz", "#", "# Definition of sets:", @@ -12,14 +12,14 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T11:46:24.34147" + "timestamp": "2024-05-31T18:14:35.506777837" }, "sarscov2 - vcf_gz - exons": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats --exons exons.tsv.gz test.vcf.gz", "#", "# Definition of sets:", @@ -27,32 +27,28 @@ "ID\t0\ttest.vcf.gz" ] ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.0" - }, - "timestamp": "2024-03-20T11:46:18.378716" - }, - "exon_version": { - "content": null, "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:02:02.530551189" + "timestamp": "2024-05-31T18:14:30.57486244" }, - "ref_version": { - "content": null, + "versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:02:06.885381764" + "timestamp": "2024-05-31T18:16:27.637515559" }, "sarscov2 - vcf_gz - targets": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats --targets-file test2.targets.tsv.gz test.vcf.gz", "#", "# Definition of sets:", @@ -62,17 +58,33 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:14:25.732997442" + }, + "regions_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T11:46:12.48194" + "timestamp": "2024-05-31T18:16:32.559884458" }, - "targets_version": { - "content": null, + "targets_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:01:58.412147664" + "timestamp": "2024-05-31T18:16:37.512009805" }, "sarscov2 - vcf_gz - stub": { "content": [ @@ -86,7 +98,7 @@ ] ], "1": [ - "versions.yml:md5,5909d472a49b0aa2bfbbb1094c129e48" + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" ], "stats": [ [ @@ -97,36 +109,44 @@ ] ], "versions": [ - "versions.yml:md5,5909d472a49b0aa2bfbbb1094c129e48" + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-03-19T16:26:21.450513562" + "timestamp": "2024-06-03T11:57:09.614976125" }, - "version": { - "content": null, + "exon_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T09:57:04.317347424" + "timestamp": "2024-05-31T18:16:42.347397266" }, - "regions_version": { - "content": null, + "ref_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:01:54.349855366" + "timestamp": "2024-05-31T18:16:47.26823622" }, "sarscov2 - vcf_gz": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats test.vcf.gz", "#", "# Definition of sets:", @@ -136,14 +156,14 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T11:46:01.862297" + "timestamp": "2024-05-31T18:16:27.670416598" }, "sarscov2 - vcf_gz - regions": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats --regions-file test3.vcf.gz test.vcf.gz", "#", "# Definition of sets:", @@ -153,8 +173,8 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T11:46:07.296109" + "timestamp": "2024-05-31T18:14:20.759094062" } } \ No newline at end of file diff --git a/modules/nf-core/bwa/index/environment.yml b/modules/nf-core/bwa/index/environment.yml index 5d3cb32..d8789a2 100644 --- a/modules/nf-core/bwa/index/environment.yml +++ b/modules/nf-core/bwa/index/environment.yml @@ -1,7 +1,5 @@ -name: bwa_index channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bwa=0.7.17 + - bioconda::bwa=0.7.18 diff --git a/modules/nf-core/bwa/index/main.nf b/modules/nf-core/bwa/index/main.nf index 24b5a2e..29d9957 100644 --- a/modules/nf-core/bwa/index/main.nf +++ b/modules/nf-core/bwa/index/main.nf @@ -4,15 +4,15 @@ process BWA_INDEX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7' : - 'biocontainers/bwa:0.7.17--hed695b0_7' }" + 'https://depot.galaxyproject.org/singularity/bwa:0.7.18--he4a0461_0' : + 'biocontainers/bwa:0.7.18--he4a0461_0' }" input: tuple val(meta), path(fasta) output: - tuple val(meta), path(bwa) , emit: index - path "versions.yml" , emit: versions + tuple val(meta), path("bwa") , emit: index + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/bwa/index/meta.yml b/modules/nf-core/bwa/index/meta.yml index 730628d..ce5cb8f 100644 --- a/modules/nf-core/bwa/index/meta.yml +++ b/modules/nf-core/bwa/index/meta.yml @@ -11,35 +11,42 @@ tools: BWA is a software package for mapping DNA sequences against a large reference genome, such as the human genome. homepage: http://bio-bwa.sourceforge.net/ - documentation: http://www.htslib.org/doc/samtools.html + documentation: https://bio-bwa.sourceforge.net/bwa.shtml arxiv: arXiv:1303.3997 licence: ["GPL-3.0-or-later"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing reference information. - e.g. [ id:'test', single_end:false ] - - fasta: - type: file - description: Input genome fasta file + - - meta: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Input genome fasta file output: - - meta: - type: map - description: | - Groovy Map containing reference information. - e.g. [ id:'test', single_end:false ] - index: - type: file - description: BWA genome index files - pattern: "*.{amb,ann,bwt,pac,sa}" + - meta: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] + pattern: "*.{amb,ann,bwt,pac,sa}" + - bwa: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] + pattern: "*.{amb,ann,bwt,pac,sa}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@maxulysse" maintainers: - "@drpatelh" - "@maxulysse" + - "@gallvp" diff --git a/modules/nf-core/bwa/index/tests/main.nf.test.snap b/modules/nf-core/bwa/index/tests/main.nf.test.snap index e51ad5b..7c8f046 100644 --- a/modules/nf-core/bwa/index/tests/main.nf.test.snap +++ b/modules/nf-core/bwa/index/tests/main.nf.test.snap @@ -17,7 +17,7 @@ ] ], "1": [ - "versions.yml:md5,0f20525da90e7489a7ebb02adca3265f" + "versions.yml:md5,a64462ac7dfb21f4ade9b02e7f65c5bb" ], "index": [ [ @@ -34,10 +34,14 @@ ] ], "versions": [ - "versions.yml:md5,0f20525da90e7489a7ebb02adca3265f" + "versions.yml:md5,a64462ac7dfb21f4ade9b02e7f65c5bb" ] } ], - "timestamp": "2023-10-17T17:20:20.180927714" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-16T11:40:09.925307" } } \ No newline at end of file diff --git a/modules/nf-core/bwa/mem/environment.yml b/modules/nf-core/bwa/mem/environment.yml index 3f136d0..ef7b966 100644 --- a/modules/nf-core/bwa/mem/environment.yml +++ b/modules/nf-core/bwa/mem/environment.yml @@ -1,10 +1,8 @@ -name: bwa_mem channels: - conda-forge - bioconda - - defaults + dependencies: - - bwa=0.7.17 - # renovate: datasource=conda depName=bioconda/samtools - - samtools=1.19.2 - - htslib=1.19.1 + - bwa=0.7.18 + - htslib=1.20.0 + - samtools=1.20 diff --git a/modules/nf-core/bwa/mem/main.nf b/modules/nf-core/bwa/mem/main.nf index d8bd281..d18cd93 100644 --- a/modules/nf-core/bwa/mem/main.nf +++ b/modules/nf-core/bwa/mem/main.nf @@ -4,8 +4,8 @@ process BWA_MEM { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:a34558545ae1413d94bde4578787ebef08027945-0' : - 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:a34558545ae1413d94bde4578787ebef08027945-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:1bd8542a8a0b42e0981337910954371d0230828e-0' : + 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:1bd8542a8a0b42e0981337910954371d0230828e-0' }" input: tuple val(meta) , path(reads) @@ -53,10 +53,8 @@ process BWA_MEM { """ stub: - def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def samtools_command = sort_bam ? 'sort' : 'view' def extension = args2.contains("--output-fmt sam") ? "sam" : args2.contains("--output-fmt cram") ? "cram": sort_bam && args2.contains("-O cram")? "cram": diff --git a/modules/nf-core/bwa/mem/meta.yml b/modules/nf-core/bwa/mem/meta.yml index 1532c26..37467d2 100644 --- a/modules/nf-core/bwa/mem/meta.yml +++ b/modules/nf-core/bwa/mem/meta.yml @@ -14,58 +14,85 @@ tools: BWA is a software package for mapping DNA sequences against a large reference genome, such as the human genome. homepage: http://bio-bwa.sourceforge.net/ - documentation: http://www.htslib.org/doc/samtools.html + documentation: https://bio-bwa.sourceforge.net/bwa.shtml arxiv: arXiv:1303.3997 licence: ["GPL-3.0-or-later"] + identifier: "" 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 files of size 1 and 2 for single-end and paired-end data, - respectively. - - meta2: - type: map - description: | - Groovy Map containing reference information. - e.g. [ id:'test', single_end:false ] - - index: - type: file - description: BWA genome index files - pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" - - fasta: - type: file - description: Reference genome in FASTA format - pattern: "*.{fasta,fa}" - - sort_bam: - type: boolean - description: use samtools sort (true) or samtools view (false) - pattern: "true or false" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. + - - meta2: + type: map + description: | + Groovy Map containing reference information. + e.g. [ id:'test', single_end:false ] + - index: + type: file + description: BWA genome index files + pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}" + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fasta: + type: file + description: Reference genome in FASTA format + pattern: "*.{fasta,fa}" + - - sort_bam: + type: boolean + description: use samtools sort (true) or samtools view (false) + pattern: "true or false" output: - bam: - type: file - description: Output BAM file containing read alignments - pattern: "*.{bam}" + - meta: + type: file + description: Output BAM file containing read alignments + pattern: "*.{bam}" + - "*.bam": + type: file + description: Output BAM file containing read alignments + pattern: "*.{bam}" - cram: - type: file - description: Output CRAM file containing read alignments - pattern: "*.{cram}" + - meta: + type: file + description: Output CRAM file containing read alignments + pattern: "*.{cram}" + - "*.cram": + type: file + description: Output CRAM file containing read alignments + pattern: "*.{cram}" - csi: - type: file - description: Optional index file for BAM file - pattern: "*.{csi}" + - meta: + type: file + description: Optional index file for BAM file + pattern: "*.{csi}" + - "*.csi": + type: file + description: Optional index file for BAM file + pattern: "*.{csi}" - crai: - type: file - description: Optional index file for CRAM file - pattern: "*.{crai}" + - meta: + type: file + description: Optional index file for CRAM file + pattern: "*.{crai}" + - "*.crai": + type: file + description: Optional index file for CRAM file + pattern: "*.{crai}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@jeremy1805" diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test b/modules/nf-core/bwa/mem/tests/main.nf.test index 1fa9b56..5de2c2f 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test +++ b/modules/nf-core/bwa/mem/tests/main.nf.test @@ -9,21 +9,21 @@ nextflow_process { script "../main.nf" process "BWA_MEM" - test("Single-End") { - - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } + setup { + run("BWA_INDEX") { + script "../../index/main.nf" + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ } } + } + + test("Single-End") { when { process { @@ -44,7 +44,15 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() + ).match() + } ) } @@ -52,20 +60,6 @@ nextflow_process { test("Single-End Sort") { - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } - when { process { """ @@ -85,7 +79,15 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() + ).match() + } ) } @@ -93,20 +95,6 @@ nextflow_process { test("Paired-End") { - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } - when { process { """ @@ -127,7 +115,15 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() + ).match() + } ) } @@ -135,20 +131,6 @@ nextflow_process { test("Paired-End Sort") { - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } - when { process { """ @@ -169,7 +151,15 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() + ).match() + } ) } @@ -177,20 +167,6 @@ nextflow_process { test("Paired-End - no fasta") { - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } - when { process { """ @@ -211,27 +187,24 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5() + ).match() + } ) } } test("Single-end - stub") { + options "-stub" - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } + when { process { """ @@ -251,30 +224,15 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.bam[0][1]).name, - file(process.out.csi[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } } test("Paired-end - stub") { + options "-stub" - setup { - run("BWA_INDEX") { - script "../../index/main.nf" - process { - """ - input[0] = [ - [id: 'test'], - file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - """ - } - } - } + when { process { """ @@ -295,11 +253,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.bam[0][1]).name, - file(process.out.csi[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test.snap b/modules/nf-core/bwa/mem/tests/main.nf.test.snap index 0d1bdb4..2079ea2 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test.snap +++ b/modules/nf-core/bwa/mem/tests/main.nf.test.snap @@ -1,5 +1,97 @@ { "Single-End": { + "content": [ + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "b6d9cb250261a4c125413c5d867d87a7", + "798439cbd7fd81cbcc5078022dc5479d" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-02T12:22:28.051598" + }, + "Single-End Sort": { + "content": [ + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "848434ae4b79cfdcb2281c60b33663ce", + "94fcf617f5b994584c4e8d4044e16b4f" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-02T12:22:39.671154" + }, + "Paired-End": { + "content": [ + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "5b34d31be84478761f789e3e2e805e31", + "57aeef88ed701a8ebc8e2f0a381b2a6" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-02T12:22:51.919479" + }, + "Paired-End Sort": { + "content": [ + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "69003376d9a8952622d8587b39c3eaae", + "af8628d9df18b2d3d4f6fd47ef2bb872" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-02T12:23:00.833562" + }, + "Single-end - stub": { "content": [ { "0": [ @@ -8,73 +100,32 @@ "id": "test", "single_end": true }, - "test.bam:md5,a74710a0345b4717bb4431bf9c257120" + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ ], "2": [ - - ], - "3": [ - - ], - "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ], - "bam": [ [ { "id": "test", "single_end": true }, - "test.bam:md5,a74710a0345b4717bb4431bf9c257120" + "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - - ], - "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - } - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-14T14:14:56.820798254" - }, - "Single-End Sort": { - "content": [ - { - "0": [ + "3": [ [ { "id": "test", "single_end": true }, - "test.bam:md5,cb1e038bc4d990683fa485d632550b54" + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - ], "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ], "bam": [ [ @@ -82,30 +133,65 @@ "id": "test", "single_end": true }, - "test.bam:md5,cb1e038bc4d990683fa485d632550b54" + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "crai": [ - + [ + { + "id": "test", + "single_end": true + }, + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "cram": [ ], "csi": [ - + [ + { + "id": "test", + "single_end": true + }, + "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-14T14:15:20.271428534" + "timestamp": "2024-08-02T12:31:29.46282" }, - "Paired-End": { + "Paired-End - no fasta": { + "content": [ + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "5b34d31be84478761f789e3e2e805e31", + "57aeef88ed701a8ebc8e2f0a381b2a6" + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-02T12:23:09.942545" + }, + "Paired-end - stub": { "content": [ { "0": [ @@ -114,73 +200,32 @@ "id": "test", "single_end": false }, - "test.bam:md5,aea123a3828a99da1906126355f15a12" + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "1": [ ], "2": [ - - ], - "3": [ - - ], - "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ], - "bam": [ [ { "id": "test", "single_end": false }, - "test.bam:md5,aea123a3828a99da1906126355f15a12" + "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - - ], - "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - } - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-14T14:15:38.264256823" - }, - "Paired-End Sort": { - "content": [ - { - "0": [ + "3": [ [ { "id": "test", "single_end": false }, - "test.bam:md5,4682087bcdc3617384b375093fecd8dd" + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - ], "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ], "bam": [ [ @@ -188,108 +233,39 @@ "id": "test", "single_end": false }, - "test.bam:md5,4682087bcdc3617384b375093fecd8dd" + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "crai": [ - - ], - "cram": [ - - ], - "csi": [ - - ], - "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - } - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-14T14:16:00.528642686" - }, - "Single-end - stub": { - "content": [ - "test.bam", - "test.csi", - [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-15T09:50:33.238543011" - }, - "Paired-End - no fasta": { - "content": [ - { - "0": [ [ { "id": "test", "single_end": false }, - "test.bam:md5,aea123a3828a99da1906126355f15a12" + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "1": [ - - ], - "2": [ - - ], - "3": [ + "cram": [ ], - "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ], - "bam": [ + "csi": [ [ { "id": "test", "single_end": false }, - "test.bam:md5,aea123a3828a99da1906126355f15a12" + "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - ], "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-14T14:40:16.345342005" - }, - "Paired-end - stub": { - "content": [ - "test.bam", - "test.csi", - [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-15T09:50:42.268673302" + "timestamp": "2024-08-02T12:31:37.757037" } } \ No newline at end of file diff --git a/modules/nf-core/cat/fastq/environment.yml b/modules/nf-core/cat/fastq/environment.yml index 8c69b12..ae4fa45 100644 --- a/modules/nf-core/cat/fastq/environment.yml +++ b/modules/nf-core/cat/fastq/environment.yml @@ -1,7 +1,10 @@ -name: cat_fastq channels: - conda-forge - bioconda - - defaults dependencies: - - conda-forge::coreutils=8.30 + - 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 f132b2a..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://depot.galaxyproject.org/singularity/ubuntu:20.04' : - 'nf-core/ubuntu:20.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(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,11 +52,11 @@ 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) { + if (readList.size >= 1) { """ - touch ${prefix}.merged.fastq.gz + echo '' | gzip > ${prefix}.merged.fastq.gz cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -63,11 +64,12 @@ process CAT_FASTQ { END_VERSIONS """ } - } else { - if (readList.size > 2) { + } + else { + if (readList.size >= 2) { """ - touch ${prefix}_1.merged.fastq.gz - touch ${prefix}_2.merged.fastq.gz + echo '' | gzip > ${prefix}_1.merged.fastq.gz + echo '' | gzip > ${prefix}_2.merged.fastq.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/cat/fastq/meta.yml b/modules/nf-core/cat/fastq/meta.yml index db4ac3c..91ff2fb 100644 --- a/modules/nf-core/cat/fastq/meta.yml +++ b/modules/nf-core/cat/fastq/meta.yml @@ -10,30 +10,33 @@ tools: The cat utility reads files sequentially, writing them to the standard output. documentation: https://www.gnu.org/software/coreutils/manual/html_node/cat-invocation.html licence: ["GPL-3.0-or-later"] + identifier: "" 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 files to be concatenated. + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files to be concatenated. output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - reads: - type: file - description: Merged fastq file - pattern: "*.{merged.fastq.gz}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.merged.fastq.gz": + type: file + description: Merged fastq file + pattern: "*.{merged.fastq.gz}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/cat/fastq/tests/main.nf.test b/modules/nf-core/cat/fastq/tests/main.nf.test index dab2e14..0de5e18 100644 --- a/modules/nf-core/cat/fastq/tests/main.nf.test +++ b/modules/nf-core/cat/fastq/tests/main.nf.test @@ -11,9 +11,6 @@ nextflow_process { test("test_cat_fastq_single_end") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -36,9 +33,6 @@ nextflow_process { test("test_cat_fastq_paired_end") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -63,9 +57,6 @@ nextflow_process { test("test_cat_fastq_single_end_same_name") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -88,9 +79,6 @@ nextflow_process { test("test_cat_fastq_paired_end_same_name") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -115,9 +103,129 @@ nextflow_process { test("test_cat_fastq_single_end_single_file") { when { - params { - outdir = "$outputDir" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // meta map + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_cat_fastq_single_end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // 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(process.out).match() } + ) + } + } + + test("test_cat_fastq_paired_end - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_2.fastq.gz', checkIfExists: true)] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_cat_fastq_single_end_same_name - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:true ], // 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_1.fastq.gz', checkIfExists: true)] + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_cat_fastq_paired_end_same_name - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ 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), + 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(process.out).match() } + ) + } + } + + test("test_cat_fastq_single_end_single_file - stub") { + + options "-stub" + + when { process { """ input[0] = Channel.of([ diff --git a/modules/nf-core/cat/fastq/tests/main.nf.test.snap b/modules/nf-core/cat/fastq/tests/main.nf.test.snap index 43dfe28..f8689a1 100644 --- a/modules/nf-core/cat/fastq/tests/main.nf.test.snap +++ b/modules/nf-core/cat/fastq/tests/main.nf.test.snap @@ -12,7 +12,7 @@ ] ], "1": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ], "reads": [ [ @@ -24,11 +24,15 @@ ] ], "versions": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ] } ], - "timestamp": "2024-01-17T17:30:39.816981" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:02:07.519211144" }, "test_cat_fastq_single_end_same_name": { "content": [ @@ -43,7 +47,7 @@ ] ], "1": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ], "reads": [ [ @@ -55,11 +59,15 @@ ] ], "versions": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ] } ], - "timestamp": "2024-01-17T17:32:35.229332" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:02:31.618628921" }, "test_cat_fastq_single_end_single_file": { "content": [ @@ -74,7 +82,7 @@ ] ], "1": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ], "reads": [ [ @@ -86,11 +94,15 @@ ] ], "versions": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ] } ], - "timestamp": "2024-01-17T17:34:00.058829" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:02:57.904149581" }, "test_cat_fastq_paired_end_same_name": { "content": [ @@ -108,7 +120,7 @@ ] ], "1": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ], "reads": [ [ @@ -123,11 +135,126 @@ ] ], "versions": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ] } ], - "timestamp": "2024-01-17T17:33:33.031555" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:02:44.577183829" + }, + "test_cat_fastq_single_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:03:10.603734777" + }, + "test_cat_fastq_paired_end_same_name - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:03:46.041808828" + }, + "test_cat_fastq_single_end_same_name - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:03:34.13865402" }, "test_cat_fastq_paired_end": { "content": [ @@ -145,7 +272,7 @@ ] ], "1": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ], "reads": [ [ @@ -160,10 +287,90 @@ ] ], "versions": [ - "versions.yml:md5,d42d6e24d67004608495883e00bd501b" + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:02:19.64383573" + }, + "test_cat_fastq_paired_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "versions": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:03:22.597246066" + }, + "test_cat_fastq_single_end_single_file - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test.merged.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,6ef4fd28546a005865b9454bbedbf81a" ] } ], - "timestamp": "2024-01-17T17:32:02.270935" + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-10-19T20:03:58.44849001" } } \ No newline at end of file diff --git a/modules/nf-core/custom/dumpsoftwareversions/environment.yml b/modules/nf-core/custom/dumpsoftwareversions/environment.yml index b48ced2..9d79af9 100644 --- a/modules/nf-core/custom/dumpsoftwareversions/environment.yml +++ b/modules/nf-core/custom/dumpsoftwareversions/environment.yml @@ -1,7 +1,5 @@ -name: custom_dumpsoftwareversions channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::multiqc=1.20 diff --git a/modules/nf-core/custom/dumpsoftwareversions/meta.yml b/modules/nf-core/custom/dumpsoftwareversions/meta.yml index 5f15a5f..dc1e412 100644 --- a/modules/nf-core/custom/dumpsoftwareversions/meta.yml +++ b/modules/nf-core/custom/dumpsoftwareversions/meta.yml @@ -1,34 +1,40 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: custom_dumpsoftwareversions -description: Custom module used to dump software versions within the nf-core pipeline template +description: Custom module used to dump software versions within the nf-core pipeline + template keywords: - custom - dump - version tools: - custom: - description: Custom module used to dump software versions within the nf-core pipeline template + description: Custom module used to dump software versions within the nf-core pipeline + template homepage: https://github.com/nf-core/tools documentation: https://github.com/nf-core/tools licence: ["MIT"] + identifier: "" input: - - versions: - type: file - description: YML file containing software versions - pattern: "*.yml" + - - versions: + type: file + description: YML file containing software versions + pattern: "*.yml" output: - yml: - type: file - description: Standard YML file containing software versions - pattern: "software_versions.yml" + - software_versions.yml: + type: file + description: Standard YML file containing software versions + pattern: "software_versions.yml" - mqc_yml: - type: file - description: MultiQC custom content YML file containing software versions - pattern: "software_versions_mqc.yml" + - software_versions_mqc.yml: + type: file + description: MultiQC custom content YML file containing software versions + pattern: "software_versions_mqc.yml" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@grst" diff --git a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py index da03340..b83b32c 100755 --- a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py +++ b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py @@ -3,11 +3,11 @@ """Provide functions to merge multiple versions.yml files.""" - -import yaml import platform from textwrap import dedent +import yaml + def _make_versions_html(versions): """Generate a tabular HTML output of all versions for MultiQC.""" diff --git a/modules/nf-core/fastqc/environment.yml b/modules/nf-core/fastqc/environment.yml index 1787b38..691d4c7 100644 --- a/modules/nf-core/fastqc/environment.yml +++ b/modules/nf-core/fastqc/environment.yml @@ -1,7 +1,5 @@ -name: fastqc channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::fastqc=0.12.1 diff --git a/modules/nf-core/fastqc/main.nf b/modules/nf-core/fastqc/main.nf index 9e19a74..033f415 100644 --- a/modules/nf-core/fastqc/main.nf +++ b/modules/nf-core/fastqc/main.nf @@ -1,5 +1,5 @@ process FASTQC { - tag "$meta.id" + tag "${meta.id}" label 'process_medium' conda "${moduleDir}/environment.yml" @@ -19,21 +19,30 @@ process FASTQC { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" // Make list of old name and new name pairs to use for renaming in the bash while loop def old_new_pairs = reads instanceof Path || reads.size() == 1 ? [[ reads, "${prefix}.${reads.extension}" ]] : reads.withIndex().collect { entry, index -> [ entry, "${prefix}_${index + 1}.${entry.extension}" ] } - def rename_to = old_new_pairs*.join(' ').join(' ') - def renamed_files = old_new_pairs.collect{ old_name, new_name -> new_name }.join(' ') + def rename_to = old_new_pairs*.join(' ').join(' ') + def renamed_files = old_new_pairs.collect{ _old_name, new_name -> new_name }.join(' ') + + // The total amount of allocated RAM by FastQC is equal to the number of threads defined (--threads) time the amount of RAM defined (--memory) + // https://github.com/s-andrews/FastQC/blob/1faeea0412093224d7f6a07f777fad60a5650795/fastqc#L211-L222 + // Dividing the task.memory by task.cpu allows to stick to requested amount of RAM in the label + def memory_in_mb = task.memory ? task.memory.toUnit('MB').toFloat() / task.cpus : null + // FastQC memory value allowed range (100 - 10000) + def fastqc_memory = memory_in_mb > 10000 ? 10000 : (memory_in_mb < 100 ? 100 : memory_in_mb) + """ - printf "%s %s\\n" $rename_to | while read old_name new_name; do + printf "%s %s\\n" ${rename_to} | while read old_name new_name; do [ -f "\${new_name}" ] || ln -s \$old_name \$new_name done fastqc \\ - $args \\ - --threads $task.cpus \\ - $renamed_files + ${args} \\ + --threads ${task.cpus} \\ + --memory ${fastqc_memory} \\ + ${renamed_files} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/fastqc/meta.yml b/modules/nf-core/fastqc/meta.yml index ee5507e..2b2e62b 100644 --- a/modules/nf-core/fastqc/meta.yml +++ b/modules/nf-core/fastqc/meta.yml @@ -11,40 +11,50 @@ tools: FastQC gives general quality metrics about your reads. It provides information about the quality score distribution across your reads, the per base sequence content (%A/C/G/T). + You get information about adapter contamination and other overrepresented sequences. homepage: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/ documentation: https://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/ licence: ["GPL-2.0-only"] + identifier: biotools:fastqc 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 files of size 1 and 2 for single-end and paired-end data, - respectively. + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - html: - type: file - description: FastQC report - pattern: "*_{fastqc.html}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.html": + type: file + description: FastQC report + pattern: "*_{fastqc.html}" - zip: - type: file - description: FastQC report archive - pattern: "*_{fastqc.zip}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.zip": + type: file + description: FastQC report archive + pattern: "*_{fastqc.zip}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@grst" diff --git a/modules/nf-core/fastqc/tests/main.nf.test b/modules/nf-core/fastqc/tests/main.nf.test index 70edae4..e9d79a0 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test +++ b/modules/nf-core/fastqc/tests/main.nf.test @@ -23,17 +23,14 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - // NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it. - // looks like this:
Mon 2 Oct 2023
test.gz
- // https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039 - - { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, - { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, - { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_single") } + { assert process.success }, + // NOTE The report contains the date inside it, which means that the md5sum is stable per day, but not longer than that. So you can't md5sum it. + // looks like this:
Mon 2 Oct 2023
test.gz
+ // https://github.com/nf-core/modules/pull/3903#issuecomment-1743620039 + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -54,16 +51,14 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, - { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, - { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, - { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, - { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, - { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_paired") } + { assert process.success }, + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, + { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -83,13 +78,11 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, - { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, - { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_interleaved") } + { assert process.success }, + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -109,13 +102,11 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, - { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, - { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_bam") } + { assert process.success }, + { assert process.out.html[0][1] ==~ ".*/test_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/test_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -138,22 +129,20 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, - { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, - { assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" }, - { assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" }, - { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, - { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, - { assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" }, - { assert process.out.zip[0][1][3] ==~ ".*/test_4_fastqc.zip" }, - { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, - { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, - { assert path(process.out.html[0][1][2]).text.contains("File typeConventional base calls") }, - { assert path(process.out.html[0][1][3]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_multiple") } + { assert process.success }, + { assert process.out.html[0][1][0] ==~ ".*/test_1_fastqc.html" }, + { assert process.out.html[0][1][1] ==~ ".*/test_2_fastqc.html" }, + { assert process.out.html[0][1][2] ==~ ".*/test_3_fastqc.html" }, + { assert process.out.html[0][1][3] ==~ ".*/test_4_fastqc.html" }, + { assert process.out.zip[0][1][0] ==~ ".*/test_1_fastqc.zip" }, + { assert process.out.zip[0][1][1] ==~ ".*/test_2_fastqc.zip" }, + { assert process.out.zip[0][1][2] ==~ ".*/test_3_fastqc.zip" }, + { assert process.out.zip[0][1][3] ==~ ".*/test_4_fastqc.zip" }, + { assert path(process.out.html[0][1][0]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][1]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][2]).text.contains("File typeConventional base calls") }, + { assert path(process.out.html[0][1][3]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } @@ -173,21 +162,18 @@ nextflow_process { then { assertAll ( - { assert process.success }, - - { assert process.out.html[0][1] ==~ ".*/mysample_fastqc.html" }, - { assert process.out.zip[0][1] ==~ ".*/mysample_fastqc.zip" }, - { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, - - { assert snapshot(process.out.versions).match("fastqc_versions_custom_prefix") } + { assert process.success }, + { assert process.out.html[0][1] ==~ ".*/mysample_fastqc.html" }, + { assert process.out.zip[0][1] ==~ ".*/mysample_fastqc.zip" }, + { assert path(process.out.html[0][1]).text.contains("File typeConventional base calls") }, + { assert snapshot(process.out.versions).match() } ) } } test("sarscov2 single-end [fastq] - stub") { - options "-stub" - + options "-stub" when { process { """ @@ -201,12 +187,123 @@ nextflow_process { then { assertAll ( - { assert process.success }, - { assert snapshot(process.out.html.collect { file(it[1]).getName() } + - process.out.zip.collect { file(it[1]).getName() } + - process.out.versions ).match("fastqc_stub") } + { assert process.success }, + { assert snapshot(process.out).match() } ) } } + test("sarscov2 paired-end [fastq] - stub") { + + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [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(process.out).match() } + ) + } + } + + test("sarscov2 interleaved [fastq] - stub") { + + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [id: 'test', single_end: false], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_interleaved.fastq.gz', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 paired-end [bam] - stub") { + + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [id: 'test', single_end: false], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 multiple [fastq] - stub") { + + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test2_2.fastq.gz', checkIfExists: true) ] + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 custom_prefix - stub") { + + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'mysample', single_end:true ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } } diff --git a/modules/nf-core/fastqc/tests/main.nf.test.snap b/modules/nf-core/fastqc/tests/main.nf.test.snap index 86f7c31..d5db309 100644 --- a/modules/nf-core/fastqc/tests/main.nf.test.snap +++ b/modules/nf-core/fastqc/tests/main.nf.test.snap @@ -1,88 +1,392 @@ { - "fastqc_versions_interleaved": { + "sarscov2 custom_prefix": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:40:07.293713" + "timestamp": "2024-07-22T11:02:16.374038" }, - "fastqc_stub": { + "sarscov2 single-end [fastq] - stub": { "content": [ - [ - "test.html", - "test.zip", - "versions.yml:md5,e1cc25ca8af856014824abd842e93978" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": true + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": true + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:02:24.993809" + }, + "sarscov2 custom_prefix - stub": { + "content": [ + { + "0": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "mysample", + "single_end": true + }, + "mysample.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:31:01.425198" + "timestamp": "2024-07-22T11:03:10.93942" }, - "fastqc_versions_multiple": { + "sarscov2 interleaved [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:40:55.797907" + "timestamp": "2024-07-22T11:01:42.355718" }, - "fastqc_versions_bam": { + "sarscov2 paired-end [bam]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:40:26.795862" + "timestamp": "2024-07-22T11:01:53.276274" }, - "fastqc_versions_single": { + "sarscov2 multiple [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:39:27.043675" + "timestamp": "2024-07-22T11:02:05.527626" }, - "fastqc_versions_paired": { + "sarscov2 paired-end [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:01:31.188871" + }, + "sarscov2 paired-end [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:02:34.273566" + }, + "sarscov2 multiple [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:39:47.584191" + "timestamp": "2024-07-22T11:03:02.304411" }, - "fastqc_versions_custom_prefix": { + "sarscov2 single-end [fastq]": { "content": [ [ "versions.yml:md5,e1cc25ca8af856014824abd842e93978" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:01:19.095607" + }, + "sarscov2 interleaved [fastq] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T11:02:44.640184" + }, + "sarscov2 paired-end [bam] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "html": [ + [ + { + "id": "test", + "single_end": false + }, + "test.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e1cc25ca8af856014824abd842e93978" + ], + "zip": [ + [ + { + "id": "test", + "single_end": false + }, + "test.zip:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-01-31T17:41:14.576531" + "timestamp": "2024-07-22T11:02:53.550742" } } \ No newline at end of file diff --git a/modules/nf-core/fastqc/tests/tags.yml b/modules/nf-core/fastqc/tests/tags.yml deleted file mode 100644 index 7834294..0000000 --- a/modules/nf-core/fastqc/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -fastqc: - - modules/nf-core/fastqc/** diff --git a/modules/nf-core/multiqc/environment.yml b/modules/nf-core/multiqc/environment.yml index ca39fb6..439a7c2 100644 --- a/modules/nf-core/multiqc/environment.yml +++ b/modules/nf-core/multiqc/environment.yml @@ -1,7 +1,5 @@ -name: multiqc channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::multiqc=1.21 + - bioconda::multiqc=1.26 diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 47ac352..775b3ff 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -3,14 +3,16 @@ process MULTIQC { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.21--pyhdfd78af_0' : - 'biocontainers/multiqc:1.21--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/multiqc:1.26--pyhdfd78af_0' : + 'biocontainers/multiqc:1.26--pyhdfd78af_0' }" input: path multiqc_files, stageAs: "?/*" path(multiqc_config) path(extra_multiqc_config) path(multiqc_logo) + path(replace_names) + path(sample_names) output: path "*multiqc_report.html", emit: report @@ -23,16 +25,22 @@ process MULTIQC { script: def args = task.ext.args ?: '' + def prefix = task.ext.prefix ? "--filename ${task.ext.prefix}.html" : '' def config = multiqc_config ? "--config $multiqc_config" : '' def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' - def logo = multiqc_logo ? /--cl-config 'custom_logo: "${multiqc_logo}"'/ : '' + def logo = multiqc_logo ? "--cl-config 'custom_logo: \"${multiqc_logo}\"'" : '' + def replace = replace_names ? "--replace-names ${replace_names}" : '' + def samples = sample_names ? "--sample-names ${sample_names}" : '' """ multiqc \\ --force \\ $args \\ $config \\ + $prefix \\ $extra_config \\ $logo \\ + $replace \\ + $samples \\ . cat <<-END_VERSIONS > versions.yml @@ -44,7 +52,7 @@ process MULTIQC { stub: """ mkdir multiqc_data - touch multiqc_plots + mkdir multiqc_plots touch multiqc_report.html cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/multiqc/meta.yml b/modules/nf-core/multiqc/meta.yml index 45a9bc3..b16c187 100644 --- a/modules/nf-core/multiqc/meta.yml +++ b/modules/nf-core/multiqc/meta.yml @@ -1,5 +1,6 @@ name: multiqc -description: Aggregate results from bioinformatics analyses across many samples into a single report +description: Aggregate results from bioinformatics analyses across many samples into + a single report keywords: - QC - bioinformatics tools @@ -12,40 +13,59 @@ tools: homepage: https://multiqc.info/ documentation: https://multiqc.info/docs/ licence: ["GPL-3.0-or-later"] + identifier: biotools:multiqc input: - - multiqc_files: - type: file - description: | - List of reports / files recognised by MultiQC, for example the html and zip output of FastQC - - multiqc_config: - type: file - description: Optional config yml for MultiQC - pattern: "*.{yml,yaml}" - - extra_multiqc_config: - type: file - description: Second optional config yml for MultiQC. Will override common sections in multiqc_config. - pattern: "*.{yml,yaml}" - - multiqc_logo: - type: file - description: Optional logo file for MultiQC - pattern: "*.{png}" + - - multiqc_files: + type: file + description: | + List of reports / files recognised by MultiQC, for example the html and zip output of FastQC + - - multiqc_config: + type: file + description: Optional config yml for MultiQC + pattern: "*.{yml,yaml}" + - - extra_multiqc_config: + type: file + description: Second optional config yml for MultiQC. Will override common sections + in multiqc_config. + pattern: "*.{yml,yaml}" + - - multiqc_logo: + type: file + description: Optional logo file for MultiQC + pattern: "*.{png}" + - - replace_names: + type: file + description: | + Optional two-column sample renaming file. First column a set of + patterns, second column a set of corresponding replacements. Passed via + MultiQC's `--replace-names` option. + pattern: "*.{tsv}" + - - sample_names: + type: file + description: | + Optional TSV file with headers, passed to the MultiQC --sample_names + argument. + pattern: "*.{tsv}" output: - report: - type: file - description: MultiQC report file - pattern: "multiqc_report.html" + - "*multiqc_report.html": + type: file + description: MultiQC report file + pattern: "multiqc_report.html" - data: - type: directory - description: MultiQC data dir - pattern: "multiqc_data" + - "*_data": + type: directory + description: MultiQC data dir + pattern: "multiqc_data" - plots: - type: file - description: Plots created by MultiQC - pattern: "*_data" + - "*_plots": + type: file + description: Plots created by MultiQC + pattern: "*_data" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@abhi18av" - "@bunop" diff --git a/modules/nf-core/multiqc/tests/main.nf.test b/modules/nf-core/multiqc/tests/main.nf.test index f1c4242..33316a7 100644 --- a/modules/nf-core/multiqc/tests/main.nf.test +++ b/modules/nf-core/multiqc/tests/main.nf.test @@ -8,6 +8,8 @@ nextflow_process { tag "modules_nfcore" tag "multiqc" + config "./nextflow.config" + test("sarscov2 single-end [fastqc]") { when { @@ -17,6 +19,8 @@ nextflow_process { input[1] = [] input[2] = [] input[3] = [] + input[4] = [] + input[5] = [] """ } } @@ -41,6 +45,8 @@ nextflow_process { input[1] = Channel.of(file("https://github.com/nf-core/tools/raw/dev/nf_core/pipeline-template/assets/multiqc_config.yml", checkIfExists: true)) input[2] = [] input[3] = [] + input[4] = [] + input[5] = [] """ } } @@ -66,6 +72,8 @@ nextflow_process { input[1] = [] input[2] = [] input[3] = [] + input[4] = [] + input[5] = [] """ } } diff --git a/modules/nf-core/multiqc/tests/main.nf.test.snap b/modules/nf-core/multiqc/tests/main.nf.test.snap index bfebd80..ee01208 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,21f35ee29416b9b3073c28733efe4b7d" + "versions.yml:md5,4cab99fb04e679fd2d72e29eda1b9646" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-29T08:48:55.657331" + "timestamp": "2024-10-02T17:51:46.317523" }, "multiqc_stub": { "content": [ @@ -17,25 +17,25 @@ "multiqc_report.html", "multiqc_data", "multiqc_plots", - "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + "versions.yml:md5,4cab99fb04e679fd2d72e29eda1b9646" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-29T08:49:49.071937" + "timestamp": "2024-10-02T17:52:20.680978" }, "multiqc_versions_config": { "content": [ [ - "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + "versions.yml:md5,4cab99fb04e679fd2d72e29eda1b9646" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-29T08:49:25.457567" + "timestamp": "2024-10-02T17:52:09.185842" } } \ No newline at end of file diff --git a/modules/nf-core/multiqc/tests/nextflow.config b/modules/nf-core/multiqc/tests/nextflow.config new file mode 100644 index 0000000..c537a6a --- /dev/null +++ b/modules/nf-core/multiqc/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'MULTIQC' { + ext.prefix = null + } +} diff --git a/modules/nf-core/picard/markduplicates/environment.yml b/modules/nf-core/picard/markduplicates/environment.yml index a27db11..1d715d5 100644 --- a/modules/nf-core/picard/markduplicates/environment.yml +++ b/modules/nf-core/picard/markduplicates/environment.yml @@ -1,7 +1,5 @@ -name: picard_markduplicates channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::picard=3.2.0 + - bioconda::picard=3.3.0 diff --git a/modules/nf-core/picard/markduplicates/main.nf b/modules/nf-core/picard/markduplicates/main.nf index cf18ac3..8a2ed64 100644 --- a/modules/nf-core/picard/markduplicates/main.nf +++ b/modules/nf-core/picard/markduplicates/main.nf @@ -4,8 +4,8 @@ process PICARD_MARKDUPLICATES { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/picard:3.2.0--hdfd78af_0' : - 'biocontainers/picard:3.2.0--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/picard:3.3.0--hdfd78af_0' : + 'biocontainers/picard:3.3.0--hdfd78af_0' }" input: tuple val(meta), path(reads) diff --git a/modules/nf-core/picard/markduplicates/meta.yml b/modules/nf-core/picard/markduplicates/meta.yml index 1f0ffe1..bcaf916 100644 --- a/modules/nf-core/picard/markduplicates/meta.yml +++ b/modules/nf-core/picard/markduplicates/meta.yml @@ -15,60 +15,82 @@ tools: homepage: https://broadinstitute.github.io/picard/ documentation: https://broadinstitute.github.io/picard/ licence: ["MIT"] + identifier: biotools:picard_tools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - reads: - type: file - description: Sequence reads file, can be SAM/BAM/CRAM format - pattern: "*.{bam,cram,sam}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: Reference genome fasta file, required for CRAM input - pattern: "*.{fasta,fa}" - - meta3: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fai: - type: file - description: Reference genome fasta index - pattern: "*.{fai}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Sequence reads file, can be SAM/BAM/CRAM format + pattern: "*.{bam,cram,sam}" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: Reference genome fasta file, required for CRAM input + pattern: "*.{fasta,fa}" + - - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fai: + type: file + description: Reference genome fasta index + pattern: "*.{fai}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - bam: - type: file - description: BAM file with duplicate reads marked/removed - pattern: "*.{bam}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bam": + type: file + description: BAM file with duplicate reads marked/removed + pattern: "*.{bam}" - bai: - type: file - description: An optional BAM index file. If desired, --CREATE_INDEX must be passed as a flag - pattern: "*.{bai}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bai": + type: file + description: An optional BAM index file. If desired, --CREATE_INDEX must be + passed as a flag + pattern: "*.{bai}" - cram: - type: file - description: Output CRAM file - pattern: "*.{cram}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.cram": + type: file + description: Output CRAM file + pattern: "*.{cram}" - metrics: - type: file - description: Duplicate metrics file generated by picard - pattern: "*.{metrics.txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.metrics.txt": + type: file + description: Duplicate metrics file generated by picard + pattern: "*.{metrics.txt}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@projectoriented" diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test b/modules/nf-core/picard/markduplicates/tests/main.nf.test index e3e97f6..9ed9096 100644 --- a/modules/nf-core/picard/markduplicates/tests/main.nf.test +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test @@ -27,9 +27,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.bam[0][1]).name).match("unsorted_bam_name") }, - { assert snapshot(path(process.out.metrics.get(0).get(1)).readLines()[0..2]).match("unsorted_bam_metrics") }, - { assert snapshot(process.out.versions).match("unsorted_bam_versions") } + { assert snapshot( + file(process.out.bam[0][1]).name, + path(process.out.metrics.get(0).get(1)).readLines()[0..2], + process.out.versions) + .match() } ) } } @@ -52,9 +54,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.bam[0][1]).name).match("sorted_bam_name") }, - { assert snapshot(path(process.out.metrics.get(0).get(1)).readLines()[0..2]).match("sorted_bam_metrics") }, - { assert snapshot(process.out.versions).match("sorted_bam_versions") } + { assert snapshot( + file(process.out.bam[0][1]).name, + path(process.out.metrics.get(0).get(1)).readLines()[0..2], + process.out.versions) + .match() } ) } } @@ -83,9 +87,86 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.cram[0][1]).name).match("cram_name") }, - { assert snapshot(path(process.out.metrics.get(0).get(1)).readLines()[0..2]).match("cram_metrics") }, - { assert snapshot(process.out.versions).match("cram_versions") } + { assert snapshot( + file(process.out.cram[0][1]).name, + path(process.out.metrics.get(0).get(1)).readLines()[0..2], + process.out.versions) + .match() } + ) + } + } + + test("sarscov2 [unsorted bam] - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) + ]) + input[1] = [ [:], [] ] + input[2] = [ [:], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("sarscov2 [sorted bam] - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + input[1] = [ [:], [] ] + input[2] = [ [:], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("homo_sapiens [cram] - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = Channel.of([ + [ id:'genome' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap index 24a57d0..13770a8 100644 --- a/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap +++ b/modules/nf-core/picard/markduplicates/tests/main.nf.test.snap @@ -1,110 +1,251 @@ { - "sorted_bam_versions": { + "sarscov2 [sorted bam] - stub": { "content": [ - [ - "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,88717faa02b215b99eef3d05214a6fea" + ], + "bai": [ + + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + + ], + "metrics": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,88717faa02b215b99eef3d05214a6fea" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-07-10T09:49:13.838237323" + "timestamp": "2024-10-18T10:58:50.046420643" }, - "unsorted_bam_name": { + "sarscov2 [unsorted bam] - stub": { "content": [ - "test.marked.bam" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,88717faa02b215b99eef3d05214a6fea" + ], + "bai": [ + + ], + "bam": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + + ], + "metrics": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,88717faa02b215b99eef3d05214a6fea" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-01-19T10:26:28.100755" + "timestamp": "2024-10-18T10:58:36.738907079" }, - "cram_metrics": { + "sarscov2 [unsorted bam]": { "content": [ + "test.marked.bam", [ "## htsjdk.samtools.metrics.StringHeader", - "# MarkDuplicates --INPUT test.paired_end.sorted.cram --OUTPUT test.marked.cram --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_DUP_STRATEGY FLOW_QUALITY_SUM_STRATEGY --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --UNPAIRED_START_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "# MarkDuplicates --INPUT test.paired_end.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_DUP_STRATEGY FLOW_QUALITY_SUM_STRATEGY --FLOW_USE_END_IN_UNPAIRED_READS false --FLOW_USE_UNPAIRED_CLIPPED_END false --FLOW_UNPAIRED_END_UNCERTAINTY 0 --FLOW_UNPAIRED_START_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,88717faa02b215b99eef3d05214a6fea" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-07-10T09:49:32.685023439" + "timestamp": "2024-10-18T10:57:16.683233382" }, - "sorted_bam_metrics": { + "sarscov2 [sorted bam]": { "content": [ + "test.marked.bam", [ "## htsjdk.samtools.metrics.StringHeader", - "# MarkDuplicates --INPUT test.paired_end.sorted.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_DUP_STRATEGY FLOW_QUALITY_SUM_STRATEGY --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --UNPAIRED_START_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "# MarkDuplicates --INPUT test.paired_end.sorted.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_DUP_STRATEGY FLOW_QUALITY_SUM_STRATEGY --FLOW_USE_END_IN_UNPAIRED_READS false --FLOW_USE_UNPAIRED_CLIPPED_END false --FLOW_UNPAIRED_END_UNCERTAINTY 0 --FLOW_UNPAIRED_START_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", "## htsjdk.samtools.metrics.StringHeader" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-07-10T09:49:13.788936246" - }, - "cram_name": { - "content": [ - "test.marked.cram" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-03-20T15:25:47.459663" - }, - "cram_versions": { - "content": [ + ], [ - "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" + "versions.yml:md5,88717faa02b215b99eef3d05214a6fea" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-07-10T09:49:32.731312566" + "timestamp": "2024-10-18T10:57:47.416956759" }, - "unsorted_bam_versions": { - "content": [ - [ - "versions.yml:md5,33dd4b32140e801e0d2e50aeefd0788d" - ] - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" - }, - "timestamp": "2024-07-10T09:48:57.466503381" - }, - "unsorted_bam_metrics": { + "homo_sapiens [cram]": { "content": [ + "test.marked.cram", [ "## htsjdk.samtools.metrics.StringHeader", - "# MarkDuplicates --INPUT test.paired_end.bam --OUTPUT test.marked.bam --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_DUP_STRATEGY FLOW_QUALITY_SUM_STRATEGY --USE_END_IN_UNPAIRED_READS false --USE_UNPAIRED_CLIPPED_END false --UNPAIRED_END_UNCERTAINTY 0 --UNPAIRED_START_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", + "# MarkDuplicates --INPUT test.paired_end.sorted.cram --OUTPUT test.marked.cram --METRICS_FILE test.marked.MarkDuplicates.metrics.txt --ASSUME_SORT_ORDER queryname --REFERENCE_SEQUENCE genome.fasta --MAX_SEQUENCES_FOR_DISK_READ_ENDS_MAP 50000 --MAX_FILE_HANDLES_FOR_READ_ENDS_MAP 8000 --SORTING_COLLECTION_SIZE_RATIO 0.25 --TAG_DUPLICATE_SET_MEMBERS false --REMOVE_SEQUENCING_DUPLICATES false --TAGGING_POLICY DontTag --CLEAR_DT true --DUPLEX_UMI false --FLOW_MODE false --FLOW_DUP_STRATEGY FLOW_QUALITY_SUM_STRATEGY --FLOW_USE_END_IN_UNPAIRED_READS false --FLOW_USE_UNPAIRED_CLIPPED_END false --FLOW_UNPAIRED_END_UNCERTAINTY 0 --FLOW_UNPAIRED_START_UNCERTAINTY 0 --FLOW_SKIP_FIRST_N_FLOWS 0 --FLOW_Q_IS_KNOWN_END false --FLOW_EFFECTIVE_QUALITY_THRESHOLD 15 --ADD_PG_TAG_TO_READS true --REMOVE_DUPLICATES false --ASSUME_SORTED false --DUPLICATE_SCORING_STRATEGY SUM_OF_BASE_QUALITIES --PROGRAM_RECORD_ID MarkDuplicates --PROGRAM_GROUP_NAME MarkDuplicates --READ_NAME_REGEX --OPTICAL_DUPLICATE_PIXEL_DISTANCE 100 --MAX_OPTICAL_DUPLICATE_SET_SIZE 300000 --VERBOSITY INFO --QUIET false --VALIDATION_STRINGENCY STRICT --COMPRESSION_LEVEL 5 --MAX_RECORDS_IN_RAM 500000 --CREATE_INDEX false --CREATE_MD5_FILE false --help false --version false --showHidden false --USE_JDK_DEFLATER false --USE_JDK_INFLATER false", "## htsjdk.samtools.metrics.StringHeader" + ], + [ + "versions.yml:md5,88717faa02b215b99eef3d05214a6fea" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.2" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-07-10T09:48:57.387579606" + "timestamp": "2024-10-18T10:58:15.143314223" }, - "sorted_bam_name": { + "homo_sapiens [cram] - stub": { "content": [ - "test.marked.bam" + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,88717faa02b215b99eef3d05214a6fea" + ], + "bai": [ + + ], + "bam": [ + + ], + "cram": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "metrics": [ + [ + { + "id": "test", + "single_end": false + }, + "test.marked.MarkDuplicates.metrics.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,88717faa02b215b99eef3d05214a6fea" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-01-19T10:26:45.080116" + "timestamp": "2024-10-18T10:59:03.402916523" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/coverage/environment.yml b/modules/nf-core/samtools/coverage/environment.yml index b5e6b99..62054fc 100644 --- a/modules/nf-core/samtools/coverage/environment.yml +++ b/modules/nf-core/samtools/coverage/environment.yml @@ -1,8 +1,8 @@ -name: samtools_coverage +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/coverage/main.nf b/modules/nf-core/samtools/coverage/main.nf index 2f1091f..a6d8a2e 100644 --- a/modules/nf-core/samtools/coverage/main.nf +++ b/modules/nf-core/samtools/coverage/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_COVERAGE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(input), path(input_index) @@ -37,7 +37,6 @@ process SAMTOOLS_COVERAGE { """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}.txt diff --git a/modules/nf-core/samtools/coverage/meta.yml b/modules/nf-core/samtools/coverage/meta.yml index e74082d..fb9ba6f 100644 --- a/modules/nf-core/samtools/coverage/meta.yml +++ b/modules/nf-core/samtools/coverage/meta.yml @@ -14,47 +14,56 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - input_index: - type: file - description: BAM/CRAM index file - pattern: "*.{bai,crai}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: Reference genome file - pattern: "*.{fa,fasta}" - - fai: - type: file - description: Reference genome index file - pattern: "*.fai" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - input_index: + type: file + description: BAM/CRAM index file + pattern: "*.{bai,crai}" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: Reference genome file + pattern: "*.{fa,fasta}" + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - fai: + type: file + description: Reference genome index file + pattern: "*.fai" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - coverage: - type: file - description: Tabulated text containing the coverage at each position or region or an ASCII-art histogram (with --histogram). - pattern: "*.txt" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.txt": + type: file + description: Tabulated text containing the coverage at each position or region + or an ASCII-art histogram (with --histogram). + pattern: "*.txt" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@LouisLeNezet" maintainers: diff --git a/modules/nf-core/samtools/coverage/tests/main.nf.test.snap b/modules/nf-core/samtools/coverage/tests/main.nf.test.snap index cc3ce01..b9ddb18 100644 --- a/modules/nf-core/samtools/coverage/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/coverage/tests/main.nf.test.snap @@ -12,7 +12,7 @@ ] ], "1": [ - "versions.yml:md5,56e1239217405837de88af882d9d68f6" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ], "coverage": [ [ @@ -24,15 +24,15 @@ ] ], "versions": [ - "versions.yml:md5,56e1239217405837de88af882d9d68f6" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-29T11:08:03.724132" + "timestamp": "2024-09-16T07:53:42.773351407" }, "test_samtools_coverage_bam": { "content": [ @@ -47,7 +47,7 @@ ] ], "1": [ - "versions.yml:md5,56e1239217405837de88af882d9d68f6" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ], "coverage": [ [ @@ -59,15 +59,15 @@ ] ], "versions": [ - "versions.yml:md5,56e1239217405837de88af882d9d68f6" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-29T11:36:30.272862" + "timestamp": "2024-09-16T07:53:22.798338025" }, "test_samtools_coverage_cram": { "content": [ @@ -82,7 +82,7 @@ ] ], "1": [ - "versions.yml:md5,56e1239217405837de88af882d9d68f6" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ], "coverage": [ [ @@ -94,14 +94,14 @@ ] ], "versions": [ - "versions.yml:md5,56e1239217405837de88af882d9d68f6" + "versions.yml:md5,9c876b9db54dc710c87c404e4b28243c" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-29T11:39:08.488488" + "timestamp": "2024-09-16T07:53:32.409876082" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/depth/environment.yml b/modules/nf-core/samtools/depth/environment.yml index 3fd0e7c..62054fc 100644 --- a/modules/nf-core/samtools/depth/environment.yml +++ b/modules/nf-core/samtools/depth/environment.yml @@ -1,8 +1,8 @@ -name: samtools_depth +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/depth/main.nf b/modules/nf-core/samtools/depth/main.nf index c93a1d9..5a9c1b1 100644 --- a/modules/nf-core/samtools/depth/main.nf +++ b/modules/nf-core/samtools/depth/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_DEPTH { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta1), path(bam) diff --git a/modules/nf-core/samtools/depth/meta.yml b/modules/nf-core/samtools/depth/meta.yml index bc51f26..2acd645 100644 --- a/modules/nf-core/samtools/depth/meta.yml +++ b/modules/nf-core/samtools/depth/meta.yml @@ -7,45 +7,51 @@ keywords: - coverage tools: - samtools: - description: Tools for dealing with SAM, BAM and CRAM files; samtools depth – computes the read depth at each position or region + description: Tools for dealing with SAM, BAM and CRAM files; samtools depth – + computes the read depth at each position or region homepage: http://www.htslib.org documentation: http://www.htslib.org/doc/samtools-depth.html tool_dev_url: https://github.com/samtools/samtools doi: "10.1093/bioinformatics/btp352" licence: ["MIT"] + identifier: biotools:samtools input: - - meta1: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: sorted BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - meta2: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test' ] - - intervals: - type: file - description: list of positions or regions in specified bed file - pattern: "*.{bed}" + - - meta1: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] + - intervals: + type: file + description: list of positions or regions in specified bed file + pattern: "*.{bed}" output: - - meta1: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - tsv: - type: file - description: The output of samtools depth has three columns - the name of the contig or chromosome, the position and the number of reads aligned at that position - pattern: "*.{tsv}" + - meta1: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tsv": + type: file + description: The output of samtools depth has three columns - the name of the + contig or chromosome, the position and the number of reads aligned at that + position + pattern: "*.{tsv}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@louperelo" - "@nevinwu" diff --git a/modules/nf-core/samtools/depth/samtools-depth.diff b/modules/nf-core/samtools/depth/samtools-depth.diff index d10a4ec..3ba7796 100644 --- a/modules/nf-core/samtools/depth/samtools-depth.diff +++ b/modules/nf-core/samtools/depth/samtools-depth.diff @@ -1,4 +1,5 @@ -Changes in module 'nf-core/samtools/depth' +Changes in component 'nf-core/samtools/depth' +Changes in 'samtools/depth/main.nf': --- modules/nf-core/samtools/depth/main.nf +++ modules/nf-core/samtools/depth/main.nf @@ -1,5 +1,5 @@ @@ -48,4 +49,8 @@ Changes in module 'nf-core/samtools/depth' cat <<-END_VERSIONS > versions.yml "${task.process}": +'modules/nf-core/samtools/depth/environment.yml' is unchanged +'modules/nf-core/samtools/depth/meta.yml' is unchanged +'modules/nf-core/samtools/depth/tests/main.nf.test.snap' is unchanged +'modules/nf-core/samtools/depth/tests/main.nf.test' is unchanged ************************************************************ diff --git a/modules/nf-core/samtools/depth/tests/main.nf.test b/modules/nf-core/samtools/depth/tests/main.nf.test new file mode 100644 index 0000000..ddacb54 --- /dev/null +++ b/modules/nf-core/samtools/depth/tests/main.nf.test @@ -0,0 +1,62 @@ + +nextflow_process { + + name "Test Process SAMTOOLS_DEPTH" + script "../main.nf" + process "SAMTOOLS_DEPTH" + + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/depth" + + test("test-samtools-depth") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) + ] + input[1] = [[],[]] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-samtools-depth-intervals") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) + ] + input[1] = [ + [ id:'bed' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/samtools/depth/tests/main.nf.test.snap b/modules/nf-core/samtools/depth/tests/main.nf.test.snap new file mode 100644 index 0000000..f5523cb --- /dev/null +++ b/modules/nf-core/samtools/depth/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "test-samtools-depth-intervals": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,a89e2f8e1b66356c7500599fcadb8784" + ] + ], + "1": [ + "versions.yml:md5,8a21701d45a94582920fea7e0ba15eec" + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,a89e2f8e1b66356c7500599fcadb8784" + ] + ], + "versions": [ + "versions.yml:md5,8a21701d45a94582920fea7e0ba15eec" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T07:55:28.207892316" + }, + "test-samtools-depth": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,722d2c060944d6b96ae5ae00d8074657" + ] + ], + "1": [ + "versions.yml:md5,8a21701d45a94582920fea7e0ba15eec" + ], + "tsv": [ + [ + { + "id": "test", + "single_end": false + }, + "test.tsv:md5,722d2c060944d6b96ae5ae00d8074657" + ] + ], + "versions": [ + "versions.yml:md5,8a21701d45a94582920fea7e0ba15eec" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T07:55:17.233534429" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/faidx/environment.yml b/modules/nf-core/samtools/faidx/environment.yml index 9c24eb0..62054fc 100644 --- a/modules/nf-core/samtools/faidx/environment.yml +++ b/modules/nf-core/samtools/faidx/environment.yml @@ -1,10 +1,8 @@ -name: samtools_faidx - +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults - dependencies: - - bioconda::htslib=1.19.1 - - bioconda::samtools=1.19.2 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/faidx/main.nf b/modules/nf-core/samtools/faidx/main.nf index cfe7ad9..28c0a81 100644 --- a/modules/nf-core/samtools/faidx/main.nf +++ b/modules/nf-core/samtools/faidx/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_FAIDX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(fasta) diff --git a/modules/nf-core/samtools/faidx/meta.yml b/modules/nf-core/samtools/faidx/meta.yml index f3c25de..6721b2c 100644 --- a/modules/nf-core/samtools/faidx/meta.yml +++ b/modules/nf-core/samtools/faidx/meta.yml @@ -14,47 +14,62 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test' ] - - fasta: - type: file - description: FASTA file - pattern: "*.{fa,fasta}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'test' ] - - fai: - type: file - description: FASTA index file - pattern: "*.{fai}" + - - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - fasta: + type: file + description: FASTA file + pattern: "*.{fa,fasta}" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] + - fai: + type: file + description: FASTA index file + pattern: "*.{fai}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - fa: - type: file - description: FASTA file - pattern: "*.{fa}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.{fa,fasta}": + type: file + description: FASTA file + pattern: "*.{fa}" - fai: - type: file - description: FASTA index file - pattern: "*.{fai}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.fai": + type: file + description: FASTA index file + pattern: "*.{fai}" - gzi: - type: file - description: Optional gzip index file for compressed inputs - pattern: "*.gzi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.gzi": + type: file + description: Optional gzip index file for compressed inputs + pattern: "*.gzi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/nf-core/samtools/faidx/tests/main.nf.test b/modules/nf-core/samtools/faidx/tests/main.nf.test index 136b212..17244ef 100644 --- a/modules/nf-core/samtools/faidx/tests/main.nf.test +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_process { process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = [[],[]] """ @@ -27,7 +27,7 @@ nextflow_process { { assert process.success }, { assert snapshot(process.out).match() } ) - } + } } test("test_samtools_faidx_bgzip") { @@ -36,7 +36,7 @@ nextflow_process { process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta_gz'], checkIfExists: true) ] + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)] input[1] = [[],[]] """ @@ -48,7 +48,7 @@ nextflow_process { { assert process.success }, { assert snapshot(process.out).match() } ) - } + } } test("test_samtools_faidx_fasta") { @@ -59,10 +59,10 @@ nextflow_process { process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) ] + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] """ } } @@ -72,7 +72,7 @@ nextflow_process { { assert process.success }, { assert snapshot(process.out).match() } ) - } + } } test("test_samtools_faidx_stub_fasta") { @@ -83,10 +83,10 @@ nextflow_process { process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta_fai'], checkIfExists: true) ] + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] """ } } @@ -96,7 +96,7 @@ nextflow_process { { assert process.success }, { assert snapshot(process.out).match() } ) - } + } } test("test_samtools_faidx_stub_fai") { @@ -105,7 +105,7 @@ nextflow_process { process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ] + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[1] = [[],[]] """ @@ -117,7 +117,6 @@ nextflow_process { { assert process.success }, { assert snapshot(process.out).match() } ) - } + } } - } \ No newline at end of file diff --git a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap index 3e651ef..1bbb3ec 100644 --- a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap @@ -18,7 +18,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ @@ -36,15 +36,15 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-18T16:22:39.412601" + "timestamp": "2024-09-16T07:57:47.450887871" }, "test_samtools_faidx_bgzip": { "content": [ @@ -71,7 +71,7 @@ ] ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ @@ -95,15 +95,15 @@ ] ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-18T16:23:22.427966" + "timestamp": "2024-09-16T07:58:04.804905659" }, "test_samtools_faidx_fasta": { "content": [ @@ -124,7 +124,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ [ @@ -142,15 +142,15 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-18T16:24:04.107537" + "timestamp": "2024-09-16T07:58:23.831268154" }, "test_samtools_faidx_stub_fasta": { "content": [ @@ -171,7 +171,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ [ @@ -189,15 +189,15 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-18T16:24:45.868463" + "timestamp": "2024-09-16T07:58:35.600243706" }, "test_samtools_faidx_stub_fai": { "content": [ @@ -218,7 +218,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ], "fa": [ @@ -236,14 +236,14 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,6bbe80a2e14bd61202ca63e12d66027f" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-18T16:25:27.550554" + "timestamp": "2024-09-16T07:58:54.705460167" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/flagstat/environment.yml b/modules/nf-core/samtools/flagstat/environment.yml index bd57cb5..62054fc 100644 --- a/modules/nf-core/samtools/flagstat/environment.yml +++ b/modules/nf-core/samtools/flagstat/environment.yml @@ -1,8 +1,8 @@ -name: samtools_flagstat +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/flagstat/main.nf b/modules/nf-core/samtools/flagstat/main.nf index eb5f525..c23f3a5 100644 --- a/modules/nf-core/samtools/flagstat/main.nf +++ b/modules/nf-core/samtools/flagstat/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_FLAGSTAT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(bam), path(bai) @@ -18,7 +18,6 @@ process SAMTOOLS_FLAGSTAT { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ samtools \\ diff --git a/modules/nf-core/samtools/flagstat/meta.yml b/modules/nf-core/samtools/flagstat/meta.yml index 9799135..cdc4c25 100644 --- a/modules/nf-core/samtools/flagstat/meta.yml +++ b/modules/nf-core/samtools/flagstat/meta.yml @@ -1,5 +1,6 @@ name: samtools_flagstat -description: Counts the number of alignments in a BAM/CRAM/SAM file for each FLAG type +description: Counts the number of alignments in a BAM/CRAM/SAM file for each FLAG + type keywords: - stats - mapping @@ -17,34 +18,37 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - bai: - type: file - description: Index for BAM/CRAM/SAM file - pattern: "*.{bai,crai,sai}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - bai: + type: file + description: Index for BAM/CRAM/SAM file + pattern: "*.{bai,crai,sai}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - flagstat: - type: file - description: File containing samtools flagstat output - pattern: "*.{flagstat}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.flagstat": + type: file + description: File containing samtools flagstat output + pattern: "*.{flagstat}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" maintainers: diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test b/modules/nf-core/samtools/flagstat/tests/main.nf.test index 24c3c04..3b648a3 100644 --- a/modules/nf-core/samtools/flagstat/tests/main.nf.test +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test @@ -11,9 +11,30 @@ nextflow_process { test("BAM") { when { - params { - outdir = "$outputDir" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]) + """ } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("BAM - stub") { + + options "-stub" + + when { process { """ input[0] = Channel.of([ @@ -28,8 +49,7 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.flagstat).match("flagstat") }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap index a76fc27..04c3852 100644 --- a/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/flagstat/tests/main.nf.test.snap @@ -1,32 +1,72 @@ { - "flagstat": { + "BAM - stub": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,108a155f2d4a99f50bf3176904208d27" + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,108a155f2d4a99f50bf3176904208d27" ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-12T18:31:37.783927" + "timestamp": "2024-09-16T08:02:58.866491759" }, - "versions": { + "BAM": { "content": [ - [ - "versions.yml:md5,fd0030ce49ab3a92091ad80260226452" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ], + "1": [ + "versions.yml:md5,108a155f2d4a99f50bf3176904208d27" + ], + "flagstat": [ + [ + { + "id": "test", + "single_end": false + }, + "test.flagstat:md5,4f7ffd1e6a5e85524d443209ac97d783" + ] + ], + "versions": [ + "versions.yml:md5,108a155f2d4a99f50bf3176904208d27" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-13T16:11:44.299617452" + "timestamp": "2024-09-16T08:02:47.383332837" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/idxstats/environment.yml b/modules/nf-core/samtools/idxstats/environment.yml index 174973b..62054fc 100644 --- a/modules/nf-core/samtools/idxstats/environment.yml +++ b/modules/nf-core/samtools/idxstats/environment.yml @@ -1,8 +1,8 @@ -name: samtools_idxstats +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/idxstats/main.nf b/modules/nf-core/samtools/idxstats/main.nf index a544026..e2bb6b2 100644 --- a/modules/nf-core/samtools/idxstats/main.nf +++ b/modules/nf-core/samtools/idxstats/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_IDXSTATS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(bam), path(bai) @@ -18,7 +18,6 @@ process SAMTOOLS_IDXSTATS { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ diff --git a/modules/nf-core/samtools/idxstats/meta.yml b/modules/nf-core/samtools/idxstats/meta.yml index 344e92a..f0a6bcb 100644 --- a/modules/nf-core/samtools/idxstats/meta.yml +++ b/modules/nf-core/samtools/idxstats/meta.yml @@ -18,34 +18,37 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" - - bai: - type: file - description: Index for BAM/CRAM/SAM file - pattern: "*.{bai,crai,sai}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - bam: + type: file + description: BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - bai: + type: file + description: Index for BAM/CRAM/SAM file + pattern: "*.{bai,crai,sai}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - idxstats: - type: file - description: File containing samtools idxstats output - pattern: "*.{idxstats}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.idxstats": + type: file + description: File containing samtools idxstats output + pattern: "*.{idxstats}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" maintainers: diff --git a/modules/nf-core/samtools/idxstats/tests/main.nf.test b/modules/nf-core/samtools/idxstats/tests/main.nf.test index a2dcb27..5fd1fc7 100644 --- a/modules/nf-core/samtools/idxstats/tests/main.nf.test +++ b/modules/nf-core/samtools/idxstats/tests/main.nf.test @@ -11,9 +11,6 @@ nextflow_process { test("bam") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -28,9 +25,29 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.idxstats).match("idxstats") }, - { assert snapshot(process.out.versions).match("versions") } + { assert snapshot(process.out).match() } ) } } -} + + test("bam - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + }} diff --git a/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap b/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap index a7050bd..2cc89a3 100644 --- a/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/idxstats/tests/main.nf.test.snap @@ -1,32 +1,72 @@ { - "versions": { + "bam - stub": { "content": [ - [ - "versions.yml:md5,613dde56f108418039ffcdeeddba397a" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,c8d7394830c3c1e5be150589571534fb" + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,c8d7394830c3c1e5be150589571534fb" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-13T16:16:50.147462763" + "timestamp": "2024-09-16T08:11:56.466856235" }, - "idxstats": { + "bam": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + ] + ], + "1": [ + "versions.yml:md5,c8d7394830c3c1e5be150589571534fb" + ], + "idxstats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.idxstats:md5,df60a8c8d6621100d05178c93fb053a2" + ] + ], + "versions": [ + "versions.yml:md5,c8d7394830c3c1e5be150589571534fb" ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-12T18:36:41.561026" + "timestamp": "2024-09-16T08:11:46.311550359" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml index a5e5064..62054fc 100644 --- a/modules/nf-core/samtools/index/environment.yml +++ b/modules/nf-core/samtools/index/environment.yml @@ -1,8 +1,8 @@ -name: samtools_index +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf index dc14f98..3117561 100644 --- a/modules/nf-core/samtools/index/main.nf +++ b/modules/nf-core/samtools/index/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_INDEX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(input) @@ -35,10 +35,11 @@ process SAMTOOLS_INDEX { """ stub: + def args = task.ext.args ?: '' + def extension = file(input).getExtension() == 'cram' ? + "crai" : args.contains("-c") ? "csi" : "bai" """ - touch ${input}.bai - touch ${input}.crai - touch ${input}.csi + touch ${input}.${extension} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/samtools/index/meta.yml b/modules/nf-core/samtools/index/meta.yml index 01a4ee0..db8df0d 100644 --- a/modules/nf-core/samtools/index/meta.yml +++ b/modules/nf-core/samtools/index/meta.yml @@ -15,38 +15,52 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - bam: - type: file - description: BAM/CRAM/SAM file - pattern: "*.{bam,cram,sam}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: input file output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - bai: - type: file - description: BAM/CRAM/SAM index file - pattern: "*.{bai,crai,sai}" - - crai: - type: file - description: BAM/CRAM/SAM index file - pattern: "*.{bai,crai,sai}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bai": + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" - csi: - type: file - description: CSI index file - pattern: "*.{csi}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: CSI index file + pattern: "*.{csi}" + - crai: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.crai": + type: file + description: BAM/CRAM/SAM index file + pattern: "*.{bai,crai,sai}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/nf-core/samtools/index/tests/main.nf.test b/modules/nf-core/samtools/index/tests/main.nf.test index bb7756d..ca34fb5 100644 --- a/modules/nf-core/samtools/index/tests/main.nf.test +++ b/modules/nf-core/samtools/index/tests/main.nf.test @@ -9,11 +9,7 @@ nextflow_process { tag "samtools/index" test("bai") { - when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -27,18 +23,13 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.bai).match("bai") }, - { assert snapshot(process.out.versions).match("bai_versions") } + { assert snapshot(process.out).match() } ) } } test("crai") { - when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -52,20 +43,83 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.crai).match("crai") }, - { assert snapshot(process.out.versions).match("crai_versions") } + { assert snapshot(process.out).match() } ) } } test("csi") { - config "./csi.nextflow.config" when { - params { - outdir = "$outputDir" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + file(process.out.csi[0][1]).name, + process.out.versions + ).match() } + ) + } + } + + test("bai - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("crai - stub") { + options "-stub" + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true) + ]) + """ } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("csi - stub") { + options "-stub" + config "./csi.nextflow.config" + + when { process { """ input[0] = Channel.of([ @@ -79,8 +133,7 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert path(process.out.csi.get(0).get(1)).exists() }, - { assert snapshot(process.out.versions).match("csi_versions") } + { assert snapshot(process.out).match() } ) } } diff --git a/modules/nf-core/samtools/index/tests/main.nf.test.snap b/modules/nf-core/samtools/index/tests/main.nf.test.snap index 3dc8e7d..72d65e8 100644 --- a/modules/nf-core/samtools/index/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/index/tests/main.nf.test.snap @@ -1,74 +1,250 @@ { - "crai_versions": { + "csi - stub": { "content": [ - [ - "versions.yml:md5,cc4370091670b64bba7c7206403ffb3e" - ] + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + + ], + "crai": [ + + ], + "csi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-13T16:12:00.324667957" + "timestamp": "2024-09-16T08:21:25.261127166" }, - "csi_versions": { + "crai - stub": { "content": [ - [ - "versions.yml:md5,cc4370091670b64bba7c7206403ffb3e" - ] + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-13T16:12:07.885103162" + "timestamp": "2024-09-16T08:21:12.653194876" }, - "crai": { + "bai - stub": { "content": [ - [ - [ - { - "id": "test", - "single_end": false - }, - "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-12T18:41:38.446424" + "timestamp": "2024-09-16T08:21:01.854932651" }, - "bai": { + "csi": { "content": [ + "test.paired_end.sorted.bam.csi", [ - [ - { - "id": "test", - "single_end": false - }, - "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" - ] + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-12T18:40:46.579747" + "timestamp": "2024-09-16T08:20:51.485364222" }, - "bai_versions": { + "crai": { "content": [ - [ - "versions.yml:md5,cc4370091670b64bba7c7206403ffb3e" - ] + { + "0": [ + + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T08:20:40.518873972" + }, + "bai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ], + "crai": [ + + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,5e09a6fdf76de396728f877193d72315" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-13T16:11:51.641425452" + "timestamp": "2024-09-16T08:20:21.184050361" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/stats/environment.yml b/modules/nf-core/samtools/stats/environment.yml index 67bb0ca..62054fc 100644 --- a/modules/nf-core/samtools/stats/environment.yml +++ b/modules/nf-core/samtools/stats/environment.yml @@ -1,8 +1,8 @@ -name: samtools_stats +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::htslib=1.21 + - bioconda::samtools=1.21 diff --git a/modules/nf-core/samtools/stats/main.nf b/modules/nf-core/samtools/stats/main.nf index 52b00f4..4443948 100644 --- a/modules/nf-core/samtools/stats/main.nf +++ b/modules/nf-core/samtools/stats/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_STATS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : + 'biocontainers/samtools:1.21--h50ea8bc_0' }" input: tuple val(meta), path(input), path(input_index) @@ -19,7 +19,6 @@ process SAMTOOLS_STATS { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def reference = fasta ? "--reference ${fasta}" : "" """ diff --git a/modules/nf-core/samtools/stats/meta.yml b/modules/nf-core/samtools/stats/meta.yml index 735ff81..77b020f 100644 --- a/modules/nf-core/samtools/stats/meta.yml +++ b/modules/nf-core/samtools/stats/meta.yml @@ -16,43 +16,46 @@ tools: documentation: http://www.htslib.org/doc/samtools.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:samtools input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: BAM/CRAM file from alignment - pattern: "*.{bam,cram}" - - input_index: - type: file - description: BAI/CRAI file from alignment - pattern: "*.{bai,crai}" - - meta2: - type: map - description: | - Groovy Map containing reference information - e.g. [ id:'genome' ] - - fasta: - type: file - description: Reference file the CRAM was created with (optional) - pattern: "*.{fasta,fa}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: BAM/CRAM file from alignment + pattern: "*.{bam,cram}" + - input_index: + type: file + description: BAI/CRAI file from alignment + pattern: "*.{bai,crai}" + - - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'genome' ] + - fasta: + type: file + description: Reference file the CRAM was created with (optional) + pattern: "*.{fasta,fa}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - stats: - type: file - description: File containing samtools stats output - pattern: "*.{stats}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.stats": + type: file + description: File containing samtools stats output + pattern: "*.{stats}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@FriederikeHanssen" diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test b/modules/nf-core/samtools/stats/tests/main.nf.test index e3d5cb1..5bc8930 100644 --- a/modules/nf-core/samtools/stats/tests/main.nf.test +++ b/modules/nf-core/samtools/stats/tests/main.nf.test @@ -3,6 +3,7 @@ nextflow_process { name "Test Process SAMTOOLS_STATS" script "../main.nf" process "SAMTOOLS_STATS" + tag "modules" tag "modules_nfcore" tag "samtools" @@ -11,9 +12,6 @@ nextflow_process { test("bam") { when { - params { - outdir = "$outputDir" - } process { """ input[0] = Channel.of([ @@ -37,9 +35,59 @@ nextflow_process { test("cram") { when { - params { - outdir = "$outputDir" + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true) + ]) + input[1] = Channel.of([ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ]) + """ } + } + + then { + assertAll( + {assert process.success}, + {assert snapshot(process.out).match()} + ) + } + } + + test("bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true) + ]) + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + {assert process.success}, + {assert snapshot(process.out).match()} + ) + } + } + + test("cram - stub") { + + options "-stub" + + when { process { """ input[0] = Channel.of([ @@ -49,7 +97,7 @@ nextflow_process { ]) input[1] = Channel.of([ [ id:'genome' ], // meta map - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) ]) """ } diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test.snap b/modules/nf-core/samtools/stats/tests/main.nf.test.snap index 1b7c9ba..df507be 100644 --- a/modules/nf-core/samtools/stats/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/stats/tests/main.nf.test.snap @@ -8,11 +8,11 @@ "id": "test", "single_end": false }, - "test.stats:md5,01812900aa4027532906c5d431114233" + "test.stats:md5,a27fe55e49a341f92379bb20a65c6a06" ] ], "1": [ - "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" + "versions.yml:md5,15b91d8c0e0440332e0fe4df80957043" ], "stats": [ [ @@ -20,19 +20,89 @@ "id": "test", "single_end": false }, - "test.stats:md5,01812900aa4027532906c5d431114233" + "test.stats:md5,a27fe55e49a341f92379bb20a65c6a06" ] ], "versions": [ - "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" + "versions.yml:md5,15b91d8c0e0440332e0fe4df80957043" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-13T16:15:25.562429714" + "timestamp": "2024-09-16T09:29:16.767396182" + }, + "bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,15b91d8c0e0440332e0fe4df80957043" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,15b91d8c0e0440332e0fe4df80957043" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T09:29:29.721580274" + }, + "cram - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,15b91d8c0e0440332e0fe4df80957043" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,15b91d8c0e0440332e0fe4df80957043" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-16T09:29:53.567964304" }, "bam": { "content": [ @@ -43,11 +113,11 @@ "id": "test", "single_end": false }, - "test.stats:md5,5d8681bf541199898c042bf400391d59" + "test.stats:md5,d53a2584376d78942839e9933a34d11b" ] ], "1": [ - "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" + "versions.yml:md5,15b91d8c0e0440332e0fe4df80957043" ], "stats": [ [ @@ -55,18 +125,18 @@ "id": "test", "single_end": false }, - "test.stats:md5,5d8681bf541199898c042bf400391d59" + "test.stats:md5,d53a2584376d78942839e9933a34d11b" ] ], "versions": [ - "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" + "versions.yml:md5,15b91d8c0e0440332e0fe4df80957043" ] } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-02-13T16:15:07.857611509" + "timestamp": "2024-09-16T09:28:50.73610604" } } \ No newline at end of file diff --git a/modules/nf-core/snpeff/download/environment.yml b/modules/nf-core/snpeff/download/environment.yml index c5dc011..56ff06b 100644 --- a/modules/nf-core/snpeff/download/environment.yml +++ b/modules/nf-core/snpeff/download/environment.yml @@ -1,8 +1,6 @@ -name: snpeff_download channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::snpeff=5.2 - bioconda::tabix=1.11 diff --git a/modules/nf-core/snpeff/download/main.nf b/modules/nf-core/snpeff/download/main.nf index dfc2d33..97c1aa6 100644 --- a/modules/nf-core/snpeff/download/main.nf +++ b/modules/nf-core/snpeff/download/main.nf @@ -8,7 +8,7 @@ process SNPEFF_DOWNLOAD { 'biocontainers/mulled-v2-2fe536b56916bd1d61a6a1889eb2987d9ea0cd2f:c51b2e46bf63786b2d9a7a7d23680791163ab39a-0' }" input: - tuple val(meta), val(genome) + tuple val(meta), val(snpeff_db) output: tuple val(meta), path('snpeff_cache'), emit: cache @@ -28,7 +28,7 @@ process SNPEFF_DOWNLOAD { """ snpEff \\ -Xmx${avail_mem}M \\ - download ${genome} \\ + download ${snpeff_db} \\ -dataDir \${PWD}/snpeff_cache \\ ${args} @@ -41,7 +41,10 @@ process SNPEFF_DOWNLOAD { stub: """ - mkdir ${genome} + mkdir -p snpeff_cache/${snpeff_db} + + touch snpeff_cache/${snpeff_db}/sequence.I.bin + touch snpeff_cache/${snpeff_db}/sequence.bin cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/snpeff/download/meta.yml b/modules/nf-core/snpeff/download/meta.yml index f367c69..a3211fc 100644 --- a/modules/nf-core/snpeff/download/meta.yml +++ b/modules/nf-core/snpeff/download/meta.yml @@ -14,29 +14,35 @@ tools: homepage: https://pcingola.github.io/SnpEff/ documentation: https://pcingola.github.io/SnpEff/se_introduction/ licence: ["MIT"] + identifier: biotools:snpeff input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: | - vcf to annotate - - db: - type: string - description: | - which db to annotate with + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - genome: + type: file + description: Reference genome in FASTA format + pattern: "*.{fasta,fna,fa}" + - cache_version: + type: string + description: Version of the snpEff cache to download output: - cache: - type: file - description: | - snpEff cache + - meta: + type: file + description: | + snpEff cache + - snpeff_cache: + type: file + description: | + snpEff cache - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@maxulysse" maintainers: diff --git a/modules/nf-core/snpeff/download/snpeff-download.diff b/modules/nf-core/snpeff/download/snpeff-download.diff index d37a461..8e99b95 100644 --- a/modules/nf-core/snpeff/download/snpeff-download.diff +++ b/modules/nf-core/snpeff/download/snpeff-download.diff @@ -1,4 +1,5 @@ -Changes in module 'nf-core/snpeff/download' +Changes in component 'nf-core/snpeff/download' +Changes in 'snpeff/download/main.nf': --- modules/nf-core/snpeff/download/main.nf +++ modules/nf-core/snpeff/download/main.nf @@ -4,11 +4,11 @@ @@ -12,7 +13,7 @@ Changes in module 'nf-core/snpeff/download' input: - tuple val(meta), val(genome), val(cache_version) -+ tuple val(meta), val(genome) ++ tuple val(meta), val(snpeff_db) output: tuple val(meta), path('snpeff_cache'), emit: cache @@ -21,28 +22,94 @@ Changes in module 'nf-core/snpeff/download' snpEff \\ -Xmx${avail_mem}M \\ - download ${genome}.${cache_version} \\ -+ download ${genome} \\ ++ download ${snpeff_db} \\ -dataDir \${PWD}/snpeff_cache \\ ${args} -@@ -41,7 +41,7 @@ +@@ -41,7 +41,10 @@ stub: """ - mkdir ${genome}.${cache_version} -+ mkdir ${genome} ++ mkdir -p snpeff_cache/${snpeff_db} ++ ++ touch snpeff_cache/${snpeff_db}/sequence.I.bin ++ touch snpeff_cache/${snpeff_db}/sequence.bin cat <<-END_VERSIONS > versions.yml "${task.process}": +Changes in 'snpeff/download/environment.yml': --- modules/nf-core/snpeff/download/environment.yml +++ modules/nf-core/snpeff/download/environment.yml -@@ -4,4 +4,5 @@ +@@ -1,7 +1,6 @@ +-name: snpeff_download + channels: + - conda-forge - bioconda - - defaults +- - defaults dependencies: - - bioconda::snpeff=5.1 + - bioconda::snpeff=5.2 + - bioconda::tabix=1.11 +Changes in 'snpeff/download/meta.yml': +--- modules/nf-core/snpeff/download/meta.yml ++++ modules/nf-core/snpeff/download/meta.yml +@@ -14,29 +14,35 @@ + homepage: https://pcingola.github.io/SnpEff/ + documentation: https://pcingola.github.io/SnpEff/se_introduction/ + licence: ["MIT"] ++ identifier: biotools:snpeff + input: +- - meta: +- type: map +- description: | +- Groovy Map containing sample information +- e.g. [ id:'test', single_end:false ] +- - vcf: +- type: file +- description: | +- vcf to annotate +- - db: +- type: string +- description: | +- which db to annotate with ++ - - meta: ++ type: map ++ description: | ++ Groovy Map containing sample information ++ e.g. [ id:'test', single_end:false ] ++ - genome: ++ type: file ++ description: Reference genome in FASTA format ++ pattern: "*.{fasta,fna,fa}" ++ - cache_version: ++ type: string ++ description: Version of the snpEff cache to download + output: + - cache: +- type: file +- description: | +- snpEff cache ++ - meta: ++ type: file ++ description: | ++ snpEff cache ++ - snpeff_cache: ++ type: file ++ description: | ++ snpEff cache + - versions: +- type: file +- description: File containing software versions +- pattern: "versions.yml" ++ - versions.yml: ++ type: file ++ description: File containing software versions ++ pattern: "versions.yml" + authors: + - "@maxulysse" + maintainers: + ************************************************************ diff --git a/modules/nf-core/snpeff/snpeff/environment.yml b/modules/nf-core/snpeff/snpeff/environment.yml index dcdd311..56ff06b 100644 --- a/modules/nf-core/snpeff/snpeff/environment.yml +++ b/modules/nf-core/snpeff/snpeff/environment.yml @@ -1,8 +1,6 @@ -name: snpeff_snpeff channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::snpeff=5.2 - bioconda::tabix=1.11 diff --git a/modules/nf-core/snpeff/snpeff/main.nf b/modules/nf-core/snpeff/snpeff/main.nf index b2dfb51..9f6012f 100644 --- a/modules/nf-core/snpeff/snpeff/main.nf +++ b/modules/nf-core/snpeff/snpeff/main.nf @@ -11,7 +11,7 @@ process SNPEFF_SNPEFF { tuple val(meta), path(vcf) val db tuple val(meta2), path(cache) - tuple val(meta2), path(config) + tuple val(meta3), path(config) output: tuple val(meta), path("*.ann.vcf.gz"), emit: vcf diff --git a/modules/nf-core/snpeff/snpeff/meta.yml b/modules/nf-core/snpeff/snpeff/meta.yml index 7559c3d..4ba0596 100644 --- a/modules/nf-core/snpeff/snpeff/meta.yml +++ b/modules/nf-core/snpeff/snpeff/meta.yml @@ -14,46 +14,85 @@ tools: homepage: https://pcingola.github.io/SnpEff/ documentation: https://pcingola.github.io/SnpEff/se_introduction/ licence: ["MIT"] + identifier: biotools:snpeff input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - vcf: - type: file - description: | - vcf to annotate - - db: - type: string - description: | - which db to annotate with - - cache: - type: file - description: | - path to snpEff cache (optional) + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: | + vcf to annotate + - - db: + type: string + description: | + which db to annotate with + - - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cache: + type: file + description: | + path to snpEff cache (optional) + - - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cache: + type: file + description: | + path to snpEff config file (optional) output: - vcf: - type: file - description: | - annotated vcf - pattern: "*.ann.vcf" + - meta: + type: file + description: | + annotated vcf + pattern: "*.ann.vcf" + - "*.ann.vcf": + type: file + description: | + annotated vcf + pattern: "*.ann.vcf" - report: - type: file - description: snpEff report csv file - pattern: "*.csv" + - meta: + type: file + description: snpEff report csv file + pattern: "*.csv" + - "*.csv": + type: file + description: snpEff report csv file + pattern: "*.csv" - summary_html: - type: file - description: snpEff summary statistics in html file - pattern: "*.html" + - meta: + type: file + description: snpEff summary statistics in html file + pattern: "*.html" + - "*.html": + type: file + description: snpEff summary statistics in html file + pattern: "*.html" - genes_txt: - type: file - description: txt (tab separated) file having counts of the number of variants affecting each transcript and gene - pattern: "*.genes.txt" + - meta: + type: file + description: txt (tab separated) file having counts of the number of variants + affecting each transcript and gene + pattern: "*.genes.txt" + - "*.genes.txt": + type: file + description: txt (tab separated) file having counts of the number of variants + affecting each transcript and gene + pattern: "*.genes.txt" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@maxulysse" maintainers: diff --git a/modules/nf-core/snpeff/snpeff/snpeff-snpeff.diff b/modules/nf-core/snpeff/snpeff/snpeff-snpeff.diff index 6663f27..cdde074 100644 --- a/modules/nf-core/snpeff/snpeff/snpeff-snpeff.diff +++ b/modules/nf-core/snpeff/snpeff/snpeff-snpeff.diff @@ -1,4 +1,5 @@ -Changes in module 'nf-core/snpeff/snpeff' +Changes in component 'nf-core/snpeff/snpeff' +Changes in 'snpeff/snpeff/main.nf': --- modules/nf-core/snpeff/snpeff/main.nf +++ modules/nf-core/snpeff/snpeff/main.nf @@ -4,26 +4,31 @@ @@ -14,7 +15,7 @@ Changes in module 'nf-core/snpeff/snpeff' tuple val(meta), path(vcf) val db tuple val(meta2), path(cache) -+ tuple val(meta2), path(config) ++ tuple val(meta3), path(config) output: - tuple val(meta), path("*.ann.vcf"), emit: vcf @@ -80,14 +81,183 @@ Changes in module 'nf-core/snpeff/snpeff' """ +Changes in 'snpeff/snpeff/environment.yml': --- modules/nf-core/snpeff/snpeff/environment.yml +++ modules/nf-core/snpeff/snpeff/environment.yml -@@ -4,4 +4,5 @@ +@@ -1,7 +1,6 @@ +-name: snpeff_snpeff + channels: + - conda-forge - bioconda - - defaults +- - defaults dependencies: - - bioconda::snpeff=5.1 + - bioconda::snpeff=5.2 + - bioconda::tabix=1.11 +Changes in 'snpeff/snpeff/meta.yml': +--- modules/nf-core/snpeff/snpeff/meta.yml ++++ modules/nf-core/snpeff/snpeff/meta.yml +@@ -14,46 +14,85 @@ + homepage: https://pcingola.github.io/SnpEff/ + documentation: https://pcingola.github.io/SnpEff/se_introduction/ + licence: ["MIT"] ++ identifier: biotools:snpeff + input: +- - meta: +- type: map +- description: | +- Groovy Map containing sample information +- e.g. [ id:'test', single_end:false ] +- - vcf: +- type: file +- description: | +- vcf to annotate +- - db: +- type: string +- description: | +- which db to annotate with +- - cache: +- type: file +- description: | +- path to snpEff cache (optional) ++ - - meta: ++ type: map ++ description: | ++ Groovy Map containing sample information ++ e.g. [ id:'test', single_end:false ] ++ - vcf: ++ type: file ++ description: | ++ vcf to annotate ++ - - db: ++ type: string ++ description: | ++ which db to annotate with ++ - - meta2: ++ type: map ++ description: | ++ Groovy Map containing sample information ++ e.g. [ id:'test', single_end:false ] ++ - cache: ++ type: file ++ description: | ++ path to snpEff cache (optional) ++ - - meta3: ++ type: map ++ description: | ++ Groovy Map containing sample information ++ e.g. [ id:'test', single_end:false ] ++ - cache: ++ type: file ++ description: | ++ path to snpEff config file (optional) + output: + - vcf: +- type: file +- description: | +- annotated vcf +- pattern: "*.ann.vcf" ++ - meta: ++ type: file ++ description: | ++ annotated vcf ++ pattern: "*.ann.vcf" ++ - "*.ann.vcf": ++ type: file ++ description: | ++ annotated vcf ++ pattern: "*.ann.vcf" + - report: +- type: file +- description: snpEff report csv file +- pattern: "*.csv" ++ - meta: ++ type: file ++ description: snpEff report csv file ++ pattern: "*.csv" ++ - "*.csv": ++ type: file ++ description: snpEff report csv file ++ pattern: "*.csv" + - summary_html: +- type: file +- description: snpEff summary statistics in html file +- pattern: "*.html" ++ - meta: ++ type: file ++ description: snpEff summary statistics in html file ++ pattern: "*.html" ++ - "*.html": ++ type: file ++ description: snpEff summary statistics in html file ++ pattern: "*.html" + - genes_txt: +- type: file +- description: txt (tab separated) file having counts of the number of variants affecting each transcript and gene +- pattern: "*.genes.txt" ++ - meta: ++ type: file ++ description: txt (tab separated) file having counts of the number of variants ++ affecting each transcript and gene ++ pattern: "*.genes.txt" ++ - "*.genes.txt": ++ type: file ++ description: txt (tab separated) file having counts of the number of variants ++ affecting each transcript and gene ++ pattern: "*.genes.txt" + - versions: +- type: file +- description: File containing software versions +- pattern: "versions.yml" ++ - versions.yml: ++ type: file ++ description: File containing software versions ++ pattern: "versions.yml" + authors: + - "@maxulysse" + maintainers: + +Changes in 'snpeff/snpeff/tests/main.nf.test': +--- modules/nf-core/snpeff/snpeff/tests/main.nf.test ++++ modules/nf-core/snpeff/snpeff/tests/main.nf.test +@@ -6,6 +6,7 @@ + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" ++ tag "modules_snpeff" + tag "snpeff" + tag "snpeff/download" + tag "snpeff/snpeff" +@@ -17,7 +18,7 @@ + script "../../download/main.nf" + process { + """ +- input[0] = Channel.of([[id:params.snpeff_genome + '.' + params.snpeff_cache_version], params.snpeff_genome, params.snpeff_cache_version]) ++ input[0] = Channel.of([[id:params.snpeff_db], params.snpeff_db]) + """ + } + } +@@ -30,7 +31,7 @@ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ]) +- input[1] = params.snpeff_genome + '.' + params.snpeff_cache_version ++ input[1] = params.snpeff_db + input[2] = SNPEFF_DOWNLOAD.out.cache + """ + } + +Changes in 'snpeff/snpeff/tests/nextflow.config': +--- modules/nf-core/snpeff/snpeff/tests/nextflow.config ++++ modules/nf-core/snpeff/snpeff/tests/nextflow.config +@@ -1,4 +1,3 @@ + params { +- snpeff_cache_version = "105" +- snpeff_genome = "WBcel235" ++ snpeff_db = "WBcel235.105" + } + +'modules/nf-core/snpeff/snpeff/tests/tags.yml' is unchanged +'modules/nf-core/snpeff/snpeff/tests/main.nf.test.snap' is unchanged ************************************************************ diff --git a/modules/nf-core/snpeff/snpeff/tests/main.nf.test b/modules/nf-core/snpeff/snpeff/tests/main.nf.test index dd37f27..2be0b7d 100644 --- a/modules/nf-core/snpeff/snpeff/tests/main.nf.test +++ b/modules/nf-core/snpeff/snpeff/tests/main.nf.test @@ -6,6 +6,7 @@ nextflow_process { config "./nextflow.config" tag "modules" tag "modules_nfcore" + tag "modules_snpeff" tag "snpeff" tag "snpeff/download" tag "snpeff/snpeff" @@ -17,7 +18,7 @@ nextflow_process { script "../../download/main.nf" process { """ - input[0] = Channel.of([[id:params.snpeff_genome + '.' + params.snpeff_cache_version], params.snpeff_genome, params.snpeff_cache_version]) + input[0] = Channel.of([[id:params.snpeff_db], params.snpeff_db]) """ } } @@ -30,7 +31,7 @@ nextflow_process { [ id:'test' ], // meta map file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ]) - input[1] = params.snpeff_genome + '.' + params.snpeff_cache_version + input[1] = params.snpeff_db input[2] = SNPEFF_DOWNLOAD.out.cache """ } diff --git a/modules/nf-core/snpeff/snpeff/tests/nextflow.config b/modules/nf-core/snpeff/snpeff/tests/nextflow.config index d31ebf6..a950a04 100644 --- a/modules/nf-core/snpeff/snpeff/tests/nextflow.config +++ b/modules/nf-core/snpeff/snpeff/tests/nextflow.config @@ -1,4 +1,3 @@ params { - snpeff_cache_version = "105" - snpeff_genome = "WBcel235" + snpeff_db = "WBcel235.105" } diff --git a/modules/nf-core/tabix/bgzip/environment.yml b/modules/nf-core/tabix/bgzip/environment.yml index 361c078..017c259 100644 --- a/modules/nf-core/tabix/bgzip/environment.yml +++ b/modules/nf-core/tabix/bgzip/environment.yml @@ -1,8 +1,7 @@ -name: tabix_bgzip channels: - conda-forge - bioconda - - defaults + dependencies: + - bioconda::htslib=1.20 - bioconda::tabix=1.11 - - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/tabix/bgzip/main.nf b/modules/nf-core/tabix/bgzip/main.nf index 3065dab..67991c7 100644 --- a/modules/nf-core/tabix/bgzip/main.nf +++ b/modules/nf-core/tabix/bgzip/main.nf @@ -4,8 +4,8 @@ process TABIX_BGZIP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/htslib:1.19.1--h81da01d_1' : - 'biocontainers/htslib:1.19.1--h81da01d_1' }" + 'https://depot.galaxyproject.org/singularity/htslib:1.20--h5efdd21_2' : + 'biocontainers/htslib:1.20--h5efdd21_2' }" input: tuple val(meta), path(input) diff --git a/modules/nf-core/tabix/bgzip/meta.yml b/modules/nf-core/tabix/bgzip/meta.yml index 621d49e..131e92c 100644 --- a/modules/nf-core/tabix/bgzip/meta.yml +++ b/modules/nf-core/tabix/bgzip/meta.yml @@ -13,33 +13,42 @@ tools: documentation: http://www.htslib.org/doc/bgzip.html doi: 10.1093/bioinformatics/btp352 licence: ["MIT"] + identifier: biotools:tabix input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - input: - type: file - description: file to compress or to decompress + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - input: + type: file + description: file to compress or to decompress output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - output: - type: file - description: Output compressed/decompressed file - pattern: "*." + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${output}: + type: file + description: Output compressed/decompressed file + pattern: "*." - gzi: - type: file - description: Optional gzip index file for compressed inputs - pattern: "*.gzi" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - ${output}.gzi: + type: file + description: Optional gzip index file for compressed inputs + pattern: "*.gzi" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/tabix/bgzip/tests/main.nf.test b/modules/nf-core/tabix/bgzip/tests/main.nf.test index 95fd4c5..d784aa0 100644 --- a/modules/nf-core/tabix/bgzip/tests/main.nf.test +++ b/modules/nf-core/tabix/bgzip/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_process { """ input[0] = [ [ id:'bgzip_test' ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] ] """ } @@ -39,7 +39,7 @@ nextflow_process { """ input[0] = [ [ id:'bedgz_test' ], - [ file(params.test_data['homo_sapiens']['genome']['genome_bed_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz', checkIfExists: true) ] ] """ } @@ -66,7 +66,7 @@ nextflow_process { """ input[0] = [ [ id:"test_stub" ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] ] """ } @@ -91,7 +91,7 @@ nextflow_process { """ input[0] = [ [ id:"gzi_compress_test" ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] ] """ } diff --git a/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap b/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap index 53d5993..0748143 100644 --- a/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap +++ b/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap @@ -3,6 +3,10 @@ "content": [ "gzi_compress_test.vcf.gz.gzi" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2024-02-19T14:52:29.328146" }, "homo_genome_bedgz_compress": { @@ -20,7 +24,7 @@ ], "2": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ], "gzi": [ @@ -34,16 +38,24 @@ ] ], "versions": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ] } ], - "timestamp": "2024-02-19T14:52:12.422209" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:28:34.159992362" }, "test_stub": { "content": [ "test_stub.vcf.gz" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2024-02-19T14:52:20.811489" }, "sarscov2_vcf_bgzip_compress": { @@ -61,7 +73,7 @@ ], "2": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ], "gzi": [ @@ -75,11 +87,15 @@ ] ], "versions": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ] } ], - "timestamp": "2024-02-19T14:52:03.706028" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:28:22.087769106" }, "sarscov2_vcf_bgzip_compress_gzi": { "content": [ @@ -101,7 +117,7 @@ ] ], "2": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ], "gzi": [ [ @@ -120,22 +136,34 @@ ] ], "versions": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ] } ], - "timestamp": "2024-02-19T14:52:29.271494" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:28:57.15091665" }, "bgzip_test": { "content": [ "bgzip_test.vcf.gz" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2024-02-19T14:52:03.768295" }, "bedgz_test": { "content": [ "bedgz_test.bed" ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, "timestamp": "2024-02-19T14:52:12.453855" }, "sarscov2_vcf_bgzip_compress_stub": { @@ -158,7 +186,7 @@ ] ], "2": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ], "gzi": [ [ @@ -177,10 +205,14 @@ ] ], "versions": [ - "versions.yml:md5,e023292de6ee109a44fc67475d658174" + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" ] } ], - "timestamp": "2024-02-19T14:52:20.769619" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:28:45.219404786" } } \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/environment.yml b/modules/nf-core/tabix/tabix/environment.yml index 76b45e1..017c259 100644 --- a/modules/nf-core/tabix/tabix/environment.yml +++ b/modules/nf-core/tabix/tabix/environment.yml @@ -1,8 +1,7 @@ -name: tabix_tabix channels: - conda-forge - bioconda - - defaults + dependencies: + - bioconda::htslib=1.20 - bioconda::tabix=1.11 - - bioconda::htslib=1.19.1 diff --git a/modules/nf-core/tabix/tabix/main.nf b/modules/nf-core/tabix/tabix/main.nf index 1737141..13acd67 100644 --- a/modules/nf-core/tabix/tabix/main.nf +++ b/modules/nf-core/tabix/tabix/main.nf @@ -4,8 +4,8 @@ process TABIX_TABIX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/htslib:1.19.1--h81da01d_1' : - 'biocontainers/htslib:1.19.1--h81da01d_1' }" + 'https://depot.galaxyproject.org/singularity/htslib:1.20--h5efdd21_2' : + 'biocontainers/htslib:1.20--h5efdd21_2' }" input: tuple val(meta), path(tab) @@ -21,7 +21,10 @@ process TABIX_TABIX { script: def args = task.ext.args ?: '' """ - tabix $args $tab + tabix \\ + --threads $task.cpus \\ + $args \\ + $tab cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -33,8 +36,8 @@ process TABIX_TABIX { """ touch ${tab}.tbi touch ${tab}.csi - cat <<-END_VERSIONS > versions.yml + cat <<-END_VERSIONS > versions.yml "${task.process}": tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//') END_VERSIONS diff --git a/modules/nf-core/tabix/tabix/meta.yml b/modules/nf-core/tabix/tabix/meta.yml index ae5b4f4..7864832 100644 --- a/modules/nf-core/tabix/tabix/meta.yml +++ b/modules/nf-core/tabix/tabix/meta.yml @@ -11,34 +11,43 @@ tools: documentation: https://www.htslib.org/doc/tabix.1.html doi: 10.1093/bioinformatics/btq671 licence: ["MIT"] + identifier: biotools:tabix input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - tab: - type: file - description: TAB-delimited genome position file compressed with bgzip - pattern: "*.{bed.gz,gff.gz,sam.gz,vcf.gz}" + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - tab: + type: file + description: TAB-delimited genome position file compressed with bgzip + pattern: "*.{bed.gz,gff.gz,sam.gz,vcf.gz}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - tbi: - type: file - description: tabix index file - pattern: "*.{tbi}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.tbi": + type: file + description: tabix index file + pattern: "*.{tbi}" - csi: - type: file - description: coordinate sorted index file - pattern: "*.{csi}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.csi": + type: file + description: coordinate sorted index file + pattern: "*.{csi}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@joseespinosa" - "@drpatelh" diff --git a/modules/nf-core/tabix/tabix/tests/main.nf.test b/modules/nf-core/tabix/tabix/tests/main.nf.test index 3a150c7..102b0d7 100644 --- a/modules/nf-core/tabix/tabix/tests/main.nf.test +++ b/modules/nf-core/tabix/tabix/tests/main.nf.test @@ -16,7 +16,7 @@ nextflow_process { """ input[0] = [ [ id:'tbi_bed' ], - [ file(params.test_data['sarscov2']['genome']['test_bed_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed.gz', checkIfExists: true) ] ] """ } @@ -25,11 +25,10 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.tbi[0][1]).name - ).match("tbi_bed") - } + process.out, + file(process.out.tbi[0][1]).name + ).match() } ) } } @@ -41,7 +40,7 @@ nextflow_process { """ input[0] = [ [ id:'tbi_gff' ], - [ file(params.test_data['sarscov2']['genome']['genome_gff3_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3.gz', checkIfExists: true) ] ] """ } @@ -50,11 +49,9 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.tbi[0][1]).name - ).match("tbi_gff") - } + process.out, + file(process.out.tbi[0][1]).name).match() } ) } @@ -67,7 +64,7 @@ nextflow_process { """ input[0] = [ [ id:'tbi_vcf' ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] ] """ } @@ -76,11 +73,10 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.tbi[0][1]).name - ).match("tbi_vcf") - } + process.out, + file(process.out.tbi[0][1]).name + ).match() } ) } @@ -93,7 +89,7 @@ nextflow_process { """ input[0] = [ [ id:'vcf_csi' ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] ] """ } @@ -102,11 +98,10 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.csi[0][1]).name - ).match("vcf_csi") - } + process.out, + file(process.out.csi[0][1]).name + ).match() } ) } @@ -120,7 +115,7 @@ nextflow_process { """ input[0] = [ [ id:'vcf_csi_stub' ], - [ file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true) ] + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] ] """ } @@ -129,11 +124,10 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out).match() }, { assert snapshot( - file(process.out.csi[0][1]).name - ).match("vcf_csi_stub") - } + process.out, + file(process.out.csi[0][1]).name + ).match() } ) } diff --git a/modules/nf-core/tabix/tabix/tests/main.nf.test.snap b/modules/nf-core/tabix/tabix/tests/main.nf.test.snap index 034e38b..c2b9ed0 100644 --- a/modules/nf-core/tabix/tabix/tests/main.nf.test.snap +++ b/modules/nf-core/tabix/tabix/tests/main.nf.test.snap @@ -1,16 +1,4 @@ { - "vcf_csi_stub": { - "content": [ - "test.vcf.gz.csi" - ], - "timestamp": "2024-03-04T14:51:59.788002" - }, - "tbi_gff": { - "content": [ - "genome.gff3.gz.tbi" - ], - "timestamp": "2024-02-19T14:53:37.420216" - }, "sarscov2_gff_tbi": { "content": [ { @@ -19,14 +7,14 @@ { "id": "tbi_gff" }, - "genome.gff3.gz.tbi:md5,53fc683fd217aae47ef10d23c52a9178" + "genome.gff3.gz.tbi:md5,f79a67d95a98076e04fbe0455d825926" ] ], "1": [ ], "2": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ @@ -36,15 +24,20 @@ { "id": "tbi_gff" }, - "genome.gff3.gz.tbi:md5,53fc683fd217aae47ef10d23c52a9178" + "genome.gff3.gz.tbi:md5,f79a67d95a98076e04fbe0455d825926" ] ], "versions": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } + }, + "genome.gff3.gz.tbi" ], - "timestamp": "2024-02-19T14:53:37.388157" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:25.653807564" }, "sarscov2_bedgz_tbi": { "content": [ @@ -54,14 +47,14 @@ { "id": "tbi_bed" }, - "test.bed.gz.tbi:md5,0f17d85e7f0a042b2aa367b70df224f8" + "test.bed.gz.tbi:md5,9a761d51cc81835fd1199201fdbcdd5d" ] ], "1": [ ], "2": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ @@ -71,27 +64,20 @@ { "id": "tbi_bed" }, - "test.bed.gz.tbi:md5,0f17d85e7f0a042b2aa367b70df224f8" + "test.bed.gz.tbi:md5,9a761d51cc81835fd1199201fdbcdd5d" ] ], "versions": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } - ], - "timestamp": "2024-02-19T14:53:28.879408" - }, - "tbi_vcf": { - "content": [ - "test.vcf.gz.tbi" - ], - "timestamp": "2024-02-19T14:53:46.402522" - }, - "vcf_csi": { - "content": [ - "test.vcf.gz.csi" + }, + "test.bed.gz.tbi" ], - "timestamp": "2024-02-19T14:53:54.921189" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:09.754082161" }, "sarscov2_vcf_tbi": { "content": [ @@ -101,14 +87,14 @@ { "id": "tbi_vcf" }, - "test.vcf.gz.tbi:md5,897f3f378a811b90e6dee56ce08d2bcf" + "test.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" ] ], "1": [ ], "2": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ @@ -118,15 +104,20 @@ { "id": "tbi_vcf" }, - "test.vcf.gz.tbi:md5,897f3f378a811b90e6dee56ce08d2bcf" + "test.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" ] ], "versions": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } + }, + "test.vcf.gz.tbi" ], - "timestamp": "2024-02-19T14:53:46.370358" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:40.042648294" }, "sarscov2_vcf_csi_stub": { "content": [ @@ -148,7 +139,7 @@ ] ], "2": [ - "versions.yml:md5,3d45df6d80883bad358631069a2940fd" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ [ @@ -167,11 +158,16 @@ ] ], "versions": [ - "versions.yml:md5,3d45df6d80883bad358631069a2940fd" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } + }, + "test.vcf.gz.csi" ], - "timestamp": "2024-03-04T14:51:59.766184" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:07:08.700367261" }, "sarscov2_vcf_csi": { "content": [ @@ -184,34 +180,33 @@ { "id": "vcf_csi" }, - "test.vcf.gz.csi:md5,0731ad6f40104d2bbb1a2cc478ef8f03" + "test.vcf.gz.csi:md5,04b41c1efd9ab3c6b1e008a286e27d2b" ] ], "2": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ], "csi": [ [ { "id": "vcf_csi" }, - "test.vcf.gz.csi:md5,0731ad6f40104d2bbb1a2cc478ef8f03" + "test.vcf.gz.csi:md5,04b41c1efd9ab3c6b1e008a286e27d2b" ] ], "tbi": [ ], "versions": [ - "versions.yml:md5,f4feeda7fdd4b567102f7f8e5d7037a3" + "versions.yml:md5,07064637fb8a217174052be8e40234e2" ] - } - ], - "timestamp": "2024-02-19T14:53:54.886876" - }, - "tbi_bed": { - "content": [ - "test.bed.gz.tbi" + }, + "test.vcf.gz.csi" ], - "timestamp": "2024-02-19T14:53:28.947628" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:55.362067748" } } \ No newline at end of file diff --git a/modules/nf-core/trimgalore/environment.yml b/modules/nf-core/trimgalore/environment.yml index 0981320..b1efd94 100644 --- a/modules/nf-core/trimgalore/environment.yml +++ b/modules/nf-core/trimgalore/environment.yml @@ -1,10 +1,7 @@ -name: trimgalore - channels: - conda-forge - bioconda - - defaults - dependencies: - - bioconda::cutadapt=3.4 - - bioconda::trim-galore=0.6.7 + - bioconda::cutadapt=4.9 + - bioconda::trim-galore=0.6.10 + - conda-forge::pigz=2.8 diff --git a/modules/nf-core/trimgalore/main.nf b/modules/nf-core/trimgalore/main.nf index 24ead87..5fe5366 100644 --- a/modules/nf-core/trimgalore/main.nf +++ b/modules/nf-core/trimgalore/main.nf @@ -1,22 +1,22 @@ process TRIMGALORE { - tag "$meta.id" + 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/trim-galore:0.6.7--hdfd78af_0' : - 'biocontainers/trim-galore:0.6.7--hdfd78af_0' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/9b/9becad054093ad4083a961d12733f2a742e11728fe9aa815d678b882b3ede520/data' + : 'community.wave.seqera.io/library/cutadapt_trim-galore_pigz:a98edd405b34582d'}" input: 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 @@ -24,14 +24,20 @@ process TRIMGALORE { script: def args = task.ext.args ?: '' // Calculate number of --cores for TrimGalore based on value of task.cpus - // See: https://github.com/FelixKrueger/TrimGalore/blob/master/Changelog.md#version-060-release-on-1-mar-2019 + // See: https://github.com/FelixKrueger/TrimGalore/blob/master/CHANGELOG.md#version-060-release-on-1-mar-2019 // See: https://github.com/nf-core/atacseq/pull/65 def cores = 1 if (task.cpus) { cores = (task.cpus as int) - 4 - if (meta.single_end) cores = (task.cpus as int) - 3 - if (cores < 1) cores = 1 - if (cores > 8) cores = 8 + if (meta.single_end) { + cores = (task.cpus as int) - 3 + } + if (cores < 1) { + cores = 1 + } + if (cores > 8) { + cores = 8 + } } // Added soft-links to original fastqs for consistent naming in MultiQC @@ -40,10 +46,10 @@ process TRIMGALORE { def args_list = args.split("\\s(?=--)").toList() args_list.removeAll { it.toLowerCase().contains('_r2 ') } """ - [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz + [ ! -f ${prefix}.fastq.gz ] && ln -s ${reads} ${prefix}.fastq.gz trim_galore \\ ${args_list.join(' ')} \\ - --cores $cores \\ + --cores ${cores} \\ --gzip \\ ${prefix}.fastq.gz @@ -51,15 +57,17 @@ process TRIMGALORE { "${task.process}": trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') cutadapt: \$(cutadapt --version) + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) END_VERSIONS """ - } else { + } + else { """ [ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz [ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz trim_galore \\ - $args \\ - --cores $cores \\ + ${args} \\ + --cores ${cores} \\ --paired \\ --gzip \\ ${prefix}_1.fastq.gz \\ @@ -69,7 +77,31 @@ process TRIMGALORE { "${task.process}": trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') cutadapt: \$(cutadapt --version) + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) END_VERSIONS """ } + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + if (meta.single_end) { + output_command = "echo '' | gzip > ${prefix}_trimmed.fq.gz ;" + output_command += "touch ${prefix}.fastq.gz_trimming_report.txt" + } + else { + output_command = "echo '' | gzip > ${prefix}_1_trimmed.fq.gz ;" + output_command += "touch ${prefix}_1.fastq.gz_trimming_report.txt ;" + output_command += "echo '' | gzip > ${prefix}_2_trimmed.fq.gz ;" + output_command += "touch ${prefix}_2.fastq.gz_trimming_report.txt" + } + """ + ${output_command} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + trimgalore: \$(echo \$(trim_galore --version 2>&1) | sed 's/^.*version //; s/Last.*\$//') + cutadapt: \$(cutadapt --version) + pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) + END_VERSIONS + """ } diff --git a/modules/nf-core/trimgalore/meta.yml b/modules/nf-core/trimgalore/meta.yml index e649088..bd79363 100644 --- a/modules/nf-core/trimgalore/meta.yml +++ b/modules/nf-core/trimgalore/meta.yml @@ -14,50 +14,87 @@ tools: homepage: https://www.bioinformatics.babraham.ac.uk/projects/trim_galore/ documentation: https://github.com/FelixKrueger/TrimGalore/blob/master/Docs/Trim_Galore_User_Guide.md licence: ["GPL-3.0-or-later"] + identifier: "" 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 files of size 1 and 2 for single-end and paired-end data, - respectively. + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: | + List of input FastQ files of size 1 and 2 for single-end and paired-end data, + respectively. output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - reads: - type: file - 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" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz": + type: map + description: | + 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: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*_{report.txt}" - unpaired: - type: file - description: | - FastQ files containing unpaired reads from read 1 or read 2 - pattern: "*unpaired*.fq.gz" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*unpaired{,_1,_2}.fq.gz": + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*unpaired*.fq.gz" - html: - type: file - description: FastQC report (optional) - pattern: "*_{fastqc.html}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*_{fastqc.html}" + - "*.html": + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*_{fastqc.html}" - zip: - type: file - description: FastQC report archive (optional) - pattern: "*_{fastqc.zip}" - - log: - type: file - description: Trim Galore! trimming report - pattern: "*_{report.txt}" + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*_{fastqc.zip}" + - "*.zip": + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + pattern: "*_{fastqc.zip}" - versions: - type: file - description: File containing software versions - pattern: "versions.yml" + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@drpatelh" - "@ewels" diff --git a/modules/nf-core/trimgalore/tests/main.nf.test b/modules/nf-core/trimgalore/tests/main.nf.test index 43904ac..c01672c 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test +++ b/modules/nf-core/trimgalore/tests/main.nf.test @@ -39,7 +39,32 @@ nextflow_process { { assert path(process.out.log.get(0).get(1)).getText().contains(report1_line) } } }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(path(process.out.versions.get(0)).yaml).match() }, + ) + } + } + + test("test_trimgalore_single_end - stub") { + + options "-stub" + + 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) ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out, + path(process.out.versions.get(0)).yaml + ).match() }, ) } } @@ -96,8 +121,68 @@ nextflow_process { { assert path(process.out.log.get(0).get(1).get(1)).getText().contains(report2_line) } } }, - { assert snapshot(process.out.versions).match() } + { assert snapshot(path(process.out.versions.get(0)).yaml).match() }, + ) + } + } + + 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" + + 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) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot(path(process.out.versions.get(0)).yaml).match("versions") }, ) } } -} +} \ No newline at end of file diff --git a/modules/nf-core/trimgalore/tests/main.nf.test.snap b/modules/nf-core/trimgalore/tests/main.nf.test.snap index 082c550..c454ad5 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test.snap +++ b/modules/nf-core/trimgalore/tests/main.nf.test.snap @@ -1,26 +1,251 @@ { "test_trimgalore_single_end": { "content": [ - [ - "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" - ] + { + "TRIMGALORE": { + "trimgalore": "0.6.10", + "cutadapt": 4.9, + "pigz": 2.8 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-06T12:25:01.330769598" + }, + "test_trimgalore_single_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,5928323d579768de37e83c56c821757f" + ], + "html": [ + + ], + "log": [ + [ + { + "id": "test", + "single_end": true + }, + "test.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": true + }, + "test_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "unpaired": [ + + ], + "versions": [ + "versions.yml:md5,5928323d579768de37e83c56c821757f" + ], + "zip": [ + + ] + }, + { + "TRIMGALORE": { + "trimgalore": "0.6.10", + "cutadapt": 4.9, + "pigz": 2.8 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-06T12:25:15.582246999" + }, + "test_trimgalore_paired_end - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_2.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + + ], + "3": [ + + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,5928323d579768de37e83c56c821757f" + ], + "html": [ + + ], + "log": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_2.fastq.gz_trimming_report.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "reads": [ + [ + { + "id": "test", + "single_end": false + }, + [ + "test_1_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_2_trimmed.fq.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "unpaired": [ + + ], + "versions": [ + "versions.yml:md5,5928323d579768de37e83c56c821757f" + ], + "zip": [ + + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.2", + "nextflow": "24.10.3" }, - "timestamp": "2024-02-29T16:33:20.401347" + "timestamp": "2025-01-06T12:26:05.201562315" + }, + "versions": { + "content": [ + { + "TRIMGALORE": { + "trimgalore": "0.6.10", + "cutadapt": 4.9, + "pigz": 2.8 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-06T12:26:05.229598492" }, "test_trimgalore_paired_end": { "content": [ + { + "TRIMGALORE": { + "trimgalore": "0.6.10", + "cutadapt": 4.9, + "pigz": 2.8 + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "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" + ] + ] + ], [ - "versions.yml:md5,47d966cbb31c80eb8f7fe860d55659b7" + [ + { + "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.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.2", + "nextflow": "24.10.3" }, - "timestamp": "2024-02-29T16:33:28.960497" + "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 f817b93..488b68c 100644 --- a/nextflow.config +++ b/nextflow.config @@ -145,14 +145,13 @@ 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 pipefail" // Returns the status of the last command to exit 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 diff --git a/nextflow_schema.json b/nextflow_schema.json index 0846da4..c3dad0b 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -1,318 +1,318 @@ { - "$schema": "https://json-schema.org/draft-07/schema", - "$id": "https://raw.githubusercontent.com/cnr-ibba/nf-resequencing-mem/master/nextflow_schema.json", - "title": "cnr-ibba/nf-resequencing-mem pipeline parameters", - "description": "Nextflow Resequencing pipeline with BWA-MEM and Freebayes", - "type": "object", - "definitions": { - "input_output_options": { - "title": "Input/output options", - "type": "object", - "fa_icon": "fas fa-terminal", - "description": "Define where the pipeline should find input data and save output data.", - "required": ["input", "genome_fasta"], - "properties": { - "input": { - "type": "string", - "format": "file-path", - "exists": true, - "mimetype": "text/csv", - "pattern": "^\\S+\\.csv$", - "description": "Path to comma-separated file containing information about the samples in the experiment.", - "help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row.", - "fa_icon": "fas fa-file-csv" - }, - "genome_fasta": { - "type": "string", - "format": "file-path", - "mimetype": "text/plain", - "pattern": "^\\S+\\.fn?a(sta)?(\\.gz)?$", - "description": "Path to FASTA genome file (compression is supported).", - "help_text": "This parameter is *mandatory* if `--genome_fasta` is not specified. If you don't have a BWA index available this will be generated for you automatically. Combine with `--save_fasta_index` and `--save_bwa_index` to save indexes for future runs.", - "fa_icon": "far fa-file-code" - }, - "genome_fasta_fai": { - "type": "string", - "description": "Path to genome fasta index (skip index calculation)" - }, - "genome_bwa_index": { - "type": "string", - "description": "Path to genome fasta BWA index (skip index calculation)" - }, - "outdir": { - "type": "string", - "format": "directory-path", - "description": "The output directory where the results will be saved. You have to use absolute paths to storage on Cloud infrastructure.", - "fa_icon": "fas fa-folder-open", - "default": "./results" - }, - "ploidy": { - "type": "integer", - "default": 2, - "description": "Sets the default ploidy for the analysis." - }, - "gvcf": { - "type": "boolean", - "description": "Write gVCF output, which indicates coverage in uncalled regions." - }, - "gvcf_chunk": { - "type": "integer", - "description": "When writing gVCF output emit a record for every N bases." - }, - "gvcf_dont_use_chunk": { - "type": "boolean", - "description": "When writing the gVCF output emit a record for all bases, will also route an int to --gvcf_chunk similar to --output-mode EMIT_ALL_SITES from GATK" - }, - "snpeff_database": { - "type": "string", - "description": "SnpEff database name (ex. GRCh38.76, Saccharomyces_cerevisiae)", - "fa_icon": "fas fa-database", - "help_text": "SnpEff database name as returned by 'java -jar snpEff.jar databases' command" - }, - "snpeff_cachedir": { - "type": "string", - "description": "SnpEff custom cache directory", - "fa_icon": "fas fa-database", - "help_text": "SnpEff cache directory which should include another directory with the name of the database in which a valid SnpEff custom database is stored" - }, - "snpeff_config": { - "type": "string", - "description": "SnpEff custom configuration file", - "fa_icon": "fas fa-database", - "help_text": "SnpEff configuration file which should include the custom database name", - "default": "assets/NO_FILE" - }, - "multiqc_title": { - "type": "string", - "description": "MultiQC report title. Printed as page header, used for filename if not otherwise specified.", - "fa_icon": "fas fa-file-signature" - }, - "email": { - "type": "string", - "description": "Email address for completion summary.", - "fa_icon": "fas fa-envelope", - "help_text": "Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits. If set in your user config file (`~/.nextflow/config`) then you don't need to specify this on the command line for every run.", - "pattern": "^([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5})$" + "$schema": "https://json-schema.org/draft-07/schema", + "$id": "https://raw.githubusercontent.com/cnr-ibba/nf-resequencing-mem/master/nextflow_schema.json", + "title": "cnr-ibba/nf-resequencing-mem pipeline parameters", + "description": "Nextflow Resequencing pipeline with BWA-MEM and Freebayes", + "type": "object", + "definitions": { + "input_output_options": { + "title": "Input/output options", + "type": "object", + "fa_icon": "fas fa-terminal", + "description": "Define where the pipeline should find input data and save output data.", + "required": ["input", "genome_fasta"], + "properties": { + "input": { + "type": "string", + "format": "file-path", + "exists": true, + "mimetype": "text/csv", + "pattern": "^\\S+\\.csv$", + "description": "Path to comma-separated file containing information about the samples in the experiment.", + "help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row.", + "fa_icon": "fas fa-file-csv" + }, + "genome_fasta": { + "type": "string", + "format": "file-path", + "mimetype": "text/plain", + "pattern": "^\\S+\\.fn?a(sta)?(\\.gz)?$", + "description": "Path to FASTA genome file (compression is supported).", + "help_text": "This parameter is *mandatory* if `--genome_fasta` is not specified. If you don't have a BWA index available this will be generated for you automatically. Combine with `--save_fasta_index` and `--save_bwa_index` to save indexes for future runs.", + "fa_icon": "far fa-file-code" + }, + "genome_fasta_fai": { + "type": "string", + "description": "Path to genome fasta index (skip index calculation)" + }, + "genome_bwa_index": { + "type": "string", + "description": "Path to genome fasta BWA index (skip index calculation)" + }, + "outdir": { + "type": "string", + "format": "directory-path", + "description": "The output directory where the results will be saved. You have to use absolute paths to storage on Cloud infrastructure.", + "fa_icon": "fas fa-folder-open", + "default": "./results" + }, + "ploidy": { + "type": "integer", + "default": 2, + "description": "Sets the default ploidy for the analysis." + }, + "gvcf": { + "type": "boolean", + "description": "Write gVCF output, which indicates coverage in uncalled regions." + }, + "gvcf_chunk": { + "type": "integer", + "description": "When writing gVCF output emit a record for every N bases." + }, + "gvcf_dont_use_chunk": { + "type": "boolean", + "description": "When writing the gVCF output emit a record for all bases, will also route an int to --gvcf_chunk similar to --output-mode EMIT_ALL_SITES from GATK" + }, + "snpeff_database": { + "type": "string", + "description": "SnpEff database name (ex. GRCh38.76, Saccharomyces_cerevisiae)", + "fa_icon": "fas fa-database", + "help_text": "SnpEff database name as returned by 'java -jar snpEff.jar databases' command" + }, + "snpeff_cachedir": { + "type": "string", + "description": "SnpEff custom cache directory", + "fa_icon": "fas fa-database", + "help_text": "SnpEff cache directory which should include another directory with the name of the database in which a valid SnpEff custom database is stored" + }, + "snpeff_config": { + "type": "string", + "description": "SnpEff custom configuration file", + "fa_icon": "fas fa-database", + "help_text": "SnpEff configuration file which should include the custom database name", + "default": "assets/NO_FILE" + }, + "multiqc_title": { + "type": "string", + "description": "MultiQC report title. Printed as page header, used for filename if not otherwise specified.", + "fa_icon": "fas fa-file-signature" + }, + "email": { + "type": "string", + "description": "Email address for completion summary.", + "fa_icon": "fas fa-envelope", + "help_text": "Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits. If set in your user config file (`~/.nextflow/config`) then you don't need to specify this on the command line for every run.", + "pattern": "^([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5})$" + } + } + }, + "pipeline_custom_parameters": { + "title": "Pipeline custom parameters", + "type": "object", + "description": "Modify pipeline run", + "default": "", + "properties": { + "remove_fastq_duplicates": { + "type": "boolean", + "description": "Remove FASTQ duplicates by IDs" + }, + "save_trimmed": { + "type": "boolean", + "description": "Save trimmed sequences in $outdir" + }, + "save_cram": { + "type": "boolean", + "description": "Save aligned/sorted CRAM files in $outdir" + }, + "save_fasta_index": { + "type": "boolean", + "description": "Save FASTA index in $outdir" + }, + "save_bwa_index": { + "type": "boolean", + "description": "Save BWA index in $outdir" + }, + "save_freebayes": { + "type": "boolean", + "description": "Save freebayes output (not-normalized)" + }, + "save_unique_fastq": { + "type": "boolean", + "description": "Save purget FASTQ in ${results_dir}" + } + } + }, + "institutional_config_options": { + "title": "Institutional config options", + "type": "object", + "fa_icon": "fas fa-university", + "description": "Parameters used to describe centralised config profiles. These should not be edited.", + "help_text": "The centralised nf-core configuration profiles use a handful of pipeline parameters to describe themselves. This information is then printed to the Nextflow log when you run a pipeline. You should not need to change these values when you run a pipeline.", + "properties": { + "custom_config_version": { + "type": "string", + "description": "Git commit id for Institutional configs.", + "default": "ibba", + "hidden": true, + "fa_icon": "fas fa-users-cog" + }, + "custom_config_base": { + "type": "string", + "description": "Base directory for Institutional configs.", + "default": "https://raw.githubusercontent.com/cnr-ibba/nf-configs/ibba", + "hidden": true, + "help_text": "If you're running offline, Nextflow will not be able to fetch the institutional config files from the internet. If you don't need them, then this is not a problem. If you do need them, you should download the files from the repo and tell Nextflow where to find them with this parameter.", + "fa_icon": "fas fa-users-cog" + }, + "config_profile_name": { + "type": "string", + "description": "Institutional config name.", + "hidden": true, + "fa_icon": "fas fa-users-cog" + }, + "config_profile_description": { + "type": "string", + "description": "Institutional config description.", + "hidden": true, + "fa_icon": "fas fa-users-cog" + }, + "config_profile_contact": { + "type": "string", + "description": "Institutional config contact information.", + "hidden": true, + "fa_icon": "fas fa-users-cog" + }, + "config_profile_url": { + "type": "string", + "description": "Institutional config URL link.", + "hidden": true, + "fa_icon": "fas fa-users-cog" + } + } + }, + "generic_options": { + "title": "Generic options", + "type": "object", + "fa_icon": "fas fa-file-import", + "description": "Less common options for the pipeline, typically set in a config file.", + "help_text": "These options are common to all nf-core pipelines and allow you to customise some of the core preferences for how the pipeline runs.\n\nTypically these options would be set in a Nextflow config file loaded for all pipeline runs, such as `~/.nextflow/config`.", + "properties": { + "help": { + "type": "boolean", + "description": "Display help text.", + "fa_icon": "fas fa-question-circle", + "hidden": true + }, + "version": { + "type": "boolean", + "description": "Display version and exit.", + "fa_icon": "fas fa-question-circle", + "hidden": true + }, + "publish_dir_mode": { + "type": "string", + "default": "copy", + "description": "Method used to save pipeline results to output directory.", + "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", + "fa_icon": "fas fa-copy", + "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], + "hidden": true + }, + "email_on_fail": { + "type": "string", + "description": "Email address for completion summary, only when pipeline fails.", + "fa_icon": "fas fa-exclamation-triangle", + "pattern": "^([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5})$", + "help_text": "An email address to send a summary email to when the pipeline is completed - ONLY sent if the pipeline does not exit successfully.", + "hidden": true + }, + "plaintext_email": { + "type": "boolean", + "description": "Send plain-text email instead of HTML.", + "fa_icon": "fas fa-remove-format", + "hidden": true + }, + "max_multiqc_email_size": { + "type": "string", + "description": "File size limit when attaching MultiQC reports to summary emails.", + "pattern": "^\\d+(\\.\\d+)?\\.?\\s*(K|M|G|T)?B$", + "default": "25.MB", + "fa_icon": "fas fa-file-upload", + "hidden": true + }, + "monochrome_logs": { + "type": "boolean", + "description": "Do not use coloured log outputs.", + "fa_icon": "fas fa-palette", + "hidden": true + }, + "hook_url": { + "type": "string", + "description": "Incoming hook URL for messaging service", + "fa_icon": "fas fa-people-group", + "help_text": "Incoming hook URL for messaging service. Currently, MS Teams and Slack are supported.", + "hidden": true + }, + "multiqc_config": { + "type": "string", + "format": "file-path", + "description": "Custom config file to supply to MultiQC.", + "fa_icon": "fas fa-cog", + "hidden": true, + "default": "assets/multiqc_config.yml" + }, + "multiqc_logo": { + "type": "string", + "description": "Custom logo file to supply to MultiQC. File name must also be set in the MultiQC config file", + "fa_icon": "fas fa-image", + "hidden": true, + "default": "assets/cnr-ibba.png" + }, + "multiqc_methods_description": { + "type": "string", + "description": "Custom MultiQC yaml file containing HTML including a methods description.", + "fa_icon": "fas fa-cog", + "hidden": true + }, + "validate_params": { + "type": "boolean", + "description": "Boolean whether to validate parameters against the schema at runtime", + "default": true, + "fa_icon": "fas fa-check-square", + "hidden": true + }, + "validationFailUnrecognisedParams": { + "type": "boolean", + "fa_icon": "far fa-check-circle", + "description": "Validation of parameters fails when an unrecognised parameter is found.", + "hidden": true, + "help_text": "By default, when an unrecognised parameter is found, it returns a warinig." + }, + "validationLenientMode": { + "type": "boolean", + "fa_icon": "far fa-check-circle", + "description": "Validation of parameters in lenient more.", + "hidden": true, + "help_text": "Allows string values that are parseable as numbers or booleans. For further information see [JSONSchema docs](https://github.com/everit-org/json-schema#lenient-mode)." + }, + "validationShowHiddenParams": { + "type": "boolean", + "fa_icon": "far fa-eye-slash", + "description": "Show all params when using `--help`", + "hidden": true, + "help_text": "By default, parameters set as _hidden_ in the schema are not shown on the command line when a user runs with `--help`. Specifying this option will tell the pipeline to show all parameters." + }, + "trace_report_suffix": { + "type": "string", + "hidden": true, + "description": "Suffix to add to the trace report filename. Default is the date and time in the format yyyy-MM-dd_HH-mm-ss.", + "fa_icon": "far fa-calendar-alt" + } + } } - } }, - "pipeline_custom_parameters": { - "title": "Pipeline custom parameters", - "type": "object", - "description": "Modify pipeline run", - "default": "", - "properties": { - "remove_fastq_duplicates": { - "type": "boolean", - "description": "Remove FASTQ duplicates by IDs" - }, - "save_trimmed": { - "type": "boolean", - "description": "Save trimmed sequences in $outdir" + "allOf": [ + { + "$ref": "#/definitions/input_output_options" }, - "save_cram": { - "type": "boolean", - "description": "Save aligned/sorted CRAM files in $outdir" + { + "$ref": "#/definitions/pipeline_custom_parameters" }, - "save_fasta_index": { - "type": "boolean", - "description": "Save FASTA index in $outdir" + { + "$ref": "#/definitions/institutional_config_options" }, - "save_bwa_index": { - "type": "boolean", - "description": "Save BWA index in $outdir" - }, - "save_freebayes": { - "type": "boolean", - "description": "Save freebayes output (not-normalized)" - }, - "save_unique_fastq": { - "type": "boolean", - "description": "Save purget FASTQ in ${results_dir}" + { + "$ref": "#/definitions/generic_options" } - } - }, - "institutional_config_options": { - "title": "Institutional config options", - "type": "object", - "fa_icon": "fas fa-university", - "description": "Parameters used to describe centralised config profiles. These should not be edited.", - "help_text": "The centralised nf-core configuration profiles use a handful of pipeline parameters to describe themselves. This information is then printed to the Nextflow log when you run a pipeline. You should not need to change these values when you run a pipeline.", - "properties": { - "custom_config_version": { - "type": "string", - "description": "Git commit id for Institutional configs.", - "default": "ibba", - "hidden": true, - "fa_icon": "fas fa-users-cog" - }, - "custom_config_base": { - "type": "string", - "description": "Base directory for Institutional configs.", - "default": "https://raw.githubusercontent.com/cnr-ibba/nf-configs/ibba", - "hidden": true, - "help_text": "If you're running offline, Nextflow will not be able to fetch the institutional config files from the internet. If you don't need them, then this is not a problem. If you do need them, you should download the files from the repo and tell Nextflow where to find them with this parameter.", - "fa_icon": "fas fa-users-cog" - }, - "config_profile_name": { - "type": "string", - "description": "Institutional config name.", - "hidden": true, - "fa_icon": "fas fa-users-cog" - }, - "config_profile_description": { - "type": "string", - "description": "Institutional config description.", - "hidden": true, - "fa_icon": "fas fa-users-cog" - }, - "config_profile_contact": { - "type": "string", - "description": "Institutional config contact information.", - "hidden": true, - "fa_icon": "fas fa-users-cog" - }, - "config_profile_url": { - "type": "string", - "description": "Institutional config URL link.", - "hidden": true, - "fa_icon": "fas fa-users-cog" - } - } - }, - "generic_options": { - "title": "Generic options", - "type": "object", - "fa_icon": "fas fa-file-import", - "description": "Less common options for the pipeline, typically set in a config file.", - "help_text": "These options are common to all nf-core pipelines and allow you to customise some of the core preferences for how the pipeline runs.\n\nTypically these options would be set in a Nextflow config file loaded for all pipeline runs, such as `~/.nextflow/config`.", - "properties": { - "help": { - "type": "boolean", - "description": "Display help text.", - "fa_icon": "fas fa-question-circle", - "hidden": true - }, - "version": { - "type": "boolean", - "description": "Display version and exit.", - "fa_icon": "fas fa-question-circle", - "hidden": true - }, - "publish_dir_mode": { - "type": "string", - "default": "copy", - "description": "Method used to save pipeline results to output directory.", - "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", - "fa_icon": "fas fa-copy", - "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], - "hidden": true - }, - "email_on_fail": { - "type": "string", - "description": "Email address for completion summary, only when pipeline fails.", - "fa_icon": "fas fa-exclamation-triangle", - "pattern": "^([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5})$", - "help_text": "An email address to send a summary email to when the pipeline is completed - ONLY sent if the pipeline does not exit successfully.", - "hidden": true - }, - "plaintext_email": { - "type": "boolean", - "description": "Send plain-text email instead of HTML.", - "fa_icon": "fas fa-remove-format", - "hidden": true - }, - "max_multiqc_email_size": { - "type": "string", - "description": "File size limit when attaching MultiQC reports to summary emails.", - "pattern": "^\\d+(\\.\\d+)?\\.?\\s*(K|M|G|T)?B$", - "default": "25.MB", - "fa_icon": "fas fa-file-upload", - "hidden": true - }, - "monochrome_logs": { - "type": "boolean", - "description": "Do not use coloured log outputs.", - "fa_icon": "fas fa-palette", - "hidden": true - }, - "hook_url": { - "type": "string", - "description": "Incoming hook URL for messaging service", - "fa_icon": "fas fa-people-group", - "help_text": "Incoming hook URL for messaging service. Currently, MS Teams and Slack are supported.", - "hidden": true - }, - "multiqc_config": { - "type": "string", - "format": "file-path", - "description": "Custom config file to supply to MultiQC.", - "fa_icon": "fas fa-cog", - "hidden": true, - "default": "assets/multiqc_config.yml" - }, - "multiqc_logo": { - "type": "string", - "description": "Custom logo file to supply to MultiQC. File name must also be set in the MultiQC config file", - "fa_icon": "fas fa-image", - "hidden": true, - "default": "assets/cnr-ibba.png" - }, - "multiqc_methods_description": { - "type": "string", - "description": "Custom MultiQC yaml file containing HTML including a methods description.", - "fa_icon": "fas fa-cog", - "hidden": true - }, - "validate_params": { - "type": "boolean", - "description": "Boolean whether to validate parameters against the schema at runtime", - "default": true, - "fa_icon": "fas fa-check-square", - "hidden": true - }, - "validationFailUnrecognisedParams": { - "type": "boolean", - "fa_icon": "far fa-check-circle", - "description": "Validation of parameters fails when an unrecognised parameter is found.", - "hidden": true, - "help_text": "By default, when an unrecognised parameter is found, it returns a warinig." - }, - "validationLenientMode": { - "type": "boolean", - "fa_icon": "far fa-check-circle", - "description": "Validation of parameters in lenient more.", - "hidden": true, - "help_text": "Allows string values that are parseable as numbers or booleans. For further information see [JSONSchema docs](https://github.com/everit-org/json-schema#lenient-mode)." - }, - "validationShowHiddenParams": { - "type": "boolean", - "fa_icon": "far fa-eye-slash", - "description": "Show all params when using `--help`", - "hidden": true, - "help_text": "By default, parameters set as _hidden_ in the schema are not shown on the command line when a user runs with `--help`. Specifying this option will tell the pipeline to show all parameters." - }, - "trace_report_suffix": { - "type": "string", - "hidden": true, - "description": "Suffix to add to the trace report filename. Default is the date and time in the format yyyy-MM-dd_HH-mm-ss.", - "fa_icon": "far fa-calendar-alt" - } - } - } - }, - "allOf": [ - { - "$ref": "#/definitions/input_output_options" - }, - { - "$ref": "#/definitions/pipeline_custom_parameters" - }, - { - "$ref": "#/definitions/institutional_config_options" - }, - { - "$ref": "#/definitions/generic_options" - } - ] + ] } diff --git a/subworkflows/local/cram_freebayes_parallel/main.nf b/subworkflows/local/cram_freebayes_parallel/main.nf index 8fb41fc..a5fb7c6 100644 --- a/subworkflows/local/cram_freebayes_parallel/main.nf +++ b/subworkflows/local/cram_freebayes_parallel/main.nf @@ -1,12 +1,12 @@ // -// Prepare and run freebayes paralle +// Prepare and run freebayes parallel on CRAM files. // -include { SAMTOOLS_DEPTH } from '../../../modules/nf-core/samtools/depth/main' -include { FREEBAYES_SPLITCRAM } from '../../../modules/local/freebayes_splitcram' -include { FREEBAYES_CHUNK } from '../../../modules/cnr-ibba/freebayes/chunk/main' -include { BCFTOOLS_CONCAT as FREEBAYES_CONCAT } from '../../../modules/cnr-ibba/bcftools/concat/main' -include { TABIX_TABIX as FREEBAYES_TABIX } from '../../../modules/nf-core/tabix/tabix/main' +include { SAMTOOLS_DEPTH }from '../../../modules/nf-core/samtools/depth/main' +include { FREEBAYES_SPLITCRAM } from '../../../modules/local/freebayes_splitcram' +include { FREEBAYES_CHUNK } from '../../../modules/cnr-ibba/freebayes/chunk/main' +include { BCFTOOLS_CONCAT as FREEBAYES_CONCAT } from '../../../modules/cnr-ibba/bcftools/concat/main' +include { TABIX_TABIX as FREEBAYES_CONCAT_TABIX } from '../../../modules/nf-core/tabix/tabix/main' workflow CRAM_FREEBAYES_PARALLEL { take: @@ -68,16 +68,17 @@ workflow CRAM_FREEBAYES_PARALLEL { .groupTuple() // .view() + // required to remove overlapping regions after concatenation FREEBAYES_CONCAT ( vcf_ch.join(tbi_ch) ) ch_versions = ch_versions.mix(FREEBAYES_CONCAT.out.versions) // create index - FREEBAYES_TABIX ( FREEBAYES_CONCAT.out.vcf ) - ch_versions = ch_versions.mix(FREEBAYES_TABIX.out.versions) + FREEBAYES_CONCAT_TABIX ( FREEBAYES_CONCAT.out.vcf ) + ch_versions = ch_versions.mix(FREEBAYES_CONCAT_TABIX.out.versions) emit: - vcf = FREEBAYES_CONCAT.out.vcf // channel: [ val(meta), [ vcf ] ] - tbi = FREEBAYES_TABIX.out.tbi // channel: [ val(meta), [ tbi ] ] - csi = FREEBAYES_TABIX.out.csi // channel: [ val(meta), [ csi ] ] - versions = ch_versions // channel: [ versions.yml ] + vcf = FREEBAYES_CONCAT.out.vcf // channel: [ val(meta), [ vcf ] ] + tbi = FREEBAYES_CONCAT_TABIX.out.tbi // channel: [ val(meta), [ tbi ] ] + csi = FREEBAYES_CONCAT_TABIX.out.csi // channel: [ val(meta), [ csi ] ] + versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/freebayes_normalize.nf b/subworkflows/local/freebayes_normalize.nf index 06bef95..aa280dd 100644 --- a/subworkflows/local/freebayes_normalize.nf +++ b/subworkflows/local/freebayes_normalize.nf @@ -15,13 +15,14 @@ include { BCFTOOLS_FILLTAGS } from '../../modules/local/bcftools workflow FREEBAYES_NORMALIZE { take: vcf_ch // channel: [mandatory] the VCF file to normalize + tbi_ch // channel: [mandatory] the index file for the VCF file ref_fasta // value: [mandatory] the reference fasta file coming from PREPARE_GENOME main: ch_versions = Channel.empty() - // normalize input using vcfallelicprimitives - FREEBAYES_NORM(vcf_ch) + // normalize input using vcfallelicprimitives (1st normalization) + FREEBAYES_NORM(vcf_ch.join(tbi_ch)) ch_versions = ch_versions.mix(FREEBAYES_NORM.out.versions) // sort VCF file @@ -53,7 +54,7 @@ workflow FREEBAYES_NORMALIZE { // index VCFs with tags BCFTOOLS_FILLTAGS_TABIX(BCFTOOLS_FILLTAGS.out.vcf) - + ch_versions = ch_versions.mix(BCFTOOLS_FILLTAGS_TABIX.out.versions) emit: vcf = BCFTOOLS_FILLTAGS.out.vcf diff --git a/subworkflows/local/pipeline_initialization.nf b/subworkflows/local/pipeline_initialization.nf new file mode 100644 index 0000000..54fb3ba --- /dev/null +++ b/subworkflows/local/pipeline_initialization.nf @@ -0,0 +1,35 @@ +// +// pipeline initialization checks +// + + +workflow PIPELINE_INITIALIZATION { + take: + input // string: path to samplesheet + multiqc_config // file: multiqc config file + genome_fasta // file: genome fasta file + genome_bwa_index // file: genome bwa index file + + main: + + /* + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + VALIDATE INPUTS + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + + // Check input path parameters to see if they exist + def optionalFiles = [multiqc_config, genome_fasta, genome_bwa_index] + optionalFiles.each { f -> + if (f) { + Channel.fromPath(f, checkIfExists: true) + } + } + + // this should be present + Channel.fromPath(input, checkIfExists: true) + .set { ch_input } + + emit: + samplesheet = ch_input +} diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome.nf index 3236e7a..68a018c 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome.nf @@ -9,12 +9,12 @@ include { BWA_INDEX } from '../../modules/nf-core/bwa/index/main' include { TABIX_BGZIP } from '../../modules/nf-core/tabix/bgzip/main' workflow PREPARE_GENOME { - take: + take: genome_fasta // channel: [mandatory] fasta genome_fasta_fai // channel: [optional] fasta_fai genome_bwa_index // channel: [optional] bwa index - main: + main: ch_versions = Channel.empty() @@ -28,48 +28,48 @@ workflow PREPARE_GENOME { // check if reference genome is compressed or not if (params.genome_fasta.endsWith('.gz')) { - genome_fasta = genome_fasta.map{ - meta, fasta -> { - def in_fasta = ["fa", "fna", "fasta"].contains(meta.id.tokenize(".")[-1]) - def id = in_fasta ? meta.id.tokenize(".")[0..-2].join(".") : meta.id - [ [id:id], fasta ] - } - } - // .view() - - // unpack genome - TABIX_BGZIP(genome_fasta) - - // track version - ch_versions = ch_versions.mix(TABIX_BGZIP.out.versions) - - // overwrite fasta channel - genome_fasta = TABIX_BGZIP.out.output - - // force index calculation on uncompressed file - force_index = true + genome_fasta = genome_fasta.map{ + meta, fasta -> { + def in_fasta = ["fa", "fna", "fasta"].contains(meta.id.tokenize(".")[-1]) + def id = in_fasta ? meta.id.tokenize(".")[0..-2].join(".") : meta.id + [ [id:id], fasta ] + } + } + // .view() + + // unpack genome + TABIX_BGZIP(genome_fasta) + + // track version + ch_versions = ch_versions.mix(TABIX_BGZIP.out.versions) + + // overwrite fasta channel + genome_fasta = TABIX_BGZIP.out.output + + // force index calculation on uncompressed file + force_index = true } // create fasta index if necessary if (! params.genome_fasta_fai || force_index) { - SAMTOOLS_FAIDX(genome_fasta, [[],[]]) + SAMTOOLS_FAIDX(genome_fasta, [[],[]]) - // overwrite fasta_fai channel - genome_fasta_fai = SAMTOOLS_FAIDX.out.fai + // overwrite fasta_fai channel + genome_fasta_fai = SAMTOOLS_FAIDX.out.fai - // track version - ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions) + // track version + ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions) } // indexing genome if necessary if (! params.genome_bwa_index || force_index) { - BWA_INDEX(genome_fasta) - genome_bwa_index = BWA_INDEX.out.index - ch_versions = ch_versions.mix(BWA_INDEX.out.versions) + BWA_INDEX(genome_fasta) + genome_bwa_index = BWA_INDEX.out.index + ch_versions = ch_versions.mix(BWA_INDEX.out.versions) } - emit: + emit: genome_fasta = genome_fasta genome_fasta_fai = genome_fasta_fai bwa_index = genome_bwa_index diff --git a/subworkflows/local/snpeff_annotate.nf b/subworkflows/local/snpeff_annotate.nf index 0246160..b09a8dc 100644 --- a/subworkflows/local/snpeff_annotate.nf +++ b/subworkflows/local/snpeff_annotate.nf @@ -7,34 +7,34 @@ include { SNPEFF_SNPEFF } from '../../modules/nf-core/snpeff/snpeff/main' workflow SNPEFF_ANNOTATE { - take: + take: genome // value: [mandatory] the SnpEff genome database to use vcf // channel: [mandatory] the VCF file to annotate - main: + main: ch_versions = Channel.empty() cache = Channel.empty() // define configuration for SnpEff config = Channel.fromPath(params.snpeff_config, checkIfExists: true) - .map { it -> [[id:genome], it] } - .first() + .map { it -> [[id:genome], it] } + .first() if (! params.snpeff_cachedir) { - // create a input channel for SnpEff download - snpeff_genome = [[id: genome], genome] - SNPEFF_DOWNLOAD(snpeff_genome) + // create a input channel for SnpEff download + snpeff_genome = [[id: genome], genome] + SNPEFF_DOWNLOAD(snpeff_genome) - // export snpeff cache - cache = SNPEFF_DOWNLOAD.out.cache + // export snpeff cache + cache = SNPEFF_DOWNLOAD.out.cache - // track version - ch_versions = ch_versions.mix(SNPEFF_DOWNLOAD.out.versions) + // track version + ch_versions = ch_versions.mix(SNPEFF_DOWNLOAD.out.versions) } else { - // use the provided cache - cache = Channel.fromPath(params.snpeff_cachedir, checkIfExists: true) - .map { it -> [[id:genome], it] } - .first() + // use the provided cache + cache = Channel.fromPath(params.snpeff_cachedir, checkIfExists: true) + .map { it -> [[id:genome], it] } + .first() } // annotate the VCF file @@ -43,7 +43,7 @@ workflow SNPEFF_ANNOTATE { // track version ch_versions = ch_versions.mix(SNPEFF_SNPEFF.out.versions) - emit: + emit: cache = cache vcf = SNPEFF_SNPEFF.out.vcf report = SNPEFF_SNPEFF.out.report diff --git a/workflows/resequencing-mem.nf b/workflows/resequencing-mem.nf index 54616c6..f84fada 100644 --- a/workflows/resequencing-mem.nf +++ b/workflows/resequencing-mem.nf @@ -1,15 +1,3 @@ -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - VALIDATE INPUTS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -// Check input path parameters to see if they exist -def checkPathParamList = [ params.input, params.multiqc_config, params.genome_fasta, params.genome_bwa_index ] -for (param in checkPathParamList) { if (param) { file(param, checkIfExists: true) } } - -// Check mandatory parameters -if (params.input) { ch_input = file(params.input) } else { exit 1, 'Input samplesheet not specified!' } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -35,12 +23,11 @@ include { PREPARE_GENOME } from '../subworkflows/local/prepare_genome' include { CAT_FASTQ } from '../modules/nf-core/cat/fastq/main' include { FASTQC } from '../modules/nf-core/fastqc/main' include { - SEQKIT_RMDUP as SEQKIT_RMDUP_R1; - SEQKIT_RMDUP as SEQKIT_RMDUP_R2; } from '../modules/cnr-ibba/seqkit/rmdup/main' + SEQKIT_RMDUP as SEQKIT_RMDUP_R1; + SEQKIT_RMDUP as SEQKIT_RMDUP_R2; } from '../modules/cnr-ibba/seqkit/rmdup/main' include { TRIMGALORE } from '../modules/nf-core/trimgalore/main' include { BWA_MEM } from '../modules/nf-core/bwa/mem/main' include { CRAM_FREEBAYES_PARALLEL } from '../subworkflows/local/cram_freebayes_parallel/main' -include { BCFTOOLS_NORM as REMOVE_OVERLAP } from '../modules/nf-core/bcftools/norm/main' include { CRAM_MARKDUPLICATES_PICARD } from '../subworkflows/local/cram_markduplicates_picard/main' include { FREEBAYES_NORMALIZE } from '../subworkflows/local/freebayes_normalize' include { BCFTOOLS_CONCAT } from '../modules/nf-core/bcftools/concat/main' @@ -54,227 +41,222 @@ include { MULTIQC } from '../modules/nf-core/multiq // main workflow and it’s implicitly executed. Therefore it’s the entry point // of the workflow application. workflow RESEQUENCING_MEM { - // collect software version - ch_versions = Channel.empty() - - // - // SUBWORKFLOW: Read in samplesheet, validate and stage input files - // - INPUT_CHECK ( - ch_input - ) - .reads - .map { - meta, fastq -> - def meta_clone = meta.clone() - def tmp = meta_clone.id.split('_') - if (tmp.size() > 1) { - meta_clone.id = tmp[0..-2].join('_') - } - [ meta_clone, fastq ] - } - .groupTuple(by: [0]) - .branch { - meta, fastq -> - single : fastq.size() == 1 - return [ meta, fastq.flatten() ] - multiple: fastq.size() > 1 - return [ meta, fastq.flatten() ] + take: + ch_input // channel: samplesheet read in from --input + + main: + // collect software version + ch_versions = Channel.empty() + + // + // SUBWORKFLOW: Read in samplesheet, validate and stage input files + // + INPUT_CHECK ( + ch_input + ) + .reads + .map { + meta, fastq -> + def meta_clone = meta.clone() + def tmp = meta_clone.id.split('_') + if (tmp.size() > 1) { + meta_clone.id = tmp[0..-2].join('_') + } + [ meta_clone, fastq ] + } + .groupTuple(by: [0]) + .branch { + meta, fastq -> + single : fastq.size() == 1 + return [ meta, fastq.flatten() ] + multiple: fastq.size() > 1 + return [ meta, fastq.flatten() ] + } + .set { ch_fastq } + ch_versions = ch_versions.mix(INPUT_CHECK.out.versions) + + genome_fasta = Channel.fromPath(params.genome_fasta).collect() + genome_fasta_fai = params.genome_fasta_fai ? Channel.fromPath(params.genome_fasta_fai).collect() : Channel.empty() + genome_bwa_index = params.genome_bwa_index ? Channel.fromPath(params.genome_bwa_index).collect() : Channel.empty() + + // Build indices if needed + PREPARE_GENOME( + genome_fasta, + genome_fasta_fai, + genome_bwa_index + ) + ch_versions = ch_versions.mix(PREPARE_GENOME.out.versions) + + // + // MODULE: Concatenate FastQ files from same sample if required + // + CAT_FASTQ ( + ch_fastq.multiple + ) + .reads + .mix(ch_fastq.single) + .set { ch_cat_fastq } + ch_versions = ch_versions.mix(CAT_FASTQ.out.versions.first().ifEmpty(null)) + + // call FASTQC from module + FASTQC(INPUT_CHECK.out.reads) + ch_versions = ch_versions.mix(FASTQC.out.versions) + + // remove duplicates (if necessary) + if (params.remove_fastq_duplicates) { + // collect multiple files in one + ch_cat_fastq + .multiMap { meta, reads -> + r1: [meta, reads[0]] + r2: [meta, reads[1]] + }.set{ ch_seqkit_input } + + SEQKIT_RMDUP_R1(ch_seqkit_input.r1) + SEQKIT_RMDUP_R2(ch_seqkit_input.r2) + ch_versions = ch_versions.mix(SEQKIT_RMDUP_R1.out.versions) + + ch_trimgalore_input = SEQKIT_RMDUP_R1.out.unique + .join(SEQKIT_RMDUP_R2.out.unique) + .map{ meta, r1, r2 -> [meta, [r1, r2]]} + + // Trimming reads + TRIMGALORE(ch_trimgalore_input) + ch_versions = ch_versions.mix(TRIMGALORE.out.versions) + } else { + // Trimming reads + TRIMGALORE(ch_cat_fastq) + ch_versions = ch_versions.mix(TRIMGALORE.out.versions) } - .set { ch_fastq } - ch_versions = ch_versions.mix(INPUT_CHECK.out.versions) - - genome_fasta = Channel.fromPath(params.genome_fasta).collect() - genome_fasta_fai = params.genome_fasta_fai ? Channel.fromPath(params.genome_fasta_fai).collect() : Channel.empty() - genome_bwa_index = params.genome_bwa_index ? Channel.fromPath(params.genome_bwa_index).collect() : Channel.empty() - - // Build indices if needed - PREPARE_GENOME( - genome_fasta, - genome_fasta_fai, - genome_bwa_index - ) - ch_versions = ch_versions.mix(PREPARE_GENOME.out.versions) - - // - // MODULE: Concatenate FastQ files from same sample if required - // - CAT_FASTQ ( - ch_fastq.multiple - ) - .reads - .mix(ch_fastq.single) - .set { ch_cat_fastq } - ch_versions = ch_versions.mix(CAT_FASTQ.out.versions.first().ifEmpty(null)) - - // call FASTQC from module - FASTQC(INPUT_CHECK.out.reads) - ch_versions = ch_versions.mix(FASTQC.out.versions) - - // remove duplicates (if necessary) - if (params.remove_fastq_duplicates) { - // collect multiple files in one - ch_cat_fastq - .multiMap { meta, reads -> - r1: [meta, reads[0]] - r2: [meta, reads[1]] - }.set{ ch_seqkit_input } - - SEQKIT_RMDUP_R1(ch_seqkit_input.r1) - SEQKIT_RMDUP_R2(ch_seqkit_input.r2) - ch_versions = ch_versions.mix(SEQKIT_RMDUP_R1.out.versions) - - ch_trimgalore_input = SEQKIT_RMDUP_R1.out.unique - .join(SEQKIT_RMDUP_R2.out.unique) - .map{ meta, r1, r2 -> [meta, [r1, r2]]} - - // Trimming reads - TRIMGALORE(ch_trimgalore_input) - ch_versions = ch_versions.mix(TRIMGALORE.out.versions) - } else { - // Trimming reads - TRIMGALORE(ch_cat_fastq) - ch_versions = ch_versions.mix(TRIMGALORE.out.versions) - } - - // aligning with bwa: need reads in the same format used with FASTQC, a index file - // which can be read from BWA_INDEX.out emit channel (https://www.nextflow.io/docs/edge/dsl2.html#process-named-output) - // third params is if we want to sort data or not (true, so I don't need to SORT - // with an additional step) - BWA_MEM(TRIMGALORE.out.reads, PREPARE_GENOME.out.bwa_index, PREPARE_GENOME.out.genome_fasta, true) - ch_versions = ch_versions.mix(BWA_MEM.out.versions) - - // Perform Picard MarkDuplicates, index CRAM file and run samtools stats, flagstat and idxstats - CRAM_MARKDUPLICATES_PICARD(BWA_MEM.out.cram, PREPARE_GENOME.out.genome_fasta, PREPARE_GENOME.out.genome_fasta_fai) - ch_versions = ch_versions.mix(CRAM_MARKDUPLICATES_PICARD.out.versions) - - // prepare to call freebayes (multi) - get rid of meta.id - freebayes_input_cram = CRAM_MARKDUPLICATES_PICARD.out.cram.map{ meta, cram -> [cram] }.collect().map{ it -> [[id: "all-samples"], it]} - freebayes_input_crai = CRAM_MARKDUPLICATES_PICARD.out.crai.map{ meta, crai -> [crai] }.collect().map{ it -> [[id: "all-samples"], it]} - - // call freebayes paralle - CRAM_FREEBAYES_PARALLEL( - freebayes_input_cram, - freebayes_input_crai, - PREPARE_GENOME.out.genome_fasta, - PREPARE_GENOME.out.genome_fasta_fai - ) - ch_versions = ch_versions.mix(CRAM_FREEBAYES_PARALLEL.out.versions) - - // create bcftools channel. Freebayes multi will emit a single value for vcf and indexes. - // join it and then change meta key to avoid file name collisions (meta is used to - // determine output files) - bcftools_in_ch = CRAM_FREEBAYES_PARALLEL.out.vcf - .join(CRAM_FREEBAYES_PARALLEL.out.tbi) - - // normalize VCF (see https://github.com/freebayes/freebayes#normalizing-variant-representation) - // required to remove overlapping regions after concatenation - // TODO: move this normalization in CRAM_FREEBAYES_PARALLEL, after concatenation - REMOVE_OVERLAP( - bcftools_in_ch, - PREPARE_GENOME.out.genome_fasta - ) - ch_versions = ch_versions.mix(REMOVE_OVERLAP.out.versions) - - // normalize VCF using freebayes and bcftools - FREEBAYES_NORMALIZE( - REMOVE_OVERLAP.out.vcf, - PREPARE_GENOME.out.genome_fasta - ) - ch_versions = ch_versions.mix(FREEBAYES_NORMALIZE.out.versions) - - // concatenate all chromosome in one file. - bcftools_in_ch = FREEBAYES_NORMALIZE.out.vcf - .map{ _meta, vcf -> [vcf] } - .collect() - .map{ it -> [[id: "all-samples-normalized"], it]} - .join( - FREEBAYES_NORMALIZE.out.tbi + + // aligning with bwa: need reads in the same format used with FASTQC, a index file + // which can be read from BWA_INDEX.out emit channel (https://www.nextflow.io/docs/edge/dsl2.html#process-named-output) + // third params is if we want to sort data or not (true, so I don't need to SORT + // with an additional step) + BWA_MEM(TRIMGALORE.out.reads, PREPARE_GENOME.out.bwa_index, PREPARE_GENOME.out.genome_fasta, true) + ch_versions = ch_versions.mix(BWA_MEM.out.versions) + + // Perform Picard MarkDuplicates, index CRAM file and run samtools stats, flagstat and idxstats + CRAM_MARKDUPLICATES_PICARD(BWA_MEM.out.cram, PREPARE_GENOME.out.genome_fasta, PREPARE_GENOME.out.genome_fasta_fai) + ch_versions = ch_versions.mix(CRAM_MARKDUPLICATES_PICARD.out.versions) + + // prepare to call freebayes (multi) - get rid of meta.id + freebayes_input_cram = CRAM_MARKDUPLICATES_PICARD.out.cram.map{ meta, cram -> [cram] }.collect().map{ it -> [[id: "all-samples"], it]} + freebayes_input_crai = CRAM_MARKDUPLICATES_PICARD.out.crai.map{ meta, crai -> [crai] }.collect().map{ it -> [[id: "all-samples"], it]} + + // call freebayes paralle + CRAM_FREEBAYES_PARALLEL( + freebayes_input_cram, + freebayes_input_crai, + PREPARE_GENOME.out.genome_fasta, + PREPARE_GENOME.out.genome_fasta_fai + ) + ch_versions = ch_versions.mix(CRAM_FREEBAYES_PARALLEL.out.versions) + + // normalize VCF using freebayes and bcftools + FREEBAYES_NORMALIZE( + CRAM_FREEBAYES_PARALLEL.out.vcf, + CRAM_FREEBAYES_PARALLEL.out.tbi, + PREPARE_GENOME.out.genome_fasta + ) + ch_versions = ch_versions.mix(FREEBAYES_NORMALIZE.out.versions) + + // concatenate all chromosome in one file. + bcftools_in_ch = FREEBAYES_NORMALIZE.out.vcf .map{ _meta, vcf -> [vcf] } .collect() .map{ it -> [[id: "all-samples-normalized"], it]} + .join( + FREEBAYES_NORMALIZE.out.tbi + .map{ _meta, vcf -> [vcf] } + .collect() + .map{ it -> [[id: "all-samples-normalized"], it]} + ) + // .view() + + BCFTOOLS_CONCAT(bcftools_in_ch) + ch_versions = ch_versions.mix(BCFTOOLS_CONCAT.out.versions) + + // index normalized VCF file + BCFTOOLS_CONCAT_TABIX(BCFTOOLS_CONCAT.out.vcf) + ch_versions = ch_versions.mix(BCFTOOLS_CONCAT_TABIX.out.versions) + + // prepare input for bcftools stats + bcftools_in_ch = BCFTOOLS_CONCAT.out.vcf + .join(BCFTOOLS_CONCAT_TABIX.out.tbi) + // .view() + + BCFTOOLS_STATS( + bcftools_in_ch, + [[], []], + [[], []], + [[], []], + [[], []], + [[], []] ) - // .view() - - BCFTOOLS_CONCAT(bcftools_in_ch) - ch_versions = ch_versions.mix(BCFTOOLS_CONCAT.out.versions) - - // index normalized VCF file - BCFTOOLS_CONCAT_TABIX(BCFTOOLS_CONCAT.out.vcf) - ch_versions = ch_versions.mix(BCFTOOLS_CONCAT_TABIX.out.versions) - - // prepare input for bcftools stats - bcftools_in_ch = BCFTOOLS_CONCAT.out.vcf - .join(BCFTOOLS_CONCAT_TABIX.out.tbi) - // .view() - - BCFTOOLS_STATS( - bcftools_in_ch, - [[], []], - [[], []], - [[], []], - [[], []], - [[], []] - ) - ch_versions = ch_versions.mix(BCFTOOLS_STATS.out.versions) - - // for simplicity, I will collect SnpEff report in a new channel, in order - // to use it as an empty chennel in MultiQC if SnpEff is not used - snpeff_report = Channel.empty() - - // check for SnpEff annotation - if (params.snpeff_database) { - // annotate VCF with SnpEff - SNPEFF_ANNOTATE( - params.snpeff_database, - FREEBAYES_NORMALIZE.out.vcf, + ch_versions = ch_versions.mix(BCFTOOLS_STATS.out.versions) + + // for simplicity, I will collect SnpEff report in a new channel, in order + // to use it as an empty chennel in MultiQC if SnpEff is not used + snpeff_report = Channel.empty() + + // check for SnpEff annotation + if (params.snpeff_database) { + // annotate VCF with SnpEff + SNPEFF_ANNOTATE( + params.snpeff_database, + FREEBAYES_NORMALIZE.out.vcf, + ) + + // track version + ch_versions = ch_versions.mix(SNPEFF_ANNOTATE.out.versions) + + // update snpeff_report channel + snpeff_report = SNPEFF_ANNOTATE.out.report + } + + // get only the data I need for a MultiQC step + ch_multiqc_files = FASTQC.out.html.map{it[1]}.ifEmpty([]) + .concat(FASTQC.out.zip.map{it[1]}.ifEmpty([])) + .concat(TRIMGALORE.out.log.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.metrics.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.stats.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.idxstats.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.flagstat.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.coverage.map{it[1]}.ifEmpty([])) + .concat(BCFTOOLS_STATS.out.stats.map{it[1]}.ifEmpty([])) + .concat(snpeff_report.map{it[1]}.ifEmpty([])) + // .view() + + // prepare multiqc_config file + ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) + ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config, checkIfExists: true) : Channel.empty() + ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath(params.multiqc_logo, checkIfExists: true) : Channel.empty() + + // TODO: requires nf-validation plugin and other stuff + // summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") + // ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) + // ch_multiqc_custom_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) + // ch_methods_description = Channel.value(methodsDescriptionText(ch_multiqc_custom_methods_description)) + // ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) + // ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions) + // ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml', sort: false)) + + // calling MultiQC + MULTIQC ( + ch_multiqc_files.collect(), + ch_multiqc_config.toList(), + ch_multiqc_custom_config.toList(), + ch_multiqc_logo.toList(), + [], + [] ) - // track version - ch_versions = ch_versions.mix(SNPEFF_ANNOTATE.out.versions) - - // update snpeff_report channel - snpeff_report = SNPEFF_ANNOTATE.out.report - } - - // get only the data I need for a MultiQC step - ch_multiqc_files = FASTQC.out.html.map{it[1]}.ifEmpty([]) - .concat(FASTQC.out.zip.map{it[1]}.ifEmpty([])) - .concat(TRIMGALORE.out.log.map{it[1]}.ifEmpty([])) - .concat(CRAM_MARKDUPLICATES_PICARD.out.metrics.map{it[1]}.ifEmpty([])) - .concat(CRAM_MARKDUPLICATES_PICARD.out.stats.map{it[1]}.ifEmpty([])) - .concat(CRAM_MARKDUPLICATES_PICARD.out.idxstats.map{it[1]}.ifEmpty([])) - .concat(CRAM_MARKDUPLICATES_PICARD.out.flagstat.map{it[1]}.ifEmpty([])) - .concat(CRAM_MARKDUPLICATES_PICARD.out.coverage.map{it[1]}.ifEmpty([])) - .concat(BCFTOOLS_STATS.out.stats.map{it[1]}.ifEmpty([])) - .concat(snpeff_report.map{it[1]}.ifEmpty([])) - // .view() - - // prepare multiqc_config file - ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) - ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config, checkIfExists: true) : Channel.empty() - ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath(params.multiqc_logo, checkIfExists: true) : Channel.empty() - - // TODO: requires nf-validation plugin and other stuff - // summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") - // ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) - // ch_multiqc_custom_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) - // ch_methods_description = Channel.value(methodsDescriptionText(ch_multiqc_custom_methods_description)) - // ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) - // ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions) - // ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml', sort: false)) - - // calling MultiQC - MULTIQC ( - ch_multiqc_files.collect(), - ch_multiqc_config.toList(), - ch_multiqc_custom_config.toList(), - ch_multiqc_logo.toList() - ) - - // return software version - CUSTOM_DUMPSOFTWAREVERSIONS ( - ch_versions.unique().collectFile(name: 'collated_versions.yml') - ) + // return software version + CUSTOM_DUMPSOFTWAREVERSIONS ( + ch_versions.unique().collectFile(name: 'collated_versions.yml') + ) + emit: + multiqc_report = MULTIQC.out.report.toList() // channel: /path/to/multiqc_report.html + versions = ch_versions // channel: [ path(versions.yml) ] }