diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index fb0acc75..69065bdb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -52,9 +52,9 @@ These tests are run both with the latest available version of `Nextflow` and als :warning: Only in the unlikely and regretful event of a release happening with a bug. -- On your own fork, make a new branch `patch` based on `upstream/master`. +- On your own fork, make a new branch `patch` based on `upstream/main`. - Fix the bug, and bump version (X.Y.Z+1). -- A PR should be made on `master` from patch to directly this particular bug. +- A PR should be made on `main` from patch to directly this particular bug. ## Pipeline contribution conventions diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 245df89f..b8950db4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,14 +8,14 @@ These are the most common things requested on pull requests (PRs). Remember that PRs should be made against the dev branch, unless you're preparing a pipeline release. -Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-cmgg/germline/tree/master/.github/CONTRIBUTING.md) +Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-cmgg/germline/tree/main/.github/CONTRIBUTING.md) --> ## PR checklist - [ ] This comment contains a description of changes (with reason). - [ ] If you've fixed a bug or added code that should be tested, add tests! -- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-cmgg/germline/tree/master/.github/CONTRIBUTING.md) +- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-cmgg/germline/tree/main/.github/CONTRIBUTING.md) - [ ] Make sure your code lints (`nf-core lint`). - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir `). - [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir `). diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index 5d7a55fc..4cad70ae 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -1,15 +1,15 @@ name: nf-core branch protection -# This workflow is triggered on PRs to master branch on the repository -# It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev` +# This workflow is triggered on PRs to main branch on the repository +# It fails when someone tries to make a PR against the nf-core `main` branch instead of `dev` on: pull_request_target: - branches: [master] + branches: [main] jobs: test: runs-on: ubuntu-latest steps: - # PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches + # PRs to the nf-core repo main branch are only ok if coming from the nf-core repo `dev` or any `patch` branches - name: Check PRs if: github.repository == 'nf-cmgg/germline' run: | @@ -22,7 +22,7 @@ jobs: uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 with: message: | - ## This PR is against the `master` branch :x: + ## This PR is against the `main` branch :x: * Do not close this PR * Click _Edit_ and change the `base` to `dev` @@ -32,9 +32,9 @@ jobs: Hi @${{ github.event.pull_request.user.login }}, - It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `master` branch. - The `master` branch on nf-core repositories should always contain code from the latest release. - Because of this, PRs to `master` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. + It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `main` branch. + The `main` branch on nf-core repositories should always contain code from the latest release. + Because of this, PRs to `main` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch. You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page. Note that even after this, the test will continue to show as failing until you push a new commit. diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index a7eded4d..be1ba144 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -2,7 +2,6 @@ name: build docs on: push: branches: - - master - main - dev permissions: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bbcff4d..37ebe5ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: NXF_VER: - - "23.10.0" + - "24.04.0" - "latest-everything" test: - "pipeline_default" diff --git a/.github/workflows/download_pipeline.yml b/.github/workflows/download_pipeline.yml index 2d20d644..4a2e3eb4 100644 --- a/.github/workflows/download_pipeline.yml +++ b/.github/workflows/download_pipeline.yml @@ -2,7 +2,7 @@ name: Test successful pipeline download with 'nf-core download' # Run the workflow when: # - dispatched manually -# - when a PR is opened or reopened to master branch +# - when a PR is opened or reopened to main branch # - the head branch of the pull request is updated, i.e. if fixes for a release are pushed last minute to dev. on: workflow_dispatch: @@ -17,10 +17,10 @@ on: - edited - synchronize branches: - - master + - main pull_request_target: branches: - - master + - main env: NXF_ANSI_LOG: false diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 1fcafe88..9593436d 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,6 +1,6 @@ name: nf-core linting # This workflow is triggered on pushes and PRs to the repository. -# It runs the `nf-core lint` and markdown lint tests to ensure +# It runs the `nf-core pipelines lint` and markdown lint tests to ensure # that the code meets the nf-core guidelines. on: push: @@ -41,17 +41,24 @@ jobs: python-version: "3.12" architecture: "x64" + - name: read .nf-core.yml + uses: pietrobolcato/action-read-yaml@1.0.0 + id: read_yml + with: + config: ${{ github.workspace }}/.nf-core.yaml + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install nf-core + pip install git+https://github.com/nf-core/tools@dev + #pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} - - name: Run nf-core lint + - name: Run nf-core pipelines lint env: GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }} - run: nf-core -l lint_log.txt lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md + run: nf-core -l lint_log.txt pipelines lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md - name: Save PR number if: ${{ always() }} diff --git a/.github/workflows/linting_comment.yml b/.github/workflows/linting_comment.yml index 40acc23f..42e519bf 100644 --- a/.github/workflows/linting_comment.yml +++ b/.github/workflows/linting_comment.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download lint results - uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3 + uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 with: workflow: linting.yml workflow_conclusion: completed diff --git a/.nf-core.yml b/.nf-core.yml index f9c0a042..7b994ce9 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1,24 +1,35 @@ lint: files_exist: - - CODE_OF_CONDUCT.md - - assets/nf-core-germline_logo_light.png - - docs/images/nf-core-germline_logo_light.png - - docs/images/nf-core-germline_logo_dark.png - - .github/ISSUE_TEMPLATE/config.yml - - .github/workflows/awstest.yml - - .github/workflows/awsfulltest.yml + - "CODE_OF_CONDUCT.md" + - "assets/nf-core-germline_logo_light.png" + - "docs/images/nf-core-germline_logo_light.png" + - "docs/images/nf-core-germline_logo_dark.png" + - ".github/ISSUE_TEMPLATE/config.yml" + - ".github/workflows/awstest.yml" + - ".github/workflows/awsfulltest.yml" + - "docs/README.md" files_unchanged: - - CODE_OF_CONDUCT.md - - assets/nf-core-germline_logo_light.png - - docs/images/nf-core-germline_logo_light.png - - docs/images/nf-core-germline_logo_dark.png - - .github/ISSUE_TEMPLATE/bug_report.yml - multiqc_config: - - report_comment + - ".github/CONTRIBUTING.md" + - ".github/PULL_REQUEST_TEMPLATE.md" + - ".github/workflows/branch.yml" + - ".github/workflows/linting_comment.yml" + - ".github/workflows/linting.yml" + - "CODE_OF_CONDUCT.md" + - ".github/ISSUE_TEMPLATE/bug_report.yml" + - ".prettierignore" nextflow_config: - - manifest.name - - manifest.homePage -nf_core_version: 2.14.1 + - "custom_config" # TODO Remove this once the new methods are supported + - "manifest.name" + - "manifest.homePage" + - "params.genomes" + - "validation.help.beforeText" + - "validation.help.afterText" + - "validation.summary.beforeText" + - "validation.summary.afterText" + multiqc_config: + - "report_comment" + actions_ci: false # TODO readd this once the linting doesn't act up +nf_core_version: 3.0.0dev repository_type: pipeline template: author: nvnieuwk diff --git a/CHANGELOG.md b/CHANGELOG.md index f8553db3..517ea82d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v1.8.0 - Optimistic Oostkamp - [September 23 2024] + +## New features + +1. Added `watchpath` functionality to the pipeline. Add the `watch:` prefix to a file basename in the samplesheet and the pipeline will automatically wait for the file to be created in the `--watchdir` directory (the lookup happens recursively) + +## Changes + +1. Bumped the minimal support nextflow version to `24.04.0` +2. Bumped all modules to the newest versions +3. The pipeline now also outputs `csi` indices +4. Rename the `master` branch to `main` +5. Low coverage regions (regions with less than 5 reads) are no longer considered for variant calling + +## Refactors + +1. Updated the pipeline to the new linting guidelines +2. Removed `check_max` in favor of `resourceLimits` + ## v1.7.0 - Tolerant Tongeren - [August 9 2024] ## Fixes diff --git a/CITATIONS.md b/CITATIONS.md new file mode 120000 index 00000000..35cfd9f8 --- /dev/null +++ b/CITATIONS.md @@ -0,0 +1 @@ +docs/CITATIONS.md \ No newline at end of file diff --git a/README.md b/README.md index ed28ef68..bd133931 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![GitHub Actions Linting Status](https://github.com/nf-cmgg/germline/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-cmgg/germline/actions/workflows/linting.yml) [![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com) -[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A523.04.0-23aa62.svg)](https://www.nextflow.io/) +[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A524.04.0-23aa62.svg)](https://www.nextflow.io/) [![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/) [![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/) [![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/) diff --git a/assets/schema_input.json b/assets/schema_input.json index f5de4eec..f1141ae6 100644 --- a/assets/schema_input.json +++ b/assets/schema_input.json @@ -16,28 +16,64 @@ "meta": ["family"] }, "cram": { - "type": "string", - "pattern": "^\\S+\\.cram$", - "format": "file-path", - "exists": true + "oneOf": [ + { + "type": "string", + "pattern": "^\\S+\\.cram$", + "format": "file-path", + "exists": true + }, + { + "type": "string", + "pattern": "^watch:\\S+\\.cram$", + "format": "file-path" + } + ] }, "crai": { - "type": "string", - "pattern": "^\\S+\\.crai$", - "format": "file-path", - "exists": true + "oneOf": [ + { + "type": "string", + "pattern": "^\\S+\\.cram\\.crai$", + "format": "file-path", + "exists": true + }, + { + "type": "string", + "pattern": "^watch:\\S+\\.cram\\.crai$", + "format": "file-path" + } + ] }, "gvcf": { - "type": "string", - "pattern": "^\\S+vcf(.gz)?$", - "format": "file-path", - "exists": true + "oneOf": [ + { + "type": "string", + "pattern": "^\\S+\\.g\\.vcf(\\.gz)?$", + "format": "file-path", + "exists": true + }, + { + "type": "string", + "pattern": "^watch:\\S+\\.g\\.vcf(\\.gz)?$", + "format": "file-path" + } + ] }, "tbi": { - "type": "string", - "pattern": "^\\S+\\.tbi$", - "format": "file-path", - "exists": true + "oneOf": [ + { + "type": "string", + "pattern": "^\\S+\\.g\\.vcf\\.gz\\.tbi$", + "format": "file-path", + "exists": true + }, + { + "type": "string", + "pattern": "^watch:\\S+\\.g\\.vcf\\.gz\\.tbi?$", + "format": "file-path" + } + ] }, "roi": { "type": "string", diff --git a/conf/base.config b/conf/base.config index 732c5444..35b35265 100644 --- a/conf/base.config +++ b/conf/base.config @@ -10,9 +10,9 @@ process { - cpus = { check_max( 1 * task.attempt, 'cpus' ) } - memory = { check_max( 8.GB * task.attempt, 'memory' ) } - time = { check_max( 4.h * task.attempt, 'time' ) } + cpus = { 1 * task.attempt } + memory = { 8.GB * task.attempt } + time = { 4.h * task.attempt } errorStrategy = { task.exitStatus in ((130..145) + 104) ? 'retry' : 'finish' } maxRetries = 1 @@ -20,30 +20,30 @@ process { // Process-specific resource requirements withLabel:process_single { - cpus = { check_max( 1 , 'cpus' ) } - memory = { check_max( 8.GB * task.attempt, 'memory' ) } - time = { check_max( 4.h * task.attempt, 'time' ) } + cpus = { 1 } + memory = { 8.GB * task.attempt } + time = { 4.h * task.attempt } } withLabel:process_low { - cpus = { check_max( 2 * task.attempt, 'cpus' ) } - memory = { check_max( 16.GB * task.attempt, 'memory' ) } - time = { check_max( 4.h * task.attempt, 'time' ) } + cpus = { 2 * task.attempt } + memory = { 16.GB * task.attempt } + time = { 4.h * task.attempt } } withLabel:process_medium { - cpus = { check_max( 4 * task.attempt, 'cpus' ) } - memory = { check_max( 32.GB * task.attempt, 'memory' ) } - time = { check_max( 8.h * task.attempt, 'time' ) } + cpus = { 4 * task.attempt } + memory = { 32.GB * task.attempt } + time = { 8.h * task.attempt } } withLabel:process_high { - cpus = { check_max( 8 * task.attempt, 'cpus' ) } - memory = { check_max( 64.GB * task.attempt, 'memory' ) } - time = { check_max( 16.h * task.attempt, 'time' ) } + cpus = { 8 * task.attempt } + memory = { 64.GB * task.attempt } + time = { 16.h * task.attempt } } withLabel:process_long { - time = { check_max( 20.h * task.attempt, 'time' ) } + time = { 20.h * task.attempt } } withLabel:process_high_memory { - memory = { check_max( 200.GB * task.attempt, 'memory' ) } + memory = { 200.GB * task.attempt } } withLabel:error_ignore { errorStrategy = 'ignore' diff --git a/conf/empty.config b/conf/empty.config new file mode 100644 index 00000000..19c49241 --- /dev/null +++ b/conf/empty.config @@ -0,0 +1 @@ +// DON'T REMOVE THIS FILE diff --git a/conf/empty_genomes.config b/conf/empty_genomes.config new file mode 100644 index 00000000..a90c75d0 --- /dev/null +++ b/conf/empty_genomes.config @@ -0,0 +1,3 @@ +// DON'T REMOVE THIS FILE! + +params.genomes = [:] diff --git a/conf/modules.config b/conf/modules.config index 14da9639..7c54ceb0 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -101,7 +101,7 @@ process { withName: "^.*CRAM_PREPARE_SAMTOOLS_BEDTOOLS:FILTER_BEDS\$" { ext.prefix = { "${meta.id}.filter"} - ext.args = "-vE \"NO_COVERAGE${params.keep_alt_contigs ? "" : "|alt|random|decoy|Un"}\"" + ext.args = "-vE \"LOW_COVERAGE|NO_COVERAGE${params.keep_alt_contigs ? "" : "|alt|random|decoy|Un"}\"" ext.args2 = "-d 150" publishDir = [ overwrite: true, @@ -138,7 +138,7 @@ process { } withName: "^.*CRAM_CALL_GENOTYPE_GATK4:CRAM_CALL_GATK4:GATK4_HAPLOTYPECALLER\$" { - time = { check_max( 16.h * task.attempt, 'time' ) } + time = { 16.h * task.attempt } ext.prefix = {"${meta.id}.g"} ext.args = { [ @@ -208,19 +208,19 @@ process { } withName: "^.*CRAM_CALL_GENOTYPE_GATK4:GVCF_JOINT_GENOTYPE_GATK4:GATK4_GENOMICSDBIMPORT\$" { - label = { meta.family_count <= 10 ? "process_medium" : "process_high" } - time = { check_max( 16.h * task.attempt, 'time' ) } + label = { meta.family_samples.tokenize(",").size() <= 10 ? "process_medium" : "process_high" } + time = { 16.h * task.attempt } // Lots of parameters are fetched from https://gatk.broadinstitute.org/hc/en-us/articles/360056138571-GenomicsDBImport-usage-and-performance-guidelines ext.args = { [ - meta.family_count >= 100 ? "--batch-size 100" : "", + meta.family_samples.tokenize(",").size() >= 100 ? "--batch-size 100" : "", "--overwrite-existing-genomicsdb-workspace", "--genomicsdb-shared-posixfs-optimizations", "--merge-input-intervals", "--bypass-feature-reader", "--max-num-intervals-to-import-in-parallel ${task.cpus*10}", "--reader-threads ${task.cpus}", - meta.family_count >= 100 ? "--consolidate" : "", + meta.family_samples.tokenize(",").size() >= 100 ? "--consolidate" : "", "--merge-contigs-into-num-partitions 25" ].join(" ") } @@ -236,7 +236,7 @@ process { if(!params.only_merge) { withName: "^.*CRAM_CALL_GENOTYPE_GATK4:GVCF_JOINT_GENOTYPE_GATK4:GATK4_GENOTYPEGVCFS\$" { - time = { check_max( 16.h * task.attempt, 'time' ) } + time = { 16.h * task.attempt } ext.args = { [ "--allow-old-rms-mapping-quality-annotation-data", @@ -288,7 +288,7 @@ process { if("vardict" in callers) { withName: "^.*CRAM_CALL_VARDICTJAVA:VARDICTJAVA\$" { - time = { check_max( 16.h * task.attempt, 'time' ) } + time = { 16.h * task.attempt } ext.prefix = {"${meta.id}"} ext.args = { [ @@ -333,7 +333,7 @@ process { } withName: "^.*CRAM_CALL_VARDICTJAVA:VCF_FILTER_BCFTOOLS:FILTER_2\$" { - ext.args = "--soft-filter 'LowFreqBias' --mode '+' -e 'FORMAT/AF[0] < 0.02 && FORMAT/VD[0] < 30 && INFO/SBF < 0.1 && INFO/NM >= 2.0' --output-type z" + ext.args = "--soft-filter 'LowFreqBias' --mode '+' -e 'FORMAT/AF[0:*] < 0.02 && FORMAT/VD[0] < 30 && INFO/SBF < 0.1 && INFO/NM >= 2.0' --output-type z" ext.prefix = enableOutput("filter") ? final_prefix : {"${meta.id}.filtered"} publishDir = [ overwrite: true, @@ -430,7 +430,7 @@ process { if(params.annotate){ withName: "^.*VCF_ANNOTATION:VCF_ANNOTATE_ENSEMBLVEP:ENSEMBLVEP_VEP\$" { - memory = { check_max( 12.GB * task.attempt, 'memory' ) } + memory = { 12.GB * task.attempt } ext.args = {[ // Specify the input format "--format vcf", @@ -565,7 +565,7 @@ process { withName: "^.*VCF_ROH_AUTOMAP:AUTOMAP_AUTOMAP\$" { ext.prefix = {"automap_${meta.caller}"} ext.args = {[ - meta.family_count > 1 ? "--multivcf" : "--id ${meta.samples}", + meta.family_samples.tokenize(",").size() > 1 ? "--multivcf" : "--id ${meta.family_samples}", params.automap_panel_name ? "--panelname ${params.automap_panel_name}" : "" ].findAll { it != "" }.join(" ")} publishDir = [ diff --git a/conf/nf_test.config b/conf/nf_test.config index 8442cb9d..3d2c735e 100644 --- a/conf/nf_test.config +++ b/conf/nf_test.config @@ -6,11 +6,6 @@ params { - // Limit resources so that this can run on GitHub Actions - max_cpus = 2 - max_memory = '6.GB' - max_time = '6.h' - // Input data input = "${baseDir}/tests/inputs/samplesheet.csv" @@ -25,3 +20,12 @@ params { skip_date_project = true } + +process { + // Limit resources so that this can run on GitHub Actions + resourceLimits = [ + cpus : 2, + memory: 6.GB, + time : 6.h + ] +} diff --git a/conf/test.config b/conf/test.config index 0d2a33a3..01e51012 100644 --- a/conf/test.config +++ b/conf/test.config @@ -14,11 +14,6 @@ params { config_profile_name = 'Test profile' config_profile_description = 'Minimal test dataset to check pipeline function' - // Limit resources so that this can run on GitHub Actions - max_cpus = 2 - max_memory = '6.GB' - max_time = '6.h' - // Input data input = "${projectDir}/assets/samplesheet.csv" @@ -55,3 +50,12 @@ params { vcfanno_resources = "https://github.com/brentp/vcfanno/raw/master/example/exac.vcf.gz;https://github.com/brentp/vcfanno/raw/master/example/exac.vcf.gz.tbi" } + +process { + // Limit resources so that this can run on GitHub Actions + resourceLimits = [ + cpus : 2, + memory: 6.GB, + time : 6.h + ] +} diff --git a/conf/test_full.config b/conf/test_full.config index 9943a39d..37b1a6c0 100644 --- a/conf/test_full.config +++ b/conf/test_full.config @@ -15,9 +15,7 @@ params { config_profile_description = 'Full test dataset to check pipeline function' // Input data for full size test - // TODO nf-core: Specify the paths to your full test data ( on nf-core/test-datasets or directly in repositories, e.g. SRA) - // TODO nf-core: Give any required params for the test so that command line flags are not needed - input = params.pipelines_testdata_base_path + 'viralrecon/samplesheet/samplesheet_full_illumina_amplicon.csv' + // input = params.pipelines_testdata_base_path + 'viralrecon/samplesheet/samplesheet_full_illumina_amplicon.csv' // Genome references genome = 'R64-1-1' diff --git a/docs/parameters.md b/docs/parameters.md index 65da21a8..d4f25095 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -81,16 +81,6 @@ Parameters used to describe centralised config profiles. These should not be edi | `config_profile_contact` | Institutional config contact information. | `string` | | | True | | `config_profile_url` | Institutional config URL link. | `string` | | | True | -## Max job request options - -Set the top limit for requested resources for any single job. - -| Parameter | Description | Type | Default | Required | Hidden | -| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------- | -------- | ------ | -| `max_cpus` | Maximum number of CPUs that can be requested for any single job.
HelpUse to set an upper-limit for the CPU requirement for each process. Should be an integer e.g. `--max_cpus 1`
| `integer` | 16 | | True | -| `max_memory` | Maximum amount of memory that can be requested for any single job.
HelpUse to set an upper-limit for the memory requirement for each process. Should be a string in the format integer-unit e.g. `--max_memory '8.GB'`
| `string` | 128.GB | | True | -| `max_time` | Maximum amount of time that can be requested for any single job.
HelpUse to set an upper-limit for the time requirement for each process. Should be a string in the format integer-unit e.g. `--max_time '2.h'`
| `string` | 240.h | | True | - ## Generic options Less common options for the pipeline, typically set in a config file. diff --git a/main.nf b/main.nf index 16f7ecf8..285e1280 100644 --- a/main.nf +++ b/main.nf @@ -7,87 +7,36 @@ ---------------------------------------------------------------------------------------- */ -nextflow.enable.dsl = 2 - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { getGenomeAttribute } from './subworkflows/local/utils_cmgg_germline_pipeline' - -params.fasta = getGenomeAttribute('fasta') -params.fai = getGenomeAttribute('fai') -params.dict = getGenomeAttribute('dict') -params.strtablefile = getGenomeAttribute('strtablefile') -params.sdf = getGenomeAttribute('sdf') -params.dbsnp = getGenomeAttribute('dbsnp') -params.dbsnp_tbi = getGenomeAttribute('dbsnp_tbi') -params.vep_cache = getGenomeAttribute('vep_cache') -params.dbnsfp = getGenomeAttribute('dbnsfp') -params.dbnsfp_tbi = getGenomeAttribute('dbnsfp_tbi') -params.spliceai_indel = getGenomeAttribute('spliceai_indel') -params.spliceai_indel_tbi = getGenomeAttribute('spliceai_indel_tbi') -params.spliceai_snv = getGenomeAttribute('spliceai_snv') -params.spliceai_snv_tbi = getGenomeAttribute('spliceai_snv_tbi') -params.mastermind = getGenomeAttribute('mastermind') -params.mastermind_tbi = getGenomeAttribute('mastermind_tbi') -params.eog = getGenomeAttribute('eog') -params.eog_tbi = getGenomeAttribute('eog_tbi') -params.alphamissense = getGenomeAttribute('alphamissense') -params.alphamissense_tbi = getGenomeAttribute('alphamissense_tbi') -params.vcfanno_resources = getGenomeAttribute('vcfanno_resources') -params.vcfanno_config = getGenomeAttribute('vcfanno_config') - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - VALIDATE INPUTS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -// -// Check for dependencies between parameters -// - -if(params.dbsnp_tbi && !params.dbsnp){ - error("Please specify the dbsnp VCF with --dbsnp VCF") -} - -if (params.annotate) { - // Check if a genome is given - if (!params.genome) { error("A genome should be supplied for annotation (use --genome)") } - - // Check if the VEP versions were given - if (!params.vep_version) { error("A VEP version should be supplied for annotation (use --vep_version)") } - if (!params.vep_cache_version) { error("A VEP cache version should be supplied for annotation (use --vep_cache_version)") } - - // Check if a species is entered - if (!params.species) { error("A species should be supplied for annotation (use --species)") } - - // Check if all vcfanno files are supplied when vcfanno should be used - if (params.vcfanno && (!params.vcfanno_config || !params.vcfanno_resources)) { - error("A TOML file and resource files should be supplied when using vcfanno (use --vcfanno_config and --vcfanno_resources)") - } -} - -callers = params.callers.tokenize(",") -for(caller in callers) { - if(!(caller in GlobalVariables.availableCallers)) { error("\"${caller}\" is not a supported callers please use one or more of these instead: ${GlobalVariables.availableCallers}")} -} - -if (params.output_suffix && callers.size() > 1) { - error("Cannot use --output_suffix with more than one caller") -} - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - CONFIG FILES -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ - -multiqc_logo = params.multiqc_logo ?: "$projectDir/assets/CMGG_logo.png" - +include { getGenomeAttribute } from './subworkflows/local/utils_cmgg_germline_pipeline' + +params.fasta = getGenomeAttribute('fasta', params.genomes, params.genome) +params.fai = getGenomeAttribute('fai', params.genomes, params.genome) +params.dict = getGenomeAttribute('dict', params.genomes, params.genome) +params.strtablefile = getGenomeAttribute('strtablefile', params.genomes, params.genome) +params.sdf = getGenomeAttribute('sdf', params.genomes, params.genome) +params.dbsnp = getGenomeAttribute('dbsnp', params.genomes, params.genome) +params.dbsnp_tbi = getGenomeAttribute('dbsnp_tbi', params.genomes, params.genome) +params.vep_cache = getGenomeAttribute('vep_cache', params.genomes, params.genome) +params.dbnsfp = getGenomeAttribute('dbnsfp', params.genomes, params.genome) +params.dbnsfp_tbi = getGenomeAttribute('dbnsfp_tbi', params.genomes, params.genome) +params.spliceai_indel = getGenomeAttribute('spliceai_indel', params.genomes, params.genome) +params.spliceai_indel_tbi = getGenomeAttribute('spliceai_indel_tbi', params.genomes, params.genome) +params.spliceai_snv = getGenomeAttribute('spliceai_snv', params.genomes, params.genome) +params.spliceai_snv_tbi = getGenomeAttribute('spliceai_snv_tbi', params.genomes, params.genome) +params.mastermind = getGenomeAttribute('mastermind', params.genomes, params.genome) +params.mastermind_tbi = getGenomeAttribute('mastermind_tbi', params.genomes, params.genome) +params.eog = getGenomeAttribute('eog', params.genomes, params.genome) +params.eog_tbi = getGenomeAttribute('eog_tbi', params.genomes, params.genome) +params.alphamissense = getGenomeAttribute('alphamissense', params.genomes, params.genome) +params.alphamissense_tbi = getGenomeAttribute('alphamissense_tbi', params.genomes, params.genome) +params.vcfanno_resources = getGenomeAttribute('vcfanno_resources', params.genomes, params.genome) +params.vcfanno_config = getGenomeAttribute('vcfanno_config', params.genomes, params.genome) /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -106,7 +55,9 @@ include { PIPELINE_COMPLETION } from './subworkflows/local/utils_cmgg_germli workflow NFCMGG_GERMLINE { take: - samplesheet // channel: samplesheet read in from --input + samplesheet // channel: samplesheet read in from --input + pipeline_params // the parameters used for this pipeline + multiqc_logo // string: the path to the multiqc logo main: @@ -118,66 +69,66 @@ workflow NFCMGG_GERMLINE { samplesheet, // File inputs - params.fasta, - params.fai, - params.dict, - params.strtablefile, - params.sdf, - params.dbsnp, - params.dbsnp_tbi, - params.vep_cache, - params.dbnsfp, - params.dbnsfp_tbi, - params.spliceai_indel, - params.spliceai_indel_tbi, - params.spliceai_snv, - params.spliceai_snv_tbi, - params.mastermind, - params.mastermind_tbi, - params.eog, - params.eog_tbi, - params.alphamissense, - params.alphamissense_tbi, - params.vcfanno_resources, - params.vcfanno_config, - params.multiqc_config, + pipeline_params.fasta, + pipeline_params.fai, + pipeline_params.dict, + pipeline_params.strtablefile, + pipeline_params.sdf, + pipeline_params.dbsnp, + pipeline_params.dbsnp_tbi, + pipeline_params.vep_cache, + pipeline_params.dbnsfp, + pipeline_params.dbnsfp_tbi, + pipeline_params.spliceai_indel, + pipeline_params.spliceai_indel_tbi, + pipeline_params.spliceai_snv, + pipeline_params.spliceai_snv_tbi, + pipeline_params.mastermind, + pipeline_params.mastermind_tbi, + pipeline_params.eog, + pipeline_params.eog_tbi, + pipeline_params.alphamissense, + pipeline_params.alphamissense_tbi, + pipeline_params.vcfanno_resources, + pipeline_params.vcfanno_config, + pipeline_params.multiqc_config, multiqc_logo, - params.multiqc_methods_description, - params.roi, - params.somalier_sites, - params.vcfanno_lua, - params.updio_common_cnvs, - params.automap_repeats, - params.automap_panel, - params.outdir, + pipeline_params.multiqc_methods_description, + pipeline_params.roi, + pipeline_params.somalier_sites, + pipeline_params.vcfanno_lua, + pipeline_params.updio_common_cnvs, + pipeline_params.automap_repeats, + pipeline_params.automap_panel, + pipeline_params.outdir, GlobalVariables.pedFiles, // Boolean inputs - params.dragstr, - params.annotate, - params.vcfanno, - params.only_call, - params.only_merge, - params.filter, - params.normalize, - params.add_ped, - params.gemini, - params.validate, - params.updio, - params.automap, - params.vep_dbnsfp, - params.vep_spliceai, - params.vep_mastermind, - params.vep_eog, - params.vep_alphamissense, + pipeline_params.dragstr, + pipeline_params.annotate, + pipeline_params.vcfanno, + pipeline_params.only_call, + pipeline_params.only_merge, + pipeline_params.filter, + pipeline_params.normalize, + pipeline_params.add_ped, + pipeline_params.gemini, + pipeline_params.validate, + pipeline_params.updio, + pipeline_params.automap, + pipeline_params.vep_dbnsfp, + pipeline_params.vep_spliceai, + pipeline_params.vep_mastermind, + pipeline_params.vep_eog, + pipeline_params.vep_alphamissense, // Value inputs - params.genome, - params.species, - params.vep_cache_version, - params.vep_chunk_size, - params.scatter_count, - params.callers.tokenize(",") + pipeline_params.genome, + pipeline_params.species, + pipeline_params.vep_cache_version, + pipeline_params.vep_chunk_size, + pipeline_params.scatter_count, + pipeline_params.callers.tokenize(",") ) emit: @@ -195,6 +146,54 @@ workflow { main: + /* + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + VALIDATE INPUTS + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + + // + // Check for dependencies between parameters + // + + if(params.dbsnp_tbi && !params.dbsnp){ + error("Please specify the dbsnp VCF with --dbsnp VCF") + } + + if (params.annotate) { + // Check if a genome is given + if (!params.genome) { error("A genome should be supplied for annotation (use --genome)") } + + // Check if the VEP versions were given + if (!params.vep_version) { error("A VEP version should be supplied for annotation (use --vep_version)") } + if (!params.vep_cache_version) { error("A VEP cache version should be supplied for annotation (use --vep_cache_version)") } + + // Check if a species is entered + if (!params.species) { error("A species should be supplied for annotation (use --species)") } + + // Check if all vcfanno files are supplied when vcfanno should be used + if (params.vcfanno && (!params.vcfanno_config || !params.vcfanno_resources)) { + error("A TOML file and resource files should be supplied when using vcfanno (use --vcfanno_config and --vcfanno_resources)") + } + } + + def callers = params.callers.tokenize(",") + callers.each { caller -> + if(!(caller in GlobalVariables.availableCallers)) { error("\"${caller}\" is not a supported callers please use one or more of these instead: ${GlobalVariables.availableCallers}")} + } + + if (params.output_suffix && callers.size() > 1) { + error("Cannot use --output_suffix with more than one caller") + } + + /* + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CONFIG FILES + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + + def multiqc_logo = params.multiqc_logo ?: "$projectDir/assets/CMGG_logo.png" + // // SUBWORKFLOW: Run initialisation tasks // @@ -205,14 +204,20 @@ workflow { params.monochrome_logs, args, params.outdir, - params.input + params.input, + params.ped, + params.genomes, + params.genome, + params.watchdir ) // // WORKFLOW: Run main workflow // NFCMGG_GERMLINE ( - PIPELINE_INITIALISATION.out.samplesheet + PIPELINE_INITIALISATION.out.samplesheet, + params, + multiqc_logo ) // diff --git a/modules.json b/modules.json index 6f8e48ba..19d1e586 100644 --- a/modules.json +++ b/modules.json @@ -7,223 +7,210 @@ "nf-core": { "bcftools/annotate": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", - "installed_by": ["modules"] + "git_sha": "88ae68490e8f2478a1e1bbeedac970fd7cc73022", + "installed_by": ["modules"], + "patch": "modules/nf-core/bcftools/annotate/bcftools-annotate.diff" }, "bcftools/concat": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", - "installed_by": ["modules", "vcf_annotate_ensemblvep_snpeff"], - "patch": "modules/nf-core/bcftools/concat/bcftools-concat.diff" + "git_sha": "cdf83b18471db290a28fe98c2a0852cb05864890", + "installed_by": ["vcf_annotate_ensemblvep_snpeff"] }, "bcftools/filter": { "branch": "master", - "git_sha": "a3893076a76e91b3ff152faddf872f00778fb224", + "git_sha": "33ef773a7ea36e88323902f63662aa53c9b88988", "installed_by": ["modules"] }, "bcftools/norm": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "f6cc00f107826cfaf1c933297b10ed1757b41479", "installed_by": ["modules"] }, "bcftools/pluginscatter": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "33ef773a7ea36e88323902f63662aa53c9b88988", "installed_by": ["vcf_annotate_ensemblvep_snpeff"] }, "bcftools/query": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "34ac993e081b32d2170ab790d0386b74122f9d36", "installed_by": ["modules"] }, "bcftools/reheader": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", - "installed_by": ["modules"], - "patch": "modules/nf-core/bcftools/reheader/bcftools-reheader.diff" + "git_sha": "c32611ac6813055b9321d2827678e2f8aebcb394", + "installed_by": ["modules"] }, "bcftools/sort": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "cdf83b18471db290a28fe98c2a0852cb05864890", "installed_by": ["vcf_annotate_ensemblvep_snpeff"] }, "bcftools/stats": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", "installed_by": ["modules"] }, "bedtools/intersect": { "branch": "master", - "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", + "git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48", "installed_by": ["modules"] }, "bedtools/merge": { "branch": "master", - "git_sha": "575e1bc54b083fb15e7dd8b5fcc40bea60e8ce83", + "git_sha": "a3d614e4a7b8691a259bcfe33ad80903217d6215", "installed_by": ["modules"] }, "bedtools/split": { "branch": "master", - "git_sha": "3b248b84694d1939ac4bb33df84bf6233a34d668", + "git_sha": "6dc8a32e32158bb4d3f9af92c802233b5d4f8e4d", "installed_by": ["modules"] }, "ensemblvep/download": { "branch": "master", - "git_sha": "214d575774c172062924ad3564b4f66655600730", - "installed_by": ["modules"], - "patch": "modules/nf-core/ensemblvep/download/ensemblvep-download.diff" + "git_sha": "54c183cba37cac58860d9967feaae54acf9cc3e0", + "installed_by": ["modules"] }, "ensemblvep/vep": { "branch": "master", - "git_sha": "1b5ffd7aa6e3c21b702957c808cbd1c351dd1809", - "installed_by": ["vcf_annotate_ensemblvep_snpeff"], - "patch": "modules/nf-core/ensemblvep/vep/ensemblvep-vep.diff" + "git_sha": "54c183cba37cac58860d9967feaae54acf9cc3e0", + "installed_by": ["vcf_annotate_ensemblvep_snpeff"] }, "gatk4/calibratedragstrmodel": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", + "git_sha": "3f42e07a1133064c569b0dbe182979527bca9e59", "installed_by": ["modules"] }, "gatk4/composestrtablefile": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", + "git_sha": "926e2f394d01c71d3abbdbca9c588630bfe51abf", "installed_by": ["modules"] }, "gatk4/createsequencedictionary": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", + "git_sha": "e6fe277739f5894711405af3e717b2470bd956b5", "installed_by": ["modules"] }, "gatk4/genomicsdbimport": { "branch": "master", - "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", + "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", "installed_by": ["modules"] }, "gatk4/genotypegvcfs": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", - "installed_by": ["modules"], - "patch": "modules/nf-core/gatk4/genotypegvcfs/gatk4-genotypegvcfs.diff" + "git_sha": "8b74c800af3d91e0d7bfbecb902308dc4369071c", + "installed_by": ["modules"] }, "gatk4/haplotypecaller": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", - "installed_by": ["modules"], - "patch": "modules/nf-core/gatk4/haplotypecaller/gatk4-haplotypecaller.diff" - }, - "gawk": { - "branch": "master", - "git_sha": "dc3527855e7358c6d8400828754c0caa5f11698f", + "git_sha": "c332ea831f95f750be962c4b5de655f7a1e6e245", "installed_by": ["modules"] }, - "happy/happy": { + "gawk": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "cf3ed075695639b0a0924eb0901146df1996dc08", "installed_by": ["modules"] }, "mosdepth": { "branch": "master", - "git_sha": "69e3eb17fb31b772b18f134d6e8f8b93ee980e65", + "git_sha": "9bfc81874554e87740bcb3e5e07acf0a153c9ecb", "installed_by": ["modules"] }, "multiqc": { "branch": "master", - "git_sha": "b7ebe95761cd389603f9cc0e0dc384c0f663815a", + "git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48", "installed_by": ["modules"] }, "rtgtools/format": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "e743b2dea725bcfc4b76a209981808987332013a", "installed_by": ["modules"] }, "rtgtools/pedfilter": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "c1c2a770cfb0bfbf093a2434a27f091ebbc65987", "installed_by": ["modules"], "patch": "modules/nf-core/rtgtools/pedfilter/rtgtools-pedfilter.diff" }, "rtgtools/rocplot": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "64770369d851c45c364e410e052ef9a6c3a7d2bb", "installed_by": ["modules"] }, "rtgtools/vcfeval": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "e743b2dea725bcfc4b76a209981808987332013a", "installed_by": ["modules"] }, "samtools/convert": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/faidx": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/index": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "46eca555142d6e597729fcb682adcc791796f514", "installed_by": ["modules"] }, "samtools/merge": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", - "installed_by": ["modules"], - "patch": "modules/nf-core/samtools/merge/samtools-merge.diff" + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", + "installed_by": ["modules"] }, "snpeff/snpeff": { "branch": "master", - "git_sha": "214d575774c172062924ad3564b4f66655600730", + "git_sha": "3ad7292d9b8da881386e9d5b58364d7da489b38b", "installed_by": ["vcf_annotate_ensemblvep_snpeff"] }, "somalier/extract": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "458c882987320e27fc90723ec96c127a243a5497", "installed_by": ["modules"] }, "somalier/relate": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "458c882987320e27fc90723ec96c127a243a5497", "installed_by": ["modules"], "patch": "modules/nf-core/somalier/relate/somalier-relate.diff" }, "tabix/bgzip": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "b20be35facfc5acdc1259f132ed79339d79e989f", "installed_by": ["modules"] }, "tabix/bgziptabix": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "0840b387799172e77510393ed09e4d4ec1bc6d7c", "installed_by": ["modules"] }, "tabix/tabix": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "0840b387799172e77510393ed09e4d4ec1bc6d7c", "installed_by": ["modules", "vcf_annotate_ensemblvep_snpeff"] }, "untar": { "branch": "master", - "git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa", + "git_sha": "4e5f4687318f24ba944a13609d3ea6ebd890737d", "installed_by": ["modules"] }, "vardictjava": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", - "installed_by": ["modules"], - "patch": "modules/nf-core/vardictjava/vardictjava.diff" + "git_sha": "e61e5a13ef49c5595986bd31efb85c3f0709a282", + "installed_by": ["modules"] }, "vcf2db": { "branch": "master", - "git_sha": "527a80a28d9a54e5fd3626168ab72b063c11fbb2", - "installed_by": ["modules"], - "patch": "modules/nf-core/vcf2db/vcf2db.diff" + "git_sha": "730f3aee80d5f8d0b5fc532202ac59361414d006", + "installed_by": ["modules"] }, "vcfanno": { "branch": "master", - "git_sha": "b558cd24f8751dcda51f957391f5f9cb83e28586", + "git_sha": "9a8bba5910982ae637dedb8664e3121db77e173f", "installed_by": ["modules"] } } @@ -232,17 +219,17 @@ "nf-core": { "utils_nextflow_pipeline": { "branch": "master", - "git_sha": "cd08c91373cd00a73255081340e4914485846ba1", + "git_sha": "d20fb2a9cc3e2835e9d067d1046a63252eb17352", "installed_by": ["subworkflows"] }, "utils_nfcore_pipeline": { "branch": "master", - "git_sha": "262b17ed2aad591039f914951659177e6c39a8d8", + "git_sha": "2fdce49d30c0254f76bc0f13c55c17455c1251ab", "installed_by": ["subworkflows"] }, - "utils_nfvalidation_plugin": { + "utils_nfschema_plugin": { "branch": "master", - "git_sha": "cd08c91373cd00a73255081340e4914485846ba1", + "git_sha": "bbd5a41f4535a8defafe6080e00ea74c45f4f96c", "installed_by": ["subworkflows"] }, "vcf_annotate_ensemblvep_snpeff": { diff --git a/modules/local/automap/automap/main.nf b/modules/local/automap/automap/main.nf index f3090927..b84535a9 100644 --- a/modules/local/automap/automap/main.nf +++ b/modules/local/automap/automap/main.nf @@ -14,9 +14,6 @@ process AUTOMAP_AUTOMAP { tuple val(meta), path("${prefix}"), emit: automap path "versions.yml" , emit: versions - when: - task.ext.when == null || task.ext.when - script: def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" @@ -42,22 +39,23 @@ process AUTOMAP_AUTOMAP { stub: def args = task.ext.args ?: '' + def panel_name = args.contains("--panelname") ? args.split("--panelname")[-1].trim().split(" ")[0] : "" prefix = task.ext.prefix ?: "${meta.id}" - def create_outputs = meta.family_count > 1 ? (1..meta.family_count).collect { - def cmd_prefix = "touch ${prefix}/sample${it}" + def create_outputs = meta.family_samples.tokenize(",").size() > 1 ? (1..meta.family_samples.tokenize(",").size()).collect { number -> + def cmd_prefix = "touch ${prefix}/sample${number}" [ - "mkdir ${prefix}/sample${it}", - "${cmd_prefix}/sample${it}.HomRegions.pdf", - "${cmd_prefix}/sample${it}.HomRegions.${params.automap_panel_name}.tsv", - "${cmd_prefix}/sample${it}.HomRegions.tsv", - "${cmd_prefix}/sample${it}.HomRegions.strict.${params.automap_panel_name}.tsv" + "mkdir ${prefix}/sample${number}", + "${cmd_prefix}/sample${number}.HomRegions.pdf", + "${cmd_prefix}/sample${number}.HomRegions.${panel_name}.tsv", + "${cmd_prefix}/sample${number}.HomRegions.tsv", + "${cmd_prefix}/sample${number}.HomRegions.strict.${panel_name}.tsv" ].join(" && ") }.join(" && ") : [ "touch ${prefix}/${meta.id}.HomRegions.pdf", - "touch ${prefix}/${meta.id}.HomRegions.${params.automap_panel_name}.tsv", + "touch ${prefix}/${meta.id}.HomRegions.${panel_name}.tsv", "touch ${prefix}/${meta.id}.HomRegions.tsv", - "touch ${prefix}/${meta.id}.HomRegions.strict.${params.automap_panel_name}.tsv" + "touch ${prefix}/${meta.id}.HomRegions.strict.${panel_name}.tsv" ].join(" && ") def VERSION = "1.0.0" diff --git a/modules/local/automap/repeats/main.nf b/modules/local/automap/repeats/main.nf index 6bce529a..e5848023 100644 --- a/modules/local/automap/repeats/main.nf +++ b/modules/local/automap/repeats/main.nf @@ -11,9 +11,6 @@ process AUTOMAP_REPEATS { tuple val(meta), path("*.bed") , emit: repeats path "versions.yml" , emit: versions - when: - task.ext.when == null || task.ext.when - script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" diff --git a/modules/local/filter_beds/main.nf b/modules/local/filter_beds/main.nf index 26e7dbd4..d7954da0 100644 --- a/modules/local/filter_beds/main.nf +++ b/modules/local/filter_beds/main.nf @@ -14,9 +14,6 @@ process FILTER_BEDS { tuple val(meta), path('*.bed'), emit: bed path "versions.yml" , emit: versions - when: - task.ext.when == null || task.ext.when - script: // Remove regions with no coverage from the callable regions BED file def args = task.ext.args ?: '' diff --git a/modules/local/merge_beds.nf b/modules/local/merge_beds/main.nf similarity index 96% rename from modules/local/merge_beds.nf rename to modules/local/merge_beds/main.nf index cc601495..5ead9159 100644 --- a/modules/local/merge_beds.nf +++ b/modules/local/merge_beds/main.nf @@ -15,9 +15,6 @@ process MERGE_BEDS { tuple val(meta), path('*.bed'), emit: bed path "versions.yml" , emit: versions - when: - task.ext.when == null || task.ext.when - script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" diff --git a/modules/local/updio/main.nf b/modules/local/updio/main.nf index fa7b5f3a..2dfd7ef9 100644 --- a/modules/local/updio/main.nf +++ b/modules/local/updio/main.nf @@ -12,9 +12,6 @@ process UPDIO { tuple val(meta), path("${prefix}"), emit: updio path "versions.yml" , emit: versions - when: - task.ext.when == null || task.ext.when - script: def args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" diff --git a/modules/nf-core/bcftools/annotate/bcftools-annotate.diff b/modules/nf-core/bcftools/annotate/bcftools-annotate.diff new file mode 100644 index 00000000..518cee56 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/bcftools-annotate.diff @@ -0,0 +1,26 @@ +Changes in module 'nf-core/bcftools/annotate' +Changes in 'bcftools/annotate/main.nf': +--- modules/nf-core/bcftools/annotate/main.nf ++++ modules/nf-core/bcftools/annotate/main.nf +@@ -8,8 +8,7 @@ + 'biocontainers/bcftools:1.20--h8b25389_0' }" + + input: +- tuple val(meta), path(input), path(index), path(annotations), path(annotations_index) +- path(header_lines) ++ tuple val(meta), path(input), path(index), path(annotations), path(annotations_index), path(header_lines) + + output: + tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf + +'modules/nf-core/bcftools/annotate/environment.yml' is unchanged +'modules/nf-core/bcftools/annotate/meta.yml' is unchanged +'modules/nf-core/bcftools/annotate/tests/tags.yml' is unchanged +'modules/nf-core/bcftools/annotate/tests/vcf.config' is unchanged +'modules/nf-core/bcftools/annotate/tests/vcf_gz_index_csi.config' is unchanged +'modules/nf-core/bcftools/annotate/tests/vcf_gz_index_tbi.config' is unchanged +'modules/nf-core/bcftools/annotate/tests/main.nf.test' is unchanged +'modules/nf-core/bcftools/annotate/tests/bcf.config' is unchanged +'modules/nf-core/bcftools/annotate/tests/vcf_gz_index.config' is unchanged +'modules/nf-core/bcftools/annotate/tests/main.nf.test.snap' is unchanged +************************************************************ diff --git a/modules/nf-core/bcftools/annotate/environment.yml b/modules/nf-core/bcftools/annotate/environment.yml index e0abc8d2..5c00b116 100644 --- a/modules/nf-core/bcftools/annotate/environment.yml +++ b/modules/nf-core/bcftools/annotate/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_annotate channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/annotate/main.nf b/modules/nf-core/bcftools/annotate/main.nf index 27ebfd4a..2cfe29a1 100644 --- a/modules/nf-core/bcftools/annotate/main.nf +++ b/modules/nf-core/bcftools/annotate/main.nf @@ -4,14 +4,16 @@ process BCFTOOLS_ANNOTATE { 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(input), path(index), path(annotations), path(annotations_index), path(header_lines) output: 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: @@ -27,8 +29,12 @@ process BCFTOOLS_ANNOTATE { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" + def index_command = !index ? "bcftools index $input" : '' + if ("$input" == "${prefix}.${extension}") error "Input and output names are the same, set prefix in module configuration to disambiguate!" """ + $index_command + bcftools \\ annotate \\ $args \\ @@ -52,8 +58,16 @@ process BCFTOOLS_ANNOTATE { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" + 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/annotate/meta.yml b/modules/nf-core/bcftools/annotate/meta.yml index f3aa463b..248eee0c 100644 --- a/modules/nf-core/bcftools/annotate/meta.yml +++ b/modules/nf-core/bcftools/annotate/meta.yml @@ -40,14 +40,22 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - vcf: type: file description: Compressed annotated VCF file pattern: "*{vcf,vcf.gz,bcf,bcf.gz}" + - csi: + type: file + description: Default VCF file index + pattern: "*.csi" + - tbi: + type: file + description: Alternative VCF file index + pattern: "*.tbi" + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@projectoriented" - "@ramprasadn" diff --git a/modules/nf-core/bcftools/annotate/tests/bcf.config b/modules/nf-core/bcftools/annotate/tests/bcf.config new file mode 100644 index 00000000..79d26779 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/bcf.config @@ -0,0 +1,4 @@ +process { + ext.args = "-x ID,INFO/DP,FORMAT/DP --output-type u" + ext.prefix = { "${meta.id}_ann" } +} diff --git a/modules/nf-core/bcftools/annotate/tests/main.nf.test b/modules/nf-core/bcftools/annotate/tests/main.nf.test new file mode 100644 index 00000000..3a5c4933 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test @@ -0,0 +1,327 @@ +nextflow_process { + + name "Test Process BCFTOOLS_ANNOTATE" + script "../main.nf" + process "BCFTOOLS_ANNOTATE" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/annotate" + + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_output") { + + config "./vcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - [vcf, [], annotation, annotation_tbi], [] - vcf_output") { + + config "./vcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match() } + ) + } + + } + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index") { + + config "./vcf_gz_index.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.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.csi.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi") { + + config "./vcf_gz_index_csi.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.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.csi.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi") { + + config "./vcf_gz_index_tbi.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.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.csi.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match() }, + { assert process.out.tbi[0][1].endsWith(".tbi") } + ) + } + + } + test("sarscov2 - [vcf, [], annotation, annotation_tbi], header - bcf_output") { + + config "./bcf.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = Channel.of( + '##INFO=', + '##INFO=' + ).collectFile(name:"headers.vcf", newLine:true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { it.collect { it instanceof Map ? it : file(it).name }}, + process.out.versions + ).match("bcf") } + ) + } + + } + + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - stub") { + + config "./vcf.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index - stub") { + + config "./vcf_gz_index.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match()}, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi - stub") { + + config "./vcf_gz_index_csi.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi - stub") { + + config "./vcf_gz_index_tbi.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + 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/annotate/tests/main.nf.test.snap b/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap new file mode 100644 index 00000000..bac2224a --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap @@ -0,0 +1,388 @@ +{ + "bcf": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_ann.bcf" + ] + ], + [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-12T16:39:33.331888" + }, + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz" + ] + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi" + ] + ], + [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:07:59.658031137" + }, + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ], + "csi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:09:05.096883418" + }, + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_csi": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz" + ] + ], + [ + + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi" + ] + ], + [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:08:10.581301219" + }, + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:08:43.975017625" + }, + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.tbi" + ] + ], + [ + + ], + [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:08:21.354059092" + }, + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_output": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz" + ] + ], + [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:07:37.788393317" + }, + "sarscov2 - [vcf, [], annotation, annotation_tbi], [] - vcf_output": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz" + ] + ], + [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:07:48.500746325" + }, + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index_tbi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:09:16.094918834" + }, + "sarscov2 - [vcf, tbi, annotation, annotation_tbi], [] - vcf_gz_index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ], + "csi": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-08-15T10:08:54.366358502" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/annotate/tests/tags.yml b/modules/nf-core/bcftools/annotate/tests/tags.yml new file mode 100644 index 00000000..f97a1afc --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/annotate: + - "modules/nf-core/bcftools/annotate/**" diff --git a/modules/nf-core/bcftools/annotate/tests/vcf.config b/modules/nf-core/bcftools/annotate/tests/vcf.config new file mode 100644 index 00000000..611868d5 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/vcf.config @@ -0,0 +1,4 @@ +process { + ext.args = "-x ID,INFO/DP,FORMAT/DP --output-type z" + ext.prefix = { "${meta.id}_vcf" } +} diff --git a/modules/nf-core/bcftools/annotate/tests/vcf_gz_index.config b/modules/nf-core/bcftools/annotate/tests/vcf_gz_index.config new file mode 100644 index 00000000..2fd9a225 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/vcf_gz_index.config @@ -0,0 +1,4 @@ +process { + ext.args = "--output-type z --write-index --no-version" + ext.prefix = { "${meta.id}_vcf" } +} diff --git a/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_csi.config new file mode 100644 index 00000000..512c1dfb --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_csi.config @@ -0,0 +1,4 @@ +process { + ext.args = "--output-type z --write-index=csi --no-version" + ext.prefix = { "${meta.id}_vcf" } +} diff --git a/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_tbi.config new file mode 100644 index 00000000..7feb5ebb --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/vcf_gz_index_tbi.config @@ -0,0 +1,4 @@ +process { + ext.args = "--output-type z --write-index=tbi --no-version" + ext.prefix = { "${meta.id}_vcf" } +} diff --git a/modules/nf-core/bcftools/concat/bcftools-concat.diff b/modules/nf-core/bcftools/concat/bcftools-concat.diff deleted file mode 100644 index 980df77a..00000000 --- a/modules/nf-core/bcftools/concat/bcftools-concat.diff +++ /dev/null @@ -1,40 +0,0 @@ -Changes in module 'nf-core/bcftools/concat' ---- modules/nf-core/bcftools/concat/main.nf -+++ modules/nf-core/bcftools/concat/main.nf -@@ -8,7 +8,7 @@ - 'biocontainers/bcftools:1.18--h8b25389_0' }" - - input: -- tuple val(meta), path(vcfs), path(tbi) -+ tuple val(meta), path(vcfs), path(tbis) - - output: - tuple val(meta), path("*.gz"), emit: vcf -@@ -19,8 +19,11 @@ - - script: - def args = task.ext.args ?: '' -- prefix = task.ext.prefix ?: "${meta.id}" -+ def prefix = task.ext.prefix ?: "${meta.id}" -+ def create_tbis = vcfs.collect { it.extension == 'gz' && !tbis ? " tabix ${it}" : "" } -+ - """ -+ ${create_tbis.join("\n")} - bcftools concat \\ - --output ${prefix}.vcf.gz \\ - $args \\ -@@ -34,8 +37,11 @@ - """ - - stub: -- prefix = task.ext.prefix ?: "${meta.id}" -+ def prefix = task.ext.prefix ?: "${meta.id}" -+ def create_tbis = vcfs.collect { it.extension == 'gz' && !tbis ? " touch ${it}.tbi" : "" } -+ - """ -+ ${create_tbis.join("\n")} - touch ${prefix}.vcf.gz - - cat <<-END_VERSIONS > versions.yml - -************************************************************ diff --git a/modules/nf-core/bcftools/concat/environment.yml b/modules/nf-core/bcftools/concat/environment.yml index ff0200df..5c00b116 100644 --- a/modules/nf-core/bcftools/concat/environment.yml +++ b/modules/nf-core/bcftools/concat/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_concat channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/concat/main.nf b/modules/nf-core/bcftools/concat/main.nf index eaefbe73..e2337eff 100644 --- a/modules/nf-core/bcftools/concat/main.nf +++ b/modules/nf-core/bcftools/concat/main.nf @@ -4,26 +4,25 @@ 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(tbis) + tuple val(meta), path(vcfs), path(tbi) output: - tuple val(meta), path("*.gz"), emit: vcf - path "versions.yml" , emit: versions + tuple val(meta), path("*.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 script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def create_tbis = vcfs.collect { it.extension == 'gz' && !tbis ? " tabix ${it}" : "" } - + def prefix = task.ext.prefix ?: "${meta.id}" """ - ${create_tbis.join("\n")} bcftools concat \\ --output ${prefix}.vcf.gz \\ $args \\ @@ -37,12 +36,16 @@ process BCFTOOLS_CONCAT { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" - def create_tbis = vcfs.collect { it.extension == 'gz' && !tbis ? " touch ${it}.tbi" : "" } - + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + 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_index = index.matches("csi|tbi") ? "touch ${prefix}.vcf.gz.${index}" : "" """ - ${create_tbis.join("\n")} - touch ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.vcf.gz + ${create_index} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/concat/meta.yml b/modules/nf-core/bcftools/concat/meta.yml index 91cb54d5..eeeb2071 100644 --- a/modules/nf-core/bcftools/concat/meta.yml +++ b/modules/nf-core/bcftools/concat/meta.yml @@ -39,6 +39,14 @@ output: type: file description: VCF concatenated output file pattern: "*.{vcf.gz}" + - csi: + type: file + description: Default VCF file index + pattern: "*.csi" + - tbi: + type: file + description: Alternative VCF file index + pattern: "*.tbi" - versions: type: file description: File containing software versions diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test b/modules/nf-core/bcftools/concat/tests/main.nf.test index bf1a5f3f..cea386e3 100644 --- a/modules/nf-core/bcftools/concat/tests/main.nf.test +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test @@ -9,22 +9,54 @@ nextflow_process { tag "bcftools" tag "bcftools/concat" - config "./nextflow.config" test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]]") { + config "./nextflow.config" + when { process { """ - input[0] = [ + input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index") { + + config "./vcf_gz_index.config" + + when { + process { + """ + input[0] = [ + [ id:'test3' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ @@ -36,25 +68,33 @@ nextflow_process { { 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() } + ).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } ) } } - test("sarscov2 - [[vcf1, vcf2], []]") { + test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi") { + + config "./vcf_gz_index_csi.config" when { process { """ - input[0] = [ + input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], - [] + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) + ] ] """ } @@ -65,28 +105,32 @@ nextflow_process { { 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() } + ).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } ) } } - test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub") { + test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi") { + + config "./vcf_gz_index_tbi.config" - options "-stub" when { process { """ - input[0] = [ + input[0] = [ [ id:'test3' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) ] ] """ @@ -97,12 +141,176 @@ nextflow_process { assertAll( { assert process.success }, { assert snapshot( - file(process.out.vcf[0][1]).name, + 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() } + ).match() }, + { assert process.out.tbi[0][1].endsWith(".tbi") } + ) + } + + } + + + test("sarscov2 - [[vcf1, vcf2], []]") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test3' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) + ], + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } ) } } -} + test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub") { + + config "./nextflow.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test3' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index - stub") { + + config "./vcf_gz_index.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test3' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi - stub") { + + config "./vcf_gz_index_csi.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test3' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', checkIfExists: true) + ] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi - stub") { + + config "./vcf_gz_index_tbi.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test3' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) + ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi', 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/concat/tests/main.nf.test.snap b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap index 7344e6e3..1182854f 100644 --- a/modules/nf-core/bcftools/concat/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test.snap @@ -1,43 +1,395 @@ { + "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ], + "csi": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T08:09:13.734103412" + }, "sarscov2 - [[vcf1, vcf2], []]": { "content": [ + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "versions": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T15:19:09.213249578" + }, + "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index": { + "content": [ + [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], [ [ { "id": "test3" }, - "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + "test3_vcf.vcf.gz.csi" ] ], [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + + ], + [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" ] ], - "timestamp": "2023-11-29T13:52:27.03724666" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T08:08:23.981388325" + }, + "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ], + "csi": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T14:01:24.419027693" }, "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]]": { "content": [ + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "versions": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T15:19:03.597061078" + }, + "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_csi": { + "content": [ + [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], [ [ { "id": "test3" }, - "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + "test3_vcf.vcf.gz.csi" ] ], [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + + ], + [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" ] ], - "timestamp": "2023-11-29T13:52:21.468988293" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T14:00:10.868487669" }, "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub": { "content": [ - "test3.vcf.gz", + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T15:19:14.836256897" + }, + "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi": { + "content": [ [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + [ + + ], + [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" ] ], - "timestamp": "2023-11-29T13:41:04.716017811" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T14:00:31.061411617" + }, + "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - vcf_gz_index_tbi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T14:01:35.209746508" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/concat/tests/vcf_gz_index.config b/modules/nf-core/bcftools/concat/tests/vcf_gz_index.config new file mode 100644 index 00000000..7dd696ee --- /dev/null +++ b/modules/nf-core/bcftools/concat/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/concat/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/concat/tests/vcf_gz_index_csi.config new file mode 100644 index 00000000..aebffb6f --- /dev/null +++ b/modules/nf-core/bcftools/concat/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/concat/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/concat/tests/vcf_gz_index_tbi.config new file mode 100644 index 00000000..b192ae7d --- /dev/null +++ b/modules/nf-core/bcftools/concat/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/filter/environment.yml b/modules/nf-core/bcftools/filter/environment.yml index b2698757..5c00b116 100644 --- a/modules/nf-core/bcftools/filter/environment.yml +++ b/modules/nf-core/bcftools/filter/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_filter channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/filter/main.nf b/modules/nf-core/bcftools/filter/main.nf index cc9a2361..8f92c51a 100644 --- a/modules/nf-core/bcftools/filter/main.nf +++ b/modules/nf-core/bcftools/filter/main.nf @@ -4,14 +4,16 @@ process BCFTOOLS_FILTER { 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) output: tuple val(meta), path("*.${extension}"), 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: @@ -45,19 +47,23 @@ process BCFTOOLS_FILTER { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - extension = args.contains("--output-type b") || args.contains("-Ob") ? "bcf.gz" : args.contains("--output-type u") || args.contains("-Ou") ? "bcf" : args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" + 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}" : "" if ("$vcf" == "${prefix}.${extension}") error "Input and output names are the same, set prefix in module configuration to disambiguate!" - def create_file = extension.endsWith(".gz") ? "echo '' | gzip > ${prefix}.${extension}" : "touch ${prefix}.${extension}" - """ - ${create_file} + ${create_cmd} ${prefix}.${extension} + ${create_index} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/filter/meta.yml b/modules/nf-core/bcftools/filter/meta.yml index deb93b13..d67c0257 100644 --- a/modules/nf-core/bcftools/filter/meta.yml +++ b/modules/nf-core/bcftools/filter/meta.yml @@ -32,6 +32,14 @@ output: type: file description: VCF filtered output file pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" + - csi: + type: file + description: Default VCF file index + pattern: "*.csi" + - tbi: + type: file + description: Alternative VCF file index + pattern: "*.tbi" - versions: type: file description: File containing software versions diff --git a/modules/nf-core/bcftools/filter/tests/main.nf.test b/modules/nf-core/bcftools/filter/tests/main.nf.test index eaf100e8..646f37ad 100644 --- a/modules/nf-core/bcftools/filter/tests/main.nf.test +++ b/modules/nf-core/bcftools/filter/tests/main.nf.test @@ -9,10 +9,10 @@ nextflow_process { tag "bcftools" tag "bcftools/filter" - config "./nextflow.config" - test("sarscov2 - vcf") { + config "./nextflow.config" + when { process { """ @@ -33,8 +33,100 @@ nextflow_process { } + test("sarscov2 - vcf_gz_index") { + + config "./vcf_gz_index.config" + + when { + process { + """ + input[0] = [ + [id:"vcf_test"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', 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() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - vcf_gz_index_csi") { + + config "./vcf_gz_index_csi.config" + + when { + process { + """ + input[0] = [ + [id:"vcf_test"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', 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() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - vcf_gz_index_tbi") { + + config "./vcf_gz_index_tbi.config" + + when { + process { + """ + input[0] = [ + [id:"vcf_test"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', 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() }, + { assert process.out.tbi[0][1].endsWith(".tbi") } + ) + } + + } + test("sarscov2 - vcf - bcf output") { + config "./nextflow.config" + when { process { """ @@ -57,6 +149,7 @@ nextflow_process { test("sarscov2 - vcf - stub") { + config "./nextflow.config" options "-stub" when { @@ -79,4 +172,82 @@ nextflow_process { } -} + test("sarscov2 - vcf_gz_index - stub") { + + config "./vcf_gz_index.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [id:"vcf_test"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - vcf_gz_index_csi - stub") { + + config "./vcf_gz_index_csi.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [id:"vcf_test"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - vcf_gz_index_tbi - stub") { + + config "./vcf_gz_index_tbi.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [id:"vcf_test"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', 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/filter/tests/main.nf.test.snap b/modules/nf-core/bcftools/filter/tests/main.nf.test.snap index f8e17aa0..3d7605f2 100644 --- a/modules/nf-core/bcftools/filter/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/filter/tests/main.nf.test.snap @@ -1,4 +1,59 @@ { + "sarscov2 - vcf_gz_index_tbi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T13:59:08.235854993" + }, "vcf": { "content": [ { @@ -11,7 +66,19 @@ ] ], "1": [ - "versions.yml:md5,7dc77043f9afb848d942d47a7bc19f67" + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ], + "csi": [ + + ], + "tbi": [ + ], "vcf": [ [ @@ -22,15 +89,15 @@ ] ], "versions": [ - "versions.yml:md5,7dc77043f9afb848d942d47a7bc19f67" + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nextflow": "24.04.2" }, - "timestamp": "2024-03-27T16:57:32.940161987" + "timestamp": "2024-06-04T15:20:28.427974818" }, "bcf output": { "content": [ @@ -44,7 +111,19 @@ ] ], "1": [ - "versions.yml:md5,7dc77043f9afb848d942d47a7bc19f67" + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ], + "csi": [ + + ], + "tbi": [ + ], "vcf": [ [ @@ -55,15 +134,77 @@ ] ], "versions": [ - "versions.yml:md5,7dc77043f9afb848d942d47a7bc19f67" + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T15:20:34.049236749" + }, + "sarscov2 - vcf_gz_index": { + "content": [ + [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz.csi" + ] + ], + [ + + ], + [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" }, - "timestamp": "2024-03-27T16:45:14.586866398" + "timestamp": "2024-06-05T08:09:49.837854646" + }, + "sarscov2 - vcf_gz_index_csi": { + "content": [ + [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz.csi" + ] + ], + [ + + ], + [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T13:57:19.513365022" }, "vcf - stub": { "content": [ @@ -77,7 +218,19 @@ ] ], "1": [ - "versions.yml:md5,7dc77043f9afb848d942d47a7bc19f67" + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ], + "csi": [ + + ], + "tbi": [ + ], "vcf": [ [ @@ -88,14 +241,155 @@ ] ], "versions": [ - "versions.yml:md5,7dc77043f9afb848d942d47a7bc19f67" + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T15:29:55.846566153" + }, + "sarscov2 - vcf_gz_index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ], + "csi": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T15:59:37.636874258" + }, + "sarscov2 - vcf_gz_index_csi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ], + "csi": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T13:58:46.36278584" + }, + "sarscov2 - vcf_gz_index_tbi": { + "content": [ + [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + [ + + ], + [ + [ + { + "id": "vcf_test" + }, + "vcf_test_vcf.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,9a336d1ee26b527d7a2bdbeead155f64" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" }, - "timestamp": "2024-03-27T17:05:52.80837892" + "timestamp": "2024-06-05T13:57:34.748836577" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/filter/tests/vcf_gz_index.config b/modules/nf-core/bcftools/filter/tests/vcf_gz_index.config new file mode 100644 index 00000000..7dd696ee --- /dev/null +++ b/modules/nf-core/bcftools/filter/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/filter/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/filter/tests/vcf_gz_index_csi.config new file mode 100644 index 00000000..aebffb6f --- /dev/null +++ b/modules/nf-core/bcftools/filter/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/filter/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/filter/tests/vcf_gz_index_tbi.config new file mode 100644 index 00000000..b192ae7d --- /dev/null +++ b/modules/nf-core/bcftools/filter/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/norm/environment.yml b/modules/nf-core/bcftools/norm/environment.yml index fe80e4e7..5c00b116 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 47d3dab1..bd7a2501 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 1f3e1b62..a0cdeaf1 100644 --- a/modules/nf-core/bcftools/norm/meta.yml +++ b/modules/nf-core/bcftools/norm/meta.yml @@ -49,6 +49,14 @@ output: 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}" + - csi: + type: file + description: Default VCF file index + pattern: "*.csi" + - tbi: + type: file + description: Alternative VCF file index + pattern: "*.tbi" - versions: type: file description: File containing software versions 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 00000000..dbc41502 --- /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 00000000..3be52116 --- /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 00000000..b79af868 --- /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 00000000..f36f397c --- /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 00000000..510803b4 --- /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 00000000..10bf93e3 --- /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 00000000..b31dd2de --- /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 00000000..f6f5e356 --- /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 00000000..7dd696ee --- /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 00000000..aebffb6f --- /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 00000000..b192ae7d --- /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/pluginscatter/environment.yml b/modules/nf-core/bcftools/pluginscatter/environment.yml index 42e97daa..5c00b116 100644 --- a/modules/nf-core/bcftools/pluginscatter/environment.yml +++ b/modules/nf-core/bcftools/pluginscatter/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_pluginscatter channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/pluginscatter/main.nf b/modules/nf-core/bcftools/pluginscatter/main.nf index 9f52e947..b3b6691d 100644 --- a/modules/nf-core/bcftools/pluginscatter/main.nf +++ b/modules/nf-core/bcftools/pluginscatter/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_PLUGINSCATTER { 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) @@ -17,6 +17,8 @@ process BCFTOOLS_PLUGINSCATTER { output: tuple val(meta), path("*{vcf,vcf.gz,bcf,bcf.gz}") , emit: scatter + tuple val(meta), path("*.tbi") , emit: tbi, optional: true + tuple val(meta), path("*.csi") , emit: csi, optional: true path "versions.yml" , emit: versions when: @@ -57,11 +59,23 @@ process BCFTOOLS_PLUGINSCATTER { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" + 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_1 = extension.endsWith(".gz") && index.matches("csi|tbi") ? "touch ${prefix}0.${extension}.${index}" : "" + def create_index_2 = extension.endsWith(".gz") && index.matches("csi|tbi") ? "touch ${prefix}1.${extension}.${index}" : "" + def create_index_3 = extension.endsWith(".gz") && index.matches("csi|tbi") ? "touch ${prefix}2.${extension}.${index}" : "" """ - touch ${prefix}1.${extension} - touch ${prefix}2.${extension} - touch ${prefix}3.${extension} + ${create_cmd} ${prefix}0.${extension} + ${create_cmd} ${prefix}1.${extension} + ${create_cmd} ${prefix}2.${extension} + + ${create_index_1} + ${create_index_2} + ${create_index_3} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/pluginscatter/meta.yml b/modules/nf-core/bcftools/pluginscatter/meta.yml index 1a716ead..71805c03 100644 --- a/modules/nf-core/bcftools/pluginscatter/meta.yml +++ b/modules/nf-core/bcftools/pluginscatter/meta.yml @@ -66,6 +66,14 @@ output: type: file description: The resulting files of the scattering pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + - csi: + type: file + description: Default VCF file index + pattern: "*.csi" + - tbi: + type: file + description: Alternative VCF file index + pattern: "*.tbi" authors: - "@nvnieuwk" maintainers: diff --git a/modules/nf-core/bcftools/pluginscatter/tests/main.nf.test b/modules/nf-core/bcftools/pluginscatter/tests/main.nf.test new file mode 100644 index 00000000..ce66336e --- /dev/null +++ b/modules/nf-core/bcftools/pluginscatter/tests/main.nf.test @@ -0,0 +1,415 @@ +nextflow_process { + + name "Test Process BCFTOOLS_PLUGINSCATTER" + script "../main.nf" + process "BCFTOOLS_PLUGINSCATTER" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/pluginscatter" + + test("homo_sapiens - sites per chunk") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = 100 + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() + } + ) + } + + } + + test("homo_sapiens - sites per chunk - vcf_gz_index") { + + config "./vcf_gz_index.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = 100 + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { meta, files -> files.collect { it instanceof Map ? it : file(it).name } }, + process.out.csi.collect { meta, files -> files.collect { it instanceof Map ? it : file(it).name } }, + process.out.tbi.collect { meta, files -> files.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match("vcf_gz_index") }, + { assert process.out.csi[0][1][0] =~ ".*/test_vcf0.vcf.gz.csi" } + ) + } + + } + + test("homo_sapiens - sites per chunk - 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/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = 100 + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { meta, files -> files.collect { it instanceof Map ? it : file(it).name } }, + process.out.csi.collect { meta, files -> files.collect { it instanceof Map ? it : file(it).name } }, + process.out.tbi.collect { meta, files -> files.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match("vcf_gz_index_csi") }, + { assert process.out.csi[0][1][0] =~ ".*/test_vcf0.vcf.gz.csi" } + ) + } + + } + + test("homo_sapiens - sites per chunk - 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/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = 100 + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { meta, files -> files.collect { it instanceof Map ? it : file(it).name } }, + process.out.csi.collect { meta, files -> files.collect { it instanceof Map ? it : file(it).name } }, + process.out.tbi.collect { meta, files -> files.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match("vcf_gz_index_tbi") }, + { assert process.out.tbi[0][1][0] =~ ".*/test_vcf0.vcf.gz.tbi" } + ) + } + + } + + test("homo_sapiens - scatter") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + input[2] = "chr21" + input[3] = [] + input[4] = [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) + ] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() + } + ) + } + + } + + test("homo_sapiens - scatter file") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + input[2] = [] + input[3] = Channel.of("chr21:6000000-41743940\tfile1", "chr21:41743941-46661900\tfile2") + .collectFile(name:"scatter.tsv", newLine:true) + input[4] = [] + input[5] = [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() + } + ) + } + + } + + test("homo_sapiens - sites per chunk - stub") { + + config "./nextflow.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = 100 + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() + } + ) + } + + } + + test("homo_sapiens - scatter - stub") { + + config "./nextflow.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + input[2] = "chr21" + input[3] = [] + input[4] = [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) + ] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() + } + ) + } + + } + + test("homo_sapiens - scatter file - stub") { + + config "./nextflow.config" + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = [] + input[2] = [] + input[3] = Channel.of("chr21:6000000-41743940\tfile1", "chr21:41743941-46661900\tfile2") + .collectFile(name:"scatter.tsv", newLine:true) + input[4] = [] + input[5] = [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() + } + ) + } + + } + + test("homo_sapiens - sites per chunk - 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/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = 100 + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1][0] =~ ".*/test_vcf0.vcf.gz.csi" } + ) + } + + } + + test("homo_sapiens - sites per chunk - 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/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = 100 + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1][0] =~ ".*/test_vcf0.vcf.gz.csi" } + ) + } + + } + + test("homo_sapiens - sites per chunk - 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/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true) + ] + input[1] = 100 + input[2] = [] + input[3] = [] + input[4] = [] + input[5] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.tbi[0][1][0] =~ ".*/test_vcf0.vcf.gz.tbi" } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/pluginscatter/tests/main.nf.test.snap b/modules/nf-core/bcftools/pluginscatter/tests/main.nf.test.snap new file mode 100644 index 00000000..3168f91b --- /dev/null +++ b/modules/nf-core/bcftools/pluginscatter/tests/main.nf.test.snap @@ -0,0 +1,623 @@ +{ + "homo_sapiens - scatter - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test0.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test1.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test2.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ], + "csi": [ + + ], + "scatter": [ + [ + { + "id": "test" + }, + [ + "test0.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test1.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test2.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T15:09:19.199443051" + }, + "homo_sapiens - sites per chunk": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test0.vcf:md5,76902851e1f21970f1058b4bb85920d0", + "test1.vcf:md5,b9543cf27b400282ea8adff014059c4c", + "test2.vcf:md5,538495f9a2677643e41fb7a055fbb5fd", + "test3.vcf:md5,4d2bc1976824600842c95c3e65297ae1", + "test4.vcf:md5,698bf729950ef599a457c575fa28edc2", + "test5.vcf:md5,ef26c9040b1f1612dc2b6b4124781ab5", + "test6.vcf:md5,90267dd755c7e4b440ca4bac9e2a6151", + "test7.vcf:md5,695850092383eed031ba09b67afd7633" + ] + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ], + "csi": [ + + ], + "scatter": [ + [ + { + "id": "test" + }, + [ + "test0.vcf:md5,76902851e1f21970f1058b4bb85920d0", + "test1.vcf:md5,b9543cf27b400282ea8adff014059c4c", + "test2.vcf:md5,538495f9a2677643e41fb7a055fbb5fd", + "test3.vcf:md5,4d2bc1976824600842c95c3e65297ae1", + "test4.vcf:md5,698bf729950ef599a457c575fa28edc2", + "test5.vcf:md5,ef26c9040b1f1612dc2b6b4124781ab5", + "test6.vcf:md5,90267dd755c7e4b440ca4bac9e2a6151", + "test7.vcf:md5,695850092383eed031ba09b67afd7633" + ] + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:39:46.012676995" + }, + "homo_sapiens - sites per chunk - vcf_gz_index_csi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf1.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf2.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf1.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf2.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "3": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ], + "csi": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf1.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf2.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "scatter": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf1.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf2.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T15:10:12.470969127" + }, + "homo_sapiens - scatter file": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "testfile1.vcf:md5,68e3660b6d619163692edad8ba7dd179", + "testfile2.vcf:md5,68e3660b6d619163692edad8ba7dd179" + ] + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ], + "csi": [ + + ], + "scatter": [ + [ + { + "id": "test" + }, + [ + "testfile1.vcf:md5,68e3660b6d619163692edad8ba7dd179", + "testfile2.vcf:md5,68e3660b6d619163692edad8ba7dd179" + ] + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:40:25.33705743" + }, + "homo_sapiens - scatter file - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test0.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test1.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test2.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ], + "csi": [ + + ], + "scatter": [ + [ + { + "id": "test" + }, + [ + "test0.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test1.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test2.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T15:09:41.478631999" + }, + "homo_sapiens - sites per chunk - vcf_gz_index - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf1.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf2.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + + ], + "2": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf1.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf2.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "3": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ], + "csi": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf1.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf2.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "scatter": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf1.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf2.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T15:09:59.976006697" + }, + "vcf_gz_index_tbi": { + "content": [ + [ + + ], + [ + + ], + [ + [ + "test_vcf0.vcf.gz.tbi", + "test_vcf1.vcf.gz.tbi", + "test_vcf2.vcf.gz.tbi", + "test_vcf3.vcf.gz.tbi", + "test_vcf4.vcf.gz.tbi", + "test_vcf5.vcf.gz.tbi", + "test_vcf6.vcf.gz.tbi", + "test_vcf7.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-06T10:27:48.127273006" + }, + "homo_sapiens - sites per chunk - vcf_gz_index_tbi - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf1.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf2.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "1": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf1.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf2.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ], + "csi": [ + + ], + "scatter": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf1.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test_vcf2.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ] + ], + "tbi": [ + [ + { + "id": "test" + }, + [ + "test_vcf0.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf1.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e", + "test_vcf2.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T15:10:37.027506409" + }, + "vcf_gz_index": { + "content": [ + [ + + ], + [ + [ + "test_vcf0.vcf.gz.csi", + "test_vcf1.vcf.gz.csi", + "test_vcf2.vcf.gz.csi", + "test_vcf3.vcf.gz.csi", + "test_vcf4.vcf.gz.csi", + "test_vcf5.vcf.gz.csi", + "test_vcf6.vcf.gz.csi", + "test_vcf7.vcf.gz.csi" + ] + ], + [ + + ], + [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-06T10:24:46.201810185" + }, + "vcf_gz_index_csi": { + "content": [ + [ + + ], + [ + [ + "test_vcf0.vcf.gz.csi", + "test_vcf1.vcf.gz.csi", + "test_vcf2.vcf.gz.csi", + "test_vcf3.vcf.gz.csi", + "test_vcf4.vcf.gz.csi", + "test_vcf5.vcf.gz.csi", + "test_vcf6.vcf.gz.csi", + "test_vcf7.vcf.gz.csi" + ] + ], + [ + + ], + [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-06T10:27:20.636624541" + }, + "homo_sapiens - scatter": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "testchr21.vcf:md5,68e3660b6d619163692edad8ba7dd179" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ], + "csi": [ + + ], + "scatter": [ + [ + { + "id": "test" + }, + "testchr21.vcf:md5,68e3660b6d619163692edad8ba7dd179" + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-04T14:40:12.621284696" + }, + "homo_sapiens - sites per chunk - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test0.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test1.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test2.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ], + "csi": [ + + ], + "scatter": [ + [ + { + "id": "test" + }, + [ + "test0.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test1.vcf:md5,d41d8cd98f00b204e9800998ecf8427e", + "test2.vcf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,9a7bd26da80241e2116a237c7704eabf" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T15:08:56.987822348" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/pluginscatter/tests/nextflow.config b/modules/nf-core/bcftools/pluginscatter/tests/nextflow.config new file mode 100644 index 00000000..aa8d093b --- /dev/null +++ b/modules/nf-core/bcftools/pluginscatter/tests/nextflow.config @@ -0,0 +1,3 @@ +process { + ext.args = '--no-version' +} diff --git a/modules/nf-core/bcftools/pluginscatter/tests/tags.yml b/modules/nf-core/bcftools/pluginscatter/tests/tags.yml new file mode 100644 index 00000000..60cebd43 --- /dev/null +++ b/modules/nf-core/bcftools/pluginscatter/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/pluginscatter: + - "modules/nf-core/bcftools/pluginscatter/**" diff --git a/modules/nf-core/bcftools/pluginscatter/tests/vcf_gz_index.config b/modules/nf-core/bcftools/pluginscatter/tests/vcf_gz_index.config new file mode 100644 index 00000000..7dd696ee --- /dev/null +++ b/modules/nf-core/bcftools/pluginscatter/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/pluginscatter/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/pluginscatter/tests/vcf_gz_index_csi.config new file mode 100644 index 00000000..aebffb6f --- /dev/null +++ b/modules/nf-core/bcftools/pluginscatter/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/pluginscatter/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/pluginscatter/tests/vcf_gz_index_tbi.config new file mode 100644 index 00000000..b192ae7d --- /dev/null +++ b/modules/nf-core/bcftools/pluginscatter/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/query/environment.yml b/modules/nf-core/bcftools/query/environment.yml index 4f9661ca..5c00b116 100644 --- a/modules/nf-core/bcftools/query/environment.yml +++ b/modules/nf-core/bcftools/query/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_query channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/query/main.nf b/modules/nf-core/bcftools/query/main.nf index e9e73a6a..58019f4d 100644 --- a/modules/nf-core/bcftools/query/main.nf +++ b/modules/nf-core/bcftools/query/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_QUERY { 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/query/tests/main.nf.test b/modules/nf-core/bcftools/query/tests/main.nf.test index e9ea5a9d..39e67b35 100644 --- a/modules/nf-core/bcftools/query/tests/main.nf.test +++ b/modules/nf-core/bcftools/query/tests/main.nf.test @@ -18,8 +18,8 @@ nextflow_process { """ input[0] = [ [ id:'out' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + 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] = [] input[2] = [] @@ -47,11 +47,11 @@ nextflow_process { """ input[0] = [ [ id:'out' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + 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] = file(params.test_data['sarscov2']['illumina']['test3_vcf_gz'], checkIfExists: true) - input[2] = file(params.test_data['sarscov2']['illumina']['test2_vcf_targets_tsv_gz'], checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.targets.tsv.gz', checkIfExists: true) input[3] = [] """ } @@ -76,8 +76,8 @@ nextflow_process { """ input[0] = [ [ id:'out' ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + 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] = [] input[2] = [] diff --git a/modules/nf-core/bcftools/query/tests/main.nf.test.snap b/modules/nf-core/bcftools/query/tests/main.nf.test.snap index a19f2053..3ead1f2c 100644 --- a/modules/nf-core/bcftools/query/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/query/tests/main.nf.test.snap @@ -10,19 +10,27 @@ ] ], [ - "versions.yml:md5,b40206d5437ce4b044d15c47ddd93d8e" + "versions.yml:md5,3d93ea9cd5d314743254618b49e4bd16" ] ], - "timestamp": "2023-11-29T14:21:05.191946862" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:15:44.916249758" }, "sarscov2 - [vcf, tbi], [], [], [] - stub": { "content": [ "out.txt", [ - "versions.yml:md5,b40206d5437ce4b044d15c47ddd93d8e" + "versions.yml:md5,3d93ea9cd5d314743254618b49e4bd16" ] ], - "timestamp": "2023-11-29T14:21:11.169603542" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:15:49.932359271" }, "sarscov2 - [vcf, tbi], [], [], []": { "content": [ @@ -35,9 +43,13 @@ ] ], [ - "versions.yml:md5,b40206d5437ce4b044d15c47ddd93d8e" + "versions.yml:md5,3d93ea9cd5d314743254618b49e4bd16" ] ], - "timestamp": "2023-11-29T14:20:59.335041418" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:15:39.930697926" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/reheader/bcftools-reheader.diff b/modules/nf-core/bcftools/reheader/bcftools-reheader.diff deleted file mode 100644 index 57637baa..00000000 --- a/modules/nf-core/bcftools/reheader/bcftools-reheader.diff +++ /dev/null @@ -1,19 +0,0 @@ -Changes in module 'nf-core/bcftools/reheader' ---- modules/nf-core/bcftools/reheader/main.nf -+++ modules/nf-core/bcftools/reheader/main.nf -@@ -31,10 +31,13 @@ - args2.contains("--output-type v") || args2.contains("-Ov") ? "vcf" : - "vcf" - """ -+ echo ${meta.sample} > sample.txt -+ - bcftools \\ - reheader \\ - $update_sequences \\ - $new_header \\ -+ --samples sample.txt \\ - $args \\ - --threads $task.cpus \\ - $vcf \\ - -************************************************************ diff --git a/modules/nf-core/bcftools/reheader/environment.yml b/modules/nf-core/bcftools/reheader/environment.yml index aab0dc92..5c00b116 100644 --- a/modules/nf-core/bcftools/reheader/environment.yml +++ b/modules/nf-core/bcftools/reheader/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_reheader channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/reheader/main.nf b/modules/nf-core/bcftools/reheader/main.nf index 82527167..9cf6d0d3 100644 --- a/modules/nf-core/bcftools/reheader/main.nf +++ b/modules/nf-core/bcftools/reheader/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_REHEADER { 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(header), path(samples) @@ -13,6 +13,7 @@ process BCFTOOLS_REHEADER { output: tuple val(meta), path("*.{vcf,vcf.gz,bcf,bcf.gz}"), emit: vcf + tuple val(meta), path("*.{csi,tbi}") , emit: index, optional: true path "versions.yml" , emit: versions when: @@ -59,8 +60,16 @@ process BCFTOOLS_REHEADER { args2.contains("--output-type z") || args2.contains("-Oz") ? "vcf.gz" : args2.contains("--output-type v") || args2.contains("-Ov") ? "vcf" : "vcf" + def index = args2.contains("--write-index=tbi") || args2.contains("-W=tbi") ? "tbi" : + args2.contains("--write-index=csi") || args2.contains("-W=csi") ? "csi" : + args2.contains("--write-index") || args2.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/reheader/meta.yml b/modules/nf-core/bcftools/reheader/meta.yml index 690d4ead..d903cc0f 100644 --- a/modules/nf-core/bcftools/reheader/meta.yml +++ b/modules/nf-core/bcftools/reheader/meta.yml @@ -53,6 +53,10 @@ output: type: file description: VCF with updated header, bgzipped per default pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" + - index: + type: file + description: Index of VCF with updated header + pattern: "*.{csi,tbi}" authors: - "@bjohnnyd" - "@jemten" diff --git a/modules/nf-core/bcftools/reheader/tests/main.nf.test b/modules/nf-core/bcftools/reheader/tests/main.nf.test index f3200cb3..96c1b7b0 100644 --- a/modules/nf-core/bcftools/reheader/tests/main.nf.test +++ b/modules/nf-core/bcftools/reheader/tests/main.nf.test @@ -17,13 +17,13 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], - 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), [], [] ] - input[1] = [ + input[1] = [ [ id:'genome' ], // 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) ] """ } @@ -47,13 +47,13 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], - 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), [], [] ] - input[1] = [ + input[1] = [ [ id:'genome' ], // 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) ] """ } @@ -68,6 +68,111 @@ nextflow_process { } + test("sarscov2 - [vcf, [], []], fai - vcf.gz output - index") { + + config "./vcf_gz_index.config" + when { + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + 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.fai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.index.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match() }, + { assert process.out.index[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [vcf, [], []], fai - vcf.gz output - csi index") { + + config "./vcf_gz_index_csi.config" + when { + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + 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.fai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.index.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match() }, + { assert process.out.index[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - [vcf, [], []], fai - vcf.gz output - tbi index") { + + config "./vcf_gz_index_tbi.config" + when { + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + 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.fai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf, + process.out.index.collect { it.collect { it instanceof Map ? it : file(it).name } }, + process.out.versions + ).match() }, + { assert process.out.index[0][1].endsWith(".tbi") } + ) + } + + } + test("sarscov2 - [vcf, [], []], fai - bcf output") { config "./bcf.config" @@ -77,13 +182,13 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], - 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), [], [] ] - input[1] = [ + input[1] = [ [ id:'genome' ], // 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) ] """ } @@ -107,11 +212,11 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true), + 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', checkIfExists: true), [] ] - input[1] = [ + input[1] = [ [ id:'genome' ], // meta map [] ] @@ -137,15 +242,15 @@ nextflow_process { """ ch_no_samples = Channel.of([ [ id:'test', single_end:false ], - 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), [] ]) ch_samples = Channel.of(["samples.txt", "new_name"]) .collectFile(newLine:true) input[0] = ch_no_samples.combine(ch_samples) - input[1] = [ + input[1] = [ [ id:'genome' ], // 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) ] """ } @@ -170,13 +275,13 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], - 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), [], [] ] - input[1] = [ + input[1] = [ [ id:'genome' ], // 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) ] """ } @@ -193,5 +298,97 @@ nextflow_process { } } + test("sarscov2 - [vcf, [], []], fai - vcf.gz output - index -stub") { + + options "-stub" + config "./vcf_gz_index.config" + when { + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + 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.fai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, [], []], fai - vcf.gz output - csi index -stub") { + + options "-stub" + config "./vcf_gz_index_csi.config" + when { + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + 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.fai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - [vcf, [], []], fai - vcf.gz output - tbi index -stub") { + + options "-stub" + config "./vcf_gz_index_tbi.config" + when { + + process { + """ + input[0] = [ + [ id:'test', single_end:false ], + 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.fai', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } } diff --git a/modules/nf-core/bcftools/reheader/tests/main.nf.test.snap b/modules/nf-core/bcftools/reheader/tests/main.nf.test.snap index 112736a1..87a3654a 100644 --- a/modules/nf-core/bcftools/reheader/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/reheader/tests/main.nf.test.snap @@ -1,4 +1,140 @@ { + "sarscov2 - [vcf, [], []], fai - vcf.gz output - tbi index": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T10:09:05.955833763" + }, + "sarscov2 - [vcf, [], []], fai - vcf.gz output - index -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T09:52:41.444952182" + }, + "sarscov2 - [vcf, [], []], fai - vcf.gz output - tbi index -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T09:53:04.314827944" + }, "sarscov2 - [vcf, [], []], fai - vcf output": { "content": [ { @@ -12,7 +148,13 @@ ] ], "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + + ], + "2": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ], + "index": [ + ], "vcf": [ [ @@ -24,11 +166,15 @@ ] ], "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" ] } ], - "timestamp": "2023-11-29T13:05:44.058376693" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T09:50:41.983008108" }, "sarscov2 - [vcf, [], []], fai - bcf output": { "content": [ @@ -39,11 +185,17 @@ "id": "test", "single_end": false }, - "tested.bcf.gz:md5,c31d9afd8614832c2a46d9a55682c97a" + "tested.bcf.gz:md5,c8a304c8d2892039201154153c8cd536" ] ], "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + + ], + "2": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ], + "index": [ + ], "vcf": [ [ @@ -51,15 +203,19 @@ "id": "test", "single_end": false }, - "tested.bcf.gz:md5,c31d9afd8614832c2a46d9a55682c97a" + "tested.bcf.gz:md5,c8a304c8d2892039201154153c8cd536" ] ], "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" ] } ], - "timestamp": "2023-11-29T13:06:03.793372514" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T09:51:43.072513252" }, "sarscov2 - [vcf, [], []], fai - vcf.gz output": { "content": [ @@ -70,11 +226,17 @@ "id": "test", "single_end": false }, - "tested.vcf.gz:md5,a1e45fe6d2b386fc2611766e5d2937ee" + "tested.vcf.gz:md5,8e722884ffb75155212a3fc053918766" ] ], "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + + ], + "2": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ], + "index": [ + ], "vcf": [ [ @@ -82,24 +244,145 @@ "id": "test", "single_end": false }, - "tested.vcf.gz:md5,a1e45fe6d2b386fc2611766e5d2937ee" + "tested.vcf.gz:md5,8e722884ffb75155212a3fc053918766" ] ], "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" ] } ], - "timestamp": "2023-11-29T13:05:53.954090441" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T09:50:53.055630152" + }, + "sarscov2 - [vcf, [], []], fai - vcf.gz output - index": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi" + ] + ], + [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T10:08:37.999924355" + }, + "sarscov2 - [vcf, [], []], fai - vcf.gz output - csi index -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T09:52:52.512269206" }, "sarscov2 - [vcf, [], []], fai - stub": { "content": [ "tested.vcf", [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" ] ], - "timestamp": "2023-11-29T13:06:33.549685303" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:16:36.337112514" + }, + "sarscov2 - [vcf, [], []], fai - vcf.gz output - csi index": { + "content": [ + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz.csi" + ] + ], + [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T10:08:55.434831174" }, "sarscov2 - [vcf, [], samples], fai": { "content": [ @@ -114,7 +397,13 @@ ] ], "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + + ], + "2": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ], + "index": [ + ], "vcf": [ [ @@ -126,11 +415,15 @@ ] ], "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" ] } ], - "timestamp": "2023-11-29T13:06:23.474745156" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T09:52:12.216002665" }, "sarscov2 - [vcf, header, []], []": { "content": [ @@ -145,7 +438,13 @@ ] ], "1": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + + ], + "2": [ + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" + ], + "index": [ + ], "vcf": [ [ @@ -157,10 +456,14 @@ ] ], "versions": [ - "versions.yml:md5,fbf8ac8da771b6295a47392003f983ce" + "versions.yml:md5,486e3d4ebc1dbf5c0a4dfaebae12ea34" ] } ], - "timestamp": "2023-11-29T13:06:13.841648691" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-09-03T09:51:54.062386022" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/reheader/tests/vcf_gz_index.config b/modules/nf-core/bcftools/reheader/tests/vcf_gz_index.config new file mode 100644 index 00000000..1e050ec7 --- /dev/null +++ b/modules/nf-core/bcftools/reheader/tests/vcf_gz_index.config @@ -0,0 +1,4 @@ +process { + ext.prefix = { "${meta.id}_vcf" } + ext.args2 = "--output-type z --write-index --no-version" +} diff --git a/modules/nf-core/bcftools/reheader/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/reheader/tests/vcf_gz_index_csi.config new file mode 100644 index 00000000..536e4b42 --- /dev/null +++ b/modules/nf-core/bcftools/reheader/tests/vcf_gz_index_csi.config @@ -0,0 +1,4 @@ +process { + ext.prefix = { "${meta.id}_vcf" } + ext.args2 = "--output-type z --write-index=csi --no-version" +} diff --git a/modules/nf-core/bcftools/reheader/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/reheader/tests/vcf_gz_index_tbi.config new file mode 100644 index 00000000..91a80db7 --- /dev/null +++ b/modules/nf-core/bcftools/reheader/tests/vcf_gz_index_tbi.config @@ -0,0 +1,5 @@ +process { + ext.prefix = { "${meta.id}_vcf" } + ext.args2 = "--output-type z --write-index=tbi --no-version" + +} diff --git a/modules/nf-core/bcftools/sort/environment.yml b/modules/nf-core/bcftools/sort/environment.yml index 89cf911d..5c00b116 100644 --- a/modules/nf-core/bcftools/sort/environment.yml +++ b/modules/nf-core/bcftools/sort/environment.yml @@ -1,7 +1,5 @@ -name: bcftools_sort channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/sort/main.nf b/modules/nf-core/bcftools/sort/main.nf index c982944c..7d4c9b8e 100644 --- a/modules/nf-core/bcftools/sort/main.nf +++ b/modules/nf-core/bcftools/sort/main.nf @@ -4,15 +4,17 @@ process BCFTOOLS_SORT { 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) 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 @@ -49,9 +51,16 @@ process BCFTOOLS_SORT { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" + 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/sort/meta.yml b/modules/nf-core/bcftools/sort/meta.yml index 84747c6d..dfbddcba 100644 --- a/modules/nf-core/bcftools/sort/meta.yml +++ b/modules/nf-core/bcftools/sort/meta.yml @@ -36,6 +36,14 @@ output: type: file description: Sorted VCF file pattern: "*.{vcf.gz}" + - csi: + type: file + description: Default VCF file index + pattern: "*.csi" + - tbi: + type: file + description: Alternative VCF file index + pattern: "*.tbi" authors: - "@Gwennid" maintainers: diff --git a/modules/nf-core/bcftools/sort/tests/main.nf.test b/modules/nf-core/bcftools/sort/tests/main.nf.test new file mode 100644 index 00000000..b9bdd76a --- /dev/null +++ b/modules/nf-core/bcftools/sort/tests/main.nf.test @@ -0,0 +1,222 @@ +nextflow_process { + + name "Test Process BCFTOOLS_SORT" + script "../main.nf" + process "BCFTOOLS_SORT" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/sort" + + test("sarscov2 - vcf") { + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("vcf") } + ) + } + + } + + test("sarscov2 - 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', 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() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - 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', 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() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - 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', 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() }, + { assert process.out.tbi[0][1].endsWith(".tbi") } + ) + } + + } + + test("sarscov2 - vcf - stub") { + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - 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', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - 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', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert process.out.csi[0][1].endsWith(".csi") } + ) + } + + } + + test("sarscov2 - 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', 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/sort/tests/main.nf.test.snap b/modules/nf-core/bcftools/sort/tests/main.nf.test.snap new file mode 100644 index 00000000..f38272cb --- /dev/null +++ b/modules/nf-core/bcftools/sort/tests/main.nf.test.snap @@ -0,0 +1,350 @@ +{ + "sarscov2 - 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,2c9f26ca356ef71199c3a7d1742974cb" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T12:06:05.201680777" + }, + "vcf": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions": [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T12:04:43.889971134" + }, + "sarscov2 - vcf_gz_index": { + "content": [ + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi" + ] + ], + [ + + ], + [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T12:04:55.385964497" + }, + "sarscov2 - vcf_gz_index_csi": { + "content": [ + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi" + ] + ], + [ + + ], + [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T12:05:06.662818922" + }, + "sarscov2 - 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,2c9f26ca356ef71199c3a7d1742974cb" + ], + "csi": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T12:05:40.012912381" + }, + "sarscov2 - 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,2c9f26ca356ef71199c3a7d1742974cb" + ], + "csi": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T12:05:52.405673587" + }, + "sarscov2 - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ], + "csi": [ + + ], + "tbi": [ + + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T12:05:29.117946461" + }, + "sarscov2 - vcf_gz_index_tbi": { + "content": [ + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + [ + + ], + [ + [ + { + "id": "test" + }, + "test_vcf.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-05T12:05:17.217274984" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/sort/tests/tags.yml b/modules/nf-core/bcftools/sort/tests/tags.yml new file mode 100644 index 00000000..6e9520dd --- /dev/null +++ b/modules/nf-core/bcftools/sort/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/sort: + - "modules/nf-core/bcftools/sort/**" diff --git a/modules/nf-core/bcftools/sort/tests/vcf_gz_index.config b/modules/nf-core/bcftools/sort/tests/vcf_gz_index.config new file mode 100644 index 00000000..aacd1346 --- /dev/null +++ b/modules/nf-core/bcftools/sort/tests/vcf_gz_index.config @@ -0,0 +1,4 @@ +process { + ext.prefix = { "${meta.id}_vcf" } + ext.args = "--output-type z --write-index" +} diff --git a/modules/nf-core/bcftools/sort/tests/vcf_gz_index_csi.config b/modules/nf-core/bcftools/sort/tests/vcf_gz_index_csi.config new file mode 100644 index 00000000..640eb0ba --- /dev/null +++ b/modules/nf-core/bcftools/sort/tests/vcf_gz_index_csi.config @@ -0,0 +1,4 @@ +process { + ext.prefix = { "${meta.id}_vcf" } + ext.args = "--output-type z --write-index=csi" +} diff --git a/modules/nf-core/bcftools/sort/tests/vcf_gz_index_tbi.config b/modules/nf-core/bcftools/sort/tests/vcf_gz_index_tbi.config new file mode 100644 index 00000000..589a50c6 --- /dev/null +++ b/modules/nf-core/bcftools/sort/tests/vcf_gz_index_tbi.config @@ -0,0 +1,4 @@ +process { + ext.prefix = { "${meta.id}_vcf" } + ext.args = "--output-type z --write-index=tbi" +} diff --git a/modules/nf-core/bcftools/stats/environment.yml b/modules/nf-core/bcftools/stats/environment.yml index 1a969528..93357b41 100644 --- a/modules/nf-core/bcftools/stats/environment.yml +++ b/modules/nf-core/bcftools/stats/environment.yml @@ -1,7 +1,6 @@ -name: bcftools_stats channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::bcftools=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 ffa1df64..20e5da77 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/tests/main.nf.test b/modules/nf-core/bcftools/stats/tests/main.nf.test new file mode 100644 index 00000000..be618b0b --- /dev/null +++ b/modules/nf-core/bcftools/stats/tests/main.nf.test @@ -0,0 +1,182 @@ +nextflow_process { + + name "Test Process BCFTOOLS_STATS" + script "../main.nf" + process "BCFTOOLS_STATS" + + tag "modules" + tag "modules_nfcore" + tag "bcftools" + tag "bcftools/stats" + + test("sarscov2 - vcf_gz") { + + 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] = [ [], [] ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + test("sarscov2 - vcf_gz - regions") { + + when { + process { + """ + input[0] = [ [ id:'regions_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:'regions_test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test3.vcf.gz', checkIfExists: true) ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("regions_versions") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + test("sarscov2 - vcf_gz - targets") { + + when { + process { + """ + input[0] = [ [ id:'targets_test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] ] + input[1] = [ [], [] ] + input[2] = [ [id:'targets_test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.targets.tsv.gz', checkIfExists: true) + ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("targets_versions") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + test("sarscov2 - vcf_gz - exons") { + + when { + process { + """ + input[0] = [ [ id:'exon_test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] ] + input[1] = [ [], [] ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [id: "exon_test"], + file(params.modules_testdata_base_path + 'delete_me/bcftools/stats/exons.tsv.gz', checkIfExists: true) ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("exon_versions") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + test("sarscov2 - vcf_gz - reference") { + + when { + process { + """ + input[0] = [ [ id:'ref_test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), + [] ] + input[1] = [ [], [] ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [id: 'ref_test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("ref_versions") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, + ) + } + + } + + + test("sarscov2 - vcf_gz - stub") { + + 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] = [ [], [] ] + input[2] = [ [], [] ] + input[3] = [ [], [] ] + input[4] = [ [], [] ] + input[5] = [ [], [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/stats/tests/main.nf.test.snap b/modules/nf-core/bcftools/stats/tests/main.nf.test.snap new file mode 100644 index 00000000..cd8cff6d --- /dev/null +++ b/modules/nf-core/bcftools/stats/tests/main.nf.test.snap @@ -0,0 +1,180 @@ +{ + "sarscov2 - vcf_gz - reference": { + "content": [ + [ + "# 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:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:14:35.506777837" + }, + "sarscov2 - vcf_gz - exons": { + "content": [ + [ + "# 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:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:14:30.57486244" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:16:27.637515559" + }, + "sarscov2 - vcf_gz - targets": { + "content": [ + [ + "# 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:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "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-05-31T18:16:32.559884458" + }, + "targets_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:16:37.512009805" + }, + "sarscov2 - vcf_gz - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bcftools_stats.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ], + "stats": [ + [ + { + "id": "test" + }, + "test.bcftools_stats.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:57:09.614976125" + }, + "exon_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:16:42.347397266" + }, + "ref_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:16:47.26823622" + }, + "sarscov2 - vcf_gz": { + "content": [ + [ + "# 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:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:16:27.670416598" + }, + "sarscov2 - vcf_gz - regions": { + "content": [ + [ + "# 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:", + "# ID\t[2]id\t[3]tab-separated file names", + "ID\t0\ttest.vcf.gz" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:14:20.759094062" + } +} \ No newline at end of file diff --git a/modules/nf-core/bcftools/stats/tests/tags.yml b/modules/nf-core/bcftools/stats/tests/tags.yml new file mode 100644 index 00000000..53c12d92 --- /dev/null +++ b/modules/nf-core/bcftools/stats/tests/tags.yml @@ -0,0 +1,2 @@ +bcftools/stats: + - "modules/nf-core/bcftools/stats/**" diff --git a/modules/nf-core/bedtools/intersect/environment.yml b/modules/nf-core/bedtools/intersect/environment.yml index 2a343050..5683bc05 100644 --- a/modules/nf-core/bedtools/intersect/environment.yml +++ b/modules/nf-core/bedtools/intersect/environment.yml @@ -1,7 +1,5 @@ -name: bedtools_intersect channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bedtools=2.31.1 diff --git a/modules/nf-core/bedtools/merge/environment.yml b/modules/nf-core/bedtools/merge/environment.yml index 99707878..5683bc05 100644 --- a/modules/nf-core/bedtools/merge/environment.yml +++ b/modules/nf-core/bedtools/merge/environment.yml @@ -1,7 +1,5 @@ -name: bedtools_merge channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bedtools=2.31.1 diff --git a/modules/nf-core/bedtools/merge/tests/main.nf.test b/modules/nf-core/bedtools/merge/tests/main.nf.test new file mode 100644 index 00000000..2959d6b9 --- /dev/null +++ b/modules/nf-core/bedtools/merge/tests/main.nf.test @@ -0,0 +1,34 @@ +nextflow_process { + + name "Test Process BEDTOOLS_MERGE" + script "../main.nf" + config "./nextflow.config" + process "BEDTOOLS_MERGE" + + tag "modules" + tag "modules_nfcore" + tag "bedtools" + tag "bedtools/merge" + + test("test_bedtools_merge") { + + when { + process { + """ + input[0] = [ [ id:'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/bedtools/merge/tests/main.nf.test.snap b/modules/nf-core/bedtools/merge/tests/main.nf.test.snap new file mode 100644 index 00000000..ee6c4e63 --- /dev/null +++ b/modules/nf-core/bedtools/merge/tests/main.nf.test.snap @@ -0,0 +1,35 @@ +{ + "test_bedtools_merge": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test_out.bed:md5,0cf6ed2b6f470cd44a247da74ca4fe4e" + ] + ], + "1": [ + "versions.yml:md5,2d134badb4cd1e4e903696c7967f28d6" + ], + "bed": [ + [ + { + "id": "test" + }, + "test_out.bed:md5,0cf6ed2b6f470cd44a247da74ca4fe4e" + ] + ], + "versions": [ + "versions.yml:md5,2d134badb4cd1e4e903696c7967f28d6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-18T17:07:09.721153" + } +} \ No newline at end of file diff --git a/modules/nf-core/bedtools/merge/tests/nextflow.config b/modules/nf-core/bedtools/merge/tests/nextflow.config new file mode 100644 index 00000000..16444e98 --- /dev/null +++ b/modules/nf-core/bedtools/merge/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: BEDTOOLS_MERGE { + ext.prefix = { "${meta.id}_out" } + } + +} diff --git a/modules/nf-core/bedtools/merge/tests/tags.yml b/modules/nf-core/bedtools/merge/tests/tags.yml new file mode 100644 index 00000000..60c8cad1 --- /dev/null +++ b/modules/nf-core/bedtools/merge/tests/tags.yml @@ -0,0 +1,2 @@ +bedtools/merge: + - "modules/nf-core/bedtools/merge/**" diff --git a/modules/nf-core/bedtools/split/environment.yml b/modules/nf-core/bedtools/split/environment.yml index 71912c7d..5683bc05 100644 --- a/modules/nf-core/bedtools/split/environment.yml +++ b/modules/nf-core/bedtools/split/environment.yml @@ -1,7 +1,5 @@ -name: bedtools_split channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::bedtools=2.31.1 diff --git a/modules/nf-core/bedtools/split/tests/main.nf.test b/modules/nf-core/bedtools/split/tests/main.nf.test new file mode 100644 index 00000000..a59891b7 --- /dev/null +++ b/modules/nf-core/bedtools/split/tests/main.nf.test @@ -0,0 +1,36 @@ + +nextflow_process { + + name "Test Process BEDTOOLS_SPLIT" + script "../main.nf" + process "BEDTOOLS_SPLIT" + + tag "modules" + tag "modules_nfcore" + tag "bedtools" + tag "bedtools/split" + + test("test-bedtools-split") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.multi_intervals.bed', checkIfExists: true), + 2 + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + +} diff --git a/modules/nf-core/bedtools/split/tests/main.nf.test.snap b/modules/nf-core/bedtools/split/tests/main.nf.test.snap new file mode 100644 index 00000000..359b3aa9 --- /dev/null +++ b/modules/nf-core/bedtools/split/tests/main.nf.test.snap @@ -0,0 +1,41 @@ +{ + "test-bedtools-split": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + [ + "test.00001.bed:md5,d58e5e46c2fcc3b8be5db0f023e93cb5", + "test.00002.bed:md5,03caf952e9297a54620d2bbba8dc2823" + ] + ] + ], + "1": [ + "versions.yml:md5,33e0d5f886b7f0ed6f9c3e19b049357f" + ], + "beds": [ + [ + { + "id": "test" + }, + [ + "test.00001.bed:md5,d58e5e46c2fcc3b8be5db0f023e93cb5", + "test.00002.bed:md5,03caf952e9297a54620d2bbba8dc2823" + ] + ] + ], + "versions": [ + "versions.yml:md5,33e0d5f886b7f0ed6f9c3e19b049357f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T13:50:28.137857" + } +} \ No newline at end of file diff --git a/modules/nf-core/ensemblvep/download/ensemblvep-download.diff b/modules/nf-core/ensemblvep/download/ensemblvep-download.diff deleted file mode 100644 index 954d28c3..00000000 --- a/modules/nf-core/ensemblvep/download/ensemblvep-download.diff +++ /dev/null @@ -1,25 +0,0 @@ -Changes in module 'nf-core/ensemblvep/download' ---- modules/nf-core/ensemblvep/download/main.nf -+++ modules/nf-core/ensemblvep/download/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/ensembl-vep:110.0--pl5321h2a3209d_0' : -- 'biocontainers/ensembl-vep:110.0--pl5321h2a3209d_0' }" -+ 'https://depot.galaxyproject.org/singularity/ensembl-vep:105.0--pl5321h4a94de4_1' : -+ 'biocontainers/ensembl-vep:105.0--pl5321h4a94de4_1' }" - - input: - tuple val(meta), val(assembly), val(species), val(cache_version) - ---- modules/nf-core/ensemblvep/download/environment.yml -+++ modules/nf-core/ensemblvep/download/environment.yml -@@ -4,4 +4,4 @@ - - bioconda - - defaults - dependencies: -- - bioconda::ensembl-vep=110.0 -+ - bioconda::ensembl-vep=105.0 - -************************************************************ diff --git a/modules/nf-core/ensemblvep/download/environment.yml b/modules/nf-core/ensemblvep/download/environment.yml index adba76e8..283a45bb 100644 --- a/modules/nf-core/ensemblvep/download/environment.yml +++ b/modules/nf-core/ensemblvep/download/environment.yml @@ -1,7 +1,5 @@ -name: ensemblvep_download channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::ensembl-vep=105.0 + - bioconda::ensembl-vep=112.0 diff --git a/modules/nf-core/ensemblvep/download/main.nf b/modules/nf-core/ensemblvep/download/main.nf index f6ed5872..555c3c66 100644 --- a/modules/nf-core/ensemblvep/download/main.nf +++ b/modules/nf-core/ensemblvep/download/main.nf @@ -4,24 +4,25 @@ process ENSEMBLVEP_DOWNLOAD { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ensembl-vep:105.0--pl5321h4a94de4_1' : - 'biocontainers/ensembl-vep:105.0--pl5321h4a94de4_1' }" + 'https://depot.galaxyproject.org/singularity/ensembl-vep:112.0--pl5321h2a3209d_0' : + 'biocontainers/ensembl-vep:112.0--pl5321h2a3209d_0' }" input: tuple val(meta), val(assembly), val(species), val(cache_version) output: - tuple val(meta), path("vep_cache"), emit: cache - path "versions.yml" , emit: versions + tuple val(meta), path(prefix), emit: cache + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: 'vep_cache' """ vep_install \\ - --CACHEDIR vep_cache \\ + --CACHEDIR $prefix \\ --SPECIES $species \\ --ASSEMBLY $assembly \\ --CACHE_VERSION $cache_version \\ @@ -34,8 +35,9 @@ process ENSEMBLVEP_DOWNLOAD { """ stub: + prefix = task.ext.prefix ?: 'vep_cache' """ - mkdir vep_cache + mkdir $prefix cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/ensemblvep/download/tests/main.nf.test b/modules/nf-core/ensemblvep/download/tests/main.nf.test new file mode 100644 index 00000000..ac41cc3f --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/main.nf.test @@ -0,0 +1,60 @@ +nextflow_process { + + name "Test Process ENSEMBLVEP_DOWNLOAD" + script "../main.nf" + process "ENSEMBLVEP_DOWNLOAD" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "ensemblvep" + tag "ensemblvep/download" + + test("celegans - download") { + + when { + process { + """ + input[0] = Channel.of([ + [id:"112_WBcel235"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("celegans - download - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [id:"112_WBcel235"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-core/ensemblvep/download/tests/main.nf.test.snap b/modules/nf-core/ensemblvep/download/tests/main.nf.test.snap new file mode 100644 index 00000000..9e303c54 --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/main.nf.test.snap @@ -0,0 +1,322 @@ +{ + "celegans - download": { + "content": [ + { + "0": [ + [ + { + "id": "112_WBcel235" + }, + [ + [ + [ + [ + "1-1000000.gz:md5,c7df2324c613caafe70024bb156b077c", + "10000001-11000000.gz:md5,baee612beb1fc7b931d1b4c34df9a366", + "1000001-2000000.gz:md5,4fefec2bbbcdc22022ba22e2b36fe118", + "11000001-12000000.gz:md5,e06df8391870440be75a3a0fed05ad29", + "12000001-13000000.gz:md5,3abd252ef8e0c79d7be07dfe7503c38b", + "13000001-14000000.gz:md5,9b20be645c68c1ef16f0aaadc9d1899d", + "14000001-15000000.gz:md5,c80817caa2a893c8059ad9a66e1c2c1a", + "15000001-16000000.gz:md5,595cf5694cba18c82cff8f0ab882c08a", + "2000001-3000000.gz:md5,b1e24d27d0ef74c85926c1fad795e07b", + "3000001-4000000.gz:md5,ec32b7b8263ee176c97269a34b77232d", + "4000001-5000000.gz:md5,017e3d44b66c6b343c6b9d2265f4a539", + "5000001-6000000.gz:md5,d0723825e78aceac2345548928e3c2b9", + "6000001-7000000.gz:md5,b73797333b2493592b4ebfe72c817c2d", + "7000001-8000000.gz:md5,665647b964cd5a66d8d02aa5104ca3be", + "8000001-9000000.gz:md5,d98e077bf36e071f651c9a5f7661f294", + "9000001-10000000.gz:md5,828987069dd14db0ecf1f18c05b83ea9" + ], + [ + "1-1000000.gz:md5,f9c71b88d2173861735f6bbb1628fb7b", + "10000001-11000000.gz:md5,caef13b68ca547ed551aef70c6d35045", + "1000001-2000000.gz:md5,493c2f368edeb6bbfe7ad237aff36c4b", + "11000001-12000000.gz:md5,65d6e583c532ac05033663d0fa52952c", + "12000001-13000000.gz:md5,fbba6aa2b41aa4d3e8a5bed643361d47", + "13000001-14000000.gz:md5,dcb85a41d106a9e34ed2835992aa8610", + "14000001-15000000.gz:md5,548e5bbf055f74d428538f1ce9a3c041", + "15000001-16000000.gz:md5,6f351d7bfac444405209c703671861f7", + "2000001-3000000.gz:md5,5fa9ad99eb57cabbbda8684df39f4e88", + "3000001-4000000.gz:md5,2cef090c5bb01f68155bb21bc694a323", + "4000001-5000000.gz:md5,beca6d18414146e139e27912458a8dbf", + "5000001-6000000.gz:md5,9d5d0f77c8057074063e59b40f9bea7c", + "6000001-7000000.gz:md5,41f6375102c67e2621f736f94998c037", + "7000001-8000000.gz:md5,926cd39b81e9c98b61afe5eaed6196da", + "8000001-9000000.gz:md5,a9d32d8678153eca5af93e0cc309568b", + "9000001-10000000.gz:md5,6eeb83014cd638a29d03c92dec5407dc" + ], + [ + "1-1000000.gz:md5,ea81b2b4955dd33fd770dc8ccc3f0af5", + "10000001-11000000.gz:md5,8c71450edf69cc9eb48aa832726cd986", + "1000001-2000000.gz:md5,3fc788203586e8f22f63b7655a4bcd2f", + "11000001-12000000.gz:md5,acaccb3801da9192cb211817c719c50c", + "12000001-13000000.gz:md5,0707f54bc90449303fa212e2389649b7", + "13000001-14000000.gz:md5,11701639fbdbf22fd0c795a23b995e10", + "2000001-3000000.gz:md5,d53ff5ffaa9bfb772edaf5affdb73beb", + "3000001-4000000.gz:md5,0de451e2296ac119319d0d3cedd4870f", + "4000001-5000000.gz:md5,37c248c0b8488a535bda18c318770dd4", + "5000001-6000000.gz:md5,3a4fb690e809c1fe9fe675bc5d8dc480", + "6000001-7000000.gz:md5,2ff968944165b45475799971da2b2715", + "7000001-8000000.gz:md5,d172ac8248f67a33f18a788c32cf02ab", + "8000001-9000000.gz:md5,a9ecda1e1cb3d81d43b0343169744d5a", + "9000001-10000000.gz:md5,ca8bd58fe35b597709a4de86dbe01c78" + ], + [ + "1-1000000.gz:md5,189037eb5ce432a41c198b69fa11dba1", + "10000001-11000000.gz:md5,8cbb19d243093b735f055a7e7d8506b4", + "1000001-2000000.gz:md5,f634365a563f459fd4a91e139a962620", + "11000001-12000000.gz:md5,3d05e3298731cfa83a0c8e7e14708fd5", + "12000001-13000000.gz:md5,2678ad4b5516f90af54e9460bfe9cdf8", + "13000001-14000000.gz:md5,a885dd1cb05d981ddc5f522e0ead4850", + "14000001-15000000.gz:md5,bc540a102a909b80c6e4b1374e1be69e", + "15000001-16000000.gz:md5,a49f32c55dc2dcb36dcdaffe061f6677", + "16000001-17000000.gz:md5,250ca77e8ec4f6c001c4797a8d09d1d5", + "17000001-18000000.gz:md5,4067d8d30595d4700f3eba5aee92b785", + "2000001-3000000.gz:md5,07ecf8c7e69931af567e94f48e51462e", + "3000001-4000000.gz:md5,e1cfaf343f111867baee5b01060f7e22", + "4000001-5000000.gz:md5,de905e75eb386d7a3dcbc76d69a6e439", + "5000001-6000000.gz:md5,36f2fd0fa37f36485dbc90054f3deeee", + "6000001-7000000.gz:md5,b0e1f3179f2a527c3187aa08942246ed", + "7000001-8000000.gz:md5,ea93a4d60f2a538d6e7335b14d09f0b6", + "8000001-9000000.gz:md5,8b0443d2833dacd4f82023b16be84da1", + "9000001-10000000.gz:md5,54eff9f655ae0f1c18ba6efeeefac5e8" + ], + [ + "1-1000000.gz:md5,64e3e539e8af16775cc4657c605cc585" + ], + [ + "1-1000000.gz:md5,0874a0bc852217ed68364921662e4b9b", + "10000001-11000000.gz:md5,46eb3254cf0452bcc8fed5d279bcef35", + "1000001-2000000.gz:md5,2d313518641f5efbe09d1ffd4e4523d5", + "11000001-12000000.gz:md5,2f6a28eb26832af84c9d5c40607ffa39", + "12000001-13000000.gz:md5,3dc37f2082fc45663a88aad0f67506e6", + "13000001-14000000.gz:md5,cd5185227b576640454922e060f00525", + "14000001-15000000.gz:md5,af9fe314326ae20b99a89a8aaa45d0d0", + "15000001-16000000.gz:md5,ff02629cfde390e7eed097296cea0ccb", + "16000001-17000000.gz:md5,7cb1e4babe5b867358bf4f49d9a3d58e", + "17000001-18000000.gz:md5,09588f85610505fdb95117932661a5b9", + "18000001-19000000.gz:md5,cba448de43edcee8d423c1278a76c61f", + "19000001-20000000.gz:md5,af1ee9201a78d537e6df555d3690277d", + "20000001-21000000.gz:md5,1a63895964ba6101c0109990213ec17e", + "2000001-3000000.gz:md5,02d0dc41894283e82ce2da023eb81663", + "3000001-4000000.gz:md5,64d9e97703894f5051349da978e0a3cf", + "4000001-5000000.gz:md5,1b69fdb6993a70e8f6688a03b4626a00", + "5000001-6000000.gz:md5,c4b0e3d33aa451e081ccef0dbbfcc1f5", + "6000001-7000000.gz:md5,26425e131cacb5ba8d68f6e9de39094c", + "7000001-8000000.gz:md5,1c0fcee419cccd5b4268329f7d001d2a", + "8000001-9000000.gz:md5,7515ee504db75bccbdd9d282429a999b", + "9000001-10000000.gz:md5,8647b733b4eba24aaf21b3d983461b1b" + ], + [ + "1-1000000.gz:md5,a252da6c7c69644ff29276d15796f457", + "10000001-11000000.gz:md5,e7376cbf07ee7fd1fb8214c9bc739e64", + "1000001-2000000.gz:md5,566d7342a45728a784af7ba5c2e630cb", + "11000001-12000000.gz:md5,bf44ab823c1d51cb7841958761a7cd4d", + "12000001-13000000.gz:md5,ec1494ff61067a130c05afabee046164", + "13000001-14000000.gz:md5,2b24e155be6ae36a62e7ea3b1a0a3118", + "14000001-15000000.gz:md5,3215b3d56cd19a305c8d8f2d1f517825", + "15000001-16000000.gz:md5,6fa2abd0ff33750387780798dc6bd821", + "16000001-17000000.gz:md5,c2a1e5012a895ab95662d83d387f641a", + "17000001-18000000.gz:md5,eb398d2f8bc90b519a82588b8dcbad60", + "2000001-3000000.gz:md5,b78320f16b4caafe9708f95b69668265", + "3000001-4000000.gz:md5,e04cd4871f53108aaa780dbb3718b7f7", + "4000001-5000000.gz:md5,47bd8029ef9fffb5ee2ebb0fa8b91110", + "5000001-6000000.gz:md5,a6c404381dab5da8453b265fb0f374c3", + "6000001-7000000.gz:md5,417b7a492977b76f823634128e3ea2da", + "7000001-8000000.gz:md5,d0f9d030f7f4ad834d1538c7aaace5cf", + "8000001-9000000.gz:md5,58b2eca4ddeea8d2746242b18be1dba4", + "9000001-10000000.gz:md5,62cf6898fa164616c36117472ec10ce9" + ], + "chr_synonyms.txt:md5,c7df2db509525b8ff0d95ef927882764", + "info.txt:md5,33ccb74a030a9a345051628c337cb8af" + ] + ] + ] + ] + ], + "1": [ + "versions.yml:md5,e32852e9cba2a298b7518ce610011b14" + ], + "cache": [ + [ + { + "id": "112_WBcel235" + }, + [ + [ + [ + [ + "1-1000000.gz:md5,c7df2324c613caafe70024bb156b077c", + "10000001-11000000.gz:md5,baee612beb1fc7b931d1b4c34df9a366", + "1000001-2000000.gz:md5,4fefec2bbbcdc22022ba22e2b36fe118", + "11000001-12000000.gz:md5,e06df8391870440be75a3a0fed05ad29", + "12000001-13000000.gz:md5,3abd252ef8e0c79d7be07dfe7503c38b", + "13000001-14000000.gz:md5,9b20be645c68c1ef16f0aaadc9d1899d", + "14000001-15000000.gz:md5,c80817caa2a893c8059ad9a66e1c2c1a", + "15000001-16000000.gz:md5,595cf5694cba18c82cff8f0ab882c08a", + "2000001-3000000.gz:md5,b1e24d27d0ef74c85926c1fad795e07b", + "3000001-4000000.gz:md5,ec32b7b8263ee176c97269a34b77232d", + "4000001-5000000.gz:md5,017e3d44b66c6b343c6b9d2265f4a539", + "5000001-6000000.gz:md5,d0723825e78aceac2345548928e3c2b9", + "6000001-7000000.gz:md5,b73797333b2493592b4ebfe72c817c2d", + "7000001-8000000.gz:md5,665647b964cd5a66d8d02aa5104ca3be", + "8000001-9000000.gz:md5,d98e077bf36e071f651c9a5f7661f294", + "9000001-10000000.gz:md5,828987069dd14db0ecf1f18c05b83ea9" + ], + [ + "1-1000000.gz:md5,f9c71b88d2173861735f6bbb1628fb7b", + "10000001-11000000.gz:md5,caef13b68ca547ed551aef70c6d35045", + "1000001-2000000.gz:md5,493c2f368edeb6bbfe7ad237aff36c4b", + "11000001-12000000.gz:md5,65d6e583c532ac05033663d0fa52952c", + "12000001-13000000.gz:md5,fbba6aa2b41aa4d3e8a5bed643361d47", + "13000001-14000000.gz:md5,dcb85a41d106a9e34ed2835992aa8610", + "14000001-15000000.gz:md5,548e5bbf055f74d428538f1ce9a3c041", + "15000001-16000000.gz:md5,6f351d7bfac444405209c703671861f7", + "2000001-3000000.gz:md5,5fa9ad99eb57cabbbda8684df39f4e88", + "3000001-4000000.gz:md5,2cef090c5bb01f68155bb21bc694a323", + "4000001-5000000.gz:md5,beca6d18414146e139e27912458a8dbf", + "5000001-6000000.gz:md5,9d5d0f77c8057074063e59b40f9bea7c", + "6000001-7000000.gz:md5,41f6375102c67e2621f736f94998c037", + "7000001-8000000.gz:md5,926cd39b81e9c98b61afe5eaed6196da", + "8000001-9000000.gz:md5,a9d32d8678153eca5af93e0cc309568b", + "9000001-10000000.gz:md5,6eeb83014cd638a29d03c92dec5407dc" + ], + [ + "1-1000000.gz:md5,ea81b2b4955dd33fd770dc8ccc3f0af5", + "10000001-11000000.gz:md5,8c71450edf69cc9eb48aa832726cd986", + "1000001-2000000.gz:md5,3fc788203586e8f22f63b7655a4bcd2f", + "11000001-12000000.gz:md5,acaccb3801da9192cb211817c719c50c", + "12000001-13000000.gz:md5,0707f54bc90449303fa212e2389649b7", + "13000001-14000000.gz:md5,11701639fbdbf22fd0c795a23b995e10", + "2000001-3000000.gz:md5,d53ff5ffaa9bfb772edaf5affdb73beb", + "3000001-4000000.gz:md5,0de451e2296ac119319d0d3cedd4870f", + "4000001-5000000.gz:md5,37c248c0b8488a535bda18c318770dd4", + "5000001-6000000.gz:md5,3a4fb690e809c1fe9fe675bc5d8dc480", + "6000001-7000000.gz:md5,2ff968944165b45475799971da2b2715", + "7000001-8000000.gz:md5,d172ac8248f67a33f18a788c32cf02ab", + "8000001-9000000.gz:md5,a9ecda1e1cb3d81d43b0343169744d5a", + "9000001-10000000.gz:md5,ca8bd58fe35b597709a4de86dbe01c78" + ], + [ + "1-1000000.gz:md5,189037eb5ce432a41c198b69fa11dba1", + "10000001-11000000.gz:md5,8cbb19d243093b735f055a7e7d8506b4", + "1000001-2000000.gz:md5,f634365a563f459fd4a91e139a962620", + "11000001-12000000.gz:md5,3d05e3298731cfa83a0c8e7e14708fd5", + "12000001-13000000.gz:md5,2678ad4b5516f90af54e9460bfe9cdf8", + "13000001-14000000.gz:md5,a885dd1cb05d981ddc5f522e0ead4850", + "14000001-15000000.gz:md5,bc540a102a909b80c6e4b1374e1be69e", + "15000001-16000000.gz:md5,a49f32c55dc2dcb36dcdaffe061f6677", + "16000001-17000000.gz:md5,250ca77e8ec4f6c001c4797a8d09d1d5", + "17000001-18000000.gz:md5,4067d8d30595d4700f3eba5aee92b785", + "2000001-3000000.gz:md5,07ecf8c7e69931af567e94f48e51462e", + "3000001-4000000.gz:md5,e1cfaf343f111867baee5b01060f7e22", + "4000001-5000000.gz:md5,de905e75eb386d7a3dcbc76d69a6e439", + "5000001-6000000.gz:md5,36f2fd0fa37f36485dbc90054f3deeee", + "6000001-7000000.gz:md5,b0e1f3179f2a527c3187aa08942246ed", + "7000001-8000000.gz:md5,ea93a4d60f2a538d6e7335b14d09f0b6", + "8000001-9000000.gz:md5,8b0443d2833dacd4f82023b16be84da1", + "9000001-10000000.gz:md5,54eff9f655ae0f1c18ba6efeeefac5e8" + ], + [ + "1-1000000.gz:md5,64e3e539e8af16775cc4657c605cc585" + ], + [ + "1-1000000.gz:md5,0874a0bc852217ed68364921662e4b9b", + "10000001-11000000.gz:md5,46eb3254cf0452bcc8fed5d279bcef35", + "1000001-2000000.gz:md5,2d313518641f5efbe09d1ffd4e4523d5", + "11000001-12000000.gz:md5,2f6a28eb26832af84c9d5c40607ffa39", + "12000001-13000000.gz:md5,3dc37f2082fc45663a88aad0f67506e6", + "13000001-14000000.gz:md5,cd5185227b576640454922e060f00525", + "14000001-15000000.gz:md5,af9fe314326ae20b99a89a8aaa45d0d0", + "15000001-16000000.gz:md5,ff02629cfde390e7eed097296cea0ccb", + "16000001-17000000.gz:md5,7cb1e4babe5b867358bf4f49d9a3d58e", + "17000001-18000000.gz:md5,09588f85610505fdb95117932661a5b9", + "18000001-19000000.gz:md5,cba448de43edcee8d423c1278a76c61f", + "19000001-20000000.gz:md5,af1ee9201a78d537e6df555d3690277d", + "20000001-21000000.gz:md5,1a63895964ba6101c0109990213ec17e", + "2000001-3000000.gz:md5,02d0dc41894283e82ce2da023eb81663", + "3000001-4000000.gz:md5,64d9e97703894f5051349da978e0a3cf", + "4000001-5000000.gz:md5,1b69fdb6993a70e8f6688a03b4626a00", + "5000001-6000000.gz:md5,c4b0e3d33aa451e081ccef0dbbfcc1f5", + "6000001-7000000.gz:md5,26425e131cacb5ba8d68f6e9de39094c", + "7000001-8000000.gz:md5,1c0fcee419cccd5b4268329f7d001d2a", + "8000001-9000000.gz:md5,7515ee504db75bccbdd9d282429a999b", + "9000001-10000000.gz:md5,8647b733b4eba24aaf21b3d983461b1b" + ], + [ + "1-1000000.gz:md5,a252da6c7c69644ff29276d15796f457", + "10000001-11000000.gz:md5,e7376cbf07ee7fd1fb8214c9bc739e64", + "1000001-2000000.gz:md5,566d7342a45728a784af7ba5c2e630cb", + "11000001-12000000.gz:md5,bf44ab823c1d51cb7841958761a7cd4d", + "12000001-13000000.gz:md5,ec1494ff61067a130c05afabee046164", + "13000001-14000000.gz:md5,2b24e155be6ae36a62e7ea3b1a0a3118", + "14000001-15000000.gz:md5,3215b3d56cd19a305c8d8f2d1f517825", + "15000001-16000000.gz:md5,6fa2abd0ff33750387780798dc6bd821", + "16000001-17000000.gz:md5,c2a1e5012a895ab95662d83d387f641a", + "17000001-18000000.gz:md5,eb398d2f8bc90b519a82588b8dcbad60", + "2000001-3000000.gz:md5,b78320f16b4caafe9708f95b69668265", + "3000001-4000000.gz:md5,e04cd4871f53108aaa780dbb3718b7f7", + "4000001-5000000.gz:md5,47bd8029ef9fffb5ee2ebb0fa8b91110", + "5000001-6000000.gz:md5,a6c404381dab5da8453b265fb0f374c3", + "6000001-7000000.gz:md5,417b7a492977b76f823634128e3ea2da", + "7000001-8000000.gz:md5,d0f9d030f7f4ad834d1538c7aaace5cf", + "8000001-9000000.gz:md5,58b2eca4ddeea8d2746242b18be1dba4", + "9000001-10000000.gz:md5,62cf6898fa164616c36117472ec10ce9" + ], + "chr_synonyms.txt:md5,c7df2db509525b8ff0d95ef927882764", + "info.txt:md5,33ccb74a030a9a345051628c337cb8af" + ] + ] + ] + ] + ], + "versions": [ + "versions.yml:md5,e32852e9cba2a298b7518ce610011b14" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-02T13:19:08.690863" + }, + "celegans - download - stub": { + "content": [ + { + "0": [ + [ + { + "id": "112_WBcel235" + }, + [ + + ] + ] + ], + "1": [ + "versions.yml:md5,e32852e9cba2a298b7518ce610011b14" + ], + "cache": [ + [ + { + "id": "112_WBcel235" + }, + [ + + ] + ] + ], + "versions": [ + "versions.yml:md5,e32852e9cba2a298b7518ce610011b14" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-02T13:19:23.308683" + } +} \ No newline at end of file diff --git a/modules/nf-core/ensemblvep/download/tests/nextflow.config b/modules/nf-core/ensemblvep/download/tests/nextflow.config new file mode 100644 index 00000000..9aa48164 --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/nextflow.config @@ -0,0 +1,12 @@ +params { + vep_cache_version = "112" + vep_genome = "WBcel235" + vep_species = "caenorhabditis_elegans" +} + +process { + withName: ENSEMBLVEP_DOWNLOAD { + ext.args = '--AUTO c --CONVERT --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE' + ext.prefix = { "${params.vep_cache_version}_${params.vep_genome}" } + } +} diff --git a/modules/nf-core/ensemblvep/download/tests/tags.yml b/modules/nf-core/ensemblvep/download/tests/tags.yml new file mode 100644 index 00000000..26671f3d --- /dev/null +++ b/modules/nf-core/ensemblvep/download/tests/tags.yml @@ -0,0 +1,2 @@ +ensemblvep/download: + - "modules/nf-core/ensemblvep/download/**" diff --git a/modules/nf-core/ensemblvep/vep/ensemblvep-vep.diff b/modules/nf-core/ensemblvep/vep/ensemblvep-vep.diff deleted file mode 100644 index 63309f0b..00000000 --- a/modules/nf-core/ensemblvep/vep/ensemblvep-vep.diff +++ /dev/null @@ -1,38 +0,0 @@ -Changes in module 'nf-core/ensemblvep/vep' ---- modules/nf-core/ensemblvep/vep/main.nf -+++ modules/nf-core/ensemblvep/vep/main.nf -@@ -2,10 +2,10 @@ - tag "$meta.id" - label 'process_medium' - -- conda "bioconda::ensembl-vep=109.3" -+ conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? -- 'https://depot.galaxyproject.org/singularity/ensembl-vep:109.3--pl5321h2a3209d_1' : -- 'biocontainers/ensembl-vep:109.3--pl5321h2a3209d_1' }" -+ 'https://depot.galaxyproject.org/singularity/ensembl-vep:105.0--pl5321h4a94de4_1' : -+ 'biocontainers/ensembl-vep:105.0--pl5321h4a94de4_1' }" - - input: - tuple val(meta), path(vcf), path(custom_extra_files) -@@ -48,7 +48,6 @@ - --fork $task.cpus \\ - --stats_file ${prefix}.summary.html \\ - -- - cat <<-END_VERSIONS > versions.yml - "${task.process}": - ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//') - ---- /dev/null -+++ modules/nf-core/ensemblvep/vep/environment.yml -@@ -0,0 +1,7 @@ -+name: ensemblvep_download -+channels: -+ - conda-forge -+ - bioconda -+ - defaults -+dependencies: -+ - bioconda::ensembl-vep=105.0 - -************************************************************ diff --git a/modules/nf-core/ensemblvep/vep/environment.yml b/modules/nf-core/ensemblvep/vep/environment.yml index adba76e8..87b88372 100644 --- a/modules/nf-core/ensemblvep/vep/environment.yml +++ b/modules/nf-core/ensemblvep/vep/environment.yml @@ -1,7 +1,6 @@ -name: ensemblvep_download +name: ensemblvep_vep channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::ensembl-vep=105.0 + - bioconda::ensembl-vep=112.0 diff --git a/modules/nf-core/ensemblvep/vep/main.nf b/modules/nf-core/ensemblvep/vep/main.nf index 65fbd53d..5f33265b 100644 --- a/modules/nf-core/ensemblvep/vep/main.nf +++ b/modules/nf-core/ensemblvep/vep/main.nf @@ -4,8 +4,8 @@ process ENSEMBLVEP_VEP { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/ensembl-vep:105.0--pl5321h4a94de4_1' : - 'biocontainers/ensembl-vep:105.0--pl5321h4a94de4_1' }" + 'https://depot.galaxyproject.org/singularity/ensembl-vep:112.0--pl5321h2a3209d_0' : + 'biocontainers/ensembl-vep:112.0--pl5321h2a3209d_0' }" input: tuple val(meta), path(vcf), path(custom_extra_files) @@ -20,7 +20,7 @@ process ENSEMBLVEP_VEP { tuple val(meta), path("*.vcf.gz") , optional:true, emit: vcf tuple val(meta), path("*.tab.gz") , optional:true, emit: tab tuple val(meta), path("*.json.gz") , optional:true, emit: json - path "*.summary.html" , emit: report + path "*.html" , optional:true, emit: report path "versions.yml" , emit: versions when: @@ -45,8 +45,8 @@ process ENSEMBLVEP_VEP { --cache \\ --cache_version $cache_version \\ --dir_cache $dir_cache \\ - --fork $task.cpus \\ - --stats_file ${prefix}.summary.html \\ + --fork $task.cpus + cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -57,10 +57,10 @@ process ENSEMBLVEP_VEP { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz - touch ${prefix}.tab.gz - touch ${prefix}.json.gz - touch ${prefix}.summary.html + echo "" | gzip > ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.tab.gz + echo "" | gzip > ${prefix}.json.gz + touch ${prefix}_summary.html cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/ensemblvep/vep/meta.yml b/modules/nf-core/ensemblvep/vep/meta.yml index 7783847d..d8ff8d14 100644 --- a/modules/nf-core/ensemblvep/vep/meta.yml +++ b/modules/nf-core/ensemblvep/vep/meta.yml @@ -1,4 +1,4 @@ -name: ENSEMBLVEP_VEP +name: ensemblvep_vep description: Ensembl Variant Effect Predictor (VEP). The output-file-format is controlled through `task.ext.args`. keywords: - annotation @@ -86,3 +86,7 @@ authors: - "@maxulysse" - "@matthdsm" - "@nvnieuwk" +maintainers: + - "@maxulysse" + - "@matthdsm" + - "@nvnieuwk" diff --git a/modules/nf-core/ensemblvep/vep/tests/main.nf.test b/modules/nf-core/ensemblvep/vep/tests/main.nf.test new file mode 100644 index 00000000..e68fff3c --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/main.nf.test @@ -0,0 +1,114 @@ +nextflow_process { + + name "Test Process ENSEMBLVEP_VEP" + script "../main.nf" + process "ENSEMBLVEP_VEP" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "ensemblvep" + tag "ensemblvep/vep" + tag "ensemblvep/download" + + test("test_ensemblvep_vep_fasta_vcf") { + config "./vcf.config" + + setup { + run("ENSEMBLVEP_DOWNLOAD") { + script "../../download/main.nf" + + process { + """ + input[0] = Channel.of([ + [id:"112_WBcel235"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + [] + ]) + input[1] = params.vep_genome + input[2] = params.vep_species + input[3] = params.vep_cache_version + input[4] = ENSEMBLVEP_DOWNLOAD.out.cache.map{ meta, cache -> [cache] } + input[5] = Channel.value([ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match() }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.2") } + ) + } + + } + + test("test_ensemblvep_vep_fasta_tab_gz") { + config "./tab.gz.config" + + setup { + run("ENSEMBLVEP_DOWNLOAD") { + script "../../download/main.nf" + + process { + """ + input[0] = Channel.of([ + [id:"112_WBcel235"], + params.vep_genome, + params.vep_species, + params.vep_cache_version + ]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), + [] + ]) + input[1] = params.vep_genome + input[2] = params.vep_species + input[3] = params.vep_cache_version + input[4] = ENSEMBLVEP_DOWNLOAD.out.cache.map{ meta, cache -> [cache] } + input[5] = Channel.value([ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[6] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match() }, + { assert path(process.out.tab.get(0).get(1)).linesGzip.contains("## ENSEMBL VARIANT EFFECT PREDICTOR v112.0") } + ) + } + } +} diff --git a/modules/nf-core/ensemblvep/vep/tests/main.nf.test.snap b/modules/nf-core/ensemblvep/vep/tests/main.nf.test.snap new file mode 100644 index 00000000..1c4c0e4e --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/main.nf.test.snap @@ -0,0 +1,26 @@ +{ + "test_ensemblvep_vep_fasta_tab_gz": { + "content": [ + [ + "versions.yml:md5,d06f1eb60f534489026d682eb3aa5559" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-02T10:15:18.228927" + }, + "test_ensemblvep_vep_fasta_vcf": { + "content": [ + [ + "versions.yml:md5,d06f1eb60f534489026d682eb3aa5559" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-02T10:14:50.193861" + } +} \ No newline at end of file diff --git a/modules/nf-core/ensemblvep/vep/tests/nextflow.config b/modules/nf-core/ensemblvep/vep/tests/nextflow.config new file mode 100644 index 00000000..9aa48164 --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/nextflow.config @@ -0,0 +1,12 @@ +params { + vep_cache_version = "112" + vep_genome = "WBcel235" + vep_species = "caenorhabditis_elegans" +} + +process { + withName: ENSEMBLVEP_DOWNLOAD { + ext.args = '--AUTO c --CONVERT --NO_BIOPERL --NO_HTSLIB --NO_TEST --NO_UPDATE' + ext.prefix = { "${params.vep_cache_version}_${params.vep_genome}" } + } +} diff --git a/modules/nf-core/ensemblvep/vep/tests/tab.gz.config b/modules/nf-core/ensemblvep/vep/tests/tab.gz.config new file mode 100644 index 00000000..40eb03e5 --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/tab.gz.config @@ -0,0 +1,5 @@ +process { + withName: ENSEMBLVEP_VEP { + ext.args = '--tab --compress_output bgzip' + } +} diff --git a/modules/nf-core/ensemblvep/vep/tests/tags.yml b/modules/nf-core/ensemblvep/vep/tests/tags.yml new file mode 100644 index 00000000..4aa4aa45 --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/tags.yml @@ -0,0 +1,2 @@ +ensemblvep/vep: + - "modules/nf-core/ensemblvep/vep/**" diff --git a/modules/nf-core/ensemblvep/vep/tests/vcf.config b/modules/nf-core/ensemblvep/vep/tests/vcf.config new file mode 100644 index 00000000..ad8955a3 --- /dev/null +++ b/modules/nf-core/ensemblvep/vep/tests/vcf.config @@ -0,0 +1,5 @@ +process { + withName: ENSEMBLVEP_VEP { + ext.args = '--vcf' + } +} diff --git a/modules/nf-core/gatk4/calibratedragstrmodel/environment.yml b/modules/nf-core/gatk4/calibratedragstrmodel/environment.yml index 810eade1..55993f44 100644 --- a/modules/nf-core/gatk4/calibratedragstrmodel/environment.yml +++ b/modules/nf-core/gatk4/calibratedragstrmodel/environment.yml @@ -1,7 +1,5 @@ -name: gatk4_calibratedragstrmodel channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/calibratedragstrmodel/tests/main.nf.test b/modules/nf-core/gatk4/calibratedragstrmodel/tests/main.nf.test new file mode 100644 index 00000000..f06292f2 --- /dev/null +++ b/modules/nf-core/gatk4/calibratedragstrmodel/tests/main.nf.test @@ -0,0 +1,137 @@ + +nextflow_process { + + name "Test Process GATK4_CALIBRATEDRAGSTRMODEL" + script "../main.nf" + process "GATK4_CALIBRATEDRAGSTRMODEL" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/calibratedragstrmodel" + + test("test-gatk4-calibratedragstrmodel-bam") { + + 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.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome_strtablefile.zip', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.dragstr_model[0][1]).readLines()[3..7], + process.out.versions + ).match() + } + ) + } + } + + test("test-gatk4-calibratedragstrmodel-cram") { + + when { + process { + """ + input[0] = [ + [ 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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome_strtablefile.zip', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.dragstr_model[0][1]).readLines()[3..7], + process.out.versions + ).match() + } + ) + } + } + + test("test-gatk4-calibratedragstrmodel-beds") { + + when { + process { + """ + input[0] = [ + [ 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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome_strtablefile.zip', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.dragstr_model[0][1]).readLines()[3..7], + process.out.versions + ).match() + } + ) + } + } + + test("test-gatk4-calibratedragstrmodel-gzipped-beds") { + + when { + process { + """ + input[0] = [ + [ 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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome_strtablefile.zip', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.dragstr_model[0][1]).readLines()[3..7], + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/gatk4/calibratedragstrmodel/tests/main.nf.test.snap b/modules/nf-core/gatk4/calibratedragstrmodel/tests/main.nf.test.snap new file mode 100644 index 00000000..d0d7b8b9 --- /dev/null +++ b/modules/nf-core/gatk4/calibratedragstrmodel/tests/main.nf.test.snap @@ -0,0 +1,78 @@ +{ + "test-gatk4-calibratedragstrmodel-bam": { + "content": [ + [ + "# sample = testN", + "# readGroups = 1", + "# estimatedOrDefaults = defaults", + "# commandLine = CalibrateDragstrModel --str-table-path genome_strtablefile.zip --threads 2 --output test.txt --input test.paired_end.sorted.bam --reference genome.fasta --tmp-dir . --gp-values 10:1.0:50 --api-values 0:1.0:40 --gop-values 10:.25:50 --het-to-hom-ratio 2.0 --min-loci-count 50 --api-mono-threshold 3 --max-period 8 --max-repeats 20 --minimum-depth 10 --pileup-padding 5 --sampling-min-mq 20 --parallel false --shard-size 1000000 --down-sample-size 4096 --force-estimation false --interval-set-rule UNION --interval-padding 0 --interval-exclusion-padding 0 --interval-merging-rule ALL --read-validation-stringency SILENT --seconds-between-progress-updates 10.0 --disable-sequence-dictionary-validation false --create-output-bam-index true --create-output-bam-md5 false --create-output-variant-index true --create-output-variant-md5 false --max-variants-per-shard 0 --lenient false --add-output-sam-program-record true --add-output-vcf-command-line true --cloud-prefetch-buffer 40 --cloud-index-prefetch-buffer -1 --disable-bam-index-caching false --sites-only-vcf-output false --help false --version false --showHidden false --verbosity INFO --QUIET false --use-jdk-deflater false --use-jdk-inflater false --gcs-max-retries 20 --gcs-project-for-requester-pays --disable-tool-default-read-filters false", + "############################################################################################" + ], + [ + "versions.yml:md5,3a652afb9cc9fca4e162ec205406b368" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T13:22:17.584362" + }, + "test-gatk4-calibratedragstrmodel-cram": { + "content": [ + [ + "# sample = testN", + "# readGroups = 1", + "# estimatedOrDefaults = defaults", + "# commandLine = CalibrateDragstrModel --str-table-path genome_strtablefile.zip --threads 2 --output test.txt --input test.paired_end.sorted.cram --reference genome.fasta --tmp-dir . --gp-values 10:1.0:50 --api-values 0:1.0:40 --gop-values 10:.25:50 --het-to-hom-ratio 2.0 --min-loci-count 50 --api-mono-threshold 3 --max-period 8 --max-repeats 20 --minimum-depth 10 --pileup-padding 5 --sampling-min-mq 20 --parallel false --shard-size 1000000 --down-sample-size 4096 --force-estimation false --interval-set-rule UNION --interval-padding 0 --interval-exclusion-padding 0 --interval-merging-rule ALL --read-validation-stringency SILENT --seconds-between-progress-updates 10.0 --disable-sequence-dictionary-validation false --create-output-bam-index true --create-output-bam-md5 false --create-output-variant-index true --create-output-variant-md5 false --max-variants-per-shard 0 --lenient false --add-output-sam-program-record true --add-output-vcf-command-line true --cloud-prefetch-buffer 40 --cloud-index-prefetch-buffer -1 --disable-bam-index-caching false --sites-only-vcf-output false --help false --version false --showHidden false --verbosity INFO --QUIET false --use-jdk-deflater false --use-jdk-inflater false --gcs-max-retries 20 --gcs-project-for-requester-pays --disable-tool-default-read-filters false", + "############################################################################################" + ], + [ + "versions.yml:md5,3a652afb9cc9fca4e162ec205406b368" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T13:22:30.21551" + }, + "test-gatk4-calibratedragstrmodel-gzipped-beds": { + "content": [ + [ + "# sample = testN", + "# readGroups = 1", + "# estimatedOrDefaults = defaults", + "# commandLine = CalibrateDragstrModel --str-table-path genome_strtablefile.zip --threads 2 --output test.txt --input test.paired_end.sorted.cram --reference genome.fasta --tmp-dir . --gp-values 10:1.0:50 --api-values 0:1.0:40 --gop-values 10:.25:50 --het-to-hom-ratio 2.0 --min-loci-count 50 --api-mono-threshold 3 --max-period 8 --max-repeats 20 --minimum-depth 10 --pileup-padding 5 --sampling-min-mq 20 --parallel false --shard-size 1000000 --down-sample-size 4096 --force-estimation false --interval-set-rule UNION --interval-padding 0 --interval-exclusion-padding 0 --interval-merging-rule ALL --read-validation-stringency SILENT --seconds-between-progress-updates 10.0 --disable-sequence-dictionary-validation false --create-output-bam-index true --create-output-bam-md5 false --create-output-variant-index true --create-output-variant-md5 false --max-variants-per-shard 0 --lenient false --add-output-sam-program-record true --add-output-vcf-command-line true --cloud-prefetch-buffer 40 --cloud-index-prefetch-buffer -1 --disable-bam-index-caching false --sites-only-vcf-output false --help false --version false --showHidden false --verbosity INFO --QUIET false --use-jdk-deflater false --use-jdk-inflater false --gcs-max-retries 20 --gcs-project-for-requester-pays --disable-tool-default-read-filters false", + "############################################################################################" + ], + [ + "versions.yml:md5,3a652afb9cc9fca4e162ec205406b368" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T13:22:53.619871" + }, + "test-gatk4-calibratedragstrmodel-beds": { + "content": [ + [ + "# sample = testN", + "# readGroups = 1", + "# estimatedOrDefaults = defaults", + "# commandLine = CalibrateDragstrModel --str-table-path genome_strtablefile.zip --threads 2 --output test.txt --input test.paired_end.sorted.cram --reference genome.fasta --tmp-dir . --gp-values 10:1.0:50 --api-values 0:1.0:40 --gop-values 10:.25:50 --het-to-hom-ratio 2.0 --min-loci-count 50 --api-mono-threshold 3 --max-period 8 --max-repeats 20 --minimum-depth 10 --pileup-padding 5 --sampling-min-mq 20 --parallel false --shard-size 1000000 --down-sample-size 4096 --force-estimation false --interval-set-rule UNION --interval-padding 0 --interval-exclusion-padding 0 --interval-merging-rule ALL --read-validation-stringency SILENT --seconds-between-progress-updates 10.0 --disable-sequence-dictionary-validation false --create-output-bam-index true --create-output-bam-md5 false --create-output-variant-index true --create-output-variant-md5 false --max-variants-per-shard 0 --lenient false --add-output-sam-program-record true --add-output-vcf-command-line true --cloud-prefetch-buffer 40 --cloud-index-prefetch-buffer -1 --disable-bam-index-caching false --sites-only-vcf-output false --help false --version false --showHidden false --verbosity INFO --QUIET false --use-jdk-deflater false --use-jdk-inflater false --gcs-max-retries 20 --gcs-project-for-requester-pays --disable-tool-default-read-filters false", + "############################################################################################" + ], + [ + "versions.yml:md5,3a652afb9cc9fca4e162ec205406b368" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T13:22:41.938548" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/composestrtablefile/environment.yml b/modules/nf-core/gatk4/composestrtablefile/environment.yml index ffbda0fb..55993f44 100644 --- a/modules/nf-core/gatk4/composestrtablefile/environment.yml +++ b/modules/nf-core/gatk4/composestrtablefile/environment.yml @@ -1,7 +1,5 @@ -name: gatk4_composestrtablefile channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/composestrtablefile/tests/main.nf.test b/modules/nf-core/gatk4/composestrtablefile/tests/main.nf.test new file mode 100644 index 00000000..7d066cf1 --- /dev/null +++ b/modules/nf-core/gatk4/composestrtablefile/tests/main.nf.test @@ -0,0 +1,38 @@ + +nextflow_process { + + name "Test Process GATK4_COMPOSESTRTABLEFILE" + script "../main.nf" + process "GATK4_COMPOSESTRTABLEFILE" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/composestrtablefile" + + test("test-gatk4-composestrtablefile") { + + when { + process { + """ + input[0] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + file(process.out.str_table[0]).name, + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/gatk4/composestrtablefile/tests/main.nf.test.snap b/modules/nf-core/gatk4/composestrtablefile/tests/main.nf.test.snap new file mode 100644 index 00000000..02136a8b --- /dev/null +++ b/modules/nf-core/gatk4/composestrtablefile/tests/main.nf.test.snap @@ -0,0 +1,15 @@ +{ + "test-gatk4-composestrtablefile": { + "content": [ + "genome.zip", + [ + "versions.yml:md5,755f9a44a99148151b624d70eb6ce260" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-26T13:37:10.366333" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/createsequencedictionary/environment.yml b/modules/nf-core/gatk4/createsequencedictionary/environment.yml index 78822ad0..55993f44 100644 --- a/modules/nf-core/gatk4/createsequencedictionary/environment.yml +++ b/modules/nf-core/gatk4/createsequencedictionary/environment.yml @@ -1,7 +1,5 @@ -name: gatk4_createsequencedictionary channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/createsequencedictionary/tests/main.nf.test b/modules/nf-core/gatk4/createsequencedictionary/tests/main.nf.test new file mode 100644 index 00000000..a8a9c6d2 --- /dev/null +++ b/modules/nf-core/gatk4/createsequencedictionary/tests/main.nf.test @@ -0,0 +1,56 @@ +nextflow_process { + + name "Test Process GATK4_CREATESEQUENCEDICTIONARY" + script "../main.nf" + process "GATK4_CREATESEQUENCEDICTIONARY" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/createsequencedictionary" + + test("sarscov2 - fasta") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/createsequencedictionary/tests/main.nf.test.snap b/modules/nf-core/gatk4/createsequencedictionary/tests/main.nf.test.snap new file mode 100644 index 00000000..16735f95 --- /dev/null +++ b/modules/nf-core/gatk4/createsequencedictionary/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "sarscov2 - fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "genome.dict:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,e60dd34a71fc2029d81dc67ccb5d6be6" + ], + "dict": [ + [ + { + "id": "test" + }, + "genome.dict:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,e60dd34a71fc2029d81dc67ccb5d6be6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-16T10:16:16.34453" + }, + "sarscov2 - fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "genome.dict:md5,7362679f176e0f52add03c08f457f646" + ] + ], + "1": [ + "versions.yml:md5,e60dd34a71fc2029d81dc67ccb5d6be6" + ], + "dict": [ + [ + { + "id": "test" + }, + "genome.dict:md5,7362679f176e0f52add03c08f457f646" + ] + ], + "versions": [ + "versions.yml:md5,e60dd34a71fc2029d81dc67ccb5d6be6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-16T13:58:25.822068" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/createsequencedictionary/tests/tags.yml b/modules/nf-core/gatk4/createsequencedictionary/tests/tags.yml new file mode 100644 index 00000000..035c5e4c --- /dev/null +++ b/modules/nf-core/gatk4/createsequencedictionary/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/createsequencedictionary: + - "modules/nf-core/gatk4/createsequencedictionary/**" diff --git a/modules/nf-core/gatk4/genomicsdbimport/environment.yml b/modules/nf-core/gatk4/genomicsdbimport/environment.yml index a3a13636..55993f44 100644 --- a/modules/nf-core/gatk4/genomicsdbimport/environment.yml +++ b/modules/nf-core/gatk4/genomicsdbimport/environment.yml @@ -1,7 +1,5 @@ -name: gatk4_genomicsdbimport channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test b/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test index 9c207b30..5fef5dd2 100644 --- a/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test +++ b/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test @@ -17,11 +17,11 @@ nextflow_process { """ // [meta, vcf, tbi, interval, interval_value, workspace ] input[0] = [ [ id:'test'], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) , - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true) , - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true) , - [] , - [] ] + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true) , + [] , + [] ] // run_intlist input[1] = false // run_updatewspace @@ -36,12 +36,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.genomicsdb.get(0).get(1)).list().sort()).match() } //{ assert snapshot(file(process.out.updatedb.get(0).get(1)).list().sort()).match() } //{ assert snapshot(process.out.intervallist.get(0).get(1)).match() } + { assert snapshot( + file(process.out.genomicsdb.get(0).get(1)).list().sort(), + process.out.versions + ).match() } ) } - } test("test_gatk4_genomicsdbimport_get_intervalslist") { @@ -76,10 +78,12 @@ nextflow_process { { assert process.success }, //{ assert snapshot(file(process.out.genomicsdb.get(0).get(1)).list().sort()).match() } //{ assert snapshot(file(process.out.updatedb.get(0).get(1)).list().sort()).match() } - { assert snapshot(process.out.intervallist.get(0).get(1)).match() } + { assert snapshot( + process.out.intervallist.get(0).get(1), + process.out.versions + ).match() } ) } - } test("test_gatk4_genomicsdbimport_update_genomicsdb") { @@ -113,11 +117,13 @@ nextflow_process { assertAll( { assert process.success }, //{ assert snapshot(file(process.out.genomicsdb.get(0).get(1)).list().sort()).match() } - { assert snapshot(file(process.out.updatedb.get(0).get(1)).list().sort()).match() } //{ assert snapshot(process.out.intervallist.get(0).get(1)).match() } + { assert snapshot( + file(process.out.updatedb.get(0).get(1)).list().sort(), + process.out.versions + ).match() } ) } - } test("test_gatk4_genomicsdbimport_stub") { @@ -129,11 +135,11 @@ nextflow_process { """ // [meta, vcf, tbi, interval, interval_value, workspace ] input[0] = [ [ id:'test'], - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) , - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true) , - file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true) , - [] , - [] ] + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.interval_list', checkIfExists: true) , + [] , + [] ] // run_intlist input[1] = false // run_updatewspace @@ -147,9 +153,8 @@ nextflow_process { then { assertAll( { assert process.success }, + { assert snapshot(process.out).match()} ) } - } - } diff --git a/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test.snap b/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test.snap index a633bbdc..55ced0d8 100644 --- a/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test.snap +++ b/modules/nf-core/gatk4/genomicsdbimport/tests/main.nf.test.snap @@ -1,40 +1,98 @@ { "test_gatk4_genomicsdbimport_get_intervalslist": { "content": [ - "test.interval_list:md5,4c85812ac15fc1cd29711a851d23c0bf" + "test.interval_list:md5,4c85812ac15fc1cd29711a851d23c0bf", + [ + "versions.yml:md5,c1233a04213021aa66599a36e0fb28cc" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-28T17:55:03.846241" + "timestamp": "2024-07-09T10:42:51.836379" }, "test_gatk4_genomicsdbimport_create_genomicsdb": { "content": [ - "__tiledb_workspace.tdb", - "callset.json", - "chr22$1$40001", - "vcfheader.vcf", - "vidmap.json" + [ + "__tiledb_workspace.tdb", + "callset.json", + "chr22$1$40001", + "vcfheader.vcf", + "vidmap.json" + ], + [ + "versions.yml:md5,c1233a04213021aa66599a36e0fb28cc" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-14T11:22:10.11423157" + "timestamp": "2024-07-09T10:42:36.846239" }, "test_gatk4_genomicsdbimport_update_genomicsdb": { "content": [ - "__tiledb_workspace.tdb", - "callset.json", - "chr22$1$40001", - "vcfheader.vcf", - "vidmap.json" + [ + "__tiledb_workspace.tdb", + "callset.json", + "chr22$1$40001", + "vcfheader.vcf", + "vidmap.json" + ], + [ + "versions.yml:md5,c1233a04213021aa66599a36e0fb28cc" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-14T12:46:42.403794676" + "timestamp": "2024-07-09T10:43:09.00769" + }, + "test_gatk4_genomicsdbimport_stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,c1233a04213021aa66599a36e0fb28cc" + ], + "genomicsdb": [ + [ + { + "id": "test" + }, + "test:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "intervallist": [ + + ], + "updatedb": [ + + ], + "versions": [ + "versions.yml:md5,c1233a04213021aa66599a36e0fb28cc" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-09T10:43:20.921712" } } \ No newline at end of file diff --git a/modules/nf-core/gatk4/genotypegvcfs/environment.yml b/modules/nf-core/gatk4/genotypegvcfs/environment.yml index 6e1b7c04..55993f44 100644 --- a/modules/nf-core/gatk4/genotypegvcfs/environment.yml +++ b/modules/nf-core/gatk4/genotypegvcfs/environment.yml @@ -1,7 +1,5 @@ -name: gatk4_genotypegvcfs channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/genotypegvcfs/gatk4-genotypegvcfs.diff b/modules/nf-core/gatk4/genotypegvcfs/gatk4-genotypegvcfs.diff deleted file mode 100644 index 2369ffbc..00000000 --- a/modules/nf-core/gatk4/genotypegvcfs/gatk4-genotypegvcfs.diff +++ /dev/null @@ -1,13 +0,0 @@ -Changes in module 'nf-core/gatk4/genotypegvcfs' ---- modules/nf-core/gatk4/genotypegvcfs/main.nf -+++ modules/nf-core/gatk4/genotypegvcfs/main.nf -@@ -1,6 +1,6 @@ - process GATK4_GENOTYPEGVCFS { - tag "$meta.id" -- label 'process_high' -+ label 'process_single' - - conda "bioconda::gatk4=4.4.0.0" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - -************************************************************ diff --git a/modules/nf-core/gatk4/genotypegvcfs/main.nf b/modules/nf-core/gatk4/genotypegvcfs/main.nf index 3a9fbb4e..f180f749 100644 --- a/modules/nf-core/gatk4/genotypegvcfs/main.nf +++ b/modules/nf-core/gatk4/genotypegvcfs/main.nf @@ -8,12 +8,12 @@ process GATK4_GENOTYPEGVCFS { 'biocontainers/gatk4:4.5.0.0--py36hdfd78af_0' }" input: - tuple val(meta), path(gvcf), path(gvcf_index), path(intervals), path(intervals_index) - path fasta - path fai - path dict - path dbsnp - path dbsnp_tbi + tuple val(meta), path(input), path(gvcf_index), path(intervals), path(intervals_index) + tuple val(meta2), path(fasta) + tuple val(meta3), path(fai) + tuple val(meta4), path(dict) + tuple val(meta5), path(dbsnp) + tuple val(meta6), path(dbsnp_tbi) output: tuple val(meta), path("*.vcf.gz"), emit: vcf @@ -26,7 +26,7 @@ process GATK4_GENOTYPEGVCFS { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def gvcf_command = gvcf.name.endsWith(".vcf") || gvcf.name.endsWith(".vcf.gz") ? "$gvcf" : "gendb://$gvcf" + def input_command = input.name.endsWith(".vcf") || input.name.endsWith(".vcf.gz") ? "$input" : "gendb://$input" def dbsnp_command = dbsnp ? "--dbsnp $dbsnp" : "" def interval_command = intervals ? "--intervals $intervals" : "" @@ -39,7 +39,7 @@ process GATK4_GENOTYPEGVCFS { """ gatk --java-options "-Xmx${avail_mem}M -XX:-UsePerfData" \\ GenotypeGVCFs \\ - --variant $gvcf_command \\ + --variant $input_command \\ --output ${prefix}.vcf.gz \\ --reference $fasta \\ $interval_command \\ @@ -57,7 +57,7 @@ process GATK4_GENOTYPEGVCFS { def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz + echo | gzip > ${prefix}.vcf.gz touch ${prefix}.vcf.gz.tbi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/gatk4/genotypegvcfs/meta.yml b/modules/nf-core/gatk4/genotypegvcfs/meta.yml index 8f1e377e..eb704364 100644 --- a/modules/nf-core/gatk4/genotypegvcfs/meta.yml +++ b/modules/nf-core/gatk4/genotypegvcfs/meta.yml @@ -20,10 +20,10 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - gvcf: + - input: type: file description: | - gVCF(.gz) file or to a GenomicsDB + gVCF(.gz) file or a GenomicsDB pattern: "*.{vcf,vcf.gz}" - gvcf_index: type: file @@ -36,22 +36,47 @@ input: - intervals_index: type: file description: Interval index file (optional) + - meta2: + type: map + description: | + Groovy Map containing fasta information + e.g. [ id:'test' ] - fasta: type: file description: Reference fasta file pattern: "*.fasta" + - meta3: + type: map + description: | + Groovy Map containing fai information + e.g. [ id:'test' ] - fai: type: file description: Reference fasta index file pattern: "*.fai" + - meta4: + type: map + description: | + Groovy Map containing dict information + e.g. [ id:'test' ] - dict: type: file description: Reference fasta sequence dict file pattern: "*.dict" + - meta5: + type: map + description: | + Groovy Map containing dbsnp information + e.g. [ id:'test' ] - dbsnp: type: file description: dbSNP VCF file pattern: "*.vcf.gz" + - meta6: + type: map + description: | + Groovy Map containing dbsnp tbi information + e.g. [ id:'test' ] - dbsnp_tbi: type: file description: dbSNP VCF index file diff --git a/modules/nf-core/gatk4/genotypegvcfs/tests/main.nf.test b/modules/nf-core/gatk4/genotypegvcfs/tests/main.nf.test new file mode 100644 index 00000000..25bc2d38 --- /dev/null +++ b/modules/nf-core/gatk4/genotypegvcfs/tests/main.nf.test @@ -0,0 +1,285 @@ +nextflow_process { + + name "Test Process GATK4_GENOTYPEGVCFS" + script "../main.nf" + process "GATK4_GENOTYPEGVCFS" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/genotypegvcfs" + tag "untar" + + setup { + run("UNTAR") { + script "../../../untar/main.nf" + process { + """ + input[0] = [ + [id:"test"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test_genomicsdb.tar.gz', checkIfExists: true) + ] + """ + } + } + } + + test("homo_sapiens - [gvcf, idx, [], []], fasta, fai, dict, [], []") { + + when { + process { + """ + input[0] = [ + [id:"test"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.idx', checkIfExists: true), + [], + [] + ] + input[1] = [ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists:true) + ] + input[2] = [ + [id:"fai"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists:true) + ] + input[3] = [ + [id:"dict"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists:true) + ] + input[4] = [[],[]] + input[5] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { [it[0], path(it[1]).vcf.variantsMD5] }, + process.out.tbi.collect { [it[0], file(it[1]).name] }, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [gvcf_gz, tbi, [], []], fasta, fai, dict, dbsnp, dbsnp_tbi") { + + when { + process { + """ + input[0] = [ + [id:"test"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + [], + [] + ] + input[1] = [ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists:true) + ] + input[2] = [ + [id:"fai"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists:true) + ] + input[3] = [ + [id:"dict"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists:true) + ] + input[4] = [ + [id:"dbsnp"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists:true) + ] + input[5] = [ + [id:"dbsnp"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz.tbi', checkIfExists:true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { [it[0], path(it[1]).vcf.variantsMD5] }, + process.out.tbi.collect { [it[0], file(it[1]).name] }, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [gvcf_gz, tbi, bed, []], fasta, fai, dict, [], []") { + + when { + process { + """ + input[0] = [ + [id:"test"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists:true), + [] + ] + input[1] = [ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists:true) + ] + input[2] = [ + [id:"fai"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists:true) + ] + input[3] = [ + [id:"dict"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists:true) + ] + input[4] = [[],[]] + input[5] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { [it[0], path(it[1]).vcf.variantsMD5] }, + process.out.tbi.collect { [it[0], file(it[1]).name] }, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [gendb, [], [], []], fasta, fai, dict, [], []") { + + when { + process { + """ + input[0] = UNTAR.out.untar.map { meta, gendb -> [ meta, gendb, [], [], []] } + input[1] = [ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists:true) + ] + input[2] = [ + [id:"fai"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists:true) + ] + input[3] = [ + [id:"dict"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists:true) + ] + input[4] = [[],[]] + input[5] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { [it[0], path(it[1]).vcf.variantsMD5] }, + process.out.tbi.collect { [it[0], file(it[1]).name] }, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [gendb, bed, [], []], fasta, fai, dict, [], []") { + + when { + process { + """ + input[0] = UNTAR.out.untar.map { meta, gendb -> + [ + meta, + gendb, + [], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists:true), + [] + ] + } + input[1] = [ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists:true) + ] + input[2] = [ + [id:"fai"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists:true) + ] + input[3] = [ + [id:"dict"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists:true) + ] + input[4] = [[],[]] + input[5] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.vcf.collect { [it[0], path(it[1]).vcf.variantsMD5] }, + process.out.tbi.collect { [it[0], file(it[1]).name] }, + process.out.versions + ).match() } + ) + } + + } + + test("homo_sapiens - [gvcf, idx, [], []], fasta, fai, dict, [], [] - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [id:"test"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gvcf/test.genome.vcf.idx', checkIfExists: true), + [], + [] + ] + input[1] = [ + [id:"fasta"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists:true) + ] + input[2] = [ + [id:"fai"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists:true) + ] + input[3] = [ + [id:"dict"], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists:true) + ] + input[4] = [[],[]] + input[5] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/genotypegvcfs/tests/main.nf.test.snap b/modules/nf-core/gatk4/genotypegvcfs/tests/main.nf.test.snap new file mode 100644 index 00000000..1621618e --- /dev/null +++ b/modules/nf-core/gatk4/genotypegvcfs/tests/main.nf.test.snap @@ -0,0 +1,191 @@ +{ + "homo_sapiens - [gendb, [], [], []], fasta, fai, dict, [], []": { + "content": [ + [ + [ + { + "id": "test" + }, + "1ab95fbc5ec55b208f3001572bec54fa" + ] + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,3c16cbf71737813609ad10d901d92ab3" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-04T14:27:24.926097884" + }, + "homo_sapiens - [gvcf, idx, [], []], fasta, fai, dict, [], []": { + "content": [ + [ + [ + { + "id": "test" + }, + "1ab95fbc5ec55b208f3001572bec54fa" + ] + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,3c16cbf71737813609ad10d901d92ab3" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-04T14:26:24.426228557" + }, + "homo_sapiens - [gvcf_gz, tbi, bed, []], fasta, fai, dict, [], []": { + "content": [ + [ + [ + { + "id": "test" + }, + "1ab95fbc5ec55b208f3001572bec54fa" + ] + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,3c16cbf71737813609ad10d901d92ab3" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-04T14:27:04.179308513" + }, + "homo_sapiens - [gvcf_gz, tbi, [], []], fasta, fai, dict, dbsnp, dbsnp_tbi": { + "content": [ + [ + [ + { + "id": "test" + }, + "9b7d476515e07e5486633c42abd86cc" + ] + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,3c16cbf71737813609ad10d901d92ab3" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-04T14:26:43.9088684" + }, + "homo_sapiens - [gvcf, idx, [], []], fasta, fai, dict, [], [] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,3c16cbf71737813609ad10d901d92ab3" + ], + "tbi": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,3c16cbf71737813609ad10d901d92ab3" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-04T14:19:57.615552867" + }, + "homo_sapiens - [gendb, bed, [], []], fasta, fai, dict, [], []": { + "content": [ + [ + [ + { + "id": "test" + }, + "1ab95fbc5ec55b208f3001572bec54fa" + ] + ], + [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi" + ] + ], + [ + "versions.yml:md5,3c16cbf71737813609ad10d901d92ab3" + ] + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-04T14:27:46.189794941" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/haplotypecaller/environment.yml b/modules/nf-core/gatk4/haplotypecaller/environment.yml index d4e8d360..55993f44 100644 --- a/modules/nf-core/gatk4/haplotypecaller/environment.yml +++ b/modules/nf-core/gatk4/haplotypecaller/environment.yml @@ -1,7 +1,5 @@ -name: gatk4_haplotypecaller channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::gatk4=4.5.0.0 diff --git a/modules/nf-core/gatk4/haplotypecaller/gatk4-haplotypecaller.diff b/modules/nf-core/gatk4/haplotypecaller/gatk4-haplotypecaller.diff deleted file mode 100644 index 275b0dd0..00000000 --- a/modules/nf-core/gatk4/haplotypecaller/gatk4-haplotypecaller.diff +++ /dev/null @@ -1,16 +0,0 @@ -Changes in module 'nf-core/gatk4/haplotypecaller' ---- modules/nf-core/gatk4/haplotypecaller/main.nf -+++ modules/nf-core/gatk4/haplotypecaller/main.nf -@@ -12,8 +12,8 @@ - tuple val(meta2), path(fasta) - tuple val(meta3), path(fai) - tuple val(meta4), path(dict) -- tuple val(meta5), path(dbsnp) -- tuple val(meta6), path(dbsnp_tbi) -+ path(dbsnp) -+ path(dbsnp_tbi) - - output: - tuple val(meta), path("*.vcf.gz") , emit: vcf - -************************************************************ diff --git a/modules/nf-core/gatk4/haplotypecaller/main.nf b/modules/nf-core/gatk4/haplotypecaller/main.nf index 7170169f..3043ee07 100644 --- a/modules/nf-core/gatk4/haplotypecaller/main.nf +++ b/modules/nf-core/gatk4/haplotypecaller/main.nf @@ -12,8 +12,8 @@ process GATK4_HAPLOTYPECALLER { tuple val(meta2), path(fasta) tuple val(meta3), path(fai) tuple val(meta4), path(dict) - path(dbsnp) - path(dbsnp_tbi) + tuple val(meta5), path(dbsnp) + tuple val(meta6), path(dbsnp_tbi) output: tuple val(meta), path("*.vcf.gz") , emit: vcf diff --git a/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test b/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test index a124bff5..18d35f49 100644 --- a/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test +++ b/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test @@ -17,14 +17,14 @@ nextflow_process { """ input[0] = [ [ id:'test_bam' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), [], [] ] - input[1] = [ [ id:'test_fa' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] - input[2] = [ [ id:'test_fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] - input[3] = [ [ id:'test_dict' ], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) ] + input[1] = [ [ id:'test_fa' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] + input[2] = [ [ id:'test_fai' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] + input[3] = [ [ id:'test_dict' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) ] input[4] = [ [], [] ] input[5] = [ [], [] ] @@ -35,9 +35,12 @@ nextflow_process { then { assertAll( { assert process.success }, - // { assert snapshot(process.out).match() }, // Unstable hashes - { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("gatk_hc_vcf_bam_input") }, - { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match("gatk_hc_vcf_tbi_bam_input") }, + { assert snapshot( + file(process.out.vcf[0][1]).name, + file(process.out.tbi[0][1]).name, + process.out.versions + ).match() + } ) } @@ -50,14 +53,14 @@ nextflow_process { """ input[0] = [ [ id:'test_cram' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), [], [] ] - input[1] = [ [ id:'test_fa' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] - input[2] = [ [ id:'test_fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] - input[3] = [ [ id:'test_dict' ], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) ] + input[1] = [ [ id:'test_fa' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] + input[2] = [ [ id:'test_fai' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] + input[3] = [ [ id:'test_dict' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) ] input[4] = [ [], [] ] input[5] = [ [], [] ] """ @@ -67,9 +70,12 @@ nextflow_process { then { assertAll( { assert process.success }, - // { assert snapshot(process.out).match() }, // Unstable hashes - { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("gatk_hc_vcf_cram_input") }, - { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match("gatk_hc_vcf_tbi_cram_input") }, + { assert snapshot( + file(process.out.vcf[0][1]).name, + file(process.out.tbi[0][1]).name, + process.out.versions + ).match() + } ) } @@ -82,16 +88,16 @@ nextflow_process { """ input[0] = [ [ id:'test_cram_sites' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), [], [] ] - input[1] = [ [ id:'test_fa' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] - input[2] = [ [ id:'test_fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] - input[3] = [ [ id:'test_dict' ], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) ] - input[4] = [ [ id:'test_sites' ], file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true) ] - input[5] = [ [ id:'test_sites_tbi' ], file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true) ] + input[1] = [ [ id:'test_fa' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] + input[2] = [ [ id:'test_fai' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] + input[3] = [ [ id:'test_dict' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) ] + input[4] = [ [ id:'test_sites' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists: true) ] + input[5] = [ [ id:'test_sites_tbi' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz.tbi', checkIfExists: true) ] """ } } @@ -99,9 +105,12 @@ nextflow_process { then { assertAll( { assert process.success }, - // { assert snapshot(process.out).match() }, // Unstable hashes - { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("gatk_hc_vcf_cram_input_with_sites") }, - { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match("gatk_hc_vcf_tbi_cram_input_with_sites") }, + { assert snapshot( + file(process.out.vcf[0][1]).name, + file(process.out.tbi[0][1]).name, + process.out.versions + ).match() + } ) } @@ -114,16 +123,16 @@ nextflow_process { """ input[0] = [ [ id:'test_cram_sites_dragstr' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), [], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_dragstrmodel'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test_paired_end_sorted_dragstrmodel.txt', checkIfExists: true) ] - input[1] = [ [ id:'test_fa' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) ] - input[2] = [ [ id:'test_fai' ], file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) ] - input[3] = [ [ id:'test_dict' ], file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true) ] - input[4] = [ [ id:'test_sites' ], file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true) ] - input[5] = [ [ id:'test_sites_tbi' ], file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true) ] + input[1] = [ [ id:'test_fa' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] + input[2] = [ [ id:'test_fai' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] + input[3] = [ [ id:'test_dict' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.dict', checkIfExists: true) ] + input[4] = [ [ id:'test_sites' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz', checkIfExists: true) ] + input[5] = [ [ id:'test_sites_tbi' ], file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/dbsnp_146.hg38.vcf.gz.tbi', checkIfExists: true) ] """ } } @@ -131,9 +140,12 @@ nextflow_process { then { assertAll( { assert process.success }, - // { assert snapshot(process.out).match() }, // Unstable hashes - { assert snapshot(file(process.out.vcf.get(0).get(1)).name).match("gatk_hc_vcf_cram_dragstr_input_with_sites") }, - { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match("gatk_hc_vcf_tbi_cram_dragstr_input_with_sites") }, + { assert snapshot( + file(process.out.vcf[0][1]).name, + file(process.out.tbi[0][1]).name, + process.out.versions + ).match() + } ) } diff --git a/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test.snap b/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test.snap index 375025ee..0203fcfc 100644 --- a/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test.snap +++ b/modules/nf-core/gatk4/haplotypecaller/tests/main.nf.test.snap @@ -1,82 +1,58 @@ { - "gatk_hc_vcf_cram_dragstr_input_with_sites": { + "homo_sapiens - [cram, crai] - fasta - fai - dict": { "content": [ - "test_cram_sites_dragstr.vcf.gz" + "test_cram.vcf.gz", + "test_cram.vcf.gz.tbi", + [ + "versions.yml:md5,05431a0ab28c85412c8b3582e863a7ab" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.4" }, - "timestamp": "2024-02-20T13:24:45.142682" + "timestamp": "2024-08-14T09:36:54.158605" }, - "gatk_hc_vcf_bam_input": { + "homo_sapiens - [cram, crai] - fasta - fai - dict - sites - sites_tbi": { "content": [ - "test_bam.vcf.gz" + "test_cram_sites.vcf.gz", + "test_cram_sites.vcf.gz.tbi", + [ + "versions.yml:md5,05431a0ab28c85412c8b3582e863a7ab" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.4" }, - "timestamp": "2024-02-20T13:23:19.203837" + "timestamp": "2024-08-14T09:37:13.77024" }, - "gatk_hc_vcf_cram_input": { + "homo_sapiens - [bam, bai] - fasta - fai - dict": { "content": [ - "test_cram.vcf.gz" + "test_bam.vcf.gz", + "test_bam.vcf.gz.tbi", + [ + "versions.yml:md5,05431a0ab28c85412c8b3582e863a7ab" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.4" }, - "timestamp": "2024-02-20T13:23:48.434615" + "timestamp": "2024-08-14T09:36:34.77631" }, - "gatk_hc_vcf_cram_input_with_sites": { + "homo_sapiens - [cram, crai, dragstr_model] - fasta - fai - dict - sites - sites_tbi": { "content": [ - "test_cram_sites.vcf.gz" + "test_cram_sites_dragstr.vcf.gz", + "test_cram_sites_dragstr.vcf.gz.tbi", + [ + "versions.yml:md5,05431a0ab28c85412c8b3582e863a7ab" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.4" }, - "timestamp": "2024-02-20T13:24:17.147745" - }, - "gatk_hc_vcf_tbi_bam_input": { - "content": [ - "test_bam.vcf.gz.tbi" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-20T13:23:19.23048" - }, - "gatk_hc_vcf_tbi_cram_input": { - "content": [ - "test_cram.vcf.gz.tbi" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-20T13:23:48.45958" - }, - "gatk_hc_vcf_tbi_cram_dragstr_input_with_sites": { - "content": [ - "test_cram_sites_dragstr.vcf.gz.tbi" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-20T13:24:45.154818" - }, - "gatk_hc_vcf_tbi_cram_input_with_sites": { - "content": [ - "test_cram_sites.vcf.gz.tbi" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-02-20T13:24:17.158138" + "timestamp": "2024-08-14T09:37:32.967085" } } \ No newline at end of file diff --git a/modules/nf-core/gawk/environment.yml b/modules/nf-core/gawk/environment.yml index 34513c7f..315f6dc6 100644 --- a/modules/nf-core/gawk/environment.yml +++ b/modules/nf-core/gawk/environment.yml @@ -1,7 +1,5 @@ -name: gawk channels: - conda-forge - bioconda - - defaults dependencies: - - anaconda::gawk=5.1.0 + - conda-forge::gawk=5.3.0 diff --git a/modules/nf-core/gawk/main.nf b/modules/nf-core/gawk/main.nf index f856a1f8..ca468929 100644 --- a/modules/nf-core/gawk/main.nf +++ b/modules/nf-core/gawk/main.nf @@ -4,8 +4,8 @@ process GAWK { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/gawk:5.1.0' : - 'biocontainers/gawk:5.1.0' }" + 'https://depot.galaxyproject.org/singularity/gawk:5.3.0' : + 'biocontainers/gawk:5.3.0' }" input: tuple val(meta), path(input) @@ -41,10 +41,11 @@ process GAWK { stub: prefix = task.ext.prefix ?: "${meta.id}" - suffix = task.ext.suffix ?: "${input.getExtension}" + suffix = task.ext.suffix ?: "${input.getExtension()}" + def create_cmd = suffix.endsWith("gz") ? "echo '' | gzip >" : "touch" """ - touch ${prefix}.${suffix} + ${create_cmd} ${prefix}.${suffix} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/gawk/tests/main.nf.test b/modules/nf-core/gawk/tests/main.nf.test new file mode 100644 index 00000000..fce82ca9 --- /dev/null +++ b/modules/nf-core/gawk/tests/main.nf.test @@ -0,0 +1,56 @@ +nextflow_process { + + name "Test Process GAWK" + script "../main.nf" + process "GAWK" + + tag "modules" + tag "modules_nfcore" + tag "gawk" + + test("convert fasta to bed") { + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("convert fasta to bed with program file") { + config "./nextflow_with_program_file.config" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[1] = Channel.of('BEGIN {FS="\t"}; {print \$1 FS "0" FS \$2}').collectFile(name:"program.txt") + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} \ No newline at end of file diff --git a/modules/nf-core/gawk/tests/main.nf.test.snap b/modules/nf-core/gawk/tests/main.nf.test.snap new file mode 100644 index 00000000..4f3a759c --- /dev/null +++ b/modules/nf-core/gawk/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "convert fasta to bed with program file": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "1": [ + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" + ], + "output": [ + [ + { + "id": "test" + }, + "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "versions": [ + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-17T15:20:02.495430346" + }, + "convert fasta to bed": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "1": [ + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" + ], + "output": [ + [ + { + "id": "test" + }, + "test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "versions": [ + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.03.0" + }, + "timestamp": "2024-05-17T15:19:53.291809648" + } +} \ No newline at end of file diff --git a/modules/nf-core/gawk/tests/nextflow.config b/modules/nf-core/gawk/tests/nextflow.config new file mode 100644 index 00000000..6e5d43a3 --- /dev/null +++ b/modules/nf-core/gawk/tests/nextflow.config @@ -0,0 +1,6 @@ +process { + withName: GAWK { + ext.suffix = "bed" + ext.args2 = '\'BEGIN {FS="\t"}; {print \$1 FS "0" FS \$2}\'' + } +} diff --git a/modules/nf-core/gawk/tests/nextflow_with_program_file.config b/modules/nf-core/gawk/tests/nextflow_with_program_file.config new file mode 100644 index 00000000..693ad419 --- /dev/null +++ b/modules/nf-core/gawk/tests/nextflow_with_program_file.config @@ -0,0 +1,5 @@ +process { + withName: GAWK { + ext.suffix = "bed" + } +} diff --git a/modules/nf-core/gawk/tests/tags.yml b/modules/nf-core/gawk/tests/tags.yml new file mode 100644 index 00000000..72e4531d --- /dev/null +++ b/modules/nf-core/gawk/tests/tags.yml @@ -0,0 +1,2 @@ +gawk: + - "modules/nf-core/gawk/**" diff --git a/modules/nf-core/happy/happy/environment.yml b/modules/nf-core/happy/happy/environment.yml deleted file mode 100644 index 3d29dcb2..00000000 --- a/modules/nf-core/happy/happy/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: happy_happy -channels: - - conda-forge - - bioconda - - defaults -dependencies: - - bioconda::hap.py=0.3.14 diff --git a/modules/nf-core/happy/happy/main.nf b/modules/nf-core/happy/happy/main.nf deleted file mode 100644 index b3cc12d5..00000000 --- a/modules/nf-core/happy/happy/main.nf +++ /dev/null @@ -1,84 +0,0 @@ -process HAPPY_HAPPY { - tag "$meta.id" - label 'process_medium' - - // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/hap.py:0.3.14--py27h5c5a3ab_0': - 'biocontainers/hap.py:0.3.14--py27h5c5a3ab_0' }" - - input: - tuple val(meta), path(query_vcf), path(truth_vcf), path(regions_bed), path(targets_bed) - tuple val(meta2), path(fasta) - tuple val(meta3), path(fasta_fai) - tuple val(meta4), path(false_positives_bed) - tuple val(meta5), path(stratification_tsv) - tuple val(meta6), path(stratification_beds) - - output: - tuple val(meta), path('*.summary.csv') , emit: summary_csv - tuple val(meta), path('*.roc.all.csv.gz') , emit: roc_all_csv - tuple val(meta), path('*.roc.Locations.INDEL.csv.gz') , emit: roc_indel_locations_csv - tuple val(meta), path('*.roc.Locations.INDEL.PASS.csv.gz') , emit: roc_indel_locations_pass_csv - tuple val(meta), path('*.roc.Locations.SNP.csv.gz') , emit: roc_snp_locations_csv - tuple val(meta), path('*.roc.Locations.SNP.PASS.csv.gz') , emit: roc_snp_locations_pass_csv - tuple val(meta), path('*.extended.csv') , emit: extended_csv - tuple val(meta), path('*.runinfo.json') , emit: runinfo - tuple val(meta), path('*.metrics.json.gz') , emit: metrics_json - tuple val(meta), path('*.vcf.gz') , emit: vcf, optional:true - tuple val(meta), path('*.tbi') , emit: tbi, optional:true - path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when - - script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def regions = regions_bed ? "-R ${regions_bed}" : "" - def targets = targets_bed ? "-T ${targets_bed}" : "" - def false_positives = false_positives_bed ? "--false-positives ${false_positives_bed}" : "" - def stratification = stratification_tsv ? "--stratification ${stratification_tsv}" : "" - def VERSION = '0.3.14' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. - """ - hap.py \\ - ${truth_vcf} \\ - ${query_vcf} \\ - ${args} \\ - --reference ${fasta} \\ - --threads ${task.cpus} \\ - ${regions} \\ - ${targets} \\ - ${false_positives} \\ - ${stratification} \\ - -o ${prefix} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - hap.py: $VERSION - END_VERSIONS - """ - - stub: - def args = task.ext.args ?: '' - def VERSION = '0.3.14' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. - """ - touch ${prefix}.summary.csv - touch ${prefix}.roc.all.csv.gz - touch ${prefix}.roc.Locations.INDEL.csv.gz - touch ${prefix}.roc.Locations.INDEL.PASS.csv.gz - touch ${prefix}.roc.Locations.SNP.csv.gz - touch ${prefix}.roc.Locations.SNP.PASS.csv.gz - touch ${prefix}.extended.csv - touch ${prefix}.runinfo.json - touch ${prefix}.metrics.json.gz - touch ${prefix}.vcf.gz - touch ${prefix}.vcf.gz.tbi - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - hap.py: $VERSION - END_VERSIONS - """ -} diff --git a/modules/nf-core/happy/happy/meta.yml b/modules/nf-core/happy/happy/meta.yml deleted file mode 100644 index 85912cb5..00000000 --- a/modules/nf-core/happy/happy/meta.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: "happy_happy" -description: Hap.py is a tool to compare diploid genotypes at haplotype level. Rather than comparing VCF records row by row, hap.py will generate and match alternate sequences in a superlocus. A superlocus is a small region of the genome (sized between 1 and around 1000 bp) that contains one or more variants. -keywords: - - happy - - benchmark - - haplotype - - validation -tools: - - "happy": - description: "Haplotype VCF comparison tools" - homepage: "https://www.illumina.com/products/by-type/informatics-products/basespace-sequence-hub/apps/hap-py-benchmarking.html" - documentation: "https://github.com/Illumina/hap.py" - tool_dev_url: "https://github.com/Illumina/hap.py" - licence: "['BSD-2-clause']" -input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - query_vcf: - type: file - description: VCF/GVCF file to query - pattern: "*.{gvcf,vcf}.gz" - - truth_vcf: - type: file - description: gold standard VCF file - pattern: "*.{gvcf,vcf}.gz" - - regions_bed: - type: file - description: Sparse regions to restrict the analysis to - pattern: "*.bed" - - targets_bed: - type: file - description: Dense regions to restrict the analysis to - pattern: "*.bed" - - fasta: - type: file - description: FASTA file of the reference genome - pattern: "*.{fa,fasta}" - - fasta_fai: - type: file - description: The index of the reference FASTA - pattern: "*.fai" - - false_positives_bed: - type: file - description: False positive / confident call regions. Calls outside these regions will be labelled as UNK. - pattern: "*.{bed,bed.gz}" - - stratification_tsv: - type: file - description: Stratification file list in TSV format - pattern: "*.tsv" - - stratification_beds: - type: file(s) - description: One or more BED files used for stratification (these should be referenced in the stratification TSV) - pattern: "*.bed" -output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - summary_csv: - type: file - description: A CSV file containing the summary of the benchmarking - pattern: "*.summary.csv" - - roc_all_csv: - type: file - description: A CSV file containing ROC values for all variants - pattern: "*.roc.all.csv.gz" - - roc_indel_locations_csv: - type: file - description: A CSV file containing ROC values for all indels - pattern: "*.roc.Locations.INDEL.csv.gz" - - roc_indel_locations_pass_csv: - type: file - description: A CSV file containing ROC values for all indels that passed all filters - pattern: "*.roc.Locations.INDEL.PASS.csv.gz" - - roc_snp_locations_csv: - type: file - description: A CSV file containing ROC values for all SNPs - pattern: "*.roc.Locations.SNP.csv.gz" - - roc_snp_locations_pass_csv: - type: file - description: A CSV file containing ROC values for all SNPs that passed all filters - pattern: "*.roc.Locations.SNP.PASS.csv.gz" - - extended_csv: - type: file - description: A CSV file containing extended info of the benchmarking - pattern: "*.extended.csv" - - json: - type: file - description: A JSON file containing the run info - pattern: "*.runinfo.json" - - runinfo: - type: file - description: A JSON file containing the benchmarking metrics - pattern: "*.metrics.json.gz" - - vcf: - type: file - description: An annotated VCF - pattern: "*.vcf.gz" - - tbi: - type: file - description: The index of the annotated VCF - pattern: "*.tbi" - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@nvnieuwk" -maintainers: - - "@nvnieuwk" diff --git a/modules/nf-core/mosdepth/environment.yml b/modules/nf-core/mosdepth/environment.yml index 88c7126c..e9379873 100644 --- a/modules/nf-core/mosdepth/environment.yml +++ b/modules/nf-core/mosdepth/environment.yml @@ -1,8 +1,6 @@ -name: mosdepth channels: - conda-forge - bioconda - - defaults dependencies: # renovate: datasource=conda depName=bioconda/mosdepth - - mosdepth=0.3.6 + - mosdepth=0.3.8 diff --git a/modules/nf-core/mosdepth/main.nf b/modules/nf-core/mosdepth/main.nf index c7e24303..6f4a8383 100644 --- a/modules/nf-core/mosdepth/main.nf +++ b/modules/nf-core/mosdepth/main.nf @@ -4,8 +4,8 @@ process MOSDEPTH { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mosdepth:0.3.6--hd299d5a_0' : - 'biocontainers/mosdepth:0.3.6--hd299d5a_0'}" + 'https://depot.galaxyproject.org/singularity/mosdepth:0.3.8--hd299d5a_0' : + 'biocontainers/mosdepth:0.3.8--hd299d5a_0'}" input: tuple val(meta), path(bam), path(bai), path(bed) @@ -63,13 +63,13 @@ process MOSDEPTH { touch ${prefix}.region.dist.txt touch ${prefix}.summary.txt touch ${prefix}.per-base.d4 - touch ${prefix}.per-base.bed.gz + echo "" | gzip > ${prefix}.per-base.bed.gz touch ${prefix}.per-base.bed.gz.csi - touch ${prefix}.regions.bed.gz + echo "" | gzip > ${prefix}.regions.bed.gz touch ${prefix}.regions.bed.gz.csi - touch ${prefix}.quantized.bed.gz + echo "" | gzip > ${prefix}.quantized.bed.gz touch ${prefix}.quantized.bed.gz.csi - touch ${prefix}.thresholds.bed.gz + echo "" | gzip > ${prefix}.thresholds.bed.gz touch ${prefix}.thresholds.bed.gz.csi cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/mosdepth/tests/main.nf.test b/modules/nf-core/mosdepth/tests/main.nf.test index d991f819..0b3c860d 100644 --- a/modules/nf-core/mosdepth/tests/main.nf.test +++ b/modules/nf-core/mosdepth/tests/main.nf.test @@ -15,8 +15,8 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), [] ] input[1] = [[],[]] @@ -40,9 +40,9 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] input[1] = [[],[]] """ @@ -65,13 +65,13 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), [] ] input[1] = [ [ id:'test' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] """ } @@ -93,13 +93,13 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] input[1] = [ [ id:'test' ], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] """ } @@ -122,8 +122,8 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), [] ] input[1] = [[],[]] @@ -148,8 +148,8 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), [] ] input[1] = [[],[]] @@ -174,9 +174,9 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] input[1] = [[],[]] """ @@ -200,9 +200,9 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] input[1] = [[],[]] """ @@ -225,9 +225,9 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:true ], - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] input[1] = [[],[]] """ @@ -237,21 +237,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.global_txt[0][1]).name, - file(process.out.summary_txt[0][1]).name, - file(process.out.regions_txt[0][1]).name, - file(process.out.per_base_d4[0][1]).name, - file(process.out.per_base_bed[0][1]).name, - file(process.out.per_base_csi[0][1]).name, - file(process.out.regions_bed[0][1]).name, - file(process.out.regions_csi[0][1]).name, - file(process.out.quantized_bed[0][1]).name, - file(process.out.quantized_csi[0][1]).name, - file(process.out.thresholds_bed[0][1]).name, - file(process.out.thresholds_csi[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } diff --git a/modules/nf-core/mosdepth/tests/main.nf.test.snap b/modules/nf-core/mosdepth/tests/main.nf.test.snap index dc4d9508..c604540b 100644 --- a/modules/nf-core/mosdepth/tests/main.nf.test.snap +++ b/modules/nf-core/mosdepth/tests/main.nf.test.snap @@ -1,23 +1,236 @@ { "homo_sapiens - bam, bai, [] - stub": { "content": [ - "test.global.dist.txt", - "test.summary.txt", - "test.region.dist.txt", - "test.per-base.d4", - "test.per-base.bed.gz", - "test.per-base.bed.gz.csi", - "test.regions.bed.gz", - "test.regions.bed.gz.csi", - "test.quantized.bed.gz", - "test.quantized.bed.gz.csi", - "test.thresholds.bed.gz", - "test.thresholds.bed.gz.csi", - [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" - ] + { + "0": [ + [ + { + "id": "test", + "single_end": true + }, + "test.global.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": true + }, + "test.summary.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "10": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "11": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "12": [ + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" + ], + "2": [ + [ + { + "id": "test", + "single_end": true + }, + "test.region.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.d4:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "5": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "6": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "7": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "8": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "9": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "global_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.global.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "per_base_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "per_base_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "per_base_d4": [ + [ + { + "id": "test", + "single_end": true + }, + "test.per-base.d4:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "quantized_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "quantized_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.quantized.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "regions_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "regions_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.regions.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "regions_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.region.dist.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "summary_txt": [ + [ + { + "id": "test", + "single_end": true + }, + "test.summary.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "thresholds_bed": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "thresholds_csi": [ + [ + { + "id": "test", + "single_end": true + }, + "test.thresholds.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" + ] + } ], - "timestamp": "2023-11-27T15:14:34.897155161" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:33:16.953408231" }, "homo_sapiens - cram, crai, bed": { "content": [ @@ -47,7 +260,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ [ @@ -67,7 +280,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -76,7 +289,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -85,7 +298,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "7": [ @@ -94,7 +307,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "8": [ @@ -118,7 +331,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -127,7 +340,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -145,7 +358,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "regions_csi": [ @@ -154,7 +367,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "regions_txt": [ @@ -182,11 +395,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], - "timestamp": "2023-11-27T14:47:18.171150781" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:32:50.160217828" }, "homo_sapiens - bam, bai, [] - quantized": { "content": [ @@ -216,7 +433,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ @@ -230,7 +447,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -239,7 +456,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -254,7 +471,7 @@ "id": "test", "single_end": true }, - "test.quantized.bed.gz:md5,3e434a8bafcf59a67841ae3d4d752838" + "test.quantized.bed.gz:md5,f037c215449d361112efc10108fcc17c" ] ], "9": [ @@ -263,7 +480,7 @@ "id": "test", "single_end": true }, - "test.quantized.bed.gz.csi:md5,be9617f551f19a33923f1e886eaefb93" + "test.quantized.bed.gz.csi:md5,4f69e6ace50206a2768be66ded3a56f0" ] ], "global_txt": [ @@ -281,7 +498,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -290,7 +507,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -302,7 +519,7 @@ "id": "test", "single_end": true }, - "test.quantized.bed.gz:md5,3e434a8bafcf59a67841ae3d4d752838" + "test.quantized.bed.gz:md5,f037c215449d361112efc10108fcc17c" ] ], "quantized_csi": [ @@ -311,7 +528,7 @@ "id": "test", "single_end": true }, - "test.quantized.bed.gz.csi:md5,be9617f551f19a33923f1e886eaefb93" + "test.quantized.bed.gz.csi:md5,4f69e6ace50206a2768be66ded3a56f0" ] ], "regions_bed": [ @@ -339,11 +556,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], - "timestamp": "2023-11-27T14:47:29.228103864" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:33:01.164885111" }, "homo_sapiens - bam, bai, bed": { "content": [ @@ -373,7 +594,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ [ @@ -393,7 +614,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -402,7 +623,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -411,7 +632,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "7": [ @@ -420,7 +641,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "8": [ @@ -444,7 +665,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -453,7 +674,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -471,7 +692,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "regions_csi": [ @@ -480,7 +701,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "regions_txt": [ @@ -508,11 +729,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], - "timestamp": "2023-11-27T14:47:04.537716314" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:32:39.071657456" }, "homo_sapiens - bam, bai, [] - window": { "content": [ @@ -542,7 +767,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ [ @@ -550,7 +775,7 @@ "id": "test", "single_end": true }, - "test.mosdepth.region.dist.txt:md5,39e0e707ec32feb5176fd20a95f1f468" + "test.mosdepth.region.dist.txt:md5,0b6ea9f0da1228252d9aef2d3b6f7f76" ] ], "3": [ @@ -562,7 +787,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -571,7 +796,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -580,7 +805,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,f02e2cb49cc050e13d76942d6960827a" + "test.regions.bed.gz:md5,34f48d16fcdd61e44d812e29e02c77b8" ] ], "7": [ @@ -589,7 +814,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,257d67678136963d9dd904330079609d" + "test.regions.bed.gz.csi:md5,2a30bcb7f5c7632136b3efce24723970" ] ], "8": [ @@ -613,7 +838,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -622,7 +847,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -640,7 +865,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,f02e2cb49cc050e13d76942d6960827a" + "test.regions.bed.gz:md5,34f48d16fcdd61e44d812e29e02c77b8" ] ], "regions_csi": [ @@ -649,7 +874,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,257d67678136963d9dd904330079609d" + "test.regions.bed.gz.csi:md5,2a30bcb7f5c7632136b3efce24723970" ] ], "regions_txt": [ @@ -658,7 +883,7 @@ "id": "test", "single_end": true }, - "test.mosdepth.region.dist.txt:md5,39e0e707ec32feb5176fd20a95f1f468" + "test.mosdepth.region.dist.txt:md5,0b6ea9f0da1228252d9aef2d3b6f7f76" ] ], "summary_txt": [ @@ -677,11 +902,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], - "timestamp": "2023-11-27T14:47:23.708536171" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:32:55.631776118" }, "homo_sapiens - bam, bai, []": { "content": [ @@ -711,7 +940,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ @@ -725,7 +954,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -734,7 +963,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -764,7 +993,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -773,7 +1002,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -810,11 +1039,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], - "timestamp": "2023-11-27T14:46:56.975710077" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:32:33.642125299" }, "homo_sapiens - cram, crai, []": { "content": [ @@ -844,7 +1077,7 @@ ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ @@ -858,7 +1091,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -867,7 +1100,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -897,7 +1130,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -906,7 +1139,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -943,11 +1176,15 @@ ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], - "timestamp": "2023-11-27T14:47:12.09259995" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:32:44.704920941" }, "homo_sapiens - bam, bai, bed - thresholds": { "content": [ @@ -976,7 +1213,7 @@ "id": "test", "single_end": true }, - "test.thresholds.bed.gz:md5,13101e326eea3cbfa1d569b69f494f4c" + "test.thresholds.bed.gz:md5,fe70ae728cd10726c42a2bcd44adfc9d" ] ], "11": [ @@ -985,11 +1222,11 @@ "id": "test", "single_end": true }, - "test.thresholds.bed.gz.csi:md5,912055ee9452229439df6fae95644196" + "test.thresholds.bed.gz.csi:md5,219414a0751185adb98d2235d83ea055" ] ], "12": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ], "2": [ [ @@ -1009,7 +1246,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "5": [ @@ -1018,7 +1255,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "6": [ @@ -1027,7 +1264,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "7": [ @@ -1036,7 +1273,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "8": [ @@ -1060,7 +1297,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz:md5,bc1df47d46f818fee5275975925d769a" + "test.per-base.bed.gz:md5,da6db0fb375a3053a89db8c935eebbaa" ] ], "per_base_csi": [ @@ -1069,7 +1306,7 @@ "id": "test", "single_end": true }, - "test.per-base.bed.gz.csi:md5,9e649ac749ff6c6073bef5ab63e8aaa4" + "test.per-base.bed.gz.csi:md5,6f322dc9250522a701bd68bd18fa8294" ] ], "per_base_d4": [ @@ -1087,7 +1324,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz:md5,5d398caf7171ec4406278e2add3009ae" + "test.regions.bed.gz:md5,9ded0397623fda26a6a3514d6a0e2a2c" ] ], "regions_csi": [ @@ -1096,7 +1333,7 @@ "id": "test", "single_end": true }, - "test.regions.bed.gz.csi:md5,47669cfe41f3e222e74d81e1b1be191f" + "test.regions.bed.gz.csi:md5,e7df086f0a36e88ca231e143d43bd3f9" ] ], "regions_txt": [ @@ -1123,7 +1360,7 @@ "id": "test", "single_end": true }, - "test.thresholds.bed.gz:md5,13101e326eea3cbfa1d569b69f494f4c" + "test.thresholds.bed.gz:md5,fe70ae728cd10726c42a2bcd44adfc9d" ] ], "thresholds_csi": [ @@ -1132,14 +1369,18 @@ "id": "test", "single_end": true }, - "test.thresholds.bed.gz.csi:md5,912055ee9452229439df6fae95644196" + "test.thresholds.bed.gz.csi:md5,219414a0751185adb98d2235d83ea055" ] ], "versions": [ - "versions.yml:md5,f8b1896c9c6784181f1234e87225f0e8" + "versions.yml:md5,87634e525fb18990cd98fe1080ad72ce" ] } ], - "timestamp": "2023-11-27T14:49:44.311847326" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-29T13:33:06.737266831" } } \ No newline at end of file diff --git a/modules/nf-core/multiqc/environment.yml b/modules/nf-core/multiqc/environment.yml index ca39fb67..f1cd99b0 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.24.1 diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 47ac352f..ceaec139 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.24.1--pyhdfd78af_0' : + 'biocontainers/multiqc:1.24.1--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 diff --git a/modules/nf-core/multiqc/meta.yml b/modules/nf-core/multiqc/meta.yml index 45a9bc35..382c08cb 100644 --- a/modules/nf-core/multiqc/meta.yml +++ b/modules/nf-core/multiqc/meta.yml @@ -29,6 +29,19 @@ input: 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 diff --git a/modules/nf-core/multiqc/tests/main.nf.test b/modules/nf-core/multiqc/tests/main.nf.test index f1c4242e..33316a7d 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 bfebd802..83fa080c 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,6eb13f3b11bbcbfc98ad3166420ff760" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-29T08:48:55.657331" + "timestamp": "2024-07-10T12:41:34.562023" }, "multiqc_stub": { "content": [ @@ -17,25 +17,25 @@ "multiqc_report.html", "multiqc_data", "multiqc_plots", - "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + "versions.yml:md5,6eb13f3b11bbcbfc98ad3166420ff760" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-29T08:49:49.071937" + "timestamp": "2024-07-10T11:27:11.933869532" }, "multiqc_versions_config": { "content": [ [ - "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" + "versions.yml:md5,6eb13f3b11bbcbfc98ad3166420ff760" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-02-29T08:49:25.457567" + "timestamp": "2024-07-10T11:26:56.709849369" } -} \ 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 00000000..c537a6a3 --- /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/rtgtools/format/environment.yml b/modules/nf-core/rtgtools/format/environment.yml index 15b3df5b..8aa83cdc 100644 --- a/modules/nf-core/rtgtools/format/environment.yml +++ b/modules/nf-core/rtgtools/format/environment.yml @@ -1,7 +1,5 @@ -name: rtgtools_format channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::rtg-tools=3.12.1 diff --git a/modules/nf-core/rtgtools/format/meta.yml b/modules/nf-core/rtgtools/format/meta.yml index 8ed18f54..1991b807 100644 --- a/modules/nf-core/rtgtools/format/meta.yml +++ b/modules/nf-core/rtgtools/format/meta.yml @@ -12,7 +12,7 @@ tools: homepage: "https://www.realtimegenomics.com/products/rtg-tools" documentation: "https://github.com/RealTimeGenomics/rtg-tools" tool_dev_url: "https://github.com/RealTimeGenomics/rtg-tools" - licence: "['BSD']" + licence: ["BSD"] input: - meta: type: map diff --git a/modules/nf-core/rtgtools/pedfilter/environment.yml b/modules/nf-core/rtgtools/pedfilter/environment.yml index 62fcaa1c..8aa83cdc 100644 --- a/modules/nf-core/rtgtools/pedfilter/environment.yml +++ b/modules/nf-core/rtgtools/pedfilter/environment.yml @@ -1,7 +1,5 @@ -name: rtgtools_pedfilter channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::rtg-tools=3.12.1 diff --git a/modules/nf-core/rtgtools/pedfilter/main.nf b/modules/nf-core/rtgtools/pedfilter/main.nf index bb36cf50..c06a33fa 100644 --- a/modules/nf-core/rtgtools/pedfilter/main.nf +++ b/modules/nf-core/rtgtools/pedfilter/main.nf @@ -11,8 +11,8 @@ process RTGTOOLS_PEDFILTER { tuple val(meta), path(input) output: - tuple val(meta), path("*.vcf.gz") , emit: output - path "versions.yml" , emit: versions + tuple val(meta), path("*.{vcf.gz,ped}") , emit: output + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -31,12 +31,11 @@ process RTGTOOLS_PEDFILTER { def postprocess = extension == "vcf.gz" ? "| rtg bgzip ${args2} -" : "" """ - cut -f1-6 ${input} > ${prefix}.ped - rtg pedfilter \\ ${args} \\ - ${prefix}.ped \\ - | head -n -1 ${postprocess} > ${prefix}.${extension} + ${input} \\ + | head -n -1 \\ + ${postprocess} > ${prefix}.${extension} cat <<-END_VERSIONS > versions.yml @@ -46,7 +45,6 @@ process RTGTOOLS_PEDFILTER { """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def extension = args.contains("--vcf") ? "vcf.gz" : "ped" diff --git a/modules/nf-core/rtgtools/pedfilter/meta.yml b/modules/nf-core/rtgtools/pedfilter/meta.yml index 785ac990..4e90fd7b 100644 --- a/modules/nf-core/rtgtools/pedfilter/meta.yml +++ b/modules/nf-core/rtgtools/pedfilter/meta.yml @@ -11,7 +11,7 @@ tools: homepage: "https://www.realtimegenomics.com/products/rtg-tools" documentation: "https://github.com/RealTimeGenomics/rtg-tools" tool_dev_url: "https://github.com/RealTimeGenomics/rtg-tools" - licence: "['BSD']" + licence: ["BSD"] input: - meta: type: map diff --git a/modules/nf-core/rtgtools/pedfilter/rtgtools-pedfilter.diff b/modules/nf-core/rtgtools/pedfilter/rtgtools-pedfilter.diff index 4463e941..18590bf8 100644 --- a/modules/nf-core/rtgtools/pedfilter/rtgtools-pedfilter.diff +++ b/modules/nf-core/rtgtools/pedfilter/rtgtools-pedfilter.diff @@ -1,39 +1,19 @@ Changes in module 'nf-core/rtgtools/pedfilter' +Changes in 'rtgtools/pedfilter/main.nf': --- modules/nf-core/rtgtools/pedfilter/main.nf +++ modules/nf-core/rtgtools/pedfilter/main.nf -@@ -11,8 +11,8 @@ - tuple val(meta), path(input) - - output: -- tuple val(meta), path("*.{vcf.gz,ped}") , emit: output -- path "versions.yml" , emit: versions -+ tuple val(meta), path("*.vcf.gz") , emit: output -+ path "versions.yml" , emit: versions - - when: - task.ext.when == null || task.ext.when -@@ -31,10 +31,12 @@ - def postprocess = extension == "vcf.gz" ? "| rtg bgzip ${args2} -" : "" - - """ -+ cut -f1-6 ${input} > ${prefix}.ped -+ +@@ -34,6 +34,7 @@ rtg pedfilter \\ ${args} \\ -- ${input} \\ -- ${postprocess} > ${prefix}.${extension} -+ ${prefix}.ped \\ -+ | head -n -1 ${postprocess} > ${prefix}.${extension} - - - cat <<-END_VERSIONS > versions.yml -@@ -44,6 +46,7 @@ - """ + ${input} \\ ++ | head -n -1 \\ + ${postprocess} > ${prefix}.${extension} - stub: -+ def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - def extension = args.contains("--vcf") ? "vcf.gz" : "ped" +'modules/nf-core/rtgtools/pedfilter/environment.yml' is unchanged +'modules/nf-core/rtgtools/pedfilter/meta.yml' is unchanged +'modules/nf-core/rtgtools/pedfilter/tests/main.nf.test' is unchanged +'modules/nf-core/rtgtools/pedfilter/tests/main.nf.test.snap' is unchanged +'modules/nf-core/rtgtools/pedfilter/tests/nextflow.config' is unchanged ************************************************************ diff --git a/modules/nf-core/rtgtools/pedfilter/tests/main.nf.test b/modules/nf-core/rtgtools/pedfilter/tests/main.nf.test new file mode 100644 index 00000000..0ddcebdb --- /dev/null +++ b/modules/nf-core/rtgtools/pedfilter/tests/main.nf.test @@ -0,0 +1,85 @@ + +nextflow_process { + + name "Test Process RTGTOOLS_PEDFILTER" + script "../main.nf" + process "RTGTOOLS_PEDFILTER" + + tag "modules" + tag "modules_nfcore" + tag "rtgtools" + tag "rtgtools/pedfilter" + + test("test-rtgtools-pedfilter-ped") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-rtgtools-pedfilter-vcf") { + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test-rtgtools-pedfilter-vcf-output") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) + ] + + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + path(process.out.output[0][1]).linesGzip[3..7], + process.out.versions + ).match() + } + ) + } + } + +} diff --git a/modules/nf-core/rtgtools/pedfilter/tests/main.nf.test.snap b/modules/nf-core/rtgtools/pedfilter/tests/main.nf.test.snap new file mode 100644 index 00000000..7475fa8b --- /dev/null +++ b/modules/nf-core/rtgtools/pedfilter/tests/main.nf.test.snap @@ -0,0 +1,91 @@ +{ + "test-rtgtools-pedfilter-vcf": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ped:md5,342135c8bf22e573367b75ef5e1c5e6b" + ] + ], + "1": [ + "versions.yml:md5,036d97d5be26fce2e7d956034b9dc86d" + ], + "output": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ped:md5,342135c8bf22e573367b75ef5e1c5e6b" + ] + ], + "versions": [ + "versions.yml:md5,036d97d5be26fce2e7d956034b9dc86d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T16:11:01.797205" + }, + "test-rtgtools-pedfilter-vcf-output": { + "content": [ + [ + "##CL=pedfilter --vcf justhusky.ped", + "##diseased=hugelymodelbat", + "##SAMPLE=", + "##SAMPLE=", + "##SAMPLE=" + ], + [ + "versions.yml:md5,036d97d5be26fce2e7d956034b9dc86d" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T20:46:00.069224" + }, + "test-rtgtools-pedfilter-ped": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ped:md5,a8b8f6538e1738d6e06fddfe15d36f09" + ] + ], + "1": [ + "versions.yml:md5,036d97d5be26fce2e7d956034b9dc86d" + ], + "output": [ + [ + { + "id": "test", + "single_end": false + }, + "test.ped:md5,a8b8f6538e1738d6e06fddfe15d36f09" + ] + ], + "versions": [ + "versions.yml:md5,036d97d5be26fce2e7d956034b9dc86d" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.4" + }, + "timestamp": "2024-08-23T16:10:53.473351" + } +} \ No newline at end of file diff --git a/modules/nf-core/rtgtools/pedfilter/tests/nextflow.config b/modules/nf-core/rtgtools/pedfilter/tests/nextflow.config new file mode 100644 index 00000000..a8a3ec54 --- /dev/null +++ b/modules/nf-core/rtgtools/pedfilter/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: 'RTGTOOLS_PEDFILTER' { + ext.args = "--vcf" + } +} diff --git a/modules/nf-core/rtgtools/rocplot/environment.yml b/modules/nf-core/rtgtools/rocplot/environment.yml index 093462a5..8aa83cdc 100644 --- a/modules/nf-core/rtgtools/rocplot/environment.yml +++ b/modules/nf-core/rtgtools/rocplot/environment.yml @@ -1,7 +1,5 @@ -name: rtgtools_rocplot channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::rtg-tools=3.12.1 diff --git a/modules/nf-core/rtgtools/rocplot/meta.yml b/modules/nf-core/rtgtools/rocplot/meta.yml index 927cff90..2b4d43d7 100644 --- a/modules/nf-core/rtgtools/rocplot/meta.yml +++ b/modules/nf-core/rtgtools/rocplot/meta.yml @@ -11,7 +11,7 @@ tools: homepage: "https://www.realtimegenomics.com/products/rtg-tools" documentation: "https://github.com/RealTimeGenomics/rtg-tools" tool_dev_url: "https://github.com/RealTimeGenomics/rtg-tools" - licence: "['BSD']" + licence: ["BSD"] input: - meta: type: map diff --git a/modules/nf-core/rtgtools/rocplot/tests/main.nf.test b/modules/nf-core/rtgtools/rocplot/tests/main.nf.test index 160eafcf..c7c37084 100644 --- a/modules/nf-core/rtgtools/rocplot/tests/main.nf.test +++ b/modules/nf-core/rtgtools/rocplot/tests/main.nf.test @@ -7,6 +7,8 @@ nextflow_process { tag "modules_nfcore" tag "rtgtools" tag "rtgtools/rocplot" + tag "rtgtools/vcfeval" + tag "untar" test("homo_sapiens - tsv") { @@ -17,7 +19,7 @@ nextflow_process { """ input[0] = [ [ id:'test' ], - file(params.test_data['homo_sapiens']['genome']['genome_21_sdf']) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome_sdf.tar.gz', checkIfExists: true) ] """ } @@ -29,12 +31,12 @@ nextflow_process { """ input[0] = [ [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_haplotc_ann_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ] input[1] = UNTAR.out.untar println(projectDir) diff --git a/modules/nf-core/rtgtools/rocplot/tests/main.nf.test.snap b/modules/nf-core/rtgtools/rocplot/tests/main.nf.test.snap index 389ffb5b..f4dee3a1 100644 --- a/modules/nf-core/rtgtools/rocplot/tests/main.nf.test.snap +++ b/modules/nf-core/rtgtools/rocplot/tests/main.nf.test.snap @@ -5,6 +5,10 @@ "test.svg", "versions.yml" ], - "timestamp": "2023-10-24T12:48:36.35343056" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-09T10:44:42.642303" } } \ No newline at end of file diff --git a/modules/nf-core/rtgtools/vcfeval/environment.yml b/modules/nf-core/rtgtools/vcfeval/environment.yml index e3c64996..8aa83cdc 100644 --- a/modules/nf-core/rtgtools/vcfeval/environment.yml +++ b/modules/nf-core/rtgtools/vcfeval/environment.yml @@ -1,7 +1,5 @@ -name: rtgtools_vcfeval channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::rtg-tools=3.12.1 diff --git a/modules/nf-core/rtgtools/vcfeval/meta.yml b/modules/nf-core/rtgtools/vcfeval/meta.yml index f67a35c0..5023ac91 100644 --- a/modules/nf-core/rtgtools/vcfeval/meta.yml +++ b/modules/nf-core/rtgtools/vcfeval/meta.yml @@ -10,7 +10,7 @@ tools: homepage: "https://www.realtimegenomics.com/products/rtg-tools" documentation: "https://github.com/RealTimeGenomics/rtg-tools" tool_dev_url: "https://github.com/RealTimeGenomics/rtg-tools" - licence: "['BSD']" + licence: ["BSD"] input: - meta: type: map diff --git a/modules/nf-core/samtools/convert/environment.yml b/modules/nf-core/samtools/convert/environment.yml index cd4ee8c3..da2df5e4 100644 --- a/modules/nf-core/samtools/convert/environment.yml +++ b/modules/nf-core/samtools/convert/environment.yml @@ -1,8 +1,6 @@ -name: samtools_convert channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::samtools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/samtools/convert/main.nf b/modules/nf-core/samtools/convert/main.nf index e2d679f7..03b7b525 100644 --- a/modules/nf-core/samtools/convert/main.nf +++ b/modules/nf-core/samtools/convert/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_CONVERT { 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.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: tuple val(meta), path(input), path(index) @@ -13,8 +13,11 @@ process SAMTOOLS_CONVERT { tuple val(meta3), path(fai) output: - tuple val(meta), path("*.{cram,bam}"), path("*.{crai,bai}") , emit: alignment_index - path "versions.yml" , emit: versions + tuple val(meta), path("*.bam") , emit: bam , optional: true + tuple val(meta), path("*.cram") , emit: cram, optional: true + tuple val(meta), path("*.bai") , emit: bai , optional: true + tuple val(meta), path("*.crai") , emit: crai, optional: true + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -39,4 +42,19 @@ process SAMTOOLS_CONVERT { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def output_extension = input.getExtension() == "bam" ? "cram" : "bam" + def index_extension = output_extension == "bam" ? "bai" : "crai" + + """ + touch ${prefix}.${output_extension} + touch ${prefix}.${index_extension} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/samtools/convert/meta.yml b/modules/nf-core/samtools/convert/meta.yml index f8a1612f..55828971 100644 --- a/modules/nf-core/samtools/convert/meta.yml +++ b/modules/nf-core/samtools/convert/meta.yml @@ -39,10 +39,22 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - alignment_index: + - bam: type: file - description: filtered/converted BAM/CRAM file + index - pattern: "*{.bam/cram,.bai/crai}" + description: filtered/converted BAM file + pattern: "*{.bam}" + - cram: + type: file + description: filtered/converted CRAM file + pattern: "*{cram}" + - bai: + type: file + description: filtered/converted BAM index + pattern: "*{.bai}" + - crai: + type: file + description: filtered/converted CRAM index + pattern: "*{.crai}" - version: type: file description: File containing software version @@ -53,3 +65,4 @@ authors: maintainers: - "@FriederikeHanssen" - "@maxulysse" + - "@matthdsm" diff --git a/modules/nf-core/samtools/convert/tests/main.nf.test b/modules/nf-core/samtools/convert/tests/main.nf.test index ee59532a..91a0c69e 100644 --- a/modules/nf-core/samtools/convert/tests/main.nf.test +++ b/modules/nf-core/samtools/convert/tests/main.nf.test @@ -34,9 +34,9 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.alignment_index[0][1]).name).match("bam_alignment_index_1") }, - { assert snapshot(file(process.out.alignment_index[0][2]).name).match("bam_alignment_index_2") }, - { assert snapshot(process.out.versions).match("bam_versions") } + { assert snapshot(file(process.out.cram[0][1]).name).match("bam_to_cram_alignment") }, + { assert snapshot(file(process.out.crai[0][1]).name).match("bam_to_cram_index") }, + { assert snapshot(process.out.versions).match("bam_to_cram_versions") } ) } } @@ -66,9 +66,41 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(file(process.out.alignment_index[0][1]).name).match("cram_alignment_index_1") }, - { assert snapshot(file(process.out.alignment_index[0][2]).name).match("cram_alignment_index_2") }, - { assert snapshot(process.out.versions).match("cram_versions") } + { assert snapshot(file(process.out.bam[0][1]).name).match("cram_to_bam_alignment") }, + { assert snapshot(file(process.out.bai[0][1]).name).match("cram_to_bam_alignment_index") }, + { assert snapshot(process.out.versions).match("cram_to_bam_versions") } + ) + } + } + + test("sarscov2 - [bam, bai], fasta, fai - 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] = Channel.of([ + [ id:'fasta' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ]) + input[2] = Channel.of([ + [ id:'fai' ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) + ]) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("stub") } ) } } diff --git a/modules/nf-core/samtools/convert/tests/main.nf.test.snap b/modules/nf-core/samtools/convert/tests/main.nf.test.snap index 96ec9f4e..51362902 100644 --- a/modules/nf-core/samtools/convert/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/convert/tests/main.nf.test.snap @@ -1,66 +1,131 @@ { - "cram_alignment_index_1": { + "cram_to_bam_alignment": { "content": [ "test.bam" ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-02T17:04:16.431159" + "timestamp": "2024-03-06T11:14:51.300147176" }, - "cram_alignment_index_2": { + "bam_to_cram_alignment": { "content": [ - "test.bam.bai" + "test.cram" ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-02T17:04:16.43428" + "timestamp": "2024-03-06T11:14:36.625470184" }, - "bam_alignment_index_2": { + "cram_to_bam_versions": { "content": [ - "test.cram.crai" + [ + "versions.yml:md5,b1040cd80ce16abb9b2c2902b62d5fcd" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-02T17:00:29.669534" + "timestamp": "2024-05-28T15:44:34.618037105" }, - "bam_alignment_index_1": { + "bam_to_cram_versions": { "content": [ - "test.cram" + [ + "versions.yml:md5,b1040cd80ce16abb9b2c2902b62d5fcd" + ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-02T17:00:29.666821" + "timestamp": "2024-05-28T15:44:29.165839679" }, - "cram_versions": { + "stub": { "content": [ - [ - "versions.yml:md5,dd0aaf61f39c9ce91c74090f3c7ce1d0" - ] + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,b1040cd80ce16abb9b2c2902b62d5fcd" + ], + "bai": [ + + ], + "bam": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cram": [ + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,b1040cd80ce16abb9b2c2902b62d5fcd" + ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:14:38.224641326" + "timestamp": "2024-05-28T15:44:40.258233921" }, - "bam_versions": { + "bam_to_cram_index": { "content": [ - [ - "versions.yml:md5,dd0aaf61f39c9ce91c74090f3c7ce1d0" - ] + "test.cram.crai" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-03-06T11:14:36.640009334" + }, + "cram_to_bam_alignment_index": { + "content": [ + "test.bam.bai" ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:14:29.852388191" + "timestamp": "2024-03-06T11:14:51.304477426" } } \ 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 3e95dd71..f8450fa5 100644 --- a/modules/nf-core/samtools/faidx/environment.yml +++ b/modules/nf-core/samtools/faidx/environment.yml @@ -1,8 +1,10 @@ name: samtools_faidx + channels: - conda-forge - bioconda - defaults + dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::htslib=1.20 + - bioconda::samtools=1.20 diff --git a/modules/nf-core/samtools/faidx/main.nf b/modules/nf-core/samtools/faidx/main.nf index cfe7ad95..bdcdbc95 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.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--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 e189af28..f3c25de2 100644 --- a/modules/nf-core/samtools/faidx/meta.yml +++ b/modules/nf-core/samtools/faidx/meta.yml @@ -39,6 +39,10 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + - fa: + type: file + description: FASTA file + pattern: "*.{fa}" - fai: type: file description: FASTA index file diff --git a/modules/nf-core/samtools/faidx/tests/main.nf.test b/modules/nf-core/samtools/faidx/tests/main.nf.test new file mode 100644 index 00000000..17244ef2 --- /dev/null +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test @@ -0,0 +1,122 @@ +nextflow_process { + + name "Test Process SAMTOOLS_FAIDX" + script "../main.nf" + process "SAMTOOLS_FAIDX" + + tag "modules" + tag "modules_nfcore" + tag "samtools" + tag "samtools/faidx" + + test("test_samtools_faidx") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_samtools_faidx_bgzip") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)] + + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_samtools_faidx_fasta") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + + input[1] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_samtools_faidx_stub_fasta") { + + config "./nextflow2.config" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + + input[1] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true) ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } + + test("test_samtools_faidx_stub_fai") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + + input[1] = [[],[]] + """ + } + } + + then { + assertAll( + { 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 new file mode 100644 index 00000000..3223b72b --- /dev/null +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap @@ -0,0 +1,249 @@ +{ + "test_samtools_faidx": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ], + "fa": [ + + ], + "fai": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "gzi": [ + + ], + "versions": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-28T15:42:14.779784761" + }, + "test_samtools_faidx_bgzip": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" + ] + ], + "3": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ], + "fa": [ + + ], + "fai": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.gz.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "gzi": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.gz.gzi:md5,7dea362b3fac8e00956a4952a3d4f474" + ] + ], + "versions": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-28T15:42:20.256633877" + }, + "test_samtools_faidx_fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "extract.fa:md5,6a0774a0ad937ba0bfd2ac7457d90f36" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ], + "fa": [ + [ + { + "id": "test", + "single_end": false + }, + "extract.fa:md5,6a0774a0ad937ba0bfd2ac7457d90f36" + ] + ], + "fai": [ + + ], + "gzi": [ + + ], + "versions": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-28T15:42:25.632577273" + }, + "test_samtools_faidx_stub_fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "extract.fa:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ], + "fa": [ + [ + { + "id": "test", + "single_end": false + }, + "extract.fa:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "fai": [ + + ], + "gzi": [ + + ], + "versions": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-28T15:42:31.058424849" + }, + "test_samtools_faidx_stub_fai": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ], + "fa": [ + + ], + "fai": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.fai:md5,9da2a56e2853dc8c0b86a9e7229c9fe5" + ] + ], + "gzi": [ + + ], + "versions": [ + "versions.yml:md5,2db78952923a61e05d50b95518b21856" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-28T15:42:36.479929617" + } +} \ No newline at end of file diff --git a/modules/nf-core/samtools/faidx/tests/nextflow.config b/modules/nf-core/samtools/faidx/tests/nextflow.config new file mode 100644 index 00000000..f76a3ba0 --- /dev/null +++ b/modules/nf-core/samtools/faidx/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: SAMTOOLS_FAIDX { + ext.args = 'MT192765.1 -o extract.fa' + } + +} diff --git a/modules/nf-core/samtools/faidx/tests/nextflow2.config b/modules/nf-core/samtools/faidx/tests/nextflow2.config new file mode 100644 index 00000000..33ebbd5d --- /dev/null +++ b/modules/nf-core/samtools/faidx/tests/nextflow2.config @@ -0,0 +1,6 @@ +process { + + withName: SAMTOOLS_FAIDX { + ext.args = '-o extract.fa' + } +} diff --git a/modules/nf-core/samtools/faidx/tests/tags.yml b/modules/nf-core/samtools/faidx/tests/tags.yml new file mode 100644 index 00000000..e4a83948 --- /dev/null +++ b/modules/nf-core/samtools/faidx/tests/tags.yml @@ -0,0 +1,2 @@ +samtools/faidx: + - modules/nf-core/samtools/faidx/** diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml index a5e50649..da2df5e4 100644 --- a/modules/nf-core/samtools/index/environment.yml +++ b/modules/nf-core/samtools/index/environment.yml @@ -1,8 +1,6 @@ -name: samtools_index channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::samtools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/samtools/index/main.nf b/modules/nf-core/samtools/index/main.nf index dc14f98d..e002585b 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.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--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/tests/main.nf.test b/modules/nf-core/samtools/index/tests/main.nf.test index bb7756d1..ca34fb5c 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 3dc8e7de..799d199c 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,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + + ], + "crai": [ + + ], + "csi": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-02-13T16:12:00.324667957" + "timestamp": "2024-07-22T16:51:53.9057" }, - "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,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-02-13T16:12:07.885103162" + "timestamp": "2024-07-22T16:51:45.931558" }, - "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,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "crai": [ + + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" ] - ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-02-12T18:41:38.446424" + "timestamp": "2024-07-22T16:51:34.807525" }, - "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,802c9776d9c5e95314e888cf18e96d77" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.04.3" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-02-12T18:40:46.579747" + "timestamp": "2024-07-22T16:52:55.688799" }, - "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,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + + ], + "crai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.recalibrated.sorted.cram.crai:md5,14bc3bd5c89cacc8f4541f9062429029" + ] + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-22T16:51:17.609533" + }, + "bai": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ], + "bai": [ + [ + { + "id": "test", + "single_end": false + }, + "test.paired_end.sorted.bam.bai:md5,704c10dd1326482448ca3073fdebc2f4" + ] + ], + "crai": [ + + ], + "csi": [ + + ], + "versions": [ + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" + ] + } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nf-test": "0.9.0", + "nextflow": "24.04.3" }, - "timestamp": "2024-02-13T16:11:51.641425452" + "timestamp": "2024-07-22T16:51:04.16585" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/merge/environment.yml b/modules/nf-core/samtools/merge/environment.yml index fc669b1b..da2df5e4 100644 --- a/modules/nf-core/samtools/merge/environment.yml +++ b/modules/nf-core/samtools/merge/environment.yml @@ -1,8 +1,6 @@ -name: samtools_merge channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::samtools=1.19.2 - - bioconda::htslib=1.19.1 + - bioconda::samtools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/samtools/merge/main.nf b/modules/nf-core/samtools/merge/main.nf index a3048c28..693b1d80 100644 --- a/modules/nf-core/samtools/merge/main.nf +++ b/modules/nf-core/samtools/merge/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_MERGE { 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.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: tuple val(meta), path(input_files, stageAs: "?/*") diff --git a/modules/nf-core/samtools/merge/samtools-merge.diff b/modules/nf-core/samtools/merge/samtools-merge.diff deleted file mode 100644 index 59077e1f..00000000 --- a/modules/nf-core/samtools/merge/samtools-merge.diff +++ /dev/null @@ -1,13 +0,0 @@ -Changes in module 'nf-core/samtools/merge' ---- modules/nf-core/samtools/merge/main.nf -+++ modules/nf-core/samtools/merge/main.nf -@@ -1,6 +1,6 @@ - process SAMTOOLS_MERGE { - tag "$meta.id" -- label 'process_low' -+ label 'process_high' - - conda "bioconda::samtools=1.17" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - -************************************************************ diff --git a/modules/nf-core/samtools/merge/tests/main.nf.test.snap b/modules/nf-core/samtools/merge/tests/main.nf.test.snap index f7da7699..17bc846f 100644 --- a/modules/nf-core/samtools/merge/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/merge/tests/main.nf.test.snap @@ -80,14 +80,14 @@ "bam_versions": { "content": [ [ - "versions.yml:md5,52c62d4712f7af00eb962d090ca32fe4" + "versions.yml:md5,84dab54b9812780df48f5cecef690c34" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:16:33.782637377" + "timestamp": "2024-05-28T15:46:35.851936597" }, "bams_csi": { "content": [ @@ -124,14 +124,14 @@ "bams_stub_versions": { "content": [ [ - "versions.yml:md5,52c62d4712f7af00eb962d090ca32fe4" + "versions.yml:md5,84dab54b9812780df48f5cecef690c34" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:16:42.594476052" + "timestamp": "2024-05-28T15:46:41.405707643" }, "bam_cram": { "content": [ @@ -158,14 +158,14 @@ "bams_versions": { "content": [ [ - "versions.yml:md5,52c62d4712f7af00eb962d090ca32fe4" + "versions.yml:md5,84dab54b9812780df48f5cecef690c34" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:16:04.805335656" + "timestamp": "2024-05-28T15:45:51.695689923" }, "crams_bam": { "content": [ @@ -182,14 +182,14 @@ "crams_versions": { "content": [ [ - "versions.yml:md5,52c62d4712f7af00eb962d090ca32fe4" + "versions.yml:md5,84dab54b9812780df48f5cecef690c34" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:16:25.889394689" + "timestamp": "2024-05-28T15:46:30.185392319" }, "bam_csi": { "content": [ diff --git a/modules/nf-core/snpeff/snpeff/environment.yml b/modules/nf-core/snpeff/snpeff/environment.yml index b492e6a8..f2ad9251 100644 --- a/modules/nf-core/snpeff/snpeff/environment.yml +++ b/modules/nf-core/snpeff/snpeff/environment.yml @@ -1,7 +1,5 @@ -name: snpeff_snpeff channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::snpeff=5.1 diff --git a/modules/nf-core/snpeff/snpeff/main.nf b/modules/nf-core/snpeff/snpeff/main.nf index cc4f2ccb..28d13826 100644 --- a/modules/nf-core/snpeff/snpeff/main.nf +++ b/modules/nf-core/snpeff/snpeff/main.nf @@ -13,11 +13,11 @@ process SNPEFF_SNPEFF { tuple val(meta2), path(cache) output: - tuple val(meta), path("*.ann.vcf"), emit: vcf - path "*.csv" , emit: report - path "*.html" , emit: summary_html - path "*.genes.txt" , emit: genes_txt - path "versions.yml" , emit: versions + tuple val(meta), path("*.ann.vcf"), emit: vcf + tuple val(meta), path("*.csv"), emit: report + tuple val(meta), path("*.html"), emit: summary_html + tuple val(meta), path("*.genes.txt"), emit: genes_txt + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/snpeff/snpeff/tests/main.nf.test b/modules/nf-core/snpeff/snpeff/tests/main.nf.test new file mode 100644 index 00000000..803ff02c --- /dev/null +++ b/modules/nf-core/snpeff/snpeff/tests/main.nf.test @@ -0,0 +1,51 @@ +nextflow_process { + + name "Test Process SNPEFF_SNPEFF" + script "../main.nf" + process "SNPEFF_SNPEFF" + config "./nextflow.config" + tag "modules" + tag "modules_nfcore" + tag "modules_snpeff" + tag "snpeff" + tag "snpeff/download" + tag "snpeff/snpeff" + + test("test_SNPEFF_SNPEFF") { + + setup { + run("SNPEFF_DOWNLOAD") { + script "../../download/main.nf" + process { + """ + input[0] = Channel.of([[id:params.snpeff_genome + '.' + params.snpeff_cache_version], params.snpeff_genome, params.snpeff_cache_version]) + """ + } + } + } + + when { + process { + """ + input[0] = Channel.of([ + [ 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[2] = SNPEFF_DOWNLOAD.out.cache + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert path(process.out.report[0][1]).exists() }, + { assert path(process.out.summary_html[0][1]).exists() }, + { assert path(process.out.vcf[0][1]).exists() }, + { assert snapshot(process.out.genes_txt).match("genes_txt") }, + { assert snapshot(process.out.versions).match("versions") } + ) + } + } +} diff --git a/modules/nf-core/snpeff/snpeff/tests/main.nf.test.snap b/modules/nf-core/snpeff/snpeff/tests/main.nf.test.snap new file mode 100644 index 00000000..0891b844 --- /dev/null +++ b/modules/nf-core/snpeff/snpeff/tests/main.nf.test.snap @@ -0,0 +1,31 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,25d44a118d558b331d51ec00be0d997c" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-03-18T17:37:18.879477" + }, + "genes_txt": { + "content": [ + [ + [ + { + "id": "test" + }, + "test.genes.txt:md5,130536bf0237d7f3f746d32aaa32840a" + ] + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.02.0" + }, + "timestamp": "2024-03-18T17:37:18.874822" + } +} \ No newline at end of file diff --git a/modules/nf-core/snpeff/snpeff/tests/nextflow.config b/modules/nf-core/snpeff/snpeff/tests/nextflow.config new file mode 100644 index 00000000..d31ebf6b --- /dev/null +++ b/modules/nf-core/snpeff/snpeff/tests/nextflow.config @@ -0,0 +1,4 @@ +params { + snpeff_cache_version = "105" + snpeff_genome = "WBcel235" +} diff --git a/modules/nf-core/snpeff/snpeff/tests/tags.yml b/modules/nf-core/snpeff/snpeff/tests/tags.yml new file mode 100644 index 00000000..427b588d --- /dev/null +++ b/modules/nf-core/snpeff/snpeff/tests/tags.yml @@ -0,0 +1,2 @@ +snpeff/snpeff: + - "modules/nf-core/snpeff/snpeff/**" diff --git a/modules/nf-core/somalier/extract/environment.yml b/modules/nf-core/somalier/extract/environment.yml index e0dd11c9..d6ce68f6 100644 --- a/modules/nf-core/somalier/extract/environment.yml +++ b/modules/nf-core/somalier/extract/environment.yml @@ -1,7 +1,5 @@ -name: somalier_extract channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::somalier=0.2.15 + - bioconda::somalier=0.2.19 diff --git a/modules/nf-core/somalier/extract/main.nf b/modules/nf-core/somalier/extract/main.nf index 8dc3c31c..703605d1 100644 --- a/modules/nf-core/somalier/extract/main.nf +++ b/modules/nf-core/somalier/extract/main.nf @@ -5,14 +5,14 @@ process SOMALIER_EXTRACT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/somalier:0.2.15--h37c5b7d_0': - 'biocontainers/somalier:0.2.15--h37c5b7d_0' }" + 'https://depot.galaxyproject.org/singularity/somalier:0.2.19--h0c29559_0': + 'biocontainers/somalier:0.2.19--h0c29559_0' }" input: tuple val(meta), path(input), path(input_index) - path(fasta) - path(fai) - path(sites) + tuple val(meta2), path(fasta) + tuple val(meta3), path(fai) + tuple val(meta4), path(sites) output: tuple val(meta), path("*.somalier") , emit: extract diff --git a/modules/nf-core/somalier/extract/meta.yml b/modules/nf-core/somalier/extract/meta.yml index 7aa426ab..aabaf5d6 100644 --- a/modules/nf-core/somalier/extract/meta.yml +++ b/modules/nf-core/somalier/extract/meta.yml @@ -19,7 +19,7 @@ tools: documentation: "https://github.com/brentp/somalier/blob/master/README.md" tool_dev_url: "https://github.com/brentp/somalier" doi: "10.1186/s13073-020-00761-2" - licence: "MIT License" + licence: ["MIT"] input: - meta: type: map @@ -32,14 +32,29 @@ input: - input_index: type: file description: index file of the input data, e.g., bam.bai, cram.crai + - meta2: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'hg38' ] - fasta: type: file description: The reference fasta file pattern: "*.{fasta,fna,fas,fa}" + - meta3: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'hg38' ] - fai: type: file description: FASTA index file pattern: "*.fai" + - meta4: + type: map + description: | + Groovy Map containing sites information + e.g. [ id:'hg38' ] - sites: type: file description: sites file in VCF format which can be taken from https://github.com/brentp/somalier diff --git a/modules/nf-core/somalier/extract/tests/main.nf.test b/modules/nf-core/somalier/extract/tests/main.nf.test new file mode 100644 index 00000000..dfc7e8a5 --- /dev/null +++ b/modules/nf-core/somalier/extract/tests/main.nf.test @@ -0,0 +1,84 @@ +nextflow_process { + + name "Test Process SOMALIER_EXTRACT" + script "../main.nf" + process "SOMALIER_EXTRACT" + + tag "modules" + tag "modules_nfcore" + tag "somalier" + tag "somalier/extract" + + test("homo_sapiens - [ bam, bai ], fasta, fai, sites") { + + 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.markduplicates.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam.bai', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'delete_me/somalier/sites_chr21.hg38.vcf.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("homo_sapiens - [ bam, bai ], fasta, fai, sites -stub") { + + options "-stub" + + 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.markduplicates.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.markduplicates.sorted.bam.bai', checkIfExists: true) + ] + input[1] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + input[2] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) + ] + input[3] = [ + [ id:'genome' ], // meta map + file(params.modules_testdata_base_path + 'delete_me/somalier/sites_chr21.hg38.vcf.gz', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/somalier/extract/tests/main.nf.test.snap b/modules/nf-core/somalier/extract/tests/main.nf.test.snap new file mode 100644 index 00000000..83df72a4 --- /dev/null +++ b/modules/nf-core/somalier/extract/tests/main.nf.test.snap @@ -0,0 +1,72 @@ +{ + "homo_sapiens - [ bam, bai ], fasta, fai, sites": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "normal.somalier:md5,21f0b980edd42ddaa8ab964959c1de02" + ] + ], + "1": [ + "versions.yml:md5,df4e49e9520f49a862026da1aa81dde0" + ], + "extract": [ + [ + { + "id": "test", + "single_end": false + }, + "normal.somalier:md5,21f0b980edd42ddaa8ab964959c1de02" + ] + ], + "versions": [ + "versions.yml:md5,df4e49e9520f49a862026da1aa81dde0" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-01T13:25:23.384476049" + }, + "homo_sapiens - [ bam, bai ], fasta, fai, sites -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somalier:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,df4e49e9520f49a862026da1aa81dde0" + ], + "extract": [ + [ + { + "id": "test", + "single_end": false + }, + "test.somalier:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,df4e49e9520f49a862026da1aa81dde0" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-01T13:25:35.741711687" + } +} \ No newline at end of file diff --git a/modules/nf-core/somalier/extract/tests/tags.yml b/modules/nf-core/somalier/extract/tests/tags.yml new file mode 100644 index 00000000..836e3524 --- /dev/null +++ b/modules/nf-core/somalier/extract/tests/tags.yml @@ -0,0 +1,2 @@ +somalier/extract: + - "modules/nf-core/somalier/extract/**" diff --git a/modules/nf-core/somalier/relate/environment.yml b/modules/nf-core/somalier/relate/environment.yml index b8b70f67..d6ce68f6 100644 --- a/modules/nf-core/somalier/relate/environment.yml +++ b/modules/nf-core/somalier/relate/environment.yml @@ -1,7 +1,5 @@ -name: somalier_relate channels: - conda-forge - bioconda - - defaults dependencies: - - bioconda::somalier=0.2.15 + - bioconda::somalier=0.2.19 diff --git a/modules/nf-core/somalier/relate/main.nf b/modules/nf-core/somalier/relate/main.nf index a8188b64..1c0ba9ae 100644 --- a/modules/nf-core/somalier/relate/main.nf +++ b/modules/nf-core/somalier/relate/main.nf @@ -5,8 +5,8 @@ process SOMALIER_RELATE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/somalier:0.2.15--h37c5b7d_0': - 'biocontainers/somalier:0.2.15--h37c5b7d_0' }" + 'https://depot.galaxyproject.org/singularity/somalier:0.2.19--h0c29559_0': + 'biocontainers/somalier:0.2.19--h0c29559_0' }" input: tuple val(meta), path(extract), path(ped) diff --git a/modules/nf-core/somalier/relate/meta.yml b/modules/nf-core/somalier/relate/meta.yml index d1d81c87..42638f4f 100644 --- a/modules/nf-core/somalier/relate/meta.yml +++ b/modules/nf-core/somalier/relate/meta.yml @@ -19,7 +19,7 @@ tools: documentation: "https://github.com/brentp/somalier/blob/master/README.md" tool_dev_url: "https://github.com/brentp/somalier" doi: "10.1186/s13073-020-00761-2" - licence: "MIT License" + licence: ["MIT"] input: - meta: type: map @@ -27,7 +27,7 @@ input: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - extract: - type: file(s) + type: file description: extract file(s) from Somalier extract pattern: "*.somalier" - ped: diff --git a/modules/nf-core/somalier/relate/somalier-relate.diff b/modules/nf-core/somalier/relate/somalier-relate.diff index 48dc50f3..918d80b2 100644 --- a/modules/nf-core/somalier/relate/somalier-relate.diff +++ b/modules/nf-core/somalier/relate/somalier-relate.diff @@ -1,4 +1,5 @@ Changes in module 'nf-core/somalier/relate' +Changes in 'somalier/relate/main.nf': --- modules/nf-core/somalier/relate/main.nf +++ modules/nf-core/somalier/relate/main.nf @@ -16,6 +16,7 @@ @@ -27,4 +28,9 @@ Changes in module 'nf-core/somalier/relate' cat <<-END_VERSIONS > versions.yml "${task.process}": +'modules/nf-core/somalier/relate/environment.yml' is unchanged +'modules/nf-core/somalier/relate/meta.yml' is unchanged +'modules/nf-core/somalier/relate/tests/tags.yml' is unchanged +'modules/nf-core/somalier/relate/tests/main.nf.test' is unchanged +'modules/nf-core/somalier/relate/tests/main.nf.test.snap' is unchanged ************************************************************ diff --git a/modules/nf-core/somalier/relate/tests/main.nf.test b/modules/nf-core/somalier/relate/tests/main.nf.test new file mode 100644 index 00000000..5f17456d --- /dev/null +++ b/modules/nf-core/somalier/relate/tests/main.nf.test @@ -0,0 +1,124 @@ +nextflow_process { + + name "Test Process SOMALIER_RELATE" + script "../main.nf" + process "SOMALIER_RELATE" + + tag "modules" + tag "modules_nfcore" + tag "somalier" + tag "somalier/relate" + + test("[ delete_me, [] ], []") { + + when { + process { + """ + input[0] = [ + [ id:'cohort', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'delete_me/somalier/normal.somalier', checkIfExists: true), + file(params.modules_testdata_base_path + 'delete_me/somalier/tumour.somalier', checkIfExists: true) + ], + [] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("[ delete_me, ped ], groups") { + + when { + process { + """ + input[0] = [ + [ id:'cohort', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'delete_me/somalier/normal.somalier', checkIfExists: true), + file(params.modules_testdata_base_path + 'delete_me/somalier/tumour.somalier', checkIfExists: true) + ], + file(params.modules_testdata_base_path + 'delete_me/somalier/family.ped', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'delete_me/somalier/groups.txt', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("[ delete_me, [] ], [] -stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'cohort', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'delete_me/somalier/normal.somalier', checkIfExists: true), + file(params.modules_testdata_base_path + 'delete_me/somalier/tumour.somalier', checkIfExists: true) + ], + [] + ] + input[1] = [] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("[ delete_me, ped ], groups -stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'cohort', single_end:false ], // meta map + [ + file(params.modules_testdata_base_path + 'delete_me/somalier/normal.somalier', checkIfExists: true), + file(params.modules_testdata_base_path + 'delete_me/somalier/tumour.somalier', checkIfExists: true) + ], + file(params.modules_testdata_base_path + 'delete_me/somalier/family.ped', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'delete_me/somalier/groups.txt', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/somalier/relate/tests/main.nf.test.snap b/modules/nf-core/somalier/relate/tests/main.nf.test.snap new file mode 100644 index 00000000..54a73033 --- /dev/null +++ b/modules/nf-core/somalier/relate/tests/main.nf.test.snap @@ -0,0 +1,286 @@ +{ + "[ delete_me, [] ], []": { + "content": [ + { + "0": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.html:md5,03cac9b2c67a8a06f63e07f83ee11e18" + ] + ], + "1": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.pairs.tsv:md5,54d1e9fca1bf9d747d4254c6fa98edcf" + ] + ], + "2": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.samples.tsv:md5,97257d88886db1325c4d7d10cefa7169" + ] + ], + "3": [ + "versions.yml:md5,59d805a9f89558414535c136c814bea6" + ], + "html": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.html:md5,03cac9b2c67a8a06f63e07f83ee11e18" + ] + ], + "pairs_tsv": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.pairs.tsv:md5,54d1e9fca1bf9d747d4254c6fa98edcf" + ] + ], + "samples_tsv": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.samples.tsv:md5,97257d88886db1325c4d7d10cefa7169" + ] + ], + "versions": [ + "versions.yml:md5,59d805a9f89558414535c136c814bea6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T05:29:21.162582556" + }, + "[ delete_me, [] ], [] -stub": { + "content": [ + { + "0": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.pairs.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.samples.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,59d805a9f89558414535c136c814bea6" + ], + "html": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pairs_tsv": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.pairs.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "samples_tsv": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.samples.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,59d805a9f89558414535c136c814bea6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T05:29:43.887124223" + }, + "[ delete_me, ped ], groups -stub": { + "content": [ + { + "0": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.pairs.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.samples.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,59d805a9f89558414535c136c814bea6" + ], + "html": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.html:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pairs_tsv": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.pairs.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "samples_tsv": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.samples.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,59d805a9f89558414535c136c814bea6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T05:29:55.034913513" + }, + "[ delete_me, ped ], groups": { + "content": [ + { + "0": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.html:md5,0d573016c9279ccdfdcfd4eb01d73b89" + ] + ], + "1": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.pairs.tsv:md5,8655714f1e5359329188e9f501168131" + ] + ], + "2": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.samples.tsv:md5,38ef93340e55fbeef47640abda9e48b0" + ] + ], + "3": [ + "versions.yml:md5,59d805a9f89558414535c136c814bea6" + ], + "html": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.html:md5,0d573016c9279ccdfdcfd4eb01d73b89" + ] + ], + "pairs_tsv": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.pairs.tsv:md5,8655714f1e5359329188e9f501168131" + ] + ], + "samples_tsv": [ + [ + { + "id": "cohort", + "single_end": false + }, + "cohort.samples.tsv:md5,38ef93340e55fbeef47640abda9e48b0" + ] + ], + "versions": [ + "versions.yml:md5,59d805a9f89558414535c136c814bea6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-02T05:29:32.451456985" + } +} \ No newline at end of file diff --git a/modules/nf-core/somalier/relate/tests/tags.yml b/modules/nf-core/somalier/relate/tests/tags.yml new file mode 100644 index 00000000..c80de730 --- /dev/null +++ b/modules/nf-core/somalier/relate/tests/tags.yml @@ -0,0 +1,2 @@ +somalier/relate: + - "modules/nf-core/somalier/relate/**" diff --git a/modules/nf-core/tabix/bgzip/environment.yml b/modules/nf-core/tabix/bgzip/environment.yml index 4fe40c56..c863e920 100644 --- a/modules/nf-core/tabix/bgzip/environment.yml +++ b/modules/nf-core/tabix/bgzip/environment.yml @@ -1,7 +1,6 @@ -name: tabix_bgzip channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::tabix=1.11 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/tabix/bgzip/main.nf b/modules/nf-core/tabix/bgzip/main.nf index 7772e9ad..67991c74 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/tabix:1.11--hdfd78af_0' : - 'biocontainers/tabix:1.11--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/htslib:1.20--h5efdd21_2' : + 'biocontainers/htslib:1.20--h5efdd21_2' }" input: tuple val(meta), path(input) @@ -44,7 +44,8 @@ process TABIX_BGZIP { output = in_bgzip ? input.getBaseName() : "${prefix}.${input.getExtension()}.gz" """ - touch ${output} + echo "" | gzip > ${output} + touch ${output}.gzi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/tabix/bgzip/tests/bgzip_compress.config b/modules/nf-core/tabix/bgzip/tests/bgzip_compress.config new file mode 100644 index 00000000..6b6ff55f --- /dev/null +++ b/modules/nf-core/tabix/bgzip/tests/bgzip_compress.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_BGZIP { + ext.args = ' -i' + } +} diff --git a/modules/nf-core/tabix/bgzip/tests/main.nf.test b/modules/nf-core/tabix/bgzip/tests/main.nf.test new file mode 100644 index 00000000..d784aa07 --- /dev/null +++ b/modules/nf-core/tabix/bgzip/tests/main.nf.test @@ -0,0 +1,111 @@ +nextflow_process { + + name "Test Process TABIX_BGZIP" + script "modules/nf-core/tabix/bgzip/main.nf" + process "TABIX_BGZIP" + + tag "modules" + tag "modules_nfcore" + tag "tabix" + tag "tabix/bgzip" + + test("sarscov2_vcf_bgzip_compress") { + when { + process { + """ + input[0] = [ + [ id:'bgzip_test' ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.output[0][1]).name + ).match("bgzip_test") + } + ) + } + } + + test("homo_genome_bedgz_compress") { + when { + process { + """ + input[0] = [ + [ id:'bedgz_test' ], + [ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed.gz', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.output[0][1]).name + ).match("bedgz_test") + } + ) + } + } + + test("sarscov2_vcf_bgzip_compress_stub") { + options '-stub' + config "./bgzip_compress.config" + + when { + process { + """ + input[0] = [ + [ id:"test_stub" ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.output[0][1]).name + ).match("test_stub") + } + ) + } + } + + test("sarscov2_vcf_bgzip_compress_gzi") { + config "./bgzip_compress.config" + when { + process { + """ + input[0] = [ + [ id:"gzi_compress_test" ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.gzi[0][1]).name + ).match("gzi_compress_test") + } + ) + } + } +} diff --git a/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap b/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap new file mode 100644 index 00000000..0748143f --- /dev/null +++ b/modules/nf-core/tabix/bgzip/tests/main.nf.test.snap @@ -0,0 +1,218 @@ +{ + "gzi_compress_test": { + "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": { + "content": [ + { + "0": [ + [ + { + "id": "bedgz_test" + }, + "bedgz_test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" + ], + "gzi": [ + + ], + "output": [ + [ + { + "id": "bedgz_test" + }, + "bedgz_test.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7" + ] + ], + "versions": [ + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" + ] + } + ], + "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": { + "content": [ + { + "0": [ + [ + { + "id": "bgzip_test" + }, + "bgzip_test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" + ], + "gzi": [ + + ], + "output": [ + [ + { + "id": "bgzip_test" + }, + "bgzip_test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions": [ + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:28:22.087769106" + }, + "sarscov2_vcf_bgzip_compress_gzi": { + "content": [ + { + "0": [ + [ + { + "id": "gzi_compress_test" + }, + "gzi_compress_test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "1": [ + [ + { + "id": "gzi_compress_test" + }, + "gzi_compress_test.vcf.gz.gzi:md5,26fd00d4e26141cd11561f6e7d4a2ad0" + ] + ], + "2": [ + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" + ], + "gzi": [ + [ + { + "id": "gzi_compress_test" + }, + "gzi_compress_test.vcf.gz.gzi:md5,26fd00d4e26141cd11561f6e7d4a2ad0" + ] + ], + "output": [ + [ + { + "id": "gzi_compress_test" + }, + "gzi_compress_test.vcf.gz:md5,8e722884ffb75155212a3fc053918766" + ] + ], + "versions": [ + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" + ] + } + ], + "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": { + "content": [ + { + "0": [ + [ + { + "id": "test_stub" + }, + "test_stub.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test_stub" + }, + "test_stub.vcf.gz.gzi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" + ], + "gzi": [ + [ + { + "id": "test_stub" + }, + "test_stub.vcf.gz.gzi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "output": [ + [ + { + "id": "test_stub" + }, + "test_stub.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,753c29916d45debdde52f4ac7c745f61" + ] + } + ], + "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/bgzip/tests/tags.yml b/modules/nf-core/tabix/bgzip/tests/tags.yml new file mode 100644 index 00000000..de0eec86 --- /dev/null +++ b/modules/nf-core/tabix/bgzip/tests/tags.yml @@ -0,0 +1,2 @@ +tabix/bgzip: + - "modules/nf-core/tabix/bgzip/**" diff --git a/modules/nf-core/tabix/bgzip/tests/vcf_none.config b/modules/nf-core/tabix/bgzip/tests/vcf_none.config new file mode 100644 index 00000000..f3a3c467 --- /dev/null +++ b/modules/nf-core/tabix/bgzip/tests/vcf_none.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_BGZIP { + ext.args = '' + } +} diff --git a/modules/nf-core/tabix/bgziptabix/environment.yml b/modules/nf-core/tabix/bgziptabix/environment.yml index 028461c9..c863e920 100644 --- a/modules/nf-core/tabix/bgziptabix/environment.yml +++ b/modules/nf-core/tabix/bgziptabix/environment.yml @@ -1,7 +1,6 @@ -name: tabix_bgziptabix channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::tabix=1.11 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/tabix/bgziptabix/main.nf b/modules/nf-core/tabix/bgziptabix/main.nf index f9482690..05041f49 100644 --- a/modules/nf-core/tabix/bgziptabix/main.nf +++ b/modules/nf-core/tabix/bgziptabix/main.nf @@ -4,8 +4,8 @@ process TABIX_BGZIPTABIX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' : - 'biocontainers/tabix:1.11--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/htslib:1.20--h5efdd21_2' : + 'biocontainers/htslib:1.20--h5efdd21_2' }" input: tuple val(meta), path(input) @@ -24,7 +24,7 @@ process TABIX_BGZIPTABIX { def prefix = task.ext.prefix ?: "${meta.id}" """ bgzip --threads ${task.cpus} -c $args $input > ${prefix}.${input.getExtension()}.gz - tabix $args2 ${prefix}.${input.getExtension()}.gz + tabix --threads ${task.cpus} $args2 ${prefix}.${input.getExtension()}.gz cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -35,7 +35,7 @@ process TABIX_BGZIPTABIX { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.${input.getExtension()}.gz + echo "" | gzip > ${prefix}.${input.getExtension()}.gz touch ${prefix}.${input.getExtension()}.gz.tbi touch ${prefix}.${input.getExtension()}.gz.csi diff --git a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test new file mode 100644 index 00000000..1a84d74f --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test @@ -0,0 +1,94 @@ +nextflow_process { + + name "Test Process TABIX_BGZIPTABIX" + script "modules/nf-core/tabix/bgziptabix/main.nf" + process "TABIX_BGZIPTABIX" + + tag "modules" + tag "modules_nfcore" + tag "tabix" + tag "tabix/bgziptabix" + + test("sarscov2_bed_tbi") { + config "./tabix_tbi.config" + + when { + process { + """ + input[0] = [ + [ id:'tbi_test' ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.gz_tbi[0][1]).name + ).match("tbi_test") + } + ) + } + } + + test("sarscov2_bed_csi") { + config "./tabix_csi.config" + + when { + process { + """ + input[0] = [ + [ id:'csi_test' ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.gz_csi[0][1]).name + ).match("csi_test") + } + ) + } + + } + + test("sarscov2_bed_csi_stub") { + config "./tabix_csi.config" + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + { assert snapshot( + file(process.out.gz_csi[0][1]).name + ).match("csi_stub") + } + ) + } + + } + +} diff --git a/modules/nf-core/tabix/bgziptabix/tests/main.nf.test.snap b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test.snap new file mode 100644 index 00000000..c166ea72 --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/main.nf.test.snap @@ -0,0 +1,167 @@ +{ + "sarscov2_bed_tbi": { + "content": [ + { + "0": [ + [ + { + "id": "tbi_test" + }, + "tbi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", + "tbi_test.bed.gz.tbi:md5,ca06caf88b1e3c67d5fcba0a1460b52c" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,736e7c3b16a3ac525253e5b5f5d8fdfa" + ], + "gz_csi": [ + + ], + "gz_tbi": [ + [ + { + "id": "tbi_test" + }, + "tbi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", + "tbi_test.bed.gz.tbi:md5,ca06caf88b1e3c67d5fcba0a1460b52c" + ] + ], + "versions": [ + "versions.yml:md5,736e7c3b16a3ac525253e5b5f5d8fdfa" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:29:16.053817543" + }, + "sarscov2_bed_csi": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "csi_test" + }, + "csi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", + "csi_test.bed.gz.csi:md5,c9c0377de58fdc89672bb3005a0d69f5" + ] + ], + "2": [ + "versions.yml:md5,736e7c3b16a3ac525253e5b5f5d8fdfa" + ], + "gz_csi": [ + [ + { + "id": "csi_test" + }, + "csi_test.bed.gz:md5,fe4053cf4de3aebbdfc3be2efb125a74", + "csi_test.bed.gz.csi:md5,c9c0377de58fdc89672bb3005a0d69f5" + ] + ], + "gz_tbi": [ + + ], + "versions": [ + "versions.yml:md5,736e7c3b16a3ac525253e5b5f5d8fdfa" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:29:27.667745444" + }, + "csi_test": { + "content": [ + "csi_test.bed.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-02-19T14:51:00.548801" + }, + "csi_stub": { + "content": [ + "test.bed.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-02-19T14:51:09.218454" + }, + "tbi_test": { + "content": [ + "tbi_test.bed.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-02-19T14:50:51.579654" + }, + "sarscov2_bed_csi_stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,736e7c3b16a3ac525253e5b5f5d8fdfa" + ], + "gz_csi": [ + [ + { + "id": "test" + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.bed.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gz_tbi": [ + [ + { + "id": "test" + }, + "test.bed.gz:md5,68b329da9893e34099c7d8ad5cb9c940", + "test.bed.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,736e7c3b16a3ac525253e5b5f5d8fdfa" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T11:29:45.105209991" + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/bgziptabix/tests/tabix_csi.config b/modules/nf-core/tabix/bgziptabix/tests/tabix_csi.config new file mode 100644 index 00000000..fb41a314 --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/tabix_csi.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_BGZIPTABIX { + ext.args2 = '-p vcf --csi' + } +} diff --git a/modules/nf-core/tabix/bgziptabix/tests/tabix_tbi.config b/modules/nf-core/tabix/bgziptabix/tests/tabix_tbi.config new file mode 100644 index 00000000..c1915dc4 --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/tabix_tbi.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_BGZIPTABIX { + ext.args2 = '-p vcf' + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/bgziptabix/tests/tags.yml b/modules/nf-core/tabix/bgziptabix/tests/tags.yml new file mode 100644 index 00000000..5052b4d7 --- /dev/null +++ b/modules/nf-core/tabix/bgziptabix/tests/tags.yml @@ -0,0 +1,2 @@ +tabix/bgziptabix: + - "modules/nf-core/tabix/bgziptabix/**" diff --git a/modules/nf-core/tabix/tabix/environment.yml b/modules/nf-core/tabix/tabix/environment.yml index 7167fb87..4d1f9dd4 100644 --- a/modules/nf-core/tabix/tabix/environment.yml +++ b/modules/nf-core/tabix/tabix/environment.yml @@ -1,7 +1,10 @@ name: tabix_tabix + channels: - conda-forge - bioconda - defaults + dependencies: + - bioconda::htslib=1.20 - bioconda::tabix=1.11 diff --git a/modules/nf-core/tabix/tabix/main.nf b/modules/nf-core/tabix/tabix/main.nf index c304a8a3..13acd670 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/tabix:1.11--hdfd78af_0' : - 'biocontainers/tabix:1.11--hdfd78af_0' }" + '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}": @@ -30,11 +33,11 @@ process TABIX_TABIX { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${tab}.tbi - cat <<-END_VERSIONS > versions.yml + touch ${tab}.csi + 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/tests/main.nf.test b/modules/nf-core/tabix/tabix/tests/main.nf.test new file mode 100644 index 00000000..102b0d7b --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/main.nf.test @@ -0,0 +1,136 @@ +nextflow_process { + + name "Test Process TABIX_TABIX" + script "modules/nf-core/tabix/tabix/main.nf" + process "TABIX_TABIX" + + tag "modules" + tag "modules_nfcore" + tag "tabix" + tag "tabix/tabix" + + test("sarscov2_bedgz_tbi") { + config "./tabix_bed.config" + when { + process { + """ + input[0] = [ + [ id:'tbi_bed' ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed.gz', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out, + file(process.out.tbi[0][1]).name + ).match() } + ) + } + } + + test("sarscov2_gff_tbi") { + config "./tabix_gff.config" + when { + process { + """ + input[0] = [ + [ id:'tbi_gff' ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.gff3.gz', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out, + file(process.out.tbi[0][1]).name).match() } + ) + } + + } + + test("sarscov2_vcf_tbi") { + config "./tabix_vcf_tbi.config" + when { + process { + """ + input[0] = [ + [ id:'tbi_vcf' ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out, + file(process.out.tbi[0][1]).name + ).match() } + ) + } + + } + + test("sarscov2_vcf_csi") { + config "./tabix_vcf_csi.config" + when { + process { + """ + input[0] = [ + [ id:'vcf_csi' ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + process.out, + file(process.out.csi[0][1]).name + ).match() } + ) + } + + } + + test("sarscov2_vcf_csi_stub") { + config "./tabix_vcf_csi.config" + options "-stub" + when { + process { + """ + input[0] = [ + [ id:'vcf_csi_stub' ], + [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true) ] + ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot( + 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 new file mode 100644 index 00000000..c2b9ed0b --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/main.nf.test.snap @@ -0,0 +1,212 @@ +{ + "sarscov2_gff_tbi": { + "content": [ + { + "0": [ + [ + { + "id": "tbi_gff" + }, + "genome.gff3.gz.tbi:md5,f79a67d95a98076e04fbe0455d825926" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "tbi_gff" + }, + "genome.gff3.gz.tbi:md5,f79a67d95a98076e04fbe0455d825926" + ] + ], + "versions": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ] + }, + "genome.gff3.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:25.653807564" + }, + "sarscov2_bedgz_tbi": { + "content": [ + { + "0": [ + [ + { + "id": "tbi_bed" + }, + "test.bed.gz.tbi:md5,9a761d51cc81835fd1199201fdbcdd5d" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "tbi_bed" + }, + "test.bed.gz.tbi:md5,9a761d51cc81835fd1199201fdbcdd5d" + ] + ], + "versions": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ] + }, + "test.bed.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:09.754082161" + }, + "sarscov2_vcf_tbi": { + "content": [ + { + "0": [ + [ + { + "id": "tbi_vcf" + }, + "test.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" + ] + ], + "1": [ + + ], + "2": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ], + "csi": [ + + ], + "tbi": [ + [ + { + "id": "tbi_vcf" + }, + "test.vcf.gz.tbi:md5,d22e5b84e4fcd18792179f72e6da702e" + ] + ], + "versions": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ] + }, + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:06:40.042648294" + }, + "sarscov2_vcf_csi_stub": { + "content": [ + { + "0": [ + [ + { + "id": "vcf_csi_stub" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "vcf_csi_stub" + }, + "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ], + "csi": [ + [ + { + "id": "vcf_csi_stub" + }, + "test.vcf.gz.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + [ + { + "id": "vcf_csi_stub" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ] + }, + "test.vcf.gz.csi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-19T12:07:08.700367261" + }, + "sarscov2_vcf_csi": { + "content": [ + { + "0": [ + + ], + "1": [ + [ + { + "id": "vcf_csi" + }, + "test.vcf.gz.csi:md5,04b41c1efd9ab3c6b1e008a286e27d2b" + ] + ], + "2": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ], + "csi": [ + [ + { + "id": "vcf_csi" + }, + "test.vcf.gz.csi:md5,04b41c1efd9ab3c6b1e008a286e27d2b" + ] + ], + "tbi": [ + + ], + "versions": [ + "versions.yml:md5,07064637fb8a217174052be8e40234e2" + ] + }, + "test.vcf.gz.csi" + ], + "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/tabix/tabix/tests/tabix_bed.config b/modules/nf-core/tabix/tabix/tests/tabix_bed.config new file mode 100644 index 00000000..7ff05905 --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tabix_bed.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_TABIX { + ext.args = '-p bed' + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/tests/tabix_gff.config b/modules/nf-core/tabix/tabix/tests/tabix_gff.config new file mode 100644 index 00000000..20c0a1e3 --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tabix_gff.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_TABIX { + ext.args = '-p gff' + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/tests/tabix_vcf_csi.config b/modules/nf-core/tabix/tabix/tests/tabix_vcf_csi.config new file mode 100644 index 00000000..eb4f2d7e --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tabix_vcf_csi.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_TABIX { + ext.args = '-p vcf --csi' + } +} diff --git a/modules/nf-core/tabix/tabix/tests/tabix_vcf_tbi.config b/modules/nf-core/tabix/tabix/tests/tabix_vcf_tbi.config new file mode 100644 index 00000000..2774c8a9 --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tabix_vcf_tbi.config @@ -0,0 +1,5 @@ +process { + withName: TABIX_TABIX { + ext.args = '-p vcf' + } +} \ No newline at end of file diff --git a/modules/nf-core/tabix/tabix/tests/tags.yml b/modules/nf-core/tabix/tabix/tests/tags.yml new file mode 100644 index 00000000..6eda0653 --- /dev/null +++ b/modules/nf-core/tabix/tabix/tests/tags.yml @@ -0,0 +1,2 @@ +tabix/tabix: + - "modules/nf-core/tabix/tabix/**" diff --git a/modules/nf-core/untar/environment.yml b/modules/nf-core/untar/environment.yml index 0c9cbb10..4f498244 100644 --- a/modules/nf-core/untar/environment.yml +++ b/modules/nf-core/untar/environment.yml @@ -1,11 +1,9 @@ name: untar - channels: - conda-forge - bioconda - defaults - dependencies: - conda-forge::grep=3.11 - - conda-forge::sed=4.7 + - conda-forge::sed=4.8 - conda-forge::tar=1.34 diff --git a/modules/nf-core/untar/main.nf b/modules/nf-core/untar/main.nf index 8a75bb95..9bd8f554 100644 --- a/modules/nf-core/untar/main.nf +++ b/modules/nf-core/untar/main.nf @@ -4,8 +4,8 @@ process UNTAR { 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' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:22.04' : + 'nf-core/ubuntu:22.04' }" input: tuple val(meta), path(archive) @@ -52,8 +52,29 @@ process UNTAR { stub: prefix = task.ext.prefix ?: ( meta.id ? "${meta.id}" : archive.toString().replaceFirst(/\.[^\.]+(.gz)?$/, "")) """ - mkdir $prefix - touch ${prefix}/file.txt + mkdir ${prefix} + ## Dry-run untaring the archive to get the files and place all in prefix + if [[ \$(tar -taf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then + for i in `tar -tf ${archive}`; + do + if [[ \$(echo "\${i}" | grep -E "/\$") == "" ]]; + then + touch \${i} + else + mkdir -p \${i} + fi + done + else + for i in `tar -tf ${archive}`; + do + if [[ \$(echo "\${i}" | grep -E "/\$") == "" ]]; + then + touch ${prefix}/\${i} + else + mkdir -p ${prefix}/\${i} + fi + done + fi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/untar/tests/main.nf.test b/modules/nf-core/untar/tests/main.nf.test index 2a7c97bf..c957517a 100644 --- a/modules/nf-core/untar/tests/main.nf.test +++ b/modules/nf-core/untar/tests/main.nf.test @@ -6,6 +6,7 @@ nextflow_process { tag "modules" tag "modules_nfcore" tag "untar" + test("test_untar") { when { @@ -19,10 +20,9 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.untar).match("test_untar") }, + { assert snapshot(process.out).match() }, ) } - } test("test_untar_onlyfiles") { @@ -38,10 +38,48 @@ nextflow_process { then { assertAll ( { assert process.success }, - { assert snapshot(process.out.untar).match("test_untar_onlyfiles") }, + { assert snapshot(process.out).match() }, ) } + } + + test("test_untar - stub") { + + options "-stub" + when { + process { + """ + input[0] = [ [], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2.tar.gz', checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } } + test("test_untar_onlyfiles - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [], file(params.modules_testdata_base_path + 'generic/tar/hello.tar.gz', checkIfExists: true) ] + """ + } + } + + then { + assertAll ( + { assert process.success }, + { assert snapshot(process.out).match() }, + ) + } + } } diff --git a/modules/nf-core/untar/tests/main.nf.test.snap b/modules/nf-core/untar/tests/main.nf.test.snap index 64550292..ceb91b79 100644 --- a/modules/nf-core/untar/tests/main.nf.test.snap +++ b/modules/nf-core/untar/tests/main.nf.test.snap @@ -1,42 +1,158 @@ { "test_untar_onlyfiles": { "content": [ - [ - [ + { + "0": [ [ - - ], + [ + + ], + [ + "hello.txt:md5,e59ff97941044f85df5297e1c302d260" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ + [ + [ + + ], + [ + "hello.txt:md5,e59ff97941044f85df5297e1c302d260" + ] + ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-10T12:04:28.231047" + }, + "test_untar_onlyfiles - stub": { + "content": [ + { + "0": [ + [ + [ + + ], + [ + "hello.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ [ - "hello.txt:md5,e59ff97941044f85df5297e1c302d260" + [ + + ], + [ + "hello.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" ] - ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-02-28T11:49:41.320643" + "timestamp": "2024-07-10T12:04:45.773103" + }, + "test_untar - stub": { + "content": [ + { + "0": [ + [ + [ + + ], + [ + "hash.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "opts.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "taxo.k2d:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ + [ + [ + + ], + [ + "hash.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "opts.k2d:md5,d41d8cd98f00b204e9800998ecf8427e", + "taxo.k2d:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-07-10T12:04:36.777441" }, "test_untar": { "content": [ - [ - [ + { + "0": [ [ - - ], + [ + + ], + [ + "hash.k2d:md5,8b8598468f54a7087c203ad0190555d9", + "opts.k2d:md5,a033d00cf6759407010b21700938f543", + "taxo.k2d:md5,094d5891cdccf2f1468088855c214b2c" + ] + ] + ], + "1": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" + ], + "untar": [ [ - "hash.k2d:md5,8b8598468f54a7087c203ad0190555d9", - "opts.k2d:md5,a033d00cf6759407010b21700938f543", - "taxo.k2d:md5,094d5891cdccf2f1468088855c214b2c" + [ + + ], + [ + "hash.k2d:md5,8b8598468f54a7087c203ad0190555d9", + "opts.k2d:md5,a033d00cf6759407010b21700938f543", + "taxo.k2d:md5,094d5891cdccf2f1468088855c214b2c" + ] ] + ], + "versions": [ + "versions.yml:md5,6063247258c56fd271d076bb04dd7536" ] - ] + } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.3" }, - "timestamp": "2024-02-28T11:49:33.795172" + "timestamp": "2024-07-10T12:04:19.377674" } } \ No newline at end of file diff --git a/modules/nf-core/vardictjava/environment.yml b/modules/nf-core/vardictjava/environment.yml index 92d169fd..a835c6db 100644 --- a/modules/nf-core/vardictjava/environment.yml +++ b/modules/nf-core/vardictjava/environment.yml @@ -1,7 +1,6 @@ -name: vardictjava channels: - conda-forge - bioconda - - defaults dependencies: + - bioconda::htslib=1.20 - bioconda::vardict-java=1.8.3 diff --git a/modules/nf-core/vardictjava/main.nf b/modules/nf-core/vardictjava/main.nf index 50d7dfab..6329391c 100644 --- a/modules/nf-core/vardictjava/main.nf +++ b/modules/nf-core/vardictjava/main.nf @@ -4,8 +4,8 @@ process VARDICTJAVA { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/vardict-java:1.8.3--hdfd78af_0': - 'biocontainers/vardict-java:1.8.3--hdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-731b8c4cf44d76e9aa181af565b9eee448d82a8c:edd70e76f3529411a748168f6eb1a61f29702123-0' : + 'biocontainers/mulled-v2-731b8c4cf44d76e9aa181af565b9eee448d82a8c:edd70e76f3529411a748168f6eb1a61f29702123-0' }" input: tuple val(meta), path(bams), path(bais), path(bed) @@ -13,7 +13,7 @@ process VARDICTJAVA { tuple val(meta3), path(fasta_fai) output: - tuple val(meta), path("*.vcf"), emit: vcf + tuple val(meta), path("*.vcf.gz"), emit: vcf path "versions.yml" , emit: versions when: @@ -22,9 +22,10 @@ process VARDICTJAVA { script: def args = task.ext.args ?: '-c 1 -S 2 -E 3' def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def somatic = bams instanceof ArrayList && bams.size() == 2 ? true : false + def somatic = bams instanceof List && bams.size() == 2 ? true : false def input = somatic ? "-b \"${bams[0]}|${bams[1]}\"" : "-b ${bams}" def filter = somatic ? "testsomatic.R" : "teststrandbias.R" def convert_to_vcf = somatic ? "var2vcf_paired.pl" : "var2vcf_valid.pl" @@ -39,8 +40,7 @@ process VARDICTJAVA { | ${filter} \\ | ${convert_to_vcf} \\ ${args2} \\ - | sed -e 's/##FORMAT= ${prefix}.vcf + | bgzip ${args3} --threads ${task.cpus} > ${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -52,10 +52,11 @@ process VARDICTJAVA { stub: def args = task.ext.args ?: '-c 1 -S 2 -E 3' def args2 = task.ext.args2 ?: '' + def args3 = task.ext.args3 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf + echo '' | gzip > ${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/vardictjava/meta.yml b/modules/nf-core/vardictjava/meta.yml index 657d1531..5c2fc921 100644 --- a/modules/nf-core/vardictjava/meta.yml +++ b/modules/nf-core/vardictjava/meta.yml @@ -13,7 +13,7 @@ tools: documentation: "https://github.com/AstraZeneca-NGS/VarDictJava" tool_dev_url: "https://github.com/AstraZeneca-NGS/VarDictJava" doi: "10.1093/nar/gkw227 " - licence: "['MIT']" + licence: ["MIT"] input: - meta: type: map diff --git a/modules/nf-core/vardictjava/tests/main.nf.test b/modules/nf-core/vardictjava/tests/main.nf.test index 483a753a..8e5fec10 100644 --- a/modules/nf-core/vardictjava/tests/main.nf.test +++ b/modules/nf-core/vardictjava/tests/main.nf.test @@ -17,17 +17,17 @@ nextflow_process { """ input[0] = Channel.value([ [ id:'test' ], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ]) input[1] = [ [id:"ref"], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] input[2] = [ [id:"ref"], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] """ } @@ -55,22 +55,22 @@ nextflow_process { input[0] = Channel.value([ [ id:'test' ], // meta map [ - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam', checkIfExists: true) ], [ - file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true), - file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam_bai'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test2.paired_end.sorted.bam.bai', checkIfExists: true) ], - file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.bed', checkIfExists: true) ]) input[1] = [ [id:"ref"], - file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) ] input[2] = [ [id:"ref"], - file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta.fai', checkIfExists: true) ] """ } diff --git a/modules/nf-core/vardictjava/tests/main.nf.test.snap b/modules/nf-core/vardictjava/tests/main.nf.test.snap index 4ccb63ec..c32a68b7 100644 --- a/modules/nf-core/vardictjava/tests/main.nf.test.snap +++ b/modules/nf-core/vardictjava/tests/main.nf.test.snap @@ -7,7 +7,7 @@ { "id": "test" }, - "test.vcf:md5,e8411ecae49b4f6afa6ea0b681ea506e" + "test.vcf.gz:md5,e8411ecae49b4f6afa6ea0b681ea506e" ] ], "1": [ @@ -18,7 +18,7 @@ { "id": "test" }, - "test.vcf:md5,e8411ecae49b4f6afa6ea0b681ea506e" + "test.vcf.gz:md5,e8411ecae49b4f6afa6ea0b681ea506e" ] ], "versions": [ @@ -26,7 +26,11 @@ ] } ], - "timestamp": "2023-10-24T09:24:20.923172332" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-04T19:08:38.328190023" }, "homo_sapiens - [[bam, bam], [bai, bai], bed] - fasta - fai": { "content": [ @@ -36,7 +40,7 @@ { "id": "test" }, - "test.vcf:md5,8acdd8ca041f024aab55d102fb6b0c38" + "test.vcf.gz:md5,b52c874c18be636d876d1e0df4a449c3" ] ], "1": [ @@ -47,7 +51,7 @@ { "id": "test" }, - "test.vcf:md5,8acdd8ca041f024aab55d102fb6b0c38" + "test.vcf.gz:md5,b52c874c18be636d876d1e0df4a449c3" ] ], "versions": [ @@ -55,6 +59,10 @@ ] } ], - "timestamp": "2023-10-24T09:24:29.462707023" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-07-04T19:08:54.416661915" } } \ No newline at end of file diff --git a/modules/nf-core/vardictjava/vardictjava.diff b/modules/nf-core/vardictjava/vardictjava.diff deleted file mode 100644 index 0efca40b..00000000 --- a/modules/nf-core/vardictjava/vardictjava.diff +++ /dev/null @@ -1,13 +0,0 @@ -Changes in module 'nf-core/vardictjava' ---- modules/nf-core/vardictjava/main.nf -+++ modules/nf-core/vardictjava/main.nf -@@ -39,6 +39,7 @@ - | ${filter} \\ - | ${convert_to_vcf} \\ - ${args2} \\ -+ | sed -e 's/##FORMAT= ${prefix}.vcf - - cat <<-END_VERSIONS > versions.yml - -************************************************************ diff --git a/modules/nf-core/vcf2db/Dockerfile b/modules/nf-core/vcf2db/Dockerfile deleted file mode 100644 index b271f667..00000000 --- a/modules/nf-core/vcf2db/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM mambaorg/micromamba:1.4-focal - -COPY ./vcf2db_env.yaml . - -RUN micromamba update --file ./vcf2db_env.yaml --yes -RUN micromamba install --yes --name base --no-deps -c bioconda vcf2db==2020.02.24 -RUN micromamba install --yes --name base --no-deps -c conda-forge coreutils -RUN micromamba clean --all --yes - -ARG MAMBA_DOCKERFILE_ACTIVATE=1 -ENV PATH "$MAMBA_ROOT_PREFIX/bin:$PATH" \ No newline at end of file diff --git a/modules/nf-core/vcf2db/environment.yml b/modules/nf-core/vcf2db/environment.yml index 51a8ab8a..58c477f9 100644 --- a/modules/nf-core/vcf2db/environment.yml +++ b/modules/nf-core/vcf2db/environment.yml @@ -1,7 +1,5 @@ -name: vcf2db channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::vcf2db=2020.02.24 diff --git a/modules/nf-core/vcf2db/main.nf b/modules/nf-core/vcf2db/main.nf index 85180a37..56c26bb6 100644 --- a/modules/nf-core/vcf2db/main.nf +++ b/modules/nf-core/vcf2db/main.nf @@ -4,7 +4,9 @@ process VCF2DB { // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. conda "${moduleDir}/environment.yml" - container "cmgg/vcf2db:2020.02.24" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/vcf2db:2020.02.24--pl5321hdfd78af_3': + 'biocontainers/vcf2db:2020.02.24--pl5321hdfd78af_3' }" input: tuple val(meta), path(vcf), path(ped) @@ -27,12 +29,6 @@ process VCF2DB { ${prefix}.db \\ $args - sqlite3 ${prefix}.db 'CREATE INDEX idx_variant_impacts_id ON variant_impacts (variant_id)' && \\ - sqlite3 ${prefix}.db 'ALTER TABLE variants ADD COLUMN tags varchar(255)' && \\ - sqlite3 ${prefix}.db 'ALTER TABLE variants ADD COLUMN tags_user varchar(255)' && \\ - sqlite3 ${prefix}.db 'ALTER TABLE variants ADD COLUMN notes varchar(255)' && \\ - sqlite3 ${prefix}.db 'ALTER TABLE variants ADD COLUMN notes_user varchar(255)' - cat <<-END_VERSIONS > versions.yml "${task.process}": vcf2db: $VERSION diff --git a/modules/nf-core/vcf2db/tests/main.nf.test b/modules/nf-core/vcf2db/tests/main.nf.test index 52742adf..9532b432 100644 --- a/modules/nf-core/vcf2db/tests/main.nf.test +++ b/modules/nf-core/vcf2db/tests/main.nf.test @@ -15,8 +15,8 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['genome']['justhusky_minimal_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['justhusky_ped'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky_minimal.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) ] """ } @@ -25,7 +25,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + file(process.out.db[0][1]).name, // Conda test fails with content md5 + process.out.versions + ).match() + } ) } @@ -40,8 +44,8 @@ nextflow_process { """ input[0] = [ [ id:'test', single_end:false ], // meta map - file(params.test_data['homo_sapiens']['genome']['justhusky_minimal_vcf_gz'], checkIfExists: true), - file(params.test_data['homo_sapiens']['genome']['justhusky_ped'], checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky_minimal.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/ped/justhusky.ped', checkIfExists: true) ] """ } diff --git a/modules/nf-core/vcf2db/tests/main.nf.test.snap b/modules/nf-core/vcf2db/tests/main.nf.test.snap index c51bea34..5e29c6ba 100644 --- a/modules/nf-core/vcf2db/tests/main.nf.test.snap +++ b/modules/nf-core/vcf2db/tests/main.nf.test.snap @@ -28,37 +28,23 @@ ] } ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, "timestamp": "2024-01-10T16:13:32.293507403" }, "homo_sapiens - vcf, ped": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.db:md5,0766bacb306d642a8358b375c4c1836f" - ] - ], - "1": [ - "versions.yml:md5,3d9eedf7998cb77b614736659eb22b1d" - ], - "db": [ - [ - { - "id": "test", - "single_end": false - }, - "test.db:md5,0766bacb306d642a8358b375c4c1836f" - ] - ], - "versions": [ - "versions.yml:md5,3d9eedf7998cb77b614736659eb22b1d" - ] - } + "test.db", + [ + "versions.yml:md5,3d9eedf7998cb77b614736659eb22b1d" + ] ], - "timestamp": "2024-01-10T16:13:25.722991475" + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.3" + }, + "timestamp": "2024-08-06T10:27:06.932652" } } \ No newline at end of file diff --git a/modules/nf-core/vcf2db/vcf2db.diff b/modules/nf-core/vcf2db/vcf2db.diff deleted file mode 100644 index 00fc493f..00000000 --- a/modules/nf-core/vcf2db/vcf2db.diff +++ /dev/null @@ -1,143 +0,0 @@ -Changes in module 'nf-core/vcf2db' ---- modules/nf-core/vcf2db/main.nf -+++ modules/nf-core/vcf2db/main.nf -@@ -4,9 +4,7 @@ - - // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. - conda "${moduleDir}/environment.yml" -- container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? -- 'https://depot.galaxyproject.org/singularity/vcf2db:2020.02.24--pl5321hdfd78af_3': -- 'biocontainers/vcf2db:2020.02.24--pl5321hdfd78af_3' }" -+ container "cmgg/vcf2db:2020.02.24" - - input: - tuple val(meta), path(vcf), path(ped) -@@ -29,6 +27,12 @@ - ${prefix}.db \\ - $args - -+ sqlite3 ${prefix}.db 'CREATE INDEX idx_variant_impacts_id ON variant_impacts (variant_id)' && \\ -+ sqlite3 ${prefix}.db 'ALTER TABLE variants ADD COLUMN tags varchar(255)' && \\ -+ sqlite3 ${prefix}.db 'ALTER TABLE variants ADD COLUMN tags_user varchar(255)' && \\ -+ sqlite3 ${prefix}.db 'ALTER TABLE variants ADD COLUMN notes varchar(255)' && \\ -+ sqlite3 ${prefix}.db 'ALTER TABLE variants ADD COLUMN notes_user varchar(255)' -+ - cat <<-END_VERSIONS > versions.yml - "${task.process}": - vcf2db: $VERSION - ---- /dev/null -+++ modules/nf-core/vcf2db/vcf2db_env.yaml -@@ -0,0 +1,96 @@ -+name: base -+channels: -+ - conda-forge -+ - bioconda -+ - defaults -+dependencies: -+ - _libgcc_mutex=0.1=conda_forge -+ - _openmp_mutex=4.5=1_llvm -+ - backports=1.0=py27_1 -+ - backports.functools_lru_cache=1.6.1=pyhd3eb1b0_0 -+ - backports.shutil_get_terminal_size=1.0.0=py27_2 -+ - backports_abc=0.5=py27_0 -+ - backports.functools_lru_cache=1.6.1=pyhd3eb1b0_0 -+ - backports_abc=0.5=py27_0 -+ - blas=2.17=openblas -+ - bzip2=1.0.8=h516909a_3 -+ - c-ares=1.17.1=h36c2ea0_0 -+ - ca-certificates=2020.11.8=ha878542_0 -+ - certifi=2016.9.26=py27_0 -+ - click=7.1.2=pyh9f0ad1d_0 -+ - coloredlogs=14.0=py27h8c360ce_1 -+ - cycler=0.10.0=py27_0 -+ - cyvcf2=0.20.9=py27h22a6d1c_0 -+ - decorator=4.4.2=py_0 -+ - freetype=2.10.4=he06d7ca_0 -+ - functools32=3.2.3.2=py27_2 -+ - futures=3.3.0=py27h8c360ce_1 -+ - geneimpacts=0.3.7=py27_0 -+ - htslib=1.10.2=hd3b49d5_1 -+ - humanfriendly=8.1=py27h8c360ce_1 -+ - icu=58.2=hf484d3e_1000 -+ - kiwisolver=1.1.0=py27h9e3301b_1 -+ - krb5=1.17.2=h926e7f8_0 -+ - libblas=3.8.0=17_openblas -+ - libcblas=3.8.0=17_openblas -+ - libcurl=7.71.1=hcdd3856_8 -+ - libdeflate=1.6=h516909a_0 -+ - libedit=3.1.20191231=he28a2e2_2 -+ - libev=4.33=h516909a_1 -+ - libffi=3.3=he6710b0_2 -+ - libgcc-ng=9.3.0=h5dbcf3e_17 -+ - libgfortran-ng=7.5.0=hae1eefd_17 -+ - libgfortran4=7.5.0=hae1eefd_17 -+ - liblapack=3.8.0=17_openblas -+ - liblapacke=3.8.0=17_openblas -+ - liblapacke=3.8.0=17_openblas -+ - libnghttp2=1.41.0=hf8bcb03_2 -+ - libopenblas=0.3.10=pthreads_hb3c22a3_5 -+ - libpng=1.6.37=hed695b0_2 -+ - libssh2=1.9.0=hab1572f_5 -+ - libstdcxx-ng=9.3.0=h2ae2ef3_17 -+ - llvm-openmp=11.0.0=hfc4b9b4_1 -+ - matplotlib-base=2.2.4=py27hfd891ef_0 -+ - monotonic=1.5=py_0 -+ - ncurses=6.2=h58526e2_4 -+ - networkx=2.2=py27_1 -+ - nomkl=3.0=0 -+ - numpy=1.16.6=py27h30dfecb_0 -+ - numpy-base=1.16.6=py27h2f8d375_0 -+ - numpy-base=1.16.6=py27h2f8d375_0 -+ - openssl=1.1.1h=h516909a_0 -+ - pandas=0.24.2=py27hf484d3e_0 -+ - pathlib2=2.3.5=py27h8c360ce_1 -+ - patsy=0.5.1=py27_0 -+ - peddy=0.4.7=pyh864c0ab_0 -+ - pip=20.1.1=pyh9f0ad1d_0 -+ - pyparsing=2.4.7=pyh9f0ad1d_0 -+ - python=2.7.18=h15b4118_1 -+ - python-dateutil=2.8.1=py_0 -+ - python-lzo=1.12=py27h42e1302_1001 -+ - python-snappy=0.5.4=py27hee44bf9_1 -+ - python_abi=2.7=1_cp27mu -+ - python-dateutil=2.8.1=py_0 -+ - python-snappy=0.5.4=py27hee44bf9_1 -+ - python_abi=2.7=1_cp27mu -+ - pytz=2020.1=pyh9f0ad1d_0 -+ - readline=8.0=he28a2e2_2 -+ - scandir=1.10.0=py27hdf8410d_1 -+ - scikit-learn=0.20.3=py27ha8026db_1 -+ - scipy=1.2.1=py27h921218d_2 -+ - seaborn=0.9.0=py27_0 -+ - setuptools=44.0.0=py27_0 -+ - singledispatch=3.4.0.3=py27_1000 -+ - six=1.15.0=pyh9f0ad1d_0 -+ - snappy=1.1.8=he1b5a44_3 -+ - sqlalchemy=1.3.15=py27hdf8410d_1 -+ - sqlite=3.33.0=h4cf870e_1 -+ - statsmodels=0.10.2=py27hc1659b7_0 -+ - subprocess32=3.5.4=py27h516909a_0 -+ - tk=8.6.10=hed695b0_1 -+ - toolshed=0.4.6=py27_0 -+ - tornado=5.1.1=py27h14c3975_1000 -+ - wheel=0.35.1=pyh9f0ad1d_0 -+ - xz=5.2.5=h516909a_1 -+ - zlib=1.2.11=h516909a_1010 -+ - zstd=1.4.5=h6597ccf_2 - ---- /dev/null -+++ modules/nf-core/vcf2db/Dockerfile -@@ -0,0 +1,11 @@ -+FROM mambaorg/micromamba:1.4-focal -+ -+COPY ./vcf2db_env.yaml . -+ -+RUN micromamba update --file ./vcf2db_env.yaml --yes -+RUN micromamba install --yes --name base --no-deps -c bioconda vcf2db==2020.02.24 -+RUN micromamba install --yes --name base --no-deps -c conda-forge coreutils -+RUN micromamba clean --all --yes -+ -+ARG MAMBA_DOCKERFILE_ACTIVATE=1 -+ENV PATH "$MAMBA_ROOT_PREFIX/bin:$PATH" -************************************************************ diff --git a/modules/nf-core/vcf2db/vcf2db_env.yaml b/modules/nf-core/vcf2db/vcf2db_env.yaml deleted file mode 100644 index 1cfa95f8..00000000 --- a/modules/nf-core/vcf2db/vcf2db_env.yaml +++ /dev/null @@ -1,96 +0,0 @@ -name: base -channels: - - conda-forge - - bioconda - - defaults -dependencies: - - _libgcc_mutex=0.1=conda_forge - - _openmp_mutex=4.5=1_llvm - - backports=1.0=py27_1 - - backports.functools_lru_cache=1.6.1=pyhd3eb1b0_0 - - backports.shutil_get_terminal_size=1.0.0=py27_2 - - backports_abc=0.5=py27_0 - - backports.functools_lru_cache=1.6.1=pyhd3eb1b0_0 - - backports_abc=0.5=py27_0 - - blas=2.17=openblas - - bzip2=1.0.8=h516909a_3 - - c-ares=1.17.1=h36c2ea0_0 - - ca-certificates=2020.11.8=ha878542_0 - - certifi=2016.9.26=py27_0 - - click=7.1.2=pyh9f0ad1d_0 - - coloredlogs=14.0=py27h8c360ce_1 - - cycler=0.10.0=py27_0 - - cyvcf2=0.20.9=py27h22a6d1c_0 - - decorator=4.4.2=py_0 - - freetype=2.10.4=he06d7ca_0 - - functools32=3.2.3.2=py27_2 - - futures=3.3.0=py27h8c360ce_1 - - geneimpacts=0.3.7=py27_0 - - htslib=1.10.2=hd3b49d5_1 - - humanfriendly=8.1=py27h8c360ce_1 - - icu=58.2=hf484d3e_1000 - - kiwisolver=1.1.0=py27h9e3301b_1 - - krb5=1.17.2=h926e7f8_0 - - libblas=3.8.0=17_openblas - - libcblas=3.8.0=17_openblas - - libcurl=7.71.1=hcdd3856_8 - - libdeflate=1.6=h516909a_0 - - libedit=3.1.20191231=he28a2e2_2 - - libev=4.33=h516909a_1 - - libffi=3.3=he6710b0_2 - - libgcc-ng=9.3.0=h5dbcf3e_17 - - libgfortran-ng=7.5.0=hae1eefd_17 - - libgfortran4=7.5.0=hae1eefd_17 - - liblapack=3.8.0=17_openblas - - liblapacke=3.8.0=17_openblas - - liblapacke=3.8.0=17_openblas - - libnghttp2=1.41.0=hf8bcb03_2 - - libopenblas=0.3.10=pthreads_hb3c22a3_5 - - libpng=1.6.37=hed695b0_2 - - libssh2=1.9.0=hab1572f_5 - - libstdcxx-ng=9.3.0=h2ae2ef3_17 - - llvm-openmp=11.0.0=hfc4b9b4_1 - - matplotlib-base=2.2.4=py27hfd891ef_0 - - monotonic=1.5=py_0 - - ncurses=6.2=h58526e2_4 - - networkx=2.2=py27_1 - - nomkl=3.0=0 - - numpy=1.16.6=py27h30dfecb_0 - - numpy-base=1.16.6=py27h2f8d375_0 - - numpy-base=1.16.6=py27h2f8d375_0 - - openssl=1.1.1h=h516909a_0 - - pandas=0.24.2=py27hf484d3e_0 - - pathlib2=2.3.5=py27h8c360ce_1 - - patsy=0.5.1=py27_0 - - peddy=0.4.7=pyh864c0ab_0 - - pip=20.1.1=pyh9f0ad1d_0 - - pyparsing=2.4.7=pyh9f0ad1d_0 - - python=2.7.18=h15b4118_1 - - python-dateutil=2.8.1=py_0 - - python-lzo=1.12=py27h42e1302_1001 - - python-snappy=0.5.4=py27hee44bf9_1 - - python_abi=2.7=1_cp27mu - - python-dateutil=2.8.1=py_0 - - python-snappy=0.5.4=py27hee44bf9_1 - - python_abi=2.7=1_cp27mu - - pytz=2020.1=pyh9f0ad1d_0 - - readline=8.0=he28a2e2_2 - - scandir=1.10.0=py27hdf8410d_1 - - scikit-learn=0.20.3=py27ha8026db_1 - - scipy=1.2.1=py27h921218d_2 - - seaborn=0.9.0=py27_0 - - setuptools=44.0.0=py27_0 - - singledispatch=3.4.0.3=py27_1000 - - six=1.15.0=pyh9f0ad1d_0 - - snappy=1.1.8=he1b5a44_3 - - sqlalchemy=1.3.15=py27hdf8410d_1 - - sqlite=3.33.0=h4cf870e_1 - - statsmodels=0.10.2=py27hc1659b7_0 - - subprocess32=3.5.4=py27h516909a_0 - - tk=8.6.10=hed695b0_1 - - toolshed=0.4.6=py27_0 - - tornado=5.1.1=py27h14c3975_1000 - - wheel=0.35.1=pyh9f0ad1d_0 - - xz=5.2.5=h516909a_1 - - zlib=1.2.11=h516909a_1010 - - zstd=1.4.5=h6597ccf_2 diff --git a/modules/nf-core/vcfanno/environment.yml b/modules/nf-core/vcfanno/environment.yml index f336cc6b..32c48b15 100644 --- a/modules/nf-core/vcfanno/environment.yml +++ b/modules/nf-core/vcfanno/environment.yml @@ -1,7 +1,5 @@ -name: vcfanno channels: - conda-forge - bioconda - - defaults dependencies: - bioconda::vcfanno=0.3.5 diff --git a/modules/nf-core/vcfanno/tests/main.nf.test b/modules/nf-core/vcfanno/tests/main.nf.test index b28431b2..8bbcfd89 100644 --- a/modules/nf-core/vcfanno/tests/main.nf.test +++ b/modules/nf-core/vcfanno/tests/main.nf.test @@ -15,11 +15,11 @@ nextflow_process { """ input[0] = [ [ id:'test_compressed', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf'], checkIfExists:true) + 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf', checkIfExists: true) ] - input[1] = file(params.test_data['homo_sapiens']['genome']['vcfanno_toml'], checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/vcfanno/vcfanno.toml', checkIfExists: true) input[2] = [] input[3] = [ file("https://github.com/brentp/vcfanno/raw/master/example/exac.vcf.gz", checkIfExists: true), @@ -45,11 +45,11 @@ nextflow_process { """ input[0] = [ [ id:'test_uncompressed', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf', checkIfExists: true), [], - file(params.test_data['sarscov2']['illumina']['test2_vcf'], checkIfExists:true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf', checkIfExists: true) ] - input[1] = file(params.test_data['homo_sapiens']['genome']['vcfanno_toml'], checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/vcfanno/vcfanno.toml', checkIfExists: true) input[2] = [] input[3] = [ file("https://github.com/brentp/vcfanno/raw/master/example/exac.vcf.gz", checkIfExists: true), @@ -77,11 +77,11 @@ nextflow_process { """ input[0] = [ [ id:'test_compressed', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true), - file(params.test_data['sarscov2']['illumina']['test2_vcf'], checkIfExists:true) + 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), + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test2.vcf', checkIfExists: true) ] - input[1] = file(params.test_data['homo_sapiens']['genome']['vcfanno_toml'], checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/vcfanno/vcfanno.toml', checkIfExists: true) input[2] = [] input[3] = [ file("https://github.com/brentp/vcfanno/raw/master/example/exac.vcf.gz", checkIfExists: true), diff --git a/nextflow.config b/nextflow.config index 603d9091..4346d485 100644 --- a/nextflow.config +++ b/nextflow.config @@ -12,6 +12,7 @@ params { // Input options input = null ped = null + watchdir = null // Pipeline specific parameters scatter_count = 40 @@ -78,10 +79,10 @@ params { // References cmgg_config_base = "/conf/" igenomes_base = null //'s3://ngi-igenomes/igenomes' - igenomes_ignore = true + igenomes_ignore = false genome = "GRCh38" genomes_base = "/references/" - genomes_ignore = false + genomes_ignore = true // Boilerplate options outdir = null @@ -103,12 +104,6 @@ params { config_profile_contact = null config_profile_url = null - // Max resource options - // Defaults only, expecting to be overwritten - max_memory = '128.GB' - max_cpus = 16 - max_time = '240.h' - // Schema validation default options validate_params = true @@ -118,22 +113,10 @@ params { includeConfig 'conf/base.config' // Load nf-core custom profiles from different Institutions -try { - includeConfig "${params.custom_config_base}/nfcore_custom.config" -} catch (Exception e) { - System.err.println("WARNING: Could not load nf-core/config profiles: ${params.custom_config_base}/nfcore_custom.config") -} - -// Load nf-cmgg/germline custom profiles from different institutions. -// Warning: Uncomment only if a pipeline-specific institutional config already exists on nf-core/configs! -// try { -// includeConfig "${params.custom_config_base}/pipeline/germline.config" -// } catch (Exception e) { -// System.err.println("WARNING: Could not load nf-core/config/germline profiles: ${params.custom_config_base}/pipeline/germline.config") -// } +includeConfig !System.getenv('NXF_OFFLINE') ? "${params.custom_config_base}/nfcore_custom.config" : "conf/empty.config" // Include test data config -includeConfig 'https://raw.githubusercontent.com/nf-cmgg/test-datasets/main/nf-cmgg-testdata.config' +includeConfig !System.getenv('NXF_OFFLINE') ? 'https://raw.githubusercontent.com/nf-cmgg/test-datasets/main/nf-cmgg-testdata.config' : "conf/empty.config" profiles { debug { @@ -149,7 +132,6 @@ profiles { podman.enabled = false shifter.enabled = false charliecloud.enabled = false - conda.channels = ['conda-forge', 'bioconda', 'defaults'] apptainer.enabled = false } mamba { @@ -254,7 +236,7 @@ singularity.registry = 'quay.io' // Nextflow plugins plugins { - id 'nf-schema@2.0.0' // Validation of pipeline parameters and creation of an input channel from a sample sheet + id 'nf-schema@2.1.0' // Validation of pipeline parameters and creation of an input channel from a sample sheet } validation { @@ -262,16 +244,16 @@ validation { lenientMode = false defaultIgnoreParams = ['genomes','igenomes_base','test_data'] showHiddenParams = false + help { + enabled = true + //beforeText = TODO + //afterText = TODO + command = "nextflow run nf-cmgg/germline -profile docker --input --outdir " + } } -// Load igenomes.config if required -if (!params.igenomes_ignore) { - includeConfig "conf/igenomes.config" -} else if (!params.genomes_ignore){ - includeConfig "https://raw.githubusercontent.com/nf-cmgg/configs/main/conf/Hsapiens/genomes.config" -} else { - params.genomes = [:] -} +includeConfig !params.igenomes_ignore ? "conf/igenomes.config" : !params.genomes_ignore ? "https://raw.githubusercontent.com/nf-cmgg/configs/main/conf/Hsapiens/genomes.config" : "conf/empty_genomes.config" + // Export these variables to prevent local Python/R libraries from conflicting with those in the container // The JULIA depot path has been adjusted to a fixed path `/usr/local/share/julia` that needs to be used for packages in the container. // See https://apeltzer.github.io/post/03-julia-lang-nextflow/ for details on that. Once we have a common agreement on where to keep Julia packages, this is adjustable. @@ -289,22 +271,21 @@ process.shell = ['/bin/bash', '-euo', 'pipefail'] // Disable process selector warnings by default. Use debug profile to enable warnings. nextflow.enable.configProcessNamesValidation = false -def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss') timeline { enabled = true - file = "${params.outdir}/pipeline_info/execution_timeline_${trace_timestamp}.html" + file = "${params.outdir}/pipeline_info/execution_timeline_${new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')}.html" } report { enabled = true - file = "${params.outdir}/pipeline_info/execution_report_${trace_timestamp}.html" + file = timeline.file.replace("timeline", "report") } trace { enabled = true - file = "${params.outdir}/pipeline_info/execution_trace_${trace_timestamp}.txt" + file = timeline.file.replace("timeline", "trace") } dag { enabled = true - file = "${params.outdir}/pipeline_info/pipeline_dag_${trace_timestamp}.html" + file = timeline.file.replace("execution_timeline", "pipeline_dag") } manifest { @@ -313,43 +294,10 @@ manifest { homePage = 'https://github.com/nf-cmgg/germline' description = """A nextflow pipeline for calling and annotating small germline variants from short DNA reads for WES and WGS data""" mainScript = 'main.nf' - nextflowVersion = '!>=23.10.0' - version = '1.7.0' + nextflowVersion = '!>=24.04.0' + version = '1.8.0' doi = '' } // Load modules.config for DSL2 module specific options includeConfig 'conf/modules.config' - -// Function to ensure that resource requirements don't go beyond -// a maximum limit -def check_max(obj, type) { - if (type == 'memory') { - try { - if (obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1) - return params.max_memory as nextflow.util.MemoryUnit - else - return obj - } catch (all) { - println " ### ERROR ### Max memory '${params.max_memory}' is not valid! Using default value: $obj" - return obj - } - } else if (type == 'time') { - try { - if (obj.compareTo(params.max_time as nextflow.util.Duration) == 1) - return params.max_time as nextflow.util.Duration - else - return obj - } catch (all) { - println " ### ERROR ### Max time '${params.max_time}' is not valid! Using default value: $obj" - return obj - } - } else if (type == 'cpus') { - try { - return Math.min( obj, params.max_cpus as int ) - } catch (all) { - println " ### ERROR ### Max cpus '${params.max_cpus}' is not valid! Using default value: $obj" - return obj - } - } -} diff --git a/nextflow_schema.json b/nextflow_schema.json index fb6d0551..31c7b78e 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -2,9 +2,9 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/nf-cmgg/germline/master/nextflow_schema.json", "title": "nf-cmgg/germline pipeline parameters", - "description": "A nextflow pipeline for calling and annotating variants", + "description": "A nextflow pipeline for calling and annotating small germline variants from short DNA reads for WES and WGS data", "type": "object", - "defs": { + "$defs": { "input_output_options": { "title": "Input/output options", "type": "object", @@ -28,6 +28,12 @@ "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" }, + "watchdir": { + "type": "string", + "format": "directory-path", + "description": "A folder to watch for the creation of files that start with `watch:` in the samplesheet", + "fa_icon": "fas fa-folder-open" + }, "email": { "type": "string", "description": "Email address for completion summary.", @@ -126,8 +132,7 @@ "description": "Do not load the iGenomes reference config.", "fa_icon": "fas fa-ban", "hidden": true, - "help_text": "Do not load `igenomes.config` when running the pipeline. You may choose this option if you observe clashes between custom parameters and those supplied in `igenomes.config`.", - "default": true + "help_text": "Do not load `igenomes.config` when running the pipeline. You may choose this option if you observe clashes between custom parameters and those supplied in `igenomes.config`." } }, "required": ["fasta"] @@ -348,41 +353,6 @@ } } }, - "max_job_request_options": { - "title": "Max job request options", - "type": "object", - "fa_icon": "fab fa-acquisitions-incorporated", - "description": "Set the top limit for requested resources for any single job.", - "help_text": "If you are running on a smaller system, a pipeline step requesting more resources than are available may cause the Nextflow to stop the run with an error. These options allow you to cap the maximum resources requested by any single job so that the pipeline will run on your system.\n\nNote that you can not _increase_ the resources requested by any job using these options. For that you will need your own configuration file. See [the nf-core website](https://nf-co.re/usage/configuration) for details.", - "properties": { - "max_cpus": { - "type": "integer", - "description": "Maximum number of CPUs that can be requested for any single job.", - "default": 16, - "fa_icon": "fas fa-microchip", - "hidden": true, - "help_text": "Use to set an upper-limit for the CPU requirement for each process. Should be an integer e.g. `--max_cpus 1`" - }, - "max_memory": { - "type": "string", - "description": "Maximum amount of memory that can be requested for any single job.", - "default": "128.GB", - "fa_icon": "fas fa-memory", - "pattern": "^\\d+(\\.\\d+)?\\.?\\s*(K|M|G|T)?B$", - "hidden": true, - "help_text": "Use to set an upper-limit for the memory requirement for each process. Should be a string in the format integer-unit e.g. `--max_memory '8.GB'`" - }, - "max_time": { - "type": "string", - "description": "Maximum amount of time that can be requested for any single job.", - "default": "240.h", - "fa_icon": "far fa-clock", - "pattern": "^(\\d+\\.?\\s*(s|m|h|d|day)\\s*)+$", - "hidden": true, - "help_text": "Use to set an upper-limit for the time requirement for each process. Should be a string in the format integer-unit e.g. `--max_time '2.h'`" - } - } - }, "generic_options": { "title": "Generic options", "type": "object", @@ -676,25 +646,22 @@ }, "allOf": [ { - "$ref": "#/defs/input_output_options" - }, - { - "$ref": "#/defs/reference_genome_options" + "$ref": "#/$defs/input_output_options" }, { - "$ref": "#/defs/pipeline_specific_parameters" + "$ref": "#/$defs/reference_genome_options" }, { - "$ref": "#/defs/institutional_config_options" + "$ref": "#/$defs/pipeline_specific_parameters" }, { - "$ref": "#/defs/max_job_request_options" + "$ref": "#/$defs/institutional_config_options" }, { - "$ref": "#/defs/generic_options" + "$ref": "#/$defs/generic_options" }, { - "$ref": "#/defs/annotation_parameters" + "$ref": "#/$defs/annotation_parameters" } ] } diff --git a/subworkflows/local/cram_call_gatk4/main.nf b/subworkflows/local/cram_call_gatk4/main.nf index 475903d9..308b69f0 100644 --- a/subworkflows/local/cram_call_gatk4/main.nf +++ b/subworkflows/local/cram_call_gatk4/main.nf @@ -27,6 +27,7 @@ workflow CRAM_CALL_GATK4 { // Generate DRAGSTR models (if --dragstr is specified) // + ch_cram_models = Channel.empty() if (dragstr) { ch_input @@ -43,10 +44,10 @@ workflow CRAM_CALL_GATK4 { GATK4_CALIBRATEDRAGSTRMODEL( ch_dragstr_input.map { meta, cram, crai, beds -> [ meta, cram, crai ] }, - ch_fasta.map { it[1] }, - ch_fai.map { it[1] }, - ch_dict.map { it[1] }, - ch_strtablefile.map { it[1] } + ch_fasta.map { meta, fasta -> fasta }, + ch_fai.map { meta, fai -> fai }, + ch_dict.map { meta, dict -> dict }, + ch_strtablefile.map { meta, str -> str } ) ch_versions = ch_versions.mix(GATK4_CALIBRATEDRAGSTRMODEL.out.versions.first()) @@ -98,10 +99,11 @@ workflow CRAM_CALL_GATK4 { ) ch_versions = ch_versions.mix(BCFTOOLS_STATS_SINGLE.out.versions.first()) - emit: - gvcfs = VCF_CONCAT_BCFTOOLS.out.vcfs // channel: [ val(meta), path(vcf), path(tbi) ] + reports = BCFTOOLS_STATS_SINGLE.out.stats.collect{ meta, report -> report} - reports = BCFTOOLS_STATS_SINGLE.out.stats.collect{it[1]} // channel: [ path(stats) ] - versions = ch_versions // channel: [ versions.yml ] + emit: + gvcfs = VCF_CONCAT_BCFTOOLS.out.vcfs // channel: [ val(meta), path(vcf), path(tbi) ] + reports // channel: [ path(stats) ] + versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/cram_call_vardictjava/main.nf b/subworkflows/local/cram_call_vardictjava/main.nf index c75a4495..203bdc7c 100644 --- a/subworkflows/local/cram_call_vardictjava/main.nf +++ b/subworkflows/local/cram_call_vardictjava/main.nf @@ -1,6 +1,6 @@ include { SAMTOOLS_CONVERT } from '../../../modules/nf-core/samtools/convert/main' include { VARDICTJAVA } from '../../../modules/nf-core/vardictjava/main' -include { TABIX_BGZIPTABIX as TABIX_SPLIT } from '../../../modules/nf-core/tabix/bgziptabix/main' +include { TABIX_TABIX as TABIX_SPLIT } from '../../../modules/nf-core/tabix/tabix/main' include { TABIX_BGZIPTABIX as TABIX_VCFANNO } from '../../../modules/nf-core/tabix/bgziptabix/main' include { BCFTOOLS_REHEADER } from '../../../modules/nf-core/bcftools/reheader/main' include { VCFANNO } from '../../../modules/nf-core/vcfanno/main' @@ -52,7 +52,7 @@ workflow CRAM_CALL_VARDICTJAVA { .set { ch_vardict_crams } ch_cram_bam.bam - .mix(SAMTOOLS_CONVERT.out.alignment_index) + .mix(SAMTOOLS_CONVERT.out.bam.join(SAMTOOLS_CONVERT.out.bai, failOnMismatch:true, failOnDuplicate:true)) .combine(ch_vardict_crams, by:0) .map { meta, bam, bai, cram, crai, bed, split_count -> def new_meta = meta + [id:bed.baseName, split_count:split_count] @@ -73,14 +73,15 @@ workflow CRAM_CALL_VARDICTJAVA { ch_versions = ch_versions.mix(TABIX_SPLIT.out.versions.first()) VCF_CONCAT_BCFTOOLS( - TABIX_SPLIT.out.gz_tbi, + VARDICTJAVA.out.vcf.join(TABIX_SPLIT.out.tbi, failOnMismatch:true, failOnDuplicate:true), false ) ch_versions = ch_versions.mix(VCF_CONCAT_BCFTOOLS.out.versions) - if(ch_dbsnp) { + ch_dbsnp_annotated = Channel.empty() + if(ch_dbsnp != [[],[]]) { ch_dbsnp - .map { [ get_vcfanno_config(it[0]) ] } + .map { meta, dbsnp -> [ get_vcfanno_config(dbsnp) ] } .collect() .set { ch_vcfanno_toml } diff --git a/subworkflows/local/cram_prepare_samtools_bedtools/main.nf b/subworkflows/local/cram_prepare_samtools_bedtools/main.nf index 32353a29..94e24a7c 100644 --- a/subworkflows/local/cram_prepare_samtools_bedtools/main.nf +++ b/subworkflows/local/cram_prepare_samtools_bedtools/main.nf @@ -31,15 +31,16 @@ workflow CRAM_PREPARE_SAMTOOLS_BEDTOOLS { // ch_crams - .groupTuple() // No size needed here because this runs before any process - .branch( - { meta, cram, crai -> - multiple: cram.size() > 1 - return [meta, cram] - single: cram.size() == 1 - return [meta, cram[0], crai[0]] - } - ) + .map { meta, cram, crai -> + [ groupKey(meta, meta.duplicate_count), cram, crai] + } + .groupTuple() + .branch { meta, cram, crai -> + multiple: cram.size() > 1 + return [meta.target, cram] + single: cram.size() == 1 + return [meta.target, cram[0], crai[0]] + } .set { ch_cram_branch } ch_cram_branch.multiple.dump(tag:'cram_branch_multiple', pretty:true) @@ -85,7 +86,10 @@ workflow CRAM_PREPARE_SAMTOOLS_BEDTOOLS { // ch_roi - .groupTuple() // A specified size isn't needed here since this runs before any process using ROI files is executed + .map { meta, roi -> + [ groupKey(meta, meta.duplicate_count), roi ] + } + .groupTuple() .branch { meta, roi -> // Determine whether there is an ROI file given to the current sample // It's possible that a sample is given multiple times in the samplesheet, in which @@ -93,16 +97,16 @@ workflow CRAM_PREPARE_SAMTOOLS_BEDTOOLS { // sample contains an ROI file def is_present = false def output_roi = [] - for( entry : roi) { + roi.each { entry -> if(entry != []){ output_roi.add(entry) is_present = true } } found: is_present - return [ meta, output_roi ] + return [ meta.target, output_roi ] missing: !is_present - return [ meta, [] ] + return [ meta.target, [] ] } .set { ch_roi_branch } @@ -114,18 +118,24 @@ workflow CRAM_PREPARE_SAMTOOLS_BEDTOOLS { // Add the default ROI file to all samples without an ROI file // if an ROI BED file has been given through the --roi parameter + ch_missing_rois = Channel.empty() if (ch_default_roi) { MERGE_ROI_PARAMS( - ch_default_roi.map { [[id:"default_roi"], it]}, + ch_default_roi.map { bed -> + [[id:"default_roi"], bed] + }, ch_fai ) ch_versions = ch_versions.mix(MERGE_ROI_PARAMS.out.versions) ch_roi_branch.missing - .groupTuple() // A specified size isn't needed here since this runs before any process using the default ROI file is executed - .combine(MERGE_ROI_PARAMS.out.bed.map { it[1] }) + .map { meta, bed -> + [ groupKey(meta, meta.duplicate_count), bed ] + } + .groupTuple() + .combine(MERGE_ROI_PARAMS.out.bed.map { meta, bed -> bed }) .map { meta, missing, default_roi -> - [ meta, default_roi ] + [ meta.target, default_roi ] } .set { ch_missing_rois } } else { diff --git a/subworkflows/local/gvcf_joint_genotype_gatk4/main.nf b/subworkflows/local/gvcf_joint_genotype_gatk4/main.nf index d2aa1d96..c9114b75 100644 --- a/subworkflows/local/gvcf_joint_genotype_gatk4/main.nf +++ b/subworkflows/local/gvcf_joint_genotype_gatk4/main.nf @@ -47,20 +47,11 @@ workflow GVCF_JOINT_GENOTYPE_GATK4 { ch_gvcfs .map { meta, gvcf, tbi -> // Create the family meta - def new_meta = [ - family: meta.family, - id: meta.family, - family_count: meta.family_count, - caller: meta.caller - ] - [ groupKey(new_meta, meta.family_count.toInteger()), gvcf, tbi, meta.sample ] + def new_meta = meta.subMap(["family", "family_samples", "caller"]) + [id:meta.family] + [ groupKey(new_meta, meta.family_samples.tokenize(",").size()), gvcf, tbi ] } .groupTuple() - .map { meta, gvcf, tbi, samples -> - def new_meta = meta + [samples: "${samples.sort(false).join(',')}"] // Having a comma-separated string ensures that joins don't fail - [ new_meta, gvcf, tbi ] - } - .combine(GAWK.out.output.map { it[1] }) + .combine(GAWK.out.output.map { meta, bed -> bed }) .map { meta, gvcfs, tbis, bed -> [ meta, gvcfs, tbis, bed, [], [] ] } @@ -87,19 +78,10 @@ workflow GVCF_JOINT_GENOTYPE_GATK4 { BCFTOOLS_QUERY.out.output .map { meta, bed -> // Create the family meta - def new_meta = [ - family: meta.family, - id: meta.family, - family_count: meta.family_count, - caller: meta.caller - ] - [ groupKey(new_meta, meta.family_count.toInteger()), bed, meta.sample ] + def new_meta = meta.subMap(["family", "family_samples", "caller"]) + [id:meta.family] + [ groupKey(new_meta, meta.family_samples.tokenize(",").size()), bed ] } .groupTuple() - .map { meta, bed, samples -> - def new_meta = meta + [samples: "${samples.sort(false).join(',')}"] // Having a comma-separated string ensures that joins don't fail - [ new_meta, bed ] - } .dump(tag:'merge_beds_input', pretty: true) .set { ch_merge_beds_input } @@ -116,7 +98,7 @@ workflow GVCF_JOINT_GENOTYPE_GATK4 { INPUT_SPLIT_BEDTOOLS( MERGE_BEDS.out.bed.map { meta, bed -> // Multiply the scatter count by the family size to better scatter big families - [meta, bed, (params.scatter_count * meta.family_count)] + [meta, bed, (scatter_count * meta.family_samples.tokenize(",").size())] }, GATK4_GENOMICSDBIMPORT.out.genomicsdb.map { meta, genomicsdb -> [ meta, genomicsdb, [] ]} ) @@ -134,9 +116,9 @@ workflow GVCF_JOINT_GENOTYPE_GATK4 { GATK4_GENOTYPEGVCFS( ch_genotypegvcfs_input, - ch_fasta.map { it[1] }, - ch_fai.map { it[1] }, - ch_dict.map { it[1] }, + ch_fasta, + ch_fai, + ch_dict, ch_dbsnp, ch_dbsnp_tbi ) diff --git a/subworkflows/local/input_split_bedtools/main.nf b/subworkflows/local/input_split_bedtools/main.nf index 54d76f54..b70140b5 100644 --- a/subworkflows/local/input_split_bedtools/main.nf +++ b/subworkflows/local/input_split_bedtools/main.nf @@ -35,6 +35,6 @@ workflow INPUT_SPLIT_BEDTOOLS { .set { ch_split_output } emit: - split = ch_split_output // channel: [ val(meta), path(input), path(input_index), path(bed) ] - versions = ch_versions // channel: [ versions.yml ] + split = ch_split_output // channel: [ val(meta), path(input), path(input_index), path(bed) ] + versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/utils_cmgg_germline_pipeline/main.nf b/subworkflows/local/utils_cmgg_germline_pipeline/main.nf index 232d17b5..6124181e 100644 --- a/subworkflows/local/utils_cmgg_germline_pipeline/main.nf +++ b/subworkflows/local/utils_cmgg_germline_pipeline/main.nf @@ -8,17 +8,14 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { UTILS_NFVALIDATION_PLUGIN } from '../../nf-core/utils_nfvalidation_plugin' +include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin' include { paramsSummaryMap } from 'plugin/nf-schema' -include { samplesheetToList } from 'plugin/nf-schema' include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline' include { completionEmail } from '../../nf-core/utils_nfcore_pipeline' include { completionSummary } from '../../nf-core/utils_nfcore_pipeline' -include { dashedLine } from '../../nf-core/utils_nfcore_pipeline' -include { nfCoreLogo } from '../../nf-core/utils_nfcore_pipeline' include { imNotification } from '../../nf-core/utils_nfcore_pipeline' include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline' -include { workflowCitation } from '../../nf-core/utils_nfcore_pipeline' +include { WATCHPATH_HANDLING } from '../watchpath_handling' /* ======================================================================================== @@ -36,6 +33,10 @@ workflow PIPELINE_INITIALISATION { nextflow_cli_args // array: List of positional nextflow CLI args outdir // string: The output directory where the results will be saved input // string: Path to input samplesheet + pedFile // string: Path to the common PED file + genomesMap // map: A map structure containing the references for each genome + genome // string: The genome to use + watchdir // string: The path to watch for input files main: @@ -54,16 +55,10 @@ workflow PIPELINE_INITIALISATION { // // Validate parameters and generate parameter summary to stdout // - pre_help_text = nfCoreLogo(monochrome_logs) - post_help_text = '\n' + workflowCitation() + '\n' + dashedLine(monochrome_logs) - def String workflow_command = "nextflow run ${workflow.manifest.name} -profile --input samplesheet.csv --outdir " - UTILS_NFVALIDATION_PLUGIN ( - help, - workflow_command, - pre_help_text, - post_help_text, + UTILS_NFSCHEMA_PLUGIN ( + workflow, validate_params, - "nextflow_schema.json" + null ) // @@ -75,46 +70,24 @@ workflow PIPELINE_INITIALISATION { // // Custom validation for pipeline parameters // - validateInputParameters() + validateInputParameters(genomesMap, genome) // // Create channel from input file provided through params.input // - // Output the samplesheet - file(params.input).copyTo("${params.outdir}/samplesheet.csv") - - def Pedigree pedigree = new Pedigree(params.ped) + WATCHPATH_HANDLING( + input, + watchdir, + "assets/schema_input.json", + pedFile + ) - def List samplesheetList = samplesheetToList(params.input, "assets/schema_input.json") - samplesheetList.each { - ped = it[6] - if(ped) { pedigree.addPedContent(ped) } - } - GlobalVariables.pedFiles = pedigree.writePeds(workflow) - - Channel.fromList(samplesheetList) - .map { meta, cram, crai, gvcf, tbi, roi, ped, truth_vcf, truth_tbi, truth_bed -> - // Infer the family ID from the PED file if no family ID was given. - // If no PED is given, use the sample ID as family ID - def new_meta = meta + [ - family: meta.family ?: pedigree.getFamily(meta.sample) - ] - [ new_meta, cram, crai, gvcf, tbi, roi, truth_vcf, truth_tbi, truth_bed ] - } - .tap { ch_raw_inputs } - .map { [ "id":it[0].id, "family":it[0].family ] } - .reduce([:]) { families, v -> - // Count the unique samples in one family - families[v.family] = families[v.family] ? families[v.family] + [v.id] : [v.id] - families[v.family] = families[v.family].unique() - families - } - .combine(ch_raw_inputs) - .set { ch_samplesheet } + // Output the samplesheet + file(input).copyTo("${outdir}/samplesheet.csv") emit: - samplesheet = ch_samplesheet + samplesheet = WATCHPATH_HANDLING.out.samplesheet versions = ch_versions } @@ -167,17 +140,17 @@ workflow PIPELINE_COMPLETION { // // Check and validate pipeline parameters // -def validateInputParameters() { - genomeExistsError() +def validateInputParameters(genomesMap, genome) { + genomeExistsError(genomesMap, genome) } // // Get attribute from genome config file e.g. fasta // -def getGenomeAttribute(attribute) { - if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) { - if (params.genomes[ params.genome ].containsKey(attribute)) { - return params.genomes[ params.genome ][ attribute ] +def getGenomeAttribute(attribute, genomesMap, genome) { + if (genomesMap && genome && genomesMap.containsKey(genome)) { + if (genomesMap[ genome ].containsKey(attribute)) { + return genomesMap[ genome ][ attribute ] } } return null @@ -186,12 +159,12 @@ def getGenomeAttribute(attribute) { // // Exit pipeline if incorrect --genome key provided // -def genomeExistsError() { - if (params.genomes && params.genome && !params.genomes.containsKey(params.genome)) { +def genomeExistsError(genomesMap, genome) { + if (genomesMap && genome && !genomesMap.containsKey(genome)) { def error_string = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + - " Genome '${params.genome}' not found in any config files provided to the pipeline.\n" + + " Genome '${genome}' not found in any config files provided to the pipeline.\n" + " Currently, the available genome keys are:\n" + - " ${params.genomes.keySet().join(", ")}\n" + + " ${genomesMap.keySet().join(", ")}\n" + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" error(error_string) } @@ -231,8 +204,10 @@ def methodsDescriptionText(mqc_methods_yaml) { // Removing `https://doi.org/` to handle pipelines using DOIs vs DOI resolvers // Removing ` ` since the manifest.doi is a string and not a proper list def temp_doi_ref = "" - String[] manifest_doi = meta.manifest_map.doi.tokenize(",") - for (String doi_ref: manifest_doi) temp_doi_ref += "(doi: ${doi_ref.replace("https://doi.org/", "").replace(" ", "")}), " + def manifest_doi = meta.manifest_map.doi.tokenize(",") + manifest_doi.each { doi_ref -> + temp_doi_ref += "(doi: ${doi_ref.replace("https://doi.org/", "").replace(" ", "")}), " + } meta["doi_text"] = temp_doi_ref.substring(0, temp_doi_ref.length() - 2) } else meta["doi_text"] = "" meta["nodoi_text"] = meta.manifest_map.doi ? "" : "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " diff --git a/subworkflows/local/vcf_concat_bcftools/main.nf b/subworkflows/local/vcf_concat_bcftools/main.nf index 47fdc8cb..c88aebe8 100644 --- a/subworkflows/local/vcf_concat_bcftools/main.nf +++ b/subworkflows/local/vcf_concat_bcftools/main.nf @@ -27,6 +27,7 @@ workflow VCF_CONCAT_BCFTOOLS { ) ch_versions = ch_versions.mix(BCFTOOLS_CONCAT.out.versions.first()) + ch_vcf_tbi = Channel.empty() if(val_tabix) { TABIX_TABIX( BCFTOOLS_CONCAT.out.vcf diff --git a/subworkflows/local/vcf_extract_relate_somalier/main.nf b/subworkflows/local/vcf_extract_relate_somalier/main.nf index 7b09bbfd..d78e4915 100644 --- a/subworkflows/local/vcf_extract_relate_somalier/main.nf +++ b/subworkflows/local/vcf_extract_relate_somalier/main.nf @@ -4,9 +4,9 @@ include { SOMALIER_RELATE } from '../../../modules/nf-core/somalier/relate/main workflow VCF_EXTRACT_RELATE_SOMALIER { take: ch_vcfs // channel: [mandatory] [ val(meta), path(vcf), path(tbi) ] - ch_fasta // channel: [mandatory] [ path(fasta) ] - ch_fasta_fai // channel: [mandatory] [ path(fai) ] - ch_somalier_sites // channel: [mandatory] [ path(somalier_sites_vcf) ] + ch_fasta // channel: [mandatory] [ val(meta), path(fasta) ] + ch_fasta_fai // channel: [mandatory] [ val(meta), path(fai) ] + ch_somalier_sites // channel: [mandatory] [ val(meta), path(somalier_sites_vcf) ] ch_peds // channel: [mandatory] [ val(meta), path(ped) ] main: diff --git a/subworkflows/local/vcf_filter_bcftools/main.nf b/subworkflows/local/vcf_filter_bcftools/main.nf index 6b3ef9d9..5b397d6c 100644 --- a/subworkflows/local/vcf_filter_bcftools/main.nf +++ b/subworkflows/local/vcf_filter_bcftools/main.nf @@ -25,6 +25,7 @@ workflow VCF_FILTER_BCFTOOLS { ) ch_versions = ch_versions.mix(FILTER_2.out.versions.first()) + ch_filter_vcfs = Channel.empty() if(val_tabix) { TABIX_TABIX( FILTER_2.out.vcf diff --git a/subworkflows/local/vcf_roh_automap/main.nf b/subworkflows/local/vcf_roh_automap/main.nf index 71fef123..24998f31 100644 --- a/subworkflows/local/vcf_roh_automap/main.nf +++ b/subworkflows/local/vcf_roh_automap/main.nf @@ -22,6 +22,7 @@ workflow VCF_ROH_AUTOMAP { } // Merge the repeat BED files from the container if no container has been given + ch_valid_repeats = Channel.empty() if (!ch_repeats) { AUTOMAP_REPEATS( Channel.value([[id:"${val_genome}_repeats"], val_genome]) diff --git a/subworkflows/local/vcf_upd_updio/main.nf b/subworkflows/local/vcf_upd_updio/main.nf index 19a37e37..c7c96d2a 100644 --- a/subworkflows/local/vcf_upd_updio/main.nf +++ b/subworkflows/local/vcf_upd_updio/main.nf @@ -16,24 +16,30 @@ workflow VCF_UPD_UPDIO { // Filter out all families that have less than 3 samples ch_vcfs - .filter { it[0].family_count >= 3 } + .filter { meta, vcf, tbi -> + meta.family_samples.tokenize(",").size() >= 3 + } .set { ch_trio_vcfs } ch_peds - .filter { it[0].family_count >= 3 } + .filter { meta, ped -> + meta.family_samples.tokenize(",").size() >= 3 + } .set { ch_trio_peds } CustomChannelOperators.joinOnKeys( [failOnDuplicate:true, failOnMismatch:true], ch_trio_vcfs, ch_trio_peds, - ["id", "family", "family_count", "caller"] + ["id", "family", "family_samples", "caller"] ) .map { meta, vcf, tbi, ped -> def meta_list = get_family_data_from_ped(meta, ped) [ meta_list, vcf, tbi ] } - .filter { it[0] } + .filter { meta, vcf, tbi -> + meta + } .transpose(by:0) .set { ch_trio_vcfs_family } diff --git a/subworkflows/local/vcf_validate_small_variants/main.nf b/subworkflows/local/vcf_validate_small_variants/main.nf index 71432d38..63ca83fd 100644 --- a/subworkflows/local/vcf_validate_small_variants/main.nf +++ b/subworkflows/local/vcf_validate_small_variants/main.nf @@ -1,6 +1,5 @@ include { RTGTOOLS_VCFEVAL } from '../../../modules/nf-core/rtgtools/vcfeval/main' include { RTGTOOLS_ROCPLOT } from '../../../modules/nf-core/rtgtools/rocplot/main' -include { HAPPY_HAPPY } from '../../../modules/nf-core/happy/happy/main' workflow VCF_VALIDATE_SMALL_VARIANTS { @@ -10,157 +9,81 @@ workflow VCF_VALIDATE_SMALL_VARIANTS { ch_fasta // [happy only] channel: [ meta, fasta ] ch_fasta_fai // [happy only] channel: [ meta, fasta_fai ] ch_vcfeval_sdf // [vcfeval only] channel: [ meta, sdf ] - ch_happy_false_positive_regions // [optional] channel: [ meta, false_positives_bed ] - ch_happy_stratification_tsv // [optional] channel: [ meta, stratification_tsv ] - ch_happy_stratification_beds // [optional] channel: [ meta, [stratification_beds] ] - tools // [mandatory] value: A comma-delimited list of the tools to use for validation (happy,vcfeval,jaccard) main: ch_versions = Channel.empty() - happy_vcf = Channel.empty() - happy_tbi = Channel.empty() - happy_indel_roc = Channel.empty() - happy_indel_roc_pass = Channel.empty() - happy_snp_roc = Channel.empty() - happy_snp_roc_pass = Channel.empty() - happy_roc = Channel.empty() - happy_summary = Channel.empty() - happy_extended_csv = Channel.empty() - - vcfeval_true_positive_vcf = Channel.empty() - vcfeval_true_positive_vcf_tbi = Channel.empty() - vcfeval_false_negative_vcf = Channel.empty() - vcfeval_false_negative_vcf_tbi = Channel.empty() - vcfeval_false_positive_vcf = Channel.empty() - vcfeval_false_positive_vcf_tbi = Channel.empty() - vcfeval_true_positive_baseline_vcf = Channel.empty() - vcfeval_true_positive_baseline_vcf_tbi = Channel.empty() - vcfeval_summary = Channel.empty() - vcfeval_phasing = Channel.empty() - vcfeval_snp_roc = Channel.empty() - vcfeval_non_snp_roc = Channel.empty() - vcfeval_weighted_roc = Channel.empty() - - rtgtools_snp_png_rocplot = Channel.empty() - rtgtools_non_snp_png_rocplot = Channel.empty() - rtgtools_weighted_png_rocplot = Channel.empty() - - rtgtools_snp_svg_rocplot = Channel.empty() - rtgtools_non_snp_svg_rocplot = Channel.empty() - rtgtools_weighted_svg_rocplot = Channel.empty() - - val_list_tools = tools.tokenize(",") - ch_input = ch_vcf.join(ch_beds, failOnDuplicate: true, failOnMismatch: true) - if("happy" in val_list_tools){ - ch_happy_input = ch_input - .map { meta, vcf, tbi, truth_vcf, truth_tbi, regions_bed, targets_bed -> - [ meta, vcf, truth_vcf, regions_bed, targets_bed ] + RTGTOOLS_VCFEVAL( + ch_input, + ch_vcfeval_sdf + ) + ch_versions = ch_versions.mix(RTGTOOLS_VCFEVAL.out.versions.first()) + + ch_rocplot_input = RTGTOOLS_VCFEVAL.out.snp_roc + .map { meta, tsv -> + [ meta + [roc_type:'snp'], tsv ] + } + .mix( + RTGTOOLS_VCFEVAL.out.non_snp_roc.map { meta, tsv -> + [ meta + [roc_type:'non_snp'], tsv ] + }, + RTGTOOLS_VCFEVAL.out.weighted_roc.map { meta, tsv -> + [ meta + [roc_type:'weighted'], tsv ] } - HAPPY_HAPPY ( - ch_happy_input, - ch_fasta, - ch_fasta_fai, - ch_happy_false_positive_regions, - ch_happy_stratification_tsv, - ch_happy_stratification_beds - ) - ch_versions = ch_versions.mix(HAPPY_HAPPY.out.versions.first()) - - happy_vcf = HAPPY_HAPPY.out.vcf - happy_tbi = HAPPY_HAPPY.out.tbi - happy_indel_roc = HAPPY_HAPPY.out.roc_indel_locations_csv - happy_indel_roc_pass = HAPPY_HAPPY.out.roc_indel_locations_pass_csv - happy_snp_roc = HAPPY_HAPPY.out.roc_snp_locations_csv - happy_snp_roc_pass = HAPPY_HAPPY.out.roc_snp_locations_pass_csv - happy_roc = HAPPY_HAPPY.out.roc_all_csv - happy_summary = HAPPY_HAPPY.out.summary_csv - happy_extended_csv = HAPPY_HAPPY.out.extended_csv - } - - if("vcfeval" in val_list_tools){ - RTGTOOLS_VCFEVAL( - ch_input, - ch_vcfeval_sdf ) - ch_versions = ch_versions.mix(RTGTOOLS_VCFEVAL.out.versions.first()) - - ch_rocplot_input = RTGTOOLS_VCFEVAL.out.snp_roc - .map { meta, tsv -> - [ meta + [roc_type:'snp'], tsv ] - } - .mix( - RTGTOOLS_VCFEVAL.out.non_snp_roc.map { meta, tsv -> - [ meta + [roc_type:'non_snp'], tsv ] - }, - RTGTOOLS_VCFEVAL.out.weighted_roc.map { meta, tsv -> - [ meta + [roc_type:'weighted'], tsv ] - } - ) - - vcfeval_true_positive_vcf = RTGTOOLS_VCFEVAL.out.tp_vcf - vcfeval_true_positive_vcf_tbi = RTGTOOLS_VCFEVAL.out.tp_tbi - vcfeval_false_negative_vcf = RTGTOOLS_VCFEVAL.out.fn_vcf - vcfeval_false_negative_vcf_tbi = RTGTOOLS_VCFEVAL.out.fn_tbi - vcfeval_false_positive_vcf = RTGTOOLS_VCFEVAL.out.fp_vcf - vcfeval_false_positive_vcf_tbi = RTGTOOLS_VCFEVAL.out.fp_tbi - vcfeval_true_positive_baseline_vcf = RTGTOOLS_VCFEVAL.out.baseline_vcf - vcfeval_true_positive_baseline_vcf_tbi = RTGTOOLS_VCFEVAL.out.baseline_tbi - vcfeval_summary = RTGTOOLS_VCFEVAL.out.summary - vcfeval_phasing = RTGTOOLS_VCFEVAL.out.phasing - vcfeval_snp_roc = RTGTOOLS_VCFEVAL.out.snp_roc - vcfeval_non_snp_roc = RTGTOOLS_VCFEVAL.out.non_snp_roc - vcfeval_weighted_roc = RTGTOOLS_VCFEVAL.out.weighted_roc - - RTGTOOLS_ROCPLOT( - ch_rocplot_input - ) - - ch_versions = ch_versions.mix(RTGTOOLS_ROCPLOT.out.versions.first()) - - rocplot_out_png = RTGTOOLS_ROCPLOT.out.png - .branch { meta, png -> - roc_type = meta.roc_type - def new_meta = meta - meta.subMap("roc_type") - snp: roc_type == "snp" - non_snp: roc_type == "non_snp" - weighted: roc_type == "weighted" - } - - rocplot_out_svg = RTGTOOLS_ROCPLOT.out.svg - .branch { meta, svg -> - roc_type = meta.roc_type - def new_meta = meta - meta.subMap("roc_type") - - snp: roc_type == "snp" - non_snp: roc_type == "non_snp" - weighted: roc_type == "weighted" - } - - rtgtools_snp_png_rocplot = rocplot_out_png.snp - rtgtools_non_snp_png_rocplot = rocplot_out_png.non_snp - rtgtools_weighted_png_rocplot = rocplot_out_png.weighted - - rtgtools_snp_svg_rocplot = rocplot_out_svg.snp - rtgtools_non_snp_svg_rocplot = rocplot_out_svg.non_snp - rtgtools_weighted_svg_rocplot = rocplot_out_svg.weighted - } + vcfeval_true_positive_vcf = RTGTOOLS_VCFEVAL.out.tp_vcf + vcfeval_true_positive_vcf_tbi = RTGTOOLS_VCFEVAL.out.tp_tbi + vcfeval_false_negative_vcf = RTGTOOLS_VCFEVAL.out.fn_vcf + vcfeval_false_negative_vcf_tbi = RTGTOOLS_VCFEVAL.out.fn_tbi + vcfeval_false_positive_vcf = RTGTOOLS_VCFEVAL.out.fp_vcf + vcfeval_false_positive_vcf_tbi = RTGTOOLS_VCFEVAL.out.fp_tbi + vcfeval_true_positive_baseline_vcf = RTGTOOLS_VCFEVAL.out.baseline_vcf + vcfeval_true_positive_baseline_vcf_tbi = RTGTOOLS_VCFEVAL.out.baseline_tbi + vcfeval_summary = RTGTOOLS_VCFEVAL.out.summary + vcfeval_phasing = RTGTOOLS_VCFEVAL.out.phasing + vcfeval_snp_roc = RTGTOOLS_VCFEVAL.out.snp_roc + vcfeval_non_snp_roc = RTGTOOLS_VCFEVAL.out.non_snp_roc + vcfeval_weighted_roc = RTGTOOLS_VCFEVAL.out.weighted_roc + + RTGTOOLS_ROCPLOT( + ch_rocplot_input + ) + + ch_versions = ch_versions.mix(RTGTOOLS_ROCPLOT.out.versions.first()) + + rocplot_out_png = RTGTOOLS_ROCPLOT.out.png + .branch { meta, png -> + roc_type = meta.roc_type + def new_meta = meta - meta.subMap("roc_type") + + snp: roc_type == "snp" + non_snp: roc_type == "non_snp" + weighted: roc_type == "weighted" + } + + rocplot_out_svg = RTGTOOLS_ROCPLOT.out.svg + .branch { meta, svg -> + roc_type = meta.roc_type + def new_meta = meta - meta.subMap("roc_type") + + snp: roc_type == "snp" + non_snp: roc_type == "non_snp" + weighted: roc_type == "weighted" + } + + rtgtools_snp_png_rocplot = rocplot_out_png.snp + rtgtools_non_snp_png_rocplot = rocplot_out_png.non_snp + rtgtools_weighted_png_rocplot = rocplot_out_png.weighted + + rtgtools_snp_svg_rocplot = rocplot_out_svg.snp + rtgtools_non_snp_svg_rocplot = rocplot_out_svg.non_snp + rtgtools_weighted_svg_rocplot = rocplot_out_svg.weighted emit: - happy_vcf // channel: [ meta, vcf ] - happy_tbi // channel: [ meta, tbi ] - happy_indel_roc // channel: [ meta, csv ] - happy_indel_roc_pass // channel: [ meta, csv ] - happy_snp_roc // channel: [ meta, csv ] - happy_snp_roc_pass // channel: [ meta, csv ] - happy_roc // channel: [ meta, csv ] - happy_summary // channel: [ meta, csv ] - happy_extended_csv // channel: [ meta, csv ] - vcfeval_true_positive_vcf // channel: [ meta, vcf ] vcfeval_true_positive_vcf_tbi // channel: [ meta, tbi ] vcfeval_false_negative_vcf // channel: [ meta, vcf ] diff --git a/subworkflows/local/watchpath_handling/main.nf b/subworkflows/local/watchpath_handling/main.nf new file mode 100644 index 00000000..eca869b1 --- /dev/null +++ b/subworkflows/local/watchpath_handling/main.nf @@ -0,0 +1,182 @@ +include { samplesheetToList } from 'plugin/nf-schema' + +workflow WATCHPATH_HANDLING { + + take: + input_samplesheet + watchdir + samplesheet_schema + pedFile + + main: + + // A map with entries for every row that expects to be watched + def watch_lines = [:] + + // Initialize a filename for the DONE file + def watch_id = UUID.randomUUID().toString() + def done_file = file("${watchdir}/DONE-${watch_id}") + + // A list containing all expected files + def expected_files = [done_file.name] + + // Initialize samplesheet to keep the linter happy + def ch_samplesheet_watched = Channel.empty() + + // Pedigree handling + def pedigree = new Pedigree(pedFile) + GlobalVariables.pedFiles = pedigree.writePeds(workflow) + + def errors = [] + + def families = [:] + def sample_counts = [:] + def sample_metas = [:] + + // Determine which files to watch for + def samplesheet_list = samplesheetToList(input_samplesheet, samplesheet_schema) + // Do some calculations and manipulations here + .collect { row -> + // Watchpath logic + def is_watch = false + row = row.collect { input -> + def input_name = input instanceof Path ? input.name : input as String + if (input_name.startsWith("watch:")) { + is_watch = true + expected_files.add(input_name.replace("watch:", "")) + return input_name + } + return input + } + if (is_watch) { + watch_lines[row[0].id] = row + if (!watchdir) { + errors.add("Found a `watch:` prefix in the samplesheet for '${row[0].id}', but no watch directory has been set.") + } + } + + // Pipeline logic + def ped = row[6] + if (ped) { + pedigree.addPedContent(ped) + } + def family = row[0].family ?: pedigree.getFamily(row[0].sample) + def sample_id = row[0].id + + if (!families.containsKey(family)) { + families[family] = [sample_id] + } else if(!families[family].contains(sample_id)) { + families[family].add(sample_id) + } + + + if (!sample_counts.containsKey(sample_id)) { + sample_counts[sample_id] = 1 + sample_metas[sample_id] = row[0] + } else { + sample_counts[sample_id] += 1 + if(sample_metas[sample_id] != row[0]) { + def other_meta = sample_metas[sample_id] + def diff_keys = [] + other_meta.each { k,v -> + if (v != row[0][k]) { + diff_keys.add(k) + } + } + errors.add("Found multiple entries for sample '${sample_id}' in the samplesheet with differing meta values (`${diff_keys.join(' ')}`).") + } + } + + def new_meta = row[0] + [family:family] + row[0] = new_meta + row.remove(6) + return row + } + + // Stop the pipeline if extra validation errors have been detected + if (errors.size() > 0) { + error(errors.join("\n")) + } + + Channel.fromList(samplesheet_list).set { ch_samplesheet_all } + + if (watchdir && expected_files.size() > 1) { + + def watchdir_path = file(watchdir) + if (!watchdir_path.exists()) { + // Create the watchdir if it doesn't exist (this is a failsafe) + watchdir_path.mkdir() + } + + // Watch the watchdir for the expected files + Channel.watchPath("${watchdir}**{${expected_files.join(',')}}", "create,modify") + .until { file -> + def file_name = file.name + if (file_name == done_file.name) { + // Delete the done file when it's been detected and stop watching + done_file.delete() + return true + } + return false + } + .map { file -> + // Try to find a matching ID in watch_lines + def id = find_id(file.name, watch_lines) + if (id == "") { + error("Could not find id for file '${file.name}' in the samplesheet.") + } + // Replace the matching watch entry with the file + watch_lines[id] = watch_lines[id].collect { line_entry -> + line_entry == "watch:${file.name}" as String ? file : line_entry + } + return watch_lines[id] + } + .filter { entry -> + def found_all_files = false + if (!entry.any { elem -> elem.toString().startsWith("watch:") }) { + // Remove the entry from watch_files when all files for the current entry have been found + watch_lines.remove(entry[0].id) + found_all_files = true + } + if (watch_lines.size() == 0) { + // Create the DONE file when all files have been found + done_file.text = "" + } + // Pass through all entries where all files have been found + return found_all_files + } + // Mix with all entries that didn't contain any watched files + .mix(ch_samplesheet_all.filter { entry -> !entry.any { elem -> elem.toString().startsWith("watch:") }}) + .set { ch_samplesheet_watched } + + } else { + ch_samplesheet_watched = ch_samplesheet_all + } + + ch_samplesheet_watched + .map { row -> + row[0] = row[0] + [ + family_samples:families[row[0].family].sort(false).join(","), + duplicate_count:sample_counts[row[0].id] + ] + return row + } + .set { samplesheet } + + emit: + samplesheet + +} + +// Find the ID of a file in a map with sample IDs as keys +def find_id(file_name, file_map) { + def lastDotIndex = file_name.lastIndexOf(".") + if (lastDotIndex == -1) { + return "" + } + def id = file_name.substring(0, lastDotIndex) + if (file_map.containsKey(id)) { + return id + } + return find_id(id, file_map) +} diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/main.nf b/subworkflows/nf-core/utils_nextflow_pipeline/main.nf index ac31f28f..28e32b20 100644 --- a/subworkflows/nf-core/utils_nextflow_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nextflow_pipeline/main.nf @@ -2,10 +2,6 @@ // Subworkflow with functionality that may be useful for any Nextflow pipeline // -import org.yaml.snakeyaml.Yaml -import groovy.json.JsonOutput -import nextflow.extension.FilesEx - /* ======================================================================================== SUBWORKFLOW DEFINITION @@ -58,7 +54,7 @@ workflow UTILS_NEXTFLOW_PIPELINE { // Generate version string // def getWorkflowVersion() { - String version_string = "" + def version_string = "" as String if (workflow.manifest.version) { def prefix_v = workflow.manifest.version[0] != 'v' ? 'v' : '' version_string += "${prefix_v}${workflow.manifest.version}" @@ -79,10 +75,10 @@ def dumpParametersToJSON(outdir) { def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss') def filename = "params_${timestamp}.json" def temp_pf = new File(workflow.launchDir.toString(), ".${filename}") - def jsonStr = JsonOutput.toJson(params) - temp_pf.text = JsonOutput.prettyPrint(jsonStr) + def jsonStr = groovy.json.JsonOutput.toJson(params) + temp_pf.text = groovy.json.JsonOutput.prettyPrint(jsonStr) - FilesEx.copyTo(temp_pf.toPath(), "${outdir}/pipeline_info/params_${timestamp}.json") + nextflow.extension.FilesEx.copyTo(temp_pf.toPath(), "${outdir}/pipeline_info/params_${timestamp}.json") temp_pf.delete() } @@ -90,7 +86,7 @@ def dumpParametersToJSON(outdir) { // When running with -profile conda, warn if channels have not been set-up appropriately // def checkCondaChannels() { - Yaml parser = new Yaml() + def parser = new org.yaml.snakeyaml.Yaml() def channels = [] try { def config = parser.load("conda config --show channels".execute().text) @@ -102,14 +98,16 @@ def checkCondaChannels() { // Check that all channels are present // This channel list is ordered by required channel priority. - def required_channels_in_order = ['conda-forge', 'bioconda', 'defaults'] + def required_channels_in_order = ['conda-forge', 'bioconda'] def channels_missing = ((required_channels_in_order as Set) - (channels as Set)) as Boolean // Check that they are in the right order def channel_priority_violation = false - def n = required_channels_in_order.size() - for (int i = 0; i < n - 1; i++) { - channel_priority_violation |= !(channels.indexOf(required_channels_in_order[i]) < channels.indexOf(required_channels_in_order[i+1])) + + required_channels_in_order.eachWithIndex { channel, index -> + if (index < required_channels_in_order.size() - 1) { + channel_priority_violation |= !(channels.indexOf(channel) < channels.indexOf(required_channels_in_order[index+1])) + } } if (channels_missing | channel_priority_violation) { diff --git a/subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config b/subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config index d0a926bf..a09572e5 100644 --- a/subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config +++ b/subworkflows/nf-core/utils_nextflow_pipeline/tests/nextflow.config @@ -3,7 +3,7 @@ manifest { author = """nf-core""" homePage = 'https://127.0.0.1' description = """Dummy pipeline""" - nextflowVersion = '!>=23.04.0' + nextflowVersion = '!>=23.04.0' version = '9.9.9' doi = 'https://doi.org/10.5281/zenodo.5070524' } diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf index 14558c39..cbd8495b 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -2,9 +2,6 @@ // Subworkflow with utility functions specific to the nf-core pipeline template // -import org.yaml.snakeyaml.Yaml -import nextflow.extension.FilesEx - /* ======================================================================================== SUBWORKFLOW DEFINITION @@ -34,7 +31,7 @@ workflow UTILS_NFCORE_PIPELINE { // Warn if a -profile or Nextflow config has not been provided to run the pipeline // def checkConfigProvided() { - valid_config = true + def valid_config = true as Boolean if (workflow.profile == 'standard' && workflow.configFiles.size() <= 1) { log.warn "[$workflow.manifest.name] You are attempting to run the pipeline without any custom configuration!\n\n" + "This will be dependent on your local compute environment but can be achieved via one or more of the following:\n" + @@ -66,11 +63,13 @@ def checkProfileProvided(nextflow_cli_args) { // def workflowCitation() { def temp_doi_ref = "" - String[] manifest_doi = workflow.manifest.doi.tokenize(",") + def manifest_doi = workflow.manifest.doi.tokenize(",") // Using a loop to handle multiple DOIs // Removing `https://doi.org/` to handle pipelines using DOIs vs DOI resolvers // Removing ` ` since the manifest.doi is a string and not a proper list - for (String doi_ref: manifest_doi) temp_doi_ref += " https://doi.org/${doi_ref.replace('https://doi.org/', '').replace(' ', '')}\n" + manifest_doi.each { doi_ref -> + temp_doi_ref += " https://doi.org/${doi_ref.replace('https://doi.org/', '').replace(' ', '')}\n" + } return "If you use ${workflow.manifest.name} for your analysis please cite:\n\n" + "* The pipeline\n" + temp_doi_ref + "\n" + @@ -84,7 +83,7 @@ def workflowCitation() { // Generate workflow version string // def getWorkflowVersion() { - String version_string = "" + def version_string = "" as String if (workflow.manifest.version) { def prefix_v = workflow.manifest.version[0] != 'v' ? 'v' : '' version_string += "${prefix_v}${workflow.manifest.version}" @@ -102,8 +101,8 @@ def getWorkflowVersion() { // Get software versions for pipeline // def processVersionsFromYAML(yaml_file) { - Yaml yaml = new Yaml() - versions = yaml.load(yaml_file).collectEntries { k, v -> [ k.tokenize(':')[-1], v ] } + def yaml = new org.yaml.snakeyaml.Yaml() + def versions = yaml.load(yaml_file).collectEntries { k, v -> [ k.tokenize(':')[-1], v ] } return yaml.dumpAsMap(versions).trim() } @@ -124,7 +123,7 @@ def workflowVersionToYAML() { def softwareVersionsToYAML(ch_versions) { return ch_versions .unique() - .map { processVersionsFromYAML(it) } + .map { version -> processVersionsFromYAML(version) } .unique() .mix(Channel.of(workflowVersionToYAML())) } @@ -134,19 +133,19 @@ def softwareVersionsToYAML(ch_versions) { // def paramsSummaryMultiqc(summary_params) { def summary_section = '' - for (group in summary_params.keySet()) { + summary_params.keySet().each { group -> def group_params = summary_params.get(group) // This gets the parameters of that particular group if (group_params) { summary_section += "

    $group

    \n" summary_section += "
    \n" - for (param in group_params.keySet()) { + group_params.keySet().sort().each { param -> summary_section += "
    $param
    ${group_params.get(param) ?: 'N/A'}
    \n" } summary_section += "
    \n" } } - String yaml_file_text = "id: '${workflow.manifest.name.replace('/','-')}-summary'\n" + def yaml_file_text = "id: '${workflow.manifest.name.replace('/','-')}-summary'\n" as String yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n" yaml_file_text += "section_name: '${workflow.manifest.name} Workflow Summary'\n" yaml_file_text += "section_href: 'https://github.com/${workflow.manifest.name}'\n" @@ -161,7 +160,7 @@ def paramsSummaryMultiqc(summary_params) { // nf-core logo // def nfCoreLogo(monochrome_logs=true) { - Map colors = logColours(monochrome_logs) + def colors = logColours(monochrome_logs) as Map String.format( """\n ${dashedLine(monochrome_logs)} @@ -180,7 +179,7 @@ def nfCoreLogo(monochrome_logs=true) { // Return dashed line // def dashedLine(monochrome_logs=true) { - Map colors = logColours(monochrome_logs) + def colors = logColours(monochrome_logs) as Map return "-${colors.dim}----------------------------------------------------${colors.reset}-" } @@ -188,7 +187,7 @@ def dashedLine(monochrome_logs=true) { // ANSII colours used for terminal logging // def logColours(monochrome_logs=true) { - Map colorcodes = [:] + def colorcodes = [:] as Map // Reset / Meta colorcodes['reset'] = monochrome_logs ? '' : "\033[0m" @@ -287,7 +286,7 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi } def summary = [:] - for (group in summary_params.keySet()) { + summary_params.keySet().sort().each { group -> summary << summary_params[group] } @@ -344,10 +343,10 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi def sendmail_html = sendmail_template.toString() // Send the HTML e-mail - Map colors = logColours(monochrome_logs) + def colors = logColours(monochrome_logs) as Map if (email_address) { try { - if (plaintext_email) { throw GroovyException('Send plaintext e-mail, not HTML') } + if (plaintext_email) { throw new org.codehaus.groovy.GroovyException('Send plaintext e-mail, not HTML') } // Try to send HTML e-mail using sendmail def sendmail_tf = new File(workflow.launchDir.toString(), ".sendmail_tmp.html") sendmail_tf.withWriter { w -> w << sendmail_html } @@ -364,13 +363,13 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi // Write summary e-mail HTML to a file def output_hf = new File(workflow.launchDir.toString(), ".pipeline_report.html") output_hf.withWriter { w -> w << email_html } - FilesEx.copyTo(output_hf.toPath(), "${outdir}/pipeline_info/pipeline_report.html"); + nextflow.extension.FilesEx.copyTo(output_hf.toPath(), "${outdir}/pipeline_info/pipeline_report.html"); output_hf.delete() // Write summary e-mail TXT to a file def output_tf = new File(workflow.launchDir.toString(), ".pipeline_report.txt") output_tf.withWriter { w -> w << email_txt } - FilesEx.copyTo(output_tf.toPath(), "${outdir}/pipeline_info/pipeline_report.txt"); + nextflow.extension.FilesEx.copyTo(output_tf.toPath(), "${outdir}/pipeline_info/pipeline_report.txt"); output_tf.delete() } @@ -378,7 +377,7 @@ def completionEmail(summary_params, email, email_on_fail, plaintext_email, outdi // Print pipeline summary on completion // def completionSummary(monochrome_logs=true) { - Map colors = logColours(monochrome_logs) + def colors = logColours(monochrome_logs) as Map if (workflow.success) { if (workflow.stats.ignoredCount == 0) { log.info "-${colors.purple}[$workflow.manifest.name]${colors.green} Pipeline completed successfully${colors.reset}-" @@ -395,7 +394,7 @@ def completionSummary(monochrome_logs=true) { // def imNotification(summary_params, hook_url) { def summary = [:] - for (group in summary_params.keySet()) { + summary_params.keySet().sort().each { group -> summary << summary_params[group] } diff --git a/subworkflows/nf-core/utils_nfschema_plugin/main.nf b/subworkflows/nf-core/utils_nfschema_plugin/main.nf new file mode 100644 index 00000000..4994303e --- /dev/null +++ b/subworkflows/nf-core/utils_nfschema_plugin/main.nf @@ -0,0 +1,46 @@ +// +// Subworkflow that uses the nf-schema plugin to validate parameters and render the parameter summary +// + +include { paramsSummaryLog } from 'plugin/nf-schema' +include { validateParameters } from 'plugin/nf-schema' + +workflow UTILS_NFSCHEMA_PLUGIN { + + take: + input_workflow // workflow: the workflow object used by nf-schema to get metadata from the workflow + validate_params // boolean: validate the parameters + parameters_schema // string: path to the parameters JSON schema. + // this has to be the same as the schema given to `validation.parametersSchema` + // when this input is empty it will automatically use the configured schema or + // "${projectDir}/nextflow_schema.json" as default. This input should not be empty + // for meta pipelines + + main: + + // + // Print parameter summary to stdout. This will display the parameters + // that differ from the default given in the JSON schema + // + if(parameters_schema) { + log.info paramsSummaryLog(input_workflow, parameters_schema:parameters_schema) + } else { + log.info paramsSummaryLog(input_workflow) + } + + // + // Validate the parameters using nextflow_schema.json or the schema + // given via the validation.parametersSchema configuration option + // + if(validate_params) { + if(parameters_schema) { + validateParameters(parameters_schema:parameters_schema) + } else { + validateParameters() + } + } + + emit: + dummy_emit = true +} + diff --git a/subworkflows/nf-core/utils_nfschema_plugin/meta.yml b/subworkflows/nf-core/utils_nfschema_plugin/meta.yml new file mode 100644 index 00000000..f7d9f028 --- /dev/null +++ b/subworkflows/nf-core/utils_nfschema_plugin/meta.yml @@ -0,0 +1,35 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json +name: "utils_nfschema_plugin" +description: Run nf-schema to validate parameters and create a summary of changed parameters +keywords: + - validation + - JSON schema + - plugin + - parameters + - summary +components: [] +input: + - input_workflow: + type: object + description: | + The workflow object of the used pipeline. + This object contains meta data used to create the params summary log + - validate_params: + type: boolean + description: Validate the parameters and error if invalid. + - parameters_schema: + type: string + description: | + Path to the parameters JSON schema. + This has to be the same as the schema given to the `validation.parametersSchema` config + option. When this input is empty it will automatically use the configured schema or + "${projectDir}/nextflow_schema.json" as default. The schema should not be given in this way + for meta pipelines. +output: + - dummy_emit: + type: boolean + description: Dummy emit to make nf-core subworkflows lint happy +authors: + - "@nvnieuwk" +maintainers: + - "@nvnieuwk" diff --git a/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test b/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test new file mode 100644 index 00000000..842dc432 --- /dev/null +++ b/subworkflows/nf-core/utils_nfschema_plugin/tests/main.nf.test @@ -0,0 +1,117 @@ +nextflow_workflow { + + name "Test Subworkflow UTILS_NFSCHEMA_PLUGIN" + script "../main.nf" + workflow "UTILS_NFSCHEMA_PLUGIN" + + tag "subworkflows" + tag "subworkflows_nfcore" + tag "subworkflows/utils_nfschema_plugin" + tag "plugin/nf-schema" + + config "./nextflow.config" + + test("Should run nothing") { + + when { + + params { + test_data = '' + } + + workflow { + """ + validate_params = false + input[0] = workflow + input[1] = validate_params + input[2] = "" + """ + } + } + + then { + assertAll( + { assert workflow.success } + ) + } + } + + test("Should validate params") { + + when { + + params { + test_data = '' + outdir = 1 + } + + workflow { + """ + validate_params = true + input[0] = workflow + input[1] = validate_params + input[2] = "" + """ + } + } + + then { + assertAll( + { assert workflow.failed }, + { assert workflow.stdout.any { it.contains('ERROR ~ Validation of pipeline parameters failed!') } } + ) + } + } + + test("Should run nothing - custom schema") { + + when { + + params { + test_data = '' + } + + workflow { + """ + validate_params = false + input[0] = workflow + input[1] = validate_params + input[2] = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" + """ + } + } + + then { + assertAll( + { assert workflow.success } + ) + } + } + + test("Should validate params - custom schema") { + + when { + + params { + test_data = '' + outdir = 1 + } + + workflow { + """ + validate_params = true + input[0] = workflow + input[1] = validate_params + input[2] = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" + """ + } + } + + then { + assertAll( + { assert workflow.failed }, + { assert workflow.stdout.any { it.contains('ERROR ~ Validation of pipeline parameters failed!') } } + ) + } + } +} diff --git a/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config new file mode 100644 index 00000000..0907ac58 --- /dev/null +++ b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow.config @@ -0,0 +1,8 @@ +plugins { + id "nf-schema@2.1.0" +} + +validation { + parametersSchema = "${projectDir}/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json" + monochromeLogs = true +} \ No newline at end of file diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/tests/nextflow_schema.json b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json similarity index 95% rename from subworkflows/nf-core/utils_nfvalidation_plugin/tests/nextflow_schema.json rename to subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json index 7626c1c9..331e0d2f 100644 --- a/subworkflows/nf-core/utils_nfvalidation_plugin/tests/nextflow_schema.json +++ b/subworkflows/nf-core/utils_nfschema_plugin/tests/nextflow_schema.json @@ -1,10 +1,10 @@ { - "$schema": "http://json-schema.org/draft-07/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/./master/nextflow_schema.json", "title": ". pipeline parameters", "description": "", "type": "object", - "definitions": { + "$defs": { "input_output_options": { "title": "Input/output options", "type": "object", @@ -87,10 +87,10 @@ }, "allOf": [ { - "$ref": "#/definitions/input_output_options" + "$ref": "#/$defs/input_output_options" }, { - "$ref": "#/definitions/generic_options" + "$ref": "#/$defs/generic_options" } ] } diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf b/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf deleted file mode 100644 index 50155c08..00000000 --- a/subworkflows/nf-core/utils_nfvalidation_plugin/main.nf +++ /dev/null @@ -1,62 +0,0 @@ -// -// Subworkflow that uses the nf-validation plugin to render help text and parameter summary -// - -/* -======================================================================================== - IMPORT NF-VALIDATION PLUGIN -======================================================================================== -*/ - -include { paramsHelp } from 'plugin/nf-schema' -include { paramsSummaryLog } from 'plugin/nf-schema' -include { validateParameters } from 'plugin/nf-schema' - -/* -======================================================================================== - SUBWORKFLOW DEFINITION -======================================================================================== -*/ - -workflow UTILS_NFVALIDATION_PLUGIN { - - take: - print_help // boolean: print help - workflow_command // string: default commmand used to run pipeline - pre_help_text // string: string to be printed before help text and summary log - post_help_text // string: string to be printed after help text and summary log - validate_params // boolean: validate parameters - schema_filename // path: JSON schema file, null to use default value - - main: - - log.debug "Using schema file: ${schema_filename}" - - // Default values for strings - pre_help_text = pre_help_text ?: '' - post_help_text = post_help_text ?: '' - workflow_command = workflow_command ?: '' - - // - // Print help message if needed - // - if (print_help) { - log.info pre_help_text + paramsHelp(workflow_command, parameters_schema: schema_filename) + post_help_text - System.exit(0) - } - - // - // Print parameter summary to stdout - // - log.info pre_help_text + paramsSummaryLog(workflow, parameters_schema: schema_filename) + post_help_text - - // - // Validate parameters relative to the parameter JSON schema - // - if (validate_params){ - validateParameters(parameters_schema: schema_filename) - } - - emit: - dummy_emit = true -} diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/meta.yml b/subworkflows/nf-core/utils_nfvalidation_plugin/meta.yml deleted file mode 100644 index 3d4a6b04..00000000 --- a/subworkflows/nf-core/utils_nfvalidation_plugin/meta.yml +++ /dev/null @@ -1,44 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json -name: "UTILS_NFVALIDATION_PLUGIN" -description: Use nf-validation to initiate and validate a pipeline -keywords: - - utility - - pipeline - - initialise - - validation -components: [] -input: - - print_help: - type: boolean - description: | - Print help message and exit - - workflow_command: - type: string - description: | - The command to run the workflow e.g. "nextflow run main.nf" - - pre_help_text: - type: string - description: | - Text to print before the help message - - post_help_text: - type: string - description: | - Text to print after the help message - - validate_params: - type: boolean - description: | - Validate the parameters and error if invalid. - - schema_filename: - type: string - description: | - The filename of the schema to validate against. -output: - - dummy_emit: - type: boolean - description: | - Dummy emit to make nf-core subworkflows lint happy -authors: - - "@adamrtalbot" -maintainers: - - "@adamrtalbot" - - "@maxulysse" diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/tests/main.nf.test b/subworkflows/nf-core/utils_nfvalidation_plugin/tests/main.nf.test deleted file mode 100644 index 5784a33f..00000000 --- a/subworkflows/nf-core/utils_nfvalidation_plugin/tests/main.nf.test +++ /dev/null @@ -1,200 +0,0 @@ -nextflow_workflow { - - name "Test Workflow UTILS_NFVALIDATION_PLUGIN" - script "../main.nf" - workflow "UTILS_NFVALIDATION_PLUGIN" - tag "subworkflows" - tag "subworkflows_nfcore" - tag "plugin/nf-validation" - tag "'plugin/nf-validation'" - tag "utils_nfvalidation_plugin" - tag "subworkflows/utils_nfvalidation_plugin" - - test("Should run nothing") { - - when { - - params { - monochrome_logs = true - test_data = '' - } - - workflow { - """ - help = false - workflow_command = null - pre_help_text = null - post_help_text = null - validate_params = false - schema_filename = "$moduleTestDir/nextflow_schema.json" - - input[0] = help - input[1] = workflow_command - input[2] = pre_help_text - input[3] = post_help_text - input[4] = validate_params - input[5] = schema_filename - """ - } - } - - then { - assertAll( - { assert workflow.success } - ) - } - } - - test("Should run help") { - - - when { - - params { - monochrome_logs = true - test_data = '' - } - workflow { - """ - help = true - workflow_command = null - pre_help_text = null - post_help_text = null - validate_params = false - schema_filename = "$moduleTestDir/nextflow_schema.json" - - input[0] = help - input[1] = workflow_command - input[2] = pre_help_text - input[3] = post_help_text - input[4] = validate_params - input[5] = schema_filename - """ - } - } - - then { - assertAll( - { assert workflow.success }, - { assert workflow.exitStatus == 0 }, - { assert workflow.stdout.any { it.contains('Input/output options') } }, - { assert workflow.stdout.any { it.contains('--outdir') } } - ) - } - } - - test("Should run help with command") { - - when { - - params { - monochrome_logs = true - test_data = '' - } - workflow { - """ - help = true - workflow_command = "nextflow run noorg/doesntexist" - pre_help_text = null - post_help_text = null - validate_params = false - schema_filename = "$moduleTestDir/nextflow_schema.json" - - input[0] = help - input[1] = workflow_command - input[2] = pre_help_text - input[3] = post_help_text - input[4] = validate_params - input[5] = schema_filename - """ - } - } - - then { - assertAll( - { assert workflow.success }, - { assert workflow.exitStatus == 0 }, - { assert workflow.stdout.any { it.contains('nextflow run noorg/doesntexist') } }, - { assert workflow.stdout.any { it.contains('Input/output options') } }, - { assert workflow.stdout.any { it.contains('--outdir') } } - ) - } - } - - test("Should run help with extra text") { - - - when { - - params { - monochrome_logs = true - test_data = '' - } - workflow { - """ - help = true - workflow_command = "nextflow run noorg/doesntexist" - pre_help_text = "pre-help-text" - post_help_text = "post-help-text" - validate_params = false - schema_filename = "$moduleTestDir/nextflow_schema.json" - - input[0] = help - input[1] = workflow_command - input[2] = pre_help_text - input[3] = post_help_text - input[4] = validate_params - input[5] = schema_filename - """ - } - } - - then { - assertAll( - { assert workflow.success }, - { assert workflow.exitStatus == 0 }, - { assert workflow.stdout.any { it.contains('pre-help-text') } }, - { assert workflow.stdout.any { it.contains('nextflow run noorg/doesntexist') } }, - { assert workflow.stdout.any { it.contains('Input/output options') } }, - { assert workflow.stdout.any { it.contains('--outdir') } }, - { assert workflow.stdout.any { it.contains('post-help-text') } } - ) - } - } - - test("Should validate params") { - - when { - - params { - monochrome_logs = true - test_data = '' - outdir = 1 - } - workflow { - """ - help = false - workflow_command = null - pre_help_text = null - post_help_text = null - validate_params = true - schema_filename = "$moduleTestDir/nextflow_schema.json" - - input[0] = help - input[1] = workflow_command - input[2] = pre_help_text - input[3] = post_help_text - input[4] = validate_params - input[5] = schema_filename - """ - } - } - - then { - assertAll( - { assert workflow.failed }, - { assert workflow.stdout.any { it.contains('ERROR ~ ERROR: Validation of pipeline parameters failed!') } } - ) - } - } -} diff --git a/subworkflows/nf-core/utils_nfvalidation_plugin/tests/tags.yml b/subworkflows/nf-core/utils_nfvalidation_plugin/tests/tags.yml deleted file mode 100644 index 60b1cfff..00000000 --- a/subworkflows/nf-core/utils_nfvalidation_plugin/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -subworkflows/utils_nfvalidation_plugin: - - subworkflows/nf-core/utils_nfvalidation_plugin/** diff --git a/tests/nextflow.config b/tests/nextflow.config index 9a3681e3..59ffd5da 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -7,11 +7,6 @@ // Change some params to test data params { - // Limit resources so that this can run on GitHub Actions - max_cpus = 2 - max_memory = '6.GB' - max_time = '6.h' - input = "${baseDir}/tests/inputs/samplesheet.csv" // References for test data @@ -67,7 +62,10 @@ params { } process { - cpus = 2 - memory = 3.GB - time = 2.h + // Limit resources so that this can run on GitHub Actions + resourceLimits = [ + cpus : 2, + memory: 6.GB, + time : 6.h + ] } diff --git a/tests/pipeline/callers/main.nf.test.snap b/tests/pipeline/callers/main.nf.test.snap index b6f693f0..f5629747 100644 --- a/tests/pipeline/callers/main.nf.test.snap +++ b/tests/pipeline/callers/main.nf.test.snap @@ -2,23 +2,26 @@ "haplotypecaller": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -29,37 +32,41 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T15:40:41.593827142" + "timestamp": "2024-09-05T11:39:15.537730988" }, "vardict + haplotypecaller": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -70,15 +77,19 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/NA24143.vardict.ped", "test/Ashkenazim/NA24143.vardict.vcf.gz", + "test/Ashkenazim/NA24143.vardict.vcf.gz.csi", "test/Ashkenazim/NA24143.vardict.vcf.gz.tbi", "test/Ashkenazim/NA24149.vardict.ped", "test/Ashkenazim/NA24149.vardict.vcf.gz", + "test/Ashkenazim/NA24149.vardict.vcf.gz.csi", "test/Ashkenazim/NA24149.vardict.vcf.gz.tbi", "test/Ashkenazim/NA24385.vardict.ped", "test/Ashkenazim/NA24385.vardict.vcf.gz", + "test/Ashkenazim/NA24385.vardict.vcf.gz.csi", "test/Ashkenazim/NA24385.vardict.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html", @@ -91,15 +102,15 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T15:41:56.768447097" + "timestamp": "2024-09-05T11:56:32.019963111" }, "vardict": { "content": [ [ - + ], [ "NA24143/NA24143.bed", @@ -116,12 +127,15 @@ "samplesheet.csv", "test/Ashkenazim/NA24143.vardict.ped", "test/Ashkenazim/NA24143.vardict.vcf.gz", + "test/Ashkenazim/NA24143.vardict.vcf.gz.csi", "test/Ashkenazim/NA24143.vardict.vcf.gz.tbi", "test/Ashkenazim/NA24149.vardict.ped", "test/Ashkenazim/NA24149.vardict.vcf.gz", + "test/Ashkenazim/NA24149.vardict.vcf.gz.csi", "test/Ashkenazim/NA24149.vardict.vcf.gz.tbi", "test/Ashkenazim/NA24385.vardict.ped", "test/Ashkenazim/NA24385.vardict.vcf.gz", + "test/Ashkenazim/NA24385.vardict.vcf.gz.csi", "test/Ashkenazim/NA24385.vardict.vcf.gz.tbi", "test/Ashkenazim/reports/NA24143.vardict.bcftools_stats.txt", "test/Ashkenazim/reports/NA24143.vardict.somalier.html", @@ -132,9 +146,9 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T15:39:37.704366119" + "timestamp": "2024-09-05T11:54:10.944847435" } } \ No newline at end of file diff --git a/tests/pipeline/default/main.nf.test.snap b/tests/pipeline/default/main.nf.test.snap index 4e35a9bf..ab43dc3b 100644 --- a/tests/pipeline/default/main.nf.test.snap +++ b/tests/pipeline/default/main.nf.test.snap @@ -2,23 +2,26 @@ "default": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -29,15 +32,16 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T15:34:28.414261433" + "timestamp": "2024-09-05T11:40:36.127517277" } } \ No newline at end of file diff --git a/tests/pipeline/gvcfs/main.nf.test.snap b/tests/pipeline/gvcfs/main.nf.test.snap index 430c3e0a..3b3b89d8 100644 --- a/tests/pipeline/gvcfs/main.nf.test.snap +++ b/tests/pipeline/gvcfs/main.nf.test.snap @@ -2,7 +2,7 @@ "gvcfs": { "content": [ [ - + ], [ "multiqc/multiqc_plots", @@ -11,15 +11,16 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T17:18:10.515388658" + "timestamp": "2024-09-05T11:41:32.108980116" } } \ No newline at end of file diff --git a/tests/pipeline/variations/main.nf.test.snap b/tests/pipeline/variations/main.nf.test.snap index 988e32fc..348a2942 100644 --- a/tests/pipeline/variations/main.nf.test.snap +++ b/tests/pipeline/variations/main.nf.test.snap @@ -2,23 +2,26 @@ "filter": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -29,37 +32,41 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T15:57:27.216291382" + "timestamp": "2024-09-05T11:45:02.491962487" }, "only_call": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -70,31 +77,34 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T15:58:10.801784853" + "timestamp": "2024-09-05T11:45:47.266012698" }, "annotate + vcfanno": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -105,37 +115,42 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.gzi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T15:56:25.391105365" + "timestamp": "2024-09-05T11:43:47.539727235" }, "automap": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -146,6 +161,7 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/automap_haplotypecaller/sample1/sample1.HomRegions.cmgg_bio.tsv", "test/Ashkenazim/automap_haplotypecaller/sample1/sample1.HomRegions.pdf", @@ -164,31 +180,34 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-04-04T16:27:21.116595696" + "timestamp": "2024-09-05T11:47:48.972236882" }, "only_merge": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -200,31 +219,34 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T16:28:12.406463008" + "timestamp": "2024-09-05T11:46:37.403799074" }, "annotate": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -235,15 +257,16 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T15:47:35.270453118" + "timestamp": "2024-09-05T11:42:39.793880467" } } \ No newline at end of file diff --git a/tests/pipeline/variations2/main.nf.test.snap b/tests/pipeline/variations2/main.nf.test.snap index af8cfcfd..053dd3eb 100644 --- a/tests/pipeline/variations2/main.nf.test.snap +++ b/tests/pipeline/variations2/main.nf.test.snap @@ -2,23 +2,26 @@ "gemini": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -30,37 +33,41 @@ "test/Ashkenazim/Ashkenazim.haplotypecaller.db", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T16:31:52.936259443" + "timestamp": "2024-09-05T11:59:55.764681555" }, "normalize": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -71,37 +78,41 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T17:04:19.112262269" + "timestamp": "2024-09-05T11:57:36.725019238" }, "updio": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -112,37 +123,41 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T16:30:38.464359399" + "timestamp": "2024-09-05T11:58:51.377552309" }, "add_ped": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", "NA24143/reports/NA24143.summary.txt", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", "NA24149/reports/NA24149.summary.txt", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -153,25 +168,27 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T17:09:21.531982672" + "timestamp": "2024-09-05T12:02:31.850254513" }, "validate": { "content": [ [ - + ], [ "NA24143/NA24143.bed", "NA24143/NA24143.haplotypecaller.g.vcf.gz", + "NA24143/NA24143.haplotypecaller.g.vcf.gz.csi", "NA24143/NA24143.haplotypecaller.g.vcf.gz.tbi", "NA24143/reports/NA24143.global.dist.txt", "NA24143/reports/NA24143.haplotypecaller.bcftools_stats.txt", @@ -197,6 +214,7 @@ "NA24143/validation/haplotypecaller/NA24143.weighted_roc.tsv.gz", "NA24149/NA24149.bed", "NA24149/NA24149.haplotypecaller.g.vcf.gz", + "NA24149/NA24149.haplotypecaller.g.vcf.gz.csi", "NA24149/NA24149.haplotypecaller.g.vcf.gz.tbi", "NA24149/reports/NA24149.global.dist.txt", "NA24149/reports/NA24149.haplotypecaller.bcftools_stats.txt", @@ -222,6 +240,7 @@ "NA24149/validation/haplotypecaller/NA24149.weighted_roc.tsv.gz", "NA24385/NA24385.bed", "NA24385/NA24385.haplotypecaller.g.vcf.gz", + "NA24385/NA24385.haplotypecaller.g.vcf.gz.csi", "NA24385/NA24385.haplotypecaller.g.vcf.gz.tbi", "NA24385/reports/NA24385.global.dist.txt", "NA24385/reports/NA24385.haplotypecaller.bcftools_stats.txt", @@ -251,15 +270,16 @@ "test/Ashkenazim/Ashkenazim.bed", "test/Ashkenazim/Ashkenazim.haplotypecaller.ped", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz", + "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.csi", "test/Ashkenazim/Ashkenazim.haplotypecaller.vcf.gz.tbi", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.bcftools_stats.txt", "test/Ashkenazim/reports/Ashkenazim.haplotypecaller.somalier.html" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T16:33:15.226868795" + "timestamp": "2024-09-05T12:01:21.850991249" } } \ No newline at end of file diff --git a/tests/subworkflows/local/cram_call_genotype_gatk4/main.nf.test b/tests/subworkflows/local/cram_call_genotype_gatk4/main.nf.test index 7ad15931..37eca413 100644 --- a/tests/subworkflows/local/cram_call_genotype_gatk4/main.nf.test +++ b/tests/subworkflows/local/cram_call_genotype_gatk4/main.nf.test @@ -21,17 +21,17 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143.00001", sample:"NA24143", family:"Ashkenazim", family_count:1, split_count:3], + [id:"NA24143.00001", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24143.00002", sample:"NA24143", family:"Ashkenazim", family_count:1, split_count:3], + [id:"NA24143.00002", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24143.00003", sample:"NA24143", family:"Ashkenazim", family_count:1, split_count:3], + [id:"NA24143.00003", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split3, checkIfExists:true) @@ -53,8 +53,8 @@ nextflow_workflow { [id:"strtablefile"], file(params.strtablefile, checkIfExists:true) ]) - input[6] = [] - input[7] = [] + input[6] = [[],[]] + input[7] = [[],[]] input[8] = false input[9] = false input[10] = false @@ -86,7 +86,7 @@ nextflow_workflow { """ input[0] = Channel.empty() input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143"], file(params.gvcf1, checkIfExists:true), file(params.gtbi1, checkIfExists:true) ]) @@ -106,10 +106,8 @@ nextflow_workflow { [id:"strtablefile"], file(params.strtablefile, checkIfExists:true) ]) - input[6] = [] - input[7] = [] - input[6] = [] - input[7] = [] + input[6] = [[],[]] + input[7] = [[],[]] input[8] = false input[9] = false input[10] = false @@ -140,27 +138,27 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split3, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:3], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.gvcf1, checkIfExists:true), file(params.gtbi1, checkIfExists:true) ],[ - [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_count:3], + [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.gvcf2, checkIfExists:true), file(params.gtbi2, checkIfExists:true) ]) @@ -180,10 +178,8 @@ nextflow_workflow { [id:"strtablefile"], file(params.strtablefile, checkIfExists:true) ]) - input[6] = [] - input[7] = [] - input[6] = [] - input[7] = [] + input[6] = [[],[]] + input[7] = [[],[]] input[8] = false input[9] = false input[10] = false @@ -215,27 +211,27 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split3, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:3], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.gvcf1, checkIfExists:true), file(params.gtbi1, checkIfExists:true) ],[ - [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_count:3], + [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.gvcf2, checkIfExists:true), file(params.gtbi2, checkIfExists:true) ]) @@ -255,10 +251,8 @@ nextflow_workflow { [id:"strtablefile"], file(params.strtablefile, checkIfExists:true) ]) - input[6] = [] - input[7] = [] - input[6] = [] - input[7] = [] + input[6] = [[],[]] + input[7] = [[],[]] input[8] = false input[9] = false input[10] = false @@ -290,27 +284,27 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split3, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:3], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.gvcf1, checkIfExists:true), file(params.gtbi1, checkIfExists:true) ],[ - [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_count:3], + [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.gvcf2, checkIfExists:true), file(params.gtbi2, checkIfExists:true) ]) @@ -330,10 +324,8 @@ nextflow_workflow { [id:"strtablefile"], file(params.strtablefile, checkIfExists:true) ]) - input[6] = [] - input[7] = [] - input[6] = [] - input[7] = [] + input[6] = [[],[]] + input[7] = [[],[]] input[8] = false input[9] = true input[10] = false @@ -365,27 +357,27 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_count:3, split_count:3], + [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split3, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:3], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.gvcf1, checkIfExists:true), file(params.gtbi1, checkIfExists:true) ],[ - [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_count:3], + [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.gvcf2, checkIfExists:true), file(params.gtbi2, checkIfExists:true) ]) @@ -405,10 +397,8 @@ nextflow_workflow { [id:"strtablefile"], file(params.strtablefile, checkIfExists:true) ]) - input[6] = [] - input[7] = [] - input[6] = [] - input[7] = [] + input[6] = [[],[]] + input[7] = [[],[]] input[8] = false input[9] = false input[10] = true @@ -439,27 +429,27 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_count:2, split_count:3], + [id:"NA24835.00001", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_count:2, split_count:3], + [id:"NA24835.00002", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_count:2, split_count:3], + [id:"NA24835.00003", sample:"NA24835", family:"Ashkenazim", family_samples:"NA24149,NA24385", split_count:3], file(params.cram3, checkIfExists:true), file(params.crai3, checkIfExists:true), file(params.split3, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:2], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143"], file(params.gvcf1, checkIfExists:true), file(params.gtbi1, checkIfExists:true) ],[ - [id:"NA24149", sample:"NA24149", family:"NA24149", family_count:2], + [id:"NA24149", sample:"NA24149", family:"NA24149", family_samples:"NA24149,NA24385"], file(params.gvcf2, checkIfExists:true), file(params.gtbi2, checkIfExists:true) ]) @@ -479,10 +469,8 @@ nextflow_workflow { [id:"strtablefile"], file(params.strtablefile, checkIfExists:true) ]) - input[6] = [] - input[7] = [] - input[6] = [] - input[7] = [] + input[6] = [[],[]] + input[7] = [[],[]] input[8] = false input[9] = false input[10] = false diff --git a/tests/subworkflows/local/cram_call_genotype_gatk4/main.nf.test.snap b/tests/subworkflows/local/cram_call_genotype_gatk4/main.nf.test.snap index 64e23b12..a0aec425 100644 --- a/tests/subworkflows/local/cram_call_genotype_gatk4/main.nf.test.snap +++ b/tests/subworkflows/local/cram_call_genotype_gatk4/main.nf.test.snap @@ -6,15 +6,15 @@ ], [ [ - "NA24835.haplotypecaller.bcftools_stats.txt:md5,cf8d900f4a7f7844bf1ece4478010459" + "NA24835.haplotypecaller.bcftools_stats.txt:md5,5f42bee02b2bd0d2af2954292ec3b422" ] ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T10:12:27.678293492" + "timestamp": "2024-09-05T11:20:45.005084818" }, "default - family": { "content": [ @@ -22,10 +22,9 @@ [ { "family": "Ashkenazim", - "id": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller", - "samples": "NA24143,NA24149,NA24835" + "id": "Ashkenazim" }, "Ashkenazim.haplotypecaller.vcf.gz", "Ashkenazim.haplotypecaller.vcf.gz.tbi" @@ -33,15 +32,15 @@ ], [ [ - "NA24835.haplotypecaller.bcftools_stats.txt:md5,cf8d900f4a7f7844bf1ece4478010459" + "NA24835.haplotypecaller.bcftools_stats.txt:md5,5f42bee02b2bd0d2af2954292ec3b422" ] ] ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T13:01:36.711373912" + "timestamp": "2024-09-05T17:35:02.44674969" }, "filter - family": { "content": [ @@ -49,10 +48,9 @@ [ { "family": "Ashkenazim", - "id": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller", - "samples": "NA24143,NA24149,NA24835" + "id": "Ashkenazim" }, "Ashkenazim.haplotypecaller.vcf.gz", "Ashkenazim.haplotypecaller.vcf.gz.tbi" @@ -60,15 +58,15 @@ ], [ [ - "NA24835.haplotypecaller.bcftools_stats.txt:md5,cf8d900f4a7f7844bf1ece4478010459" + "NA24835.haplotypecaller.bcftools_stats.txt:md5,5f42bee02b2bd0d2af2954292ec3b422" ] ] ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T13:02:26.651064532" + "timestamp": "2024-09-05T17:35:46.768542501" }, "default - gvcfs": { "content": [ @@ -76,10 +74,9 @@ [ { "family": "Ashkenazim", - "id": "Ashkenazim", - "family_count": 1, + "family_samples": "NA24143", "caller": "haplotypecaller", - "samples": "NA24143" + "id": "Ashkenazim" }, "Ashkenazim.haplotypecaller.vcf.gz", "Ashkenazim.haplotypecaller.vcf.gz.tbi" @@ -91,9 +88,9 @@ ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T12:56:23.435795439" + "timestamp": "2024-09-05T17:34:17.846266913" }, "default - crams": { "content": [ @@ -101,10 +98,9 @@ [ { "family": "Ashkenazim", - "id": "Ashkenazim", - "family_count": 1, + "family_samples": "NA24143", "caller": "haplotypecaller", - "samples": "NA24143" + "id": "Ashkenazim" }, "Ashkenazim.haplotypecaller.vcf.gz", "Ashkenazim.haplotypecaller.vcf.gz.tbi" @@ -112,15 +108,15 @@ ], [ [ - "NA24143.haplotypecaller.bcftools_stats.txt:md5,8832acfa6af30e9225b151da201733c3" + "NA24143.haplotypecaller.bcftools_stats.txt:md5,09b4e7674e0f5b98b1e548df3002250e" ] ] ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T12:55:51.608812907" + "timestamp": "2024-09-05T17:33:52.045772718" }, "only_call - family": { "content": [ @@ -129,15 +125,15 @@ ], [ [ - "NA24835.haplotypecaller.bcftools_stats.txt:md5,cf8d900f4a7f7844bf1ece4478010459" + "NA24835.haplotypecaller.bcftools_stats.txt:md5,5f42bee02b2bd0d2af2954292ec3b422" ] ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T10:11:35.142110509" + "timestamp": "2024-09-05T11:20:04.714403906" }, "only_merge - sample + family": { "content": [ @@ -145,10 +141,9 @@ [ { "family": "Ashkenazim", - "id": "Ashkenazim", - "family_count": 2, + "family_samples": "NA24143", "caller": "haplotypecaller", - "samples": "NA24143,NA24835" + "id": "Ashkenazim" }, "Ashkenazim.haplotypecaller.vcf.gz", "Ashkenazim.haplotypecaller.vcf.gz.tbi" @@ -156,14 +151,14 @@ ], [ [ - "NA24835.haplotypecaller.bcftools_stats.txt:md5,cf8d900f4a7f7844bf1ece4478010459" + "NA24835.haplotypecaller.bcftools_stats.txt:md5,5f42bee02b2bd0d2af2954292ec3b422" ] ] ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T13:04:20.473178165" + "timestamp": "2024-09-06T14:26:29.249708339" } } \ No newline at end of file diff --git a/tests/subworkflows/local/cram_call_vardictjava/main.nf.test b/tests/subworkflows/local/cram_call_vardictjava/main.nf.test index 6cf959b0..05798304 100644 --- a/tests/subworkflows/local/cram_call_vardictjava/main.nf.test +++ b/tests/subworkflows/local/cram_call_vardictjava/main.nf.test @@ -20,22 +20,22 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143"], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143.00001", sample:"NA24143", family:"Ashkenazim", family_count:1, split_count:3], + [id:"NA24143.00001", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24143.00002", sample:"NA24143", family:"Ashkenazim", family_count:1, split_count:3], + [id:"NA24143.00002", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24143.00003", sample:"NA24143", family:"Ashkenazim", family_count:1, split_count:3], + [id:"NA24143.00003", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split3, checkIfExists:true) @@ -48,8 +48,8 @@ nextflow_workflow { [id:"fai"], file(params.fai, checkIfExists:true) ]) - input[4] = [] - input[5] = [] + input[4] = [[],[]] + input[5] = [[],[]] input[6] = false """ } @@ -77,22 +77,22 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143"], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143.00001", sample:"NA24143", family:"Ashkenazim", family_count:1, split_count:3], + [id:"NA24143.00001", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24143.00002", sample:"NA24143", family:"Ashkenazim", family_count:1, split_count:3], + [id:"NA24143.00002", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24143.00003", sample:"NA24143", family:"Ashkenazim", family_count:1, split_count:3], + [id:"NA24143.00003", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split3, checkIfExists:true) @@ -105,8 +105,8 @@ nextflow_workflow { [id:"fai"], file(params.fai, checkIfExists:true) ]) - input[4] = [] - input[5] = [] + input[4] = [[],[]] + input[5] = [[],[]] input[6] = true """ } @@ -133,41 +133,41 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:2], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149"], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true) ],[ - [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_count:2], + [id:"NA24149", sample:"NA24149", family:"Ashkenazim", family_samples:"NA24143,NA24149"], file(params.cram2, checkIfExists:true), file(params.crai2, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143.00001", sample:"NA24143", family:"Ashkenazim", family_count:2, split_count:3], + [id:"NA24143.00001", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24143.00002", sample:"NA24143", family:"Ashkenazim", family_count:2, split_count:3], + [id:"NA24143.00002", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24143.00003", sample:"NA24143", family:"Ashkenazim", family_count:2, split_count:3], + [id:"NA24143.00003", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149", split_count:3], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), file(params.split3, checkIfExists:true) ],[ - [id:"NA24149.00001", sample:"NA24149", family:"Ashkenazim", family_count:2, split_count:3], + [id:"NA24149.00001", sample:"NA24149", family:"Ashkenazim", family_samples:"NA24143,NA24149", split_count:3], file(params.cram2, checkIfExists:true), file(params.crai2, checkIfExists:true), file(params.split1, checkIfExists:true) ],[ - [id:"NA24149.00002", sample:"NA24149", family:"Ashkenazim", family_count:2, split_count:3], + [id:"NA24149.00002", sample:"NA24149", family:"Ashkenazim", family_samples:"NA24143,NA24149", split_count:3], file(params.cram2, checkIfExists:true), file(params.crai2, checkIfExists:true), file(params.split2, checkIfExists:true) ],[ - [id:"NA24149.00003", sample:"NA24149", family:"Ashkenazim", family_count:2, split_count:3], + [id:"NA24149.00003", sample:"NA24149", family:"Ashkenazim", family_samples:"NA24143,NA24149", split_count:3], file(params.cram2, checkIfExists:true), file(params.crai2, checkIfExists:true), file(params.split3, checkIfExists:true) @@ -180,8 +180,8 @@ nextflow_workflow { [id:"fai"], file(params.fai, checkIfExists:true) ]) - input[4] = [] - input[5] = [] + input[4] = [[],[]] + input[5] = [[],[]] input[6] = false """ } diff --git a/tests/subworkflows/local/cram_call_vardictjava/main.nf.test.snap b/tests/subworkflows/local/cram_call_vardictjava/main.nf.test.snap index 8cbbdb2e..f2057a7b 100644 --- a/tests/subworkflows/local/cram_call_vardictjava/main.nf.test.snap +++ b/tests/subworkflows/local/cram_call_vardictjava/main.nf.test.snap @@ -7,7 +7,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1, + "family_samples": "NA24143", "caller": "vardict", "samples": "NA24143" }, @@ -18,9 +18,9 @@ ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T13:05:31.562298546" + "timestamp": "2024-09-05T17:38:01.461442987" }, "default": { "content": [ @@ -30,7 +30,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1, + "family_samples": "NA24143", "caller": "vardict", "samples": "NA24143" }, @@ -41,9 +41,9 @@ ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T13:05:04.322416692" + "timestamp": "2024-09-05T17:37:40.178107639" }, "family": { "content": [ @@ -53,7 +53,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 2, + "family_samples": "NA24143,NA24149", "caller": "vardict", "samples": "NA24143" }, @@ -65,7 +65,7 @@ "id": "NA24149", "sample": "NA24149", "family": "Ashkenazim", - "family_count": 2, + "family_samples": "NA24143,NA24149", "caller": "vardict", "samples": "NA24149" }, @@ -76,8 +76,8 @@ ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T13:06:05.012625054" + "timestamp": "2024-09-05T17:38:29.203806206" } } \ No newline at end of file diff --git a/tests/subworkflows/local/cram_prepare_samtools_bedtools/main.nf.test b/tests/subworkflows/local/cram_prepare_samtools_bedtools/main.nf.test index 7c6c226c..0a69a066 100644 --- a/tests/subworkflows/local/cram_prepare_samtools_bedtools/main.nf.test +++ b/tests/subworkflows/local/cram_prepare_samtools_bedtools/main.nf.test @@ -14,12 +14,12 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:1], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:1], [] ]) input[2] = Channel.value([ @@ -54,12 +54,12 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:1], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:1], [] ]) input[2] = Channel.value([ @@ -94,12 +94,12 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:1], file(params.cram1, checkIfExists:true), [] ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:1], file(params.bed, checkIfExists:true) ]) input[2] = Channel.value([ @@ -134,17 +134,20 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:2], file(params.cram1, checkIfExists:true), - file(params.crai1, checkIfExists:true) + [] ],[ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], - file(params.cram1, checkIfExists:true), - file(params.crai1, checkIfExists:true) + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:2], + file(params.cram2, checkIfExists:true), + [] ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:2], file(params.bed, checkIfExists:true) + ],[ + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143", duplicate_count:2], + [] ]) input[2] = Channel.value([ [id:"fasta"], diff --git a/tests/subworkflows/local/cram_prepare_samtools_bedtools/main.nf.test.snap b/tests/subworkflows/local/cram_prepare_samtools_bedtools/main.nf.test.snap index d19744ac..cbd7535e 100644 --- a/tests/subworkflows/local/cram_prepare_samtools_bedtools/main.nf.test.snap +++ b/tests/subworkflows/local/cram_prepare_samtools_bedtools/main.nf.test.snap @@ -7,9 +7,10 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1 + "family_samples": "NA24143", + "duplicate_count": 2 }, - 899520, + 798258, "NA24143.cram.crai" ] ], @@ -19,7 +20,8 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1 + "family_samples": "NA24143", + "duplicate_count": 2 }, "NA24143_intersect.bed:md5,b87069698afefb15282d069e56110046" ] @@ -29,10 +31,10 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.04.1" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-06-04T17:01:48.046624445" + "timestamp": "2024-09-23T11:46:20.577603661" }, "default - WGS": { "content": [ @@ -42,7 +44,8 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1 + "family_samples": "NA24143", + "duplicate_count": 1 }, "NA24143.cram", "NA24143.cram.crai" @@ -54,9 +57,10 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1 + "family_samples": "NA24143", + "duplicate_count": 1 }, - "NA24143.filter.bed:md5,9fc0cc2e4403678f18bc8b18646abd66" + "NA24143.filter.bed:md5,85a5568a6976ed455caa712991b30ac2" ] ], [ @@ -64,10 +68,10 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T10:49:45.063311741" + "timestamp": "2024-09-23T14:56:11.141634788" }, "default - WES": { "content": [ @@ -77,7 +81,8 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1 + "family_samples": "NA24143", + "duplicate_count": 1 }, "NA24143.cram", "NA24143.cram.crai" @@ -89,7 +94,8 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1 + "family_samples": "NA24143", + "duplicate_count": 1 }, "NA24143_intersect.bed:md5,b87069698afefb15282d069e56110046" ] @@ -99,10 +105,10 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T11:02:27.487076852" + "timestamp": "2024-09-06T14:33:15.988619426" }, "default - WES common ROI": { "content": [ @@ -112,7 +118,8 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1 + "family_samples": "NA24143", + "duplicate_count": 1 }, "NA24143.cram", "NA24143.cram.crai" @@ -124,7 +131,8 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1 + "family_samples": "NA24143", + "duplicate_count": 1 }, "NA24143_intersect.bed:md5,b87069698afefb15282d069e56110046" ] @@ -134,9 +142,9 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T11:02:14.280224701" + "timestamp": "2024-09-06T14:32:49.756585296" } } \ No newline at end of file diff --git a/tests/subworkflows/local/input_split_bedtools/main.nf.test b/tests/subworkflows/local/input_split_bedtools/main.nf.test index 3c9507ca..87cc55a6 100644 --- a/tests/subworkflows/local/input_split_bedtools/main.nf.test +++ b/tests/subworkflows/local/input_split_bedtools/main.nf.test @@ -14,12 +14,12 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143"], file(params.bed, checkIfExists:true), 3 ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:1], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143"], file(params.cram1, checkIfExists:true), file(params.crai1, checkIfExists:true), ]) diff --git a/tests/subworkflows/local/input_split_bedtools/main.nf.test.snap b/tests/subworkflows/local/input_split_bedtools/main.nf.test.snap index 9f34f75c..6089d29e 100644 --- a/tests/subworkflows/local/input_split_bedtools/main.nf.test.snap +++ b/tests/subworkflows/local/input_split_bedtools/main.nf.test.snap @@ -7,7 +7,7 @@ "id": "NA24143.00001", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1, + "family_samples": "NA24143", "split_count": 3 }, "NA24143.cram", @@ -19,7 +19,7 @@ "id": "NA24143.00002", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1, + "family_samples": "NA24143", "split_count": 3 }, "NA24143.cram", @@ -31,7 +31,7 @@ "id": "NA24143.00003", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 1, + "family_samples": "NA24143", "split_count": 3 }, "NA24143.cram", @@ -41,9 +41,9 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T11:15:19.235405576" + "timestamp": "2024-09-05T17:39:07.719231196" } } \ No newline at end of file diff --git a/tests/subworkflows/local/vcf_annotation/main.nf.test b/tests/subworkflows/local/vcf_annotation/main.nf.test index b829d298..99cedb8e 100644 --- a/tests/subworkflows/local/vcf_annotation/main.nf.test +++ b/tests/subworkflows/local/vcf_annotation/main.nf.test @@ -19,7 +19,7 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", family:"NA24143", family_count:1, caller:"haplotypecaller"], + [id:"NA24143", family:"NA24143", family_samples:"NA24143", caller:"haplotypecaller"], file(params.vcf1, checkIfExists:true) ]) input[1] = Channel.value([ @@ -66,7 +66,7 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", family:"NA24143", family_count:1, caller:"haplotypecaller"], + [id:"NA24143", family:"NA24143", family_samples:"NA24143", caller:"haplotypecaller"], file(params.vcf1, checkIfExists:true) ]) input[1] = Channel.value([ diff --git a/tests/subworkflows/local/vcf_annotation/main.nf.test.snap b/tests/subworkflows/local/vcf_annotation/main.nf.test.snap index fdec0b82..d3ebc487 100644 --- a/tests/subworkflows/local/vcf_annotation/main.nf.test.snap +++ b/tests/subworkflows/local/vcf_annotation/main.nf.test.snap @@ -6,23 +6,23 @@ { "id": "NA24143", "family": "NA24143", - "family_count": 1, + "family_samples": "NA24143", "caller": "haplotypecaller" }, "NA24143.haplotypecaller.vcf.gz" ] ], [ - "NA241431_annotated.summary.html:md5,d41d8cd98f00b204e9800998ecf8427e", - "NA241432_annotated.summary.html:md5,d41d8cd98f00b204e9800998ecf8427e", - "NA241433_annotated.summary.html:md5,d41d8cd98f00b204e9800998ecf8427e" + "NA241430_annotated_summary.html:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA241431_annotated_summary.html:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA241432_annotated_summary.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-28T09:26:20.34701886" + "timestamp": "2024-09-05T17:39:23.107888975" }, "vcfanno": { "content": [ @@ -31,22 +31,22 @@ { "id": "NA24143", "family": "NA24143", - "family_count": 1, + "family_samples": "NA24143", "caller": "haplotypecaller" }, "NA24143.haplotypecaller.vcf.gz" ] ], [ - "NA241431_annotated.summary.html:md5,d41d8cd98f00b204e9800998ecf8427e", - "NA241432_annotated.summary.html:md5,d41d8cd98f00b204e9800998ecf8427e", - "NA241433_annotated.summary.html:md5,d41d8cd98f00b204e9800998ecf8427e" + "NA241430_annotated_summary.html:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA241431_annotated_summary.html:md5,d41d8cd98f00b204e9800998ecf8427e", + "NA241432_annotated_summary.html:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-28T09:26:37.223392102" + "timestamp": "2024-09-05T17:39:39.640344999" } } \ No newline at end of file diff --git a/tests/subworkflows/local/vcf_extract_relate_somalier/main.nf.test b/tests/subworkflows/local/vcf_extract_relate_somalier/main.nf.test index 09aa4cca..3e277b57 100644 --- a/tests/subworkflows/local/vcf_extract_relate_somalier/main.nf.test +++ b/tests/subworkflows/local/vcf_extract_relate_somalier/main.nf.test @@ -14,15 +14,15 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller"], file(params.famvcf, checkIfExists:true), file(params.famtbi, checkIfExists:true) ]) - input[1] = Channel.value(file(params.fasta, checkIfExists:true)) - input[2] = Channel.value(file(params.fai, checkIfExists:true)) - input[3] = Channel.value(file(params.somalier_sites, checkIfExists:true)) + input[1] = Channel.value([[id:"ref"], file(params.fasta, checkIfExists:true)]) + input[2] = Channel.value([[id:"ref"], file(params.fai, checkIfExists:true)]) + input[3] = Channel.value([[id:"ref"], file(params.somalier_sites, checkIfExists:true)]) input[4] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller"], file(params.ped, checkIfExists:true) ]) """ @@ -50,15 +50,15 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller"], file(params.famvcf, checkIfExists:true), file(params.famtbi, checkIfExists:true) ]) - input[1] = Channel.value(file(params.fasta, checkIfExists:true)) - input[2] = Channel.value(file(params.fai, checkIfExists:true)) - input[3] = Channel.value(file(params.somalier_sites, checkIfExists:true)) + input[1] = Channel.value([[id:"ref"], file(params.fasta, checkIfExists:true)]) + input[2] = Channel.value([[id:"ref"], file(params.fai, checkIfExists:true)]) + input[3] = Channel.value([[id:"ref"], file(params.somalier_sites, checkIfExists:true)]) input[4] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller"], [] ]) """ diff --git a/tests/subworkflows/local/vcf_extract_relate_somalier/main.nf.test.snap b/tests/subworkflows/local/vcf_extract_relate_somalier/main.nf.test.snap index 6f69f1f5..49d14e7c 100644 --- a/tests/subworkflows/local/vcf_extract_relate_somalier/main.nf.test.snap +++ b/tests/subworkflows/local/vcf_extract_relate_somalier/main.nf.test.snap @@ -6,7 +6,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, [ @@ -21,7 +21,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, "Ashkenazim.haplotypecaller.html:md5,a7cc550571c8543643d10b2e9db68a48" @@ -32,7 +32,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, "Ashkenazim.haplotypecaller.pairs.tsv:md5,0c89abf63de67c9f0ee931e883a17a66" @@ -43,7 +43,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, "Ashkenazim.haplotypecaller.samples.tsv:md5,26e108afb44bcbaf4c47e43eb5611d15" @@ -54,7 +54,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, "Ashkenazim.haplotypecaller_somalier.ped:md5,689bb83118511ddcb09ae6d30d2d99b3" @@ -62,10 +62,10 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T13:17:18.055689163" + "timestamp": "2024-09-05T17:39:52.526057891" }, "default - no peds": { "content": [ @@ -74,7 +74,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, [ @@ -89,7 +89,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, "Ashkenazim.haplotypecaller.html:md5,1622292889a889778f10ae037c051e44" @@ -100,7 +100,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, "Ashkenazim.haplotypecaller.pairs.tsv:md5,fc51248691992f10a6b5176f5a2d6231" @@ -111,7 +111,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, "Ashkenazim.haplotypecaller.samples.tsv:md5,1c12b44787ba9bc79943737fa54d3007" @@ -122,7 +122,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, "Ashkenazim.haplotypecaller_somalier.ped:md5,f1a0cb22a941d0563fae2ca3c30dd0d4" @@ -130,9 +130,9 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T13:17:29.504749349" + "timestamp": "2024-09-05T17:40:03.603049023" } } \ No newline at end of file diff --git a/tests/subworkflows/local/vcf_ped_rtgtools/main.nf.test b/tests/subworkflows/local/vcf_ped_rtgtools/main.nf.test index 71fe4235..24398ed4 100644 --- a/tests/subworkflows/local/vcf_ped_rtgtools/main.nf.test +++ b/tests/subworkflows/local/vcf_ped_rtgtools/main.nf.test @@ -17,12 +17,12 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller"], file(params.famvcf, checkIfExists:true), file(params.famtbi, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller"], file(params.ped, checkIfExists:true) ]) """ diff --git a/tests/subworkflows/local/vcf_ped_rtgtools/main.nf.test.snap b/tests/subworkflows/local/vcf_ped_rtgtools/main.nf.test.snap index b5d831e0..f988cc9f 100644 --- a/tests/subworkflows/local/vcf_ped_rtgtools/main.nf.test.snap +++ b/tests/subworkflows/local/vcf_ped_rtgtools/main.nf.test.snap @@ -6,7 +6,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller" }, "Ashkenazim.haplotypecaller.vcf.gz" @@ -14,9 +14,9 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T17:28:32.40423584" + "timestamp": "2024-09-05T17:40:15.516745396" } } \ No newline at end of file diff --git a/tests/subworkflows/local/vcf_roh_automap/main.nf.test b/tests/subworkflows/local/vcf_roh_automap/main.nf.test index b73cbbfd..724b1757 100644 --- a/tests/subworkflows/local/vcf_roh_automap/main.nf.test +++ b/tests/subworkflows/local/vcf_roh_automap/main.nf.test @@ -18,7 +18,7 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller", samples: "NA24143,NA24835,NA24149"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller", samples: "NA24143,NA24835,NA24149"], file(params.famvcf, checkIfExists:true), file(params.famtbi, checkIfExists:true) ]) @@ -58,7 +58,7 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", family:"NA24143", family_count:1, caller:"haplotypecaller", samples: "NA24143,NA24835,NA24149"], + [id:"NA24143", family:"NA24143", family_samples:"NA24143", caller:"haplotypecaller", samples: "NA24143,NA24835,NA24149"], file(params.vcf1, checkIfExists:true), file(params.tbi1, checkIfExists:true) ]) diff --git a/tests/subworkflows/local/vcf_roh_automap/main.nf.test.snap b/tests/subworkflows/local/vcf_roh_automap/main.nf.test.snap index 60f01c03..cc008cf9 100644 --- a/tests/subworkflows/local/vcf_roh_automap/main.nf.test.snap +++ b/tests/subworkflows/local/vcf_roh_automap/main.nf.test.snap @@ -6,7 +6,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller", "samples": "NA24143,NA24835,NA24149" }, @@ -26,9 +26,9 @@ ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T13:06:37.322068108" + "timestamp": "2024-09-05T17:40:27.65975553" }, "default - sample": { "content": [ @@ -37,7 +37,7 @@ { "id": "NA24143", "family": "NA24143", - "family_count": 1, + "family_samples": "NA24143", "caller": "haplotypecaller", "samples": "NA24143,NA24835,NA24149" }, @@ -52,8 +52,8 @@ ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.3" + "nextflow": "24.04.4" }, - "timestamp": "2024-08-06T13:06:47.205904762" + "timestamp": "2024-09-05T17:40:37.637175166" } } \ No newline at end of file diff --git a/tests/subworkflows/local/vcf_upd_updio/main.nf.test b/tests/subworkflows/local/vcf_upd_updio/main.nf.test index 226c71a1..1507c48a 100644 --- a/tests/subworkflows/local/vcf_upd_updio/main.nf.test +++ b/tests/subworkflows/local/vcf_upd_updio/main.nf.test @@ -17,12 +17,12 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller"], file(params.famvcf, checkIfExists:true), file(params.famtbi, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385", caller:"haplotypecaller"], file(params.ped, checkIfExists:true) ]) input[2] = [[],[]] @@ -50,12 +50,12 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:1, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143", caller:"haplotypecaller"], file(params.vcf1, checkIfExists:true), file(params.tbi1, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"Ashkenazim", family:"Ashkenazim", family_count:1, caller:"haplotypecaller"], + [id:"Ashkenazim", family:"Ashkenazim", family_samples:"NA24143", caller:"haplotypecaller"], file(params.ped, checkIfExists:true) ]) input[2] = [[],[]] diff --git a/tests/subworkflows/local/vcf_upd_updio/main.nf.test.snap b/tests/subworkflows/local/vcf_upd_updio/main.nf.test.snap index 330bb7e1..09731d58 100644 --- a/tests/subworkflows/local/vcf_upd_updio/main.nf.test.snap +++ b/tests/subworkflows/local/vcf_upd_updio/main.nf.test.snap @@ -6,7 +6,7 @@ { "id": "Ashkenazim", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "caller": "haplotypecaller", "child": "NA24385", "father": "NA24149", @@ -22,10 +22,10 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T13:36:54.518507627" + "timestamp": "2024-09-05T17:40:47.828005254" }, "default - sample": { "content": [ diff --git a/tests/subworkflows/local/vcf_validate_small_variants/main.nf.test b/tests/subworkflows/local/vcf_validate_small_variants/main.nf.test index b77bd568..6714fe38 100644 --- a/tests/subworkflows/local/vcf_validate_small_variants/main.nf.test +++ b/tests/subworkflows/local/vcf_validate_small_variants/main.nf.test @@ -31,24 +31,20 @@ nextflow_workflow { workflow { """ input[0] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:3], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.famvcf, checkIfExists:true), file(params.famtbi, checkIfExists:true), file(params.vcf1, checkIfExists:true), file(params.tbi1, checkIfExists:true) ]) input[1] = Channel.of([ - [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_count:3], + [id:"NA24143", sample:"NA24143", family:"Ashkenazim", family_samples:"NA24143,NA24149,NA24385"], file(params.bed, checkIfExists:true), [] ]) input[2] = [[],[]] input[3] = [[],[]] input[4] = UNTAR.out.untar - input[5] = [[],[]] - input[6] = [[],[]] - input[7] = [[],[]] - input[8] = "vcfeval" """ } } @@ -57,15 +53,6 @@ nextflow_workflow { assertAll( { assert workflow.success }, { assert snapshot( - workflow.out.happy_vcf, - workflow.out.happy_tbi, - workflow.out.happy_indel_roc, - workflow.out.happy_indel_roc_pass, - workflow.out.happy_snp_roc, - workflow.out.happy_snp_roc_pass, - workflow.out.happy_roc, - workflow.out.happy_summary, - workflow.out.happy_extended_csv, workflow.out.vcfeval_true_positive_vcf, workflow.out.vcfeval_true_positive_vcf_tbi, workflow.out.vcfeval_false_negative_vcf, diff --git a/tests/subworkflows/local/vcf_validate_small_variants/main.nf.test.snap b/tests/subworkflows/local/vcf_validate_small_variants/main.nf.test.snap index 8639b840..7d04aca4 100644 --- a/tests/subworkflows/local/vcf_validate_small_variants/main.nf.test.snap +++ b/tests/subworkflows/local/vcf_validate_small_variants/main.nf.test.snap @@ -1,40 +1,13 @@ { "default": { "content": [ - [ - - ], - [ - - ], - [ - - ], - [ - - ], - [ - - ], - [ - - ], - [ - - ], - [ - - ], - [ - - ], [ [ { "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.tp.vcf.gz:md5,b28d3e84a6efa95bfbf673de310f62c1" ] @@ -45,7 +18,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.tp.vcf.gz.tbi:md5,8f8356fd93e093e9deb1c2c4c72cb65e" ] @@ -56,7 +29,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.fn.vcf.gz:md5,99830701ae0191110b706b20abe56857" ] @@ -67,7 +40,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.fn.vcf.gz.tbi:md5,092a7a3162e7cff25d273525751eb284" ] @@ -78,7 +51,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.fp.vcf.gz:md5,2769bf65afefc821fe54a8b314b5d2be" ] @@ -89,7 +62,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.fp.vcf.gz.tbi:md5,092a7a3162e7cff25d273525751eb284" ] @@ -100,7 +73,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.tp-baseline.vcf.gz:md5,6de63c7e2fa458ca88ea78c36f579056" ] @@ -111,7 +84,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.tp-baseline.vcf.gz.tbi:md5,8d399004d8c45fa795b70da32e23a6d5" ] @@ -122,7 +95,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.summary.txt:md5,11416903ca828b22bd64cf297f2db999" ] @@ -133,7 +106,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.phasing.txt:md5,38920536b8c3e241e873c07ba61762e6" ] @@ -144,7 +117,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.snp_roc.tsv.gz:md5,d29e7796d37dada43378e466af98c35a" ] @@ -155,7 +128,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.non_snp_roc.tsv.gz:md5,121b8b67d40efcaf1aad5064c6f3bfe9" ] @@ -166,7 +139,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3 + "family_samples": "NA24143,NA24149,NA24385" }, "NA24143.weighted_roc.tsv.gz:md5,f016f9a10e793836b9b53d702e591454" ] @@ -177,7 +150,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "roc_type": "snp" }, "NA24143.snp.png" @@ -189,7 +162,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "roc_type": "non_snp" }, "NA24143.non_snp.png" @@ -201,7 +174,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "roc_type": "weighted" }, "NA24143.weighted.png" @@ -213,7 +186,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "roc_type": "snp" }, "NA24143.snp.svg" @@ -225,7 +198,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "roc_type": "non_snp" }, "NA24143.non_snp.svg" @@ -237,7 +210,7 @@ "id": "NA24143", "sample": "NA24143", "family": "Ashkenazim", - "family_count": 3, + "family_samples": "NA24143,NA24149,NA24385", "roc_type": "weighted" }, "NA24143.weighted.svg" @@ -245,9 +218,9 @@ ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nf-test": "0.9.0", + "nextflow": "24.04.4" }, - "timestamp": "2024-03-27T14:02:50.290466115" + "timestamp": "2024-09-05T17:41:19.06545291" } } \ No newline at end of file diff --git a/workflows/germline.nf b/workflows/germline.nf index 16f4aa25..fe3e04b6 100644 --- a/workflows/germline.nf +++ b/workflows/germline.nf @@ -135,29 +135,29 @@ workflow GERMLINE { // Importing and convert the input files passed through the parameters to channels // - ch_fasta_ready = Channel.fromPath(fasta).map{ [[id:"reference"], it]}.collect() - ch_fai = fai ? Channel.fromPath(fai).map{ [[id:"reference"], it]}.collect() : null - ch_dict = dict ? Channel.fromPath(dict).map{ [[id:"reference"], it]}.collect() : null - ch_strtablefile = strtablefile ? Channel.fromPath(strtablefile).map{ [[id:"reference"], it]}.collect() : null - ch_sdf = sdf ? Channel.fromPath(sdf).map {sdf -> [[id:'reference'], sdf]}.collect() : null + ch_fasta_ready = Channel.fromPath(fasta).map{ fasta_file -> [[id:"reference"], fasta_file] }.collect() + ch_fai = fai ? Channel.fromPath(fai).map{ fai_file -> [[id:"reference"], fai_file] }.collect() : null + ch_dict = dict ? Channel.fromPath(dict).map{ dict_file -> [[id:"reference"], dict_file] }.collect() : null + ch_strtablefile = strtablefile ? Channel.fromPath(strtablefile).map{ str_file -> [[id:"reference"], str_file] }.collect() : null + ch_sdf = sdf ? Channel.fromPath(sdf).map { sdf_file -> [[id:'reference'], sdf_file] }.collect() : null ch_default_roi = roi ? Channel.fromPath(roi).collect() : [] - ch_dbsnp_ready = dbsnp ? Channel.fromPath(dbsnp).collect() : [] - ch_dbsnp_tbi = dbsnp_tbi ? Channel.fromPath(dbsnp_tbi).collect() : [] + ch_dbsnp_ready = dbsnp ? Channel.fromPath(dbsnp).collect { dbsnp_file -> [[id:"dbsnp"], dbsnp_file] } : [[],[]] + ch_dbsnp_tbi = dbsnp_tbi ? Channel.fromPath(dbsnp_tbi).collect { dbsnp_file -> [[id:"dbsnp"], dbsnp_file] } : [[],[]] - ch_somalier_sites = somalier_sites ? Channel.fromPath(somalier_sites).collect() : [] + ch_somalier_sites = somalier_sites ? Channel.fromPath(somalier_sites).collect { sites_file -> [[id:"somalier_sites"], sites_file] } : [[],[]] ch_vep_cache = vep_cache ? Channel.fromPath(vep_cache).collect() : [] ch_vcfanno_config = vcfanno_config ? Channel.fromPath(vcfanno_config).collect() : [] ch_vcfanno_lua = vcfanno_lua ? Channel.fromPath(vcfanno_lua).collect() : [] - ch_vcfanno_resources = vcfanno_resources ? Channel.of(vcfanno_resources.split(";")).map({ file(it, checkIfExists:true) }).collect() : [] + ch_vcfanno_resources = vcfanno_resources ? Channel.of(vcfanno_resources.split(";")).collect{ res -> file(res, checkIfExists:true) } : [] - ch_updio_common_cnvs = updio_common_cnvs ? Channel.fromPath(common_cnv_file).map { [[id:'updio_cnv'], it] } : [[],[]] + ch_updio_common_cnvs = updio_common_cnvs ? Channel.fromPath(updio_common_cnvs).map{ common_cnvs -> [[id:'updio_cnv'], common_cnvs] } : [[],[]] - ch_automap_repeats = automap_repeats ? Channel.fromPath(automap_repeats).map { [[id:"repeats"], it]}.collect() : [] - ch_automap_panel = automap_panel ? Channel.fromPath(automap_panel).map { [[id:"automap_panel"], it]}.collect() : [[],[]] + ch_automap_repeats = automap_repeats ? Channel.fromPath(automap_repeats).map{ repeats -> [[id:"repeats"], repeats] }.collect() : [] + ch_automap_panel = automap_panel ? Channel.fromPath(automap_panel).map{ panel -> [[id:"automap_panel"], panel] }.collect() : [[],[]] // // Check for the presence of EnsemblVEP plugins that use extra files @@ -221,7 +221,7 @@ workflow GERMLINE { // DBSNP index if (ch_dbsnp_ready && !ch_dbsnp_tbi) { TABIX_DBSNP( - ch_dbsnp_ready.map { [[id:'dbsnp'], it] } + ch_dbsnp_ready.map { dbnsp -> [[id:'dbsnp'], dbsnp] } ) ch_versions = ch_versions.mix(TABIX_DBSNP.out.versions) @@ -236,6 +236,7 @@ workflow GERMLINE { } // Reference fasta index + ch_fai_ready = Channel.empty() if (!ch_fai) { FAIDX( ch_fasta_ready, @@ -252,6 +253,7 @@ workflow GERMLINE { } // Reference sequence dictionary + ch_dict_ready = Channel.empty() if (!ch_dict) { CREATESEQUENCEDICTIONARY( ch_fasta_ready @@ -288,7 +290,7 @@ workflow GERMLINE { // Reference validation SDF if (validate && !ch_sdf) { RTGTOOLS_FORMAT( - ch_fasta_ready.map { meta, fasta -> [meta, fasta, [], []]} + ch_fasta_ready.map { meta, fasta_file -> [meta, fasta_file, [], []] } ) ch_versions = ch_versions.mix(RTGTOOLS_FORMAT.out.versions) @@ -318,7 +320,7 @@ workflow GERMLINE { ) ch_versions = ch_versions.mix(ENSEMBLVEP_DOWNLOAD.out.versions) - ch_vep_cache_ready = ENSEMBLVEP_DOWNLOAD.out.cache.map{it[1]}.collect() + ch_vep_cache_ready = ENSEMBLVEP_DOWNLOAD.out.cache.collect{ meta, cache -> cache } } else { ch_vep_cache_ready = ch_vep_cache } @@ -328,35 +330,30 @@ workflow GERMLINE { // ch_samplesheet - .multiMap { families, meta, cram, crai, gvcf, tbi, roi, truth_vcf, truth_tbi, truth_bed -> + .multiMap { meta, cram, crai, gvcf, tbi, roi_file, truth_vcf, truth_tbi, truth_bed -> // Divide the input files into their corresponding channel def new_meta = meta + [ - family_count: families[meta.family].size(), // Contains the amount of samples in the family from this sample type: gvcf && cram ? "gvcf_cram" : gvcf ? "gvcf" : "cram" // Define the type of input data ] - def new_meta_validation = [ - id: meta.id, - sample: meta.sample, - family: meta.family - ] + def new_meta_validation = meta.subMap(["id", "sample", "family", "duplicate_count"]) truth_variants: [new_meta_validation, truth_vcf, truth_tbi, truth_bed] // Optional channel containing the truth VCF, its index and the optional BED file gvcf: [new_meta, gvcf, tbi] // Optional channel containing the GVCFs and their optional indices cram: [new_meta, cram, crai] // Mandatory channel containing the CRAM files and their optional indices - roi: [new_meta, roi] // Optional channel containing the ROI BED files for WES samples - family_samples: [meta.family, families[meta.family]] // A channel containing the samples per family + roi: [new_meta, roi_file] // Optional channel containing the ROI BED files for WES samples } .set { ch_input } - ch_family_samples = ch_input.family_samples.distinct() - // // Create the GVCF index if it's missing // ch_input.gvcf - .filter { it[0].type == "gvcf" || it[0].type == "gvcf_cram" } // Filter out samples that have no GVCF + .filter { meta, gvcf, tbi -> + // Filter out samples that have no GVCF + meta.type == "gvcf" || meta.type == "gvcf_cram" + } .branch { meta, gvcf, tbi -> no_tbi: !tbi return [ meta, gvcf ] @@ -380,8 +377,14 @@ workflow GERMLINE { // CRAM_PREPARE_SAMTOOLS_BEDTOOLS( - ch_input.cram.filter { it[0].type == "cram" || (it[0].type == "gvcf_cram" && callers - GlobalVariables.gvcfCallers) }, // Filter out files that already have a called GVCF when only GVCF callers are used - ch_input.roi.filter { it[0].type == "cram" || (it[0].type == "gvcf_cram" && callers - GlobalVariables.gvcfCallers) }, // Filter out files that already have a called GVCF when only GVCF callers are used + ch_input.cram.filter { meta, cram, crai -> + // Filter out files that already have a called GVCF when only GVCF callers are used + meta.type == "cram" || (meta.type == "gvcf_cram" && callers - GlobalVariables.gvcfCallers) + }, + ch_input.roi.filter { meta, roi_file -> + // Filter out files that already have a called GVCF when only GVCF callers are used + meta.type == "cram" || (meta.type == "gvcf_cram" && callers - GlobalVariables.gvcfCallers) + }, ch_fasta_ready, ch_fai_ready, ch_default_roi @@ -393,7 +396,9 @@ workflow GERMLINE { // INPUT_SPLIT_BEDTOOLS( - CRAM_PREPARE_SAMTOOLS_BEDTOOLS.out.ready_beds.map { it + [scatter_count] }, + CRAM_PREPARE_SAMTOOLS_BEDTOOLS.out.ready_beds.map { meta, bed -> + [meta, bed, scatter_count] + }, CRAM_PREPARE_SAMTOOLS_BEDTOOLS.out.ready_crams ) ch_versions = ch_versions.mix(INPUT_SPLIT_BEDTOOLS.out.versions) @@ -406,7 +411,10 @@ workflow GERMLINE { // CRAM_CALL_GENOTYPE_GATK4( - INPUT_SPLIT_BEDTOOLS.out.split.filter { it[0].type == "cram" }, // Filter out the entries that already have a GVCF + INPUT_SPLIT_BEDTOOLS.out.split.filter { meta, cram, crai, bed -> + // Filter out the entries that already have a GVCF + meta.type == "cram" + }, ch_gvcfs_ready, ch_fasta_ready, ch_fai_ready, @@ -462,8 +470,9 @@ workflow GERMLINE { [[],[]] ) ch_versions = ch_versions.mix(BCFTOOLS_STATS.out.versions.first()) - ch_reports = ch_reports.mix(BCFTOOLS_STATS.out.stats.collect { it[1] }) + ch_reports = ch_reports.mix(BCFTOOLS_STATS.out.stats.collect { meta, report -> report }) + ch_normalized_variants = Channel.empty() if(normalize) { BCFTOOLS_NORM( ch_called_variants, @@ -489,7 +498,6 @@ workflow GERMLINE { // Preprocess the PED channel // - ch_normalized_variants .map { meta, vcf, tbi -> [ meta, pedFiles.containsKey(meta.family) ? pedFiles[meta.family] : [] ] @@ -502,8 +510,8 @@ workflow GERMLINE { VCF_EXTRACT_RELATE_SOMALIER( ch_normalized_variants, - ch_fasta_ready.map { it[1] }, - ch_fai_ready.map { it[1] }, + ch_fasta_ready, + ch_fai_ready, ch_somalier_sites, ch_somalier_input ) @@ -513,6 +521,7 @@ workflow GERMLINE { // Add PED headers to the VCFs // + ch_ped_vcfs = Channel.empty() if(add_ped){ VCF_PED_RTGTOOLS( @@ -535,6 +544,7 @@ workflow GERMLINE { // Annotation of the variants and creation of Gemini-compatible database files // + ch_annotation_output = Channel.empty() if (annotate) { VCF_ANNOTATION( ch_ped_vcfs, @@ -581,12 +591,16 @@ workflow GERMLINE { if (validate){ ch_input.truth_variants - .groupTuple() // No size needed here since it's being run before any process + .map { meta, vcf, tbi, bed -> + def new_meta = meta - meta.subMap("duplicate_count") + [ groupKey(new_meta, meta.duplicate_count), vcf, tbi, bed ] + } + .groupTuple() .map { meta, vcf, tbi, bed -> // Get only one VCF for samples that were given multiple times - one_vcf = vcf.find { it != [] } ?: [] - one_tbi = tbi.find { it != [] } ?: [] - one_bed = bed.find { it != [] } ?: [] + def one_vcf = vcf.find { vcf_file -> vcf_file != [] } ?: [] + def one_tbi = tbi.find { tbi_file -> tbi_file != [] } ?: [] + def one_bed = bed.find { bed_file -> bed_file != [] } ?: [] [ meta, one_vcf, one_tbi, one_bed ] } .branch { meta, vcf, tbi, bed -> @@ -620,13 +634,8 @@ workflow GERMLINE { ch_final_vcfs .map { meta, vcf, tbi -> - def new_meta = meta - meta.subMap("family_count") - [ meta.family, new_meta, vcf, tbi ] - } - .combine(ch_family_samples, by:0) - .map { family, meta, vcf, tbi, samples -> - def sample = meta.sample ? [meta.sample] : samples - [ meta, vcf, tbi, sample ] + def new_meta = meta - meta.subMap("family_samples") + [ new_meta, vcf, tbi, meta.family_samples.tokenize(",") ] } .transpose(by: 3) .map { meta, vcf, tbi, sample -> @@ -638,7 +647,7 @@ workflow GERMLINE { ] [ new_meta, vcf, tbi ] } - .combine(ch_truths, by:0) + .join(ch_truths, failOnMismatch:true, failOnDuplicate:true) .filter { meta, vcf, tbi, truth_vcf, truth_tbi, truth_bed -> // Filter out all samples that have no truth VCF truth_vcf != [] @@ -654,11 +663,7 @@ workflow GERMLINE { ch_validation_input.bed, ch_fasta_ready, ch_fai_ready, - ch_sdf_ready.collect(), - [[],[]], - [[],[]], - [[],[]], - "vcfeval" //Only VCFeval for now, awaiting the conda fix for happy (https://github.com/bioconda/bioconda-recipes/pull/39267) + ch_sdf_ready.collect() ) ch_versions = ch_versions.mix(VCF_VALIDATE_SMALL_VARIANTS.out.versions) } @@ -671,7 +676,7 @@ workflow GERMLINE { CustomChannelOperators.joinOnKeys( ch_final_vcfs.map { meta, vcf, tbi -> [ meta, vcf ]}, VCF_EXTRACT_RELATE_SOMALIER.out.peds, - ['id', 'family', 'family_count'] + ['id', 'family', 'family_samples'] ) .dump(tag:'vcf2db_input', pretty:true) .set { ch_vcf2db_input } @@ -757,7 +762,9 @@ workflow GERMLINE { ch_multiqc_files.collect(), ch_multiqc_config.toList(), ch_multiqc_custom_config.toList(), - ch_multiqc_logo.toList() + ch_multiqc_logo.toList(), + [], + [] ) emit: