diff --git a/.editorconfig b/.editorconfig index dd9ffa5387..72dda289a0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -28,10 +28,6 @@ indent_style = unset [/assets/email*] indent_size = unset -# ignore Readme -[README.md] -indent_style = unset - -# ignore python +# ignore python and markdown [*.{py,md}] indent_style = unset diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e322567d91..934d8f2600 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -18,7 +18,7 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/sare - [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/sarek/tree/master/.github/CONTRIBUTING.md) - [ ] If necessary, also make a PR on the nf-core/sarek _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. - [ ] Make sure your code lints (`nf-core lint`). -- [ ] Ensure the test suite passes (`nf-test test tests/ --verbose --profile +docker`). +- [ ] 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 `). - [ ] Usage Documentation in `docs/usage.md` is updated. - [ ] Output Documentation in `docs/output.md` is updated. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd10494805..c48d11e7c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: steps: - name: Check out pipeline code - uses: actions/checkout@v4 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b - name: Hash Github Workspace id: hash_workspace @@ -89,7 +89,7 @@ jobs: run: pip install --upgrade -r tests/requirements.txt - name: Install Nextflow ${{ matrix.NXF_VER }} - uses: nf-core/setup-nextflow@v1 + uses: nf-core/setup-nextflow@v2 with: version: "${{ matrix.NXF_VER }}" @@ -214,6 +214,7 @@ jobs: - "23.04.0" - "latest-everything" exclude: + - tags: "bcftools/annotate" - tags: "bcftools/concat" - tags: "bcftools/mpileup" - tags: "bcftools/sort" @@ -223,7 +224,9 @@ jobs: - tags: "bwamem2/mem" - tags: "cat/cat" - tags: "cat/fastq" + - tags: "cnvkit/antitarget" - tags: "cnvkit/batch" + - tags: "cnvkit/reference" - tags: "deepvariant" - tags: "dragmap/align" - tags: "dragmap/hashtable" @@ -243,9 +246,12 @@ jobs: - tags: "gatk4/mutect2" - tags: "gatk4spark/applybqsr" - tags: "gatk4spark/markduplicates" + - tags: "gawk" - tags: "mosdepth" - tags: "multiqc" + - tags: "ngscheckmate/ncm" - tags: "samblaster" + - tags: "samtools/convert" - tags: "samtools/mpileup" - tags: "samtools/stats" - tags: "snpeff/snpeff" @@ -274,7 +280,7 @@ jobs: java-version: "17" - name: Install Nextflow ${{ matrix.NXF_VER }} - uses: nf-core/setup-nextflow@v1 + uses: nf-core/setup-nextflow@v2 with: version: "${{ matrix.NXF_VER }}" diff --git a/.github/workflows/download_pipeline.yml b/.github/workflows/download_pipeline.yml index 48fe5d0a94..2d20d64422 100644 --- a/.github/workflows/download_pipeline.yml +++ b/.github/workflows/download_pipeline.yml @@ -14,6 +14,8 @@ on: pull_request: types: - opened + - edited + - synchronize branches: - master pull_request_target: @@ -28,11 +30,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Nextflow - uses: nf-core/setup-nextflow@v1 + uses: nf-core/setup-nextflow@v2 - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 + - name: Disk space cleanup + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + + - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 with: - python-version: "3.11" + python-version: "3.12" architecture: "x64" - uses: eWaterCycle/setup-singularity@931d4e31109e875b13309ae1d07c70ca8fbc8537 # v7 with: @@ -65,7 +70,16 @@ jobs: - name: Inspect download run: tree ./${{ env.REPOTITLE_LOWERCASE }} - - name: Run the downloaded pipeline + - name: Run the downloaded pipeline (stub) + id: stub_run_pipeline + continue-on-error: true + env: + NXF_SINGULARITY_CACHEDIR: ./ + NXF_SINGULARITY_HOME_MOUNT: true + run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results + - name: Run the downloaded pipeline (stub run not supported) + id: run_pipeline + if: ${{ job.steps.stub_run_pipeline.status == failure() }} env: NXF_SINGULARITY_CACHEDIR: ./ NXF_SINGULARITY_HOME_MOUNT: true diff --git a/.github/workflows/fix-linting.yml b/.github/workflows/fix-linting.yml index d0354d3ef8..8d6428f8e2 100644 --- a/.github/workflows/fix-linting.yml +++ b/.github/workflows/fix-linting.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: # Use the @nf-core-bot token to check out so we can push later - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 with: token: ${{ secrets.nf_core_bot_auth_token }} @@ -32,9 +32,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }} # Install and run pre-commit - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 + - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 with: - python-version: 3.11 + python-version: "3.12" - name: Install pre-commit run: pip install pre-commit diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 073e18767e..1fcafe8805 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -14,13 +14,12 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 - - name: Set up Python 3.11 - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 + - name: Set up Python 3.12 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 with: - python-version: 3.11 - cache: "pip" + python-version: "3.12" - name: Install pre-commit run: pip install pre-commit @@ -32,14 +31,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out pipeline code - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 - name: Install Nextflow - uses: nf-core/setup-nextflow@v1 + uses: nf-core/setup-nextflow@v2 - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 + - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 with: - python-version: "3.11" + python-version: "3.12" architecture: "x64" - name: Install dependencies @@ -60,7 +59,7 @@ jobs: - name: Upload linting log file artifact if: ${{ always() }} - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4 with: name: linting-logs path: | diff --git a/.github/workflows/linting_comment.yml b/.github/workflows/linting_comment.yml index b706875fc0..40acc23f5b 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@f6b0bace624032e30a85a8fd9c1a7f8f611f5737 # v3 + uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3 with: workflow: linting.yml workflow_conclusion: completed diff --git a/.github/workflows/release-announcements.yml b/.github/workflows/release-announcements.yml index d468aeaaec..03ecfcf720 100644 --- a/.github/workflows/release-announcements.yml +++ b/.github/workflows/release-announcements.yml @@ -12,7 +12,7 @@ jobs: - name: get topics and convert to hashtags id: get_topics run: | - curl -s https://nf-co.re/pipelines.json | jq -r '.remote_workflows[] | select(.full_name == "${{ github.repository }}") | .topics[]' | awk '{print "#"$0}' | tr '\n' ' ' >> $GITHUB_OUTPUT + echo "topics=$(curl -s https://nf-co.re/pipelines.json | jq -r '.remote_workflows[] | select(.full_name == "${{ github.repository }}") | .topics[]' | awk '{print "#"$0}' | tr '\n' ' ')" >> $GITHUB_OUTPUT - uses: rzr/fediverse-action@master with: @@ -25,13 +25,13 @@ jobs: Please see the changelog: ${{ github.event.release.html_url }} - ${{ steps.get_topics.outputs.GITHUB_OUTPUT }} #nfcore #openscience #nextflow #bioinformatics + ${{ steps.get_topics.outputs.topics }} #nfcore #openscience #nextflow #bioinformatics send-tweet: runs-on: ubuntu-latest steps: - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5 + - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 with: python-version: "3.10" - name: Install dependencies diff --git a/.gitignore b/.gitignore index 9bd5a6ee00..c807bd5d3f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ testing* .nf-test* .nf-test/ test-datasets/ +test.tap +test.xml diff --git a/.nf-core.yml b/.nf-core.yml index c54e86853c..e0b3aa1f76 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -1,19 +1,16 @@ repository_type: pipeline +nf_core_version: "2.14.1" lint: actions_ci: False files_exist: - .github/workflows/awsfulltest.yml - .github/workflows/awstest.yml - conf/modules.config - - lib/WorkflowMain.groovy - - lib/NfcoreTemplate.groovy - - lib/WorkflowSarek.groovy files_unchanged: - .gitignore - .github/PULL_REQUEST_TEMPLATE.md - assets/nf-core-sarek_logo_light.png - docs/images/nf-core-sarek_logo_dark.png - docs/images/nf-core-sarek_logo_light.png - - lib/NfcoreTemplate.groovy - - lib/NfcoreSchema.groovy + modules_config: False template_strings: False diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af57081f60..4dc0f1dcd7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,9 @@ repos: rev: "v3.1.0" hooks: - id: prettier + additional_dependencies: + - prettier@3.2.5 + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python rev: "2.7.3" hooks: diff --git a/CHANGELOG.md b/CHANGELOG.md index 4257960df7..f3e00d0863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,57 @@ All notable changes to this project will be documented in this file. 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). +## [3.4.3](https://github.com/nf-core/sarek/releases/tag/3.4.3) - Loametjåhkkå + +Loametjåhkkå is another one of the main peaks of the Pårte massif. + +### Added + +- [#1502](https://github.com/nf-core/sarek/pull/1502) - export CNVs into VCF format in `bam_variant_calling_cnvkit` +- [#1534](https://github.com/nf-core/sarek/pull/1534), [#1573](https://github.com/nf-core/sarek/pull/1573) - Handling `.fastq.gz.spring` files as input +- [#1593](https://github.com/nf-core/sarek/pull/1593) - Prepare release `3.4.2` + +### Changed + +- [#1502](https://github.com/nf-core/sarek/pull/1502) - Improved handling of CNVkit reference +- [#1502](https://github.com/nf-core/sarek/pull/1502) - Specific CNV call step, with recommended settings for germline +- [#1508](https://github.com/nf-core/sarek/pull/1508) - Sync `TEMPLATE` with `tools` `2.14.0` +- [#1513](https://github.com/nf-core/sarek/pull/1513) - Back to dev +- [#1518](https://github.com/nf-core/sarek/pull/1518) - Sync `TEMPLATE` with `tools` `2.14.1` +- [#1521](https://github.com/nf-core/sarek/pull/1521) - Minor code refactoring to simplify syntax in args handling +- [#1545](https://github.com/nf-core/sarek/pull/1545) - Update modules +- [#1552](https://github.com/nf-core/sarek/pull/1552) - Update samtools to v1.20 +- [#1545](https://github.com/nf-core/sarek/pull/1545) - Update modules +- [#1553](https://github.com/nf-core/sarek/pull/1553) - Update bcftools to v1.20 +- [#1557](https://github.com/nf-core/sarek/pull/1557) - Update ENSEMBLVEP cache to 111 + +### Fixed + +- [#1536](https://github.com/nf-core/sarek/pull/1536) - Correct typo `Strelka2` to `Strelka` +- [#1541](https://github.com/nf-core/sarek/pull/1541) - Getting bam and bai published in the same folder +- [#1542](https://github.com/nf-core/sarek/pull/1542) - Removing legacy configs of `CUSTOM_DUMPSOFTWAREVERSIONS` +- [#1547](https://github.com/nf-core/sarek/pull/1547) - Correct typo in help text in nextflow_schema.json +- [#1556](https://github.com/nf-core/sarek/pull/1556) - Fix display of some commands in `docs/usage.md` +- [#1563](https://github.com/nf-core/sarek/pull/1563) - Fix `vep_cache_path_full` so that `--refseq/--merged` will work for ENSEMBLVEP +- [#1570](https://github.com/nf-core/sarek/pull/1570) - Remove duplicated notes in FASTQC output docs +- [#1596](https://github.com/nf-core/sarek/pull/1596) - Fix haplotypecaller tests +- [#1597](https://github.com/nf-core/sarek/pull/1597) - Fix deepvariant tests +- [#1612](https://github.com/nf-core/sarek/pull/1612) - Remove empty output directories + +### Removed + +### Dependencies + +| Dependency | Old version | New version | +| ---------- | ----------- | ----------- | +| `bcftools` | 1.18 | 1.20 | +| `bwa` | 0.7.17 | 0.7.18 | +| `cnvkit` | 0.9.10 | 0.9.11 | +| `htslib` | 1.19.1 | 1.20 | +| `samtools` | 1.19.2 | 1.20 | + +### Parameters + ## [3.4.2](https://github.com/nf-core/sarek/releases/tag/3.4.2) - Sájtáristjåhkkå Sájtáristjåhkkå is another peak (just under 2k) in the Pårte massif, it is one of the few peaks in Sweden that cannot be climbed without proper climbing equipment. diff --git a/README.md b/README.md index 490230d700..4afd61518c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ [![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/) -[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://tower.nf/launch?pipeline=https://github.com/nf-core/sarek) +[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/nf-core/sarek) [![Get help on Slack](http://img.shields.io/badge/slack-nf--core%20%23sarek-4A154B?labelColor=000000&logo=slack)](https://nfcore.slack.com/channels/sarek) [![Follow on Twitter](http://img.shields.io/badge/twitter-%40nf__core-1DA1F2?labelColor=000000&logo=twitter)](https://twitter.com/nf_core) @@ -142,12 +142,14 @@ We thank the following people for their extensive assistance in the development - [Chela James](https://github.com/chelauk) - [David Mas-Ponte](https://github.com/davidmasp) - [Edmund Miller](https://github.com/edmundmiller) +- [Famke Bäuerle](https://github.com/famosab) - [Francesco Lescai](https://github.com/lescai) - [Gavin Mackenzie](https://github.com/GCJMackenzie) - [Gisela Gabernet](https://github.com/ggabernet) - [Grant Neilson](https://github.com/grantn5) - [gulfshores](https://github.com/gulfshores) - [Harshil Patel](https://github.com/drpatelh) +- [Hongwei Ye](https://github.com/YeHW) - [James A. Fellows Yates](https://github.com/jfy133) - [Jesper Eisfeldt](https://github.com/J35P312) - [Johannes Alneberg](https://github.com/alneberg) diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index 206bd82386..ea1fbb0aae 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -3,9 +3,9 @@ custom_logo_url: https://github.com/nf-core/sarek/ custom_logo_title: "nf-core/sarek" report_comment: > - This report has been generated by the nf-core/sarek + This report has been generated by the nf-core/sarek analysis pipeline. For information about how to interpret these results, please see the - documentation. + documentation. report_section_order: "nf-core-sarek-methods-description": order: -1000 diff --git a/assets/schema_input.json b/assets/schema_input.json index ad0b39f586..ce010b51dd 100644 --- a/assets/schema_input.json +++ b/assets/schema_input.json @@ -47,17 +47,20 @@ "pattern": "^\\S+$", "unique": ["patient", "sample"], "anyOf": [ + { + "dependentRequired": ["bam"] + }, { "dependentRequired": ["fastq_1"] }, { - "dependentRequired": ["bam"] + "dependentRequired": ["spring_1"] } ], "meta": ["lane"] }, "fastq_1": { - "errorMessage": "FastQ file for reads 1 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'", + "errorMessage": "Gzipped FastQ file for reads 1 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'", "anyOf": [ { "type": "string", @@ -72,7 +75,7 @@ "exists": true }, "fastq_2": { - "errorMessage": "FastQ file for reads 2 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'", + "errorMessage": "Gzipped FastQ file for reads 2 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'", "dependentRequired": ["fastq_1"], "anyOf": [ { @@ -87,6 +90,37 @@ "format": "file-path", "exists": true }, + "spring_1": { + "errorMessage": "Gzipped and spring-compressed FastQ file for reads 1 cannot contain spaces and must have extension '.fq.gz.spring' or '.fastq.gz.spring'", + "anyOf": [ + { + "type": "string", + "pattern": "^\\S+\\.f(ast)?q\\.gz.spring$" + }, + { + "type": "string", + "maxLength": 0 + } + ], + "format": "file-path", + "exists": true + }, + "spring_2": { + "errorMessage": "Gzipped and spring-compressed FastQ file for reads 2 cannot contain spaces and must have extension '.fq.gz.spring' or '.fastq.gz.spring'", + "dependentRequired": ["spring_1"], + "anyOf": [ + { + "type": "string", + "pattern": "^\\S+\\.f(ast)?q\\.gz.spring$" + }, + { + "type": "string", + "maxLength": 0 + } + ], + "format": "file-path", + "exists": true + }, "table": { "errorMessage": "Recalibration table cannot contain spaces and must have extension '.table'", "anyOf": [ diff --git a/conf/base.config b/conf/base.config index d371e9407f..cf19c7081c 100644 --- a/conf/base.config +++ b/conf/base.config @@ -54,7 +54,7 @@ process { withLabel:process_high_memory { memory = { check_max( 200.GB * task.attempt, 'memory' ) } } - withName: 'UNZIP.*|UNTAR.*|TABIX.*|BUILD_INTERVALS|CREATE_INTERVALS_BED|CUSTOM_DUMPSOFTWAREVERSIONS|VCFTOOLS|BCFTOOLS.*|SAMTOOLS_INDEX' { + withName: 'UNZIP.*|UNTAR.*|TABIX.*|BUILD_INTERVALS|CREATE_INTERVALS_BED|VCFTOOLS|BCFTOOLS.*|SAMTOOLS_INDEX' { cpus = { check_max( 1 * task.attempt, 'cpus' ) } memory = { check_max( 1.GB * task.attempt, 'memory' ) } } diff --git a/conf/igenomes.config b/conf/igenomes.config index a3f57e6d7e..af199c5e6d 100644 --- a/conf/igenomes.config +++ b/conf/igenomes.config @@ -75,7 +75,7 @@ params { sentieon_dnascope_model = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/Sentieon/SentieonDNAscopeModel1.1.model" snpeff_db = '105' snpeff_genome = 'GRCh38' - vep_cache_version = '110' + vep_cache_version = '111' vep_genome = 'GRCh38' vep_species = 'homo_sapiens' } @@ -336,7 +336,7 @@ params { ngscheckmate_bed = "${params.igenomes_base}/genomics/homo_sapiens/genome/chr21/germlineresources/SNP_GRCh38_hg38_wChr.bed" snpeff_db = '105' snpeff_genome = 'WBcel235' - vep_cache_version = '110' + vep_cache_version = '111' vep_genome = 'WBcel235' vep_species = 'caenorhabditis_elegans' } diff --git a/conf/modules/cnvkit.config b/conf/modules/cnvkit.config index afeed0bdf6..2bf455faa7 100644 --- a/conf/modules/cnvkit.config +++ b/conf/modules/cnvkit.config @@ -25,6 +25,36 @@ process { ] } + withName: '.*:BAM_VARIANT_CALLING_CNVKIT:CNVKIT_CALL' { + ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/cnvkit/${meta.id}/" }, + pattern: "*{cns}" + ] + } + withName: '.*:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_CNVKIT:CNVKIT_CALL' { + ext.prefix = { "${cns.baseName}.germline.call" } + ext.args = "--filter ci" + } + withName: '.*:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_CNVKIT:CNVKIT_CALL' { + ext.prefix = { "${cns.baseName}.somatic.call" } + } + withName: '.*:BAM_VARIANT_CALLING_TUMOR_ONLY_ALL:BAM_VARIANT_CALLING_CNVKIT:CNVKIT_CALL' { + ext.prefix = { "${cns.baseName}.tumor_only.call" } + } + + withName: 'CNVKIT_EXPORT' { + ext.args = "vcf" + ext.prefix = { "${meta.id}.cnvcall" } + ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } + publishDir = [ + mode: params.publish_dir_mode, + path: { "${params.outdir}/variant_calling/cnvkit/${meta.id}/" }, + pattern: "*{vcf}" + ] + } + withName: 'CNVKIT_GENEMETRICS' { ext.prefix = { "${cnr.baseName}.genemetrics" } ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } diff --git a/conf/modules/modules.config b/conf/modules/modules.config index f24cb481b7..d87f97174f 100644 --- a/conf/modules/modules.config +++ b/conf/modules/modules.config @@ -18,15 +18,6 @@ process { saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] - withName: CUSTOM_DUMPSOFTWAREVERSIONS { - cache = false - publishDir = [ - mode: params.publish_dir_mode, - path: { "${params.outdir}/pipeline_info" }, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - // QC withName: 'FASTQC' { ext.args = { '--quiet' } @@ -59,6 +50,13 @@ process { ] } + withName: 'NFCORE_SAREK:SAREK:SPRING_DECOMPRESS_.*' { + ext.prefix = { "${spring.simpleName}" } + publishDir = [ + enabled: false + ] + } + withName: 'MOSDEPTH' { ext.args = { !params.wes ? "-n --fast-mode --by 500" : ""} ext.prefix = { diff --git a/conf/modules/prepare_genome.config b/conf/modules/prepare_genome.config index e54138538c..1f57237be7 100644 --- a/conf/modules/prepare_genome.config +++ b/conf/modules/prepare_genome.config @@ -39,9 +39,9 @@ process { ext.when = { params.tools && params.tools.split(',').contains('cnvkit') } publishDir = [ mode: params.publish_dir_mode, - path: { "${params.outdir}/reference/cnvkit" }, + path: { "${params.outdir}/reference" }, pattern: "*{bed}", - saveAs: { params.save_reference || params.build_only_index ? it : null } + saveAs: { params.save_reference || params.build_only_index ? "cnvkit/${it}" : null } ] } @@ -50,9 +50,9 @@ process { ext.when = { params.tools && params.tools.split(',').contains('cnvkit') && !params.cnvkit_reference } publishDir = [ mode: params.publish_dir_mode, - path: { "${params.outdir}/reference/cnvkit" }, + path: { "${params.outdir}/reference" }, pattern: "*{cnn}", - saveAs: { params.save_reference || params.build_only_index ? it : null } + saveAs: { params.save_reference || params.build_only_index ? "cnvkit/${it}" : null } ] } diff --git a/conf/modules/prepare_intervals.config b/conf/modules/prepare_intervals.config index 77814b5d42..815903b996 100644 --- a/conf/modules/prepare_intervals.config +++ b/conf/modules/prepare_intervals.config @@ -23,18 +23,18 @@ process { withName: 'CREATE_INTERVALS_BED' { publishDir = [ mode: params.publish_dir_mode, - path: { "${params.outdir}/reference/intervals" }, + path: { "${params.outdir}/reference" }, pattern: "*bed", - saveAs: { params.save_reference || params.build_only_index ? it : null } + saveAs: { params.save_reference || params.build_only_index ? "intervals/${it}" : null } ] } withName: 'GATK4_INTERVALLISTTOBED' { publishDir = [ mode: params.publish_dir_mode, - path: { "${params.outdir}/reference/intervals" }, + path: { "${params.outdir}/reference" }, pattern: "*bed", - saveAs: { params.save_reference || params.build_only_index ? it : null } + saveAs: { params.save_reference || params.build_only_index ? "intervals/${it}" : null } ] } @@ -42,9 +42,9 @@ process { ext.prefix = {"${meta.id}"} publishDir = [ mode: params.publish_dir_mode, - path: { "${params.outdir}/reference/intervals" }, + path: { "${params.outdir}/reference" }, pattern: "*bed.gz", - saveAs: { params.save_reference || params.build_only_index ? it : null } + saveAs: { params.save_reference || params.build_only_index ? "intervals/${it}" : null } ] } } diff --git a/conf/modules/trimming.config b/conf/modules/trimming.config index 58be3b2539..5fc6f7646b 100644 --- a/conf/modules/trimming.config +++ b/conf/modules/trimming.config @@ -16,7 +16,7 @@ process { withName: 'FASTP' { - ext.args = [ '', + ext.args = [ !params.trim_fastq ? '--disable_adapter_trimming' : '', // Disable adapter trimming params.clip_r1 > 0 ? "--trim_front1 ${params.clip_r1}" : '', // Remove bp from the 5' end of read 1 params.clip_r2 > 0 ? "--trim_front2 ${params.clip_r2}" : '', // Remove bp from the 5' end of read 2 @@ -32,10 +32,10 @@ process { pattern: "*.{html,json,log}" ], [ - path: { "${params.outdir}/preprocessing/fastp/${meta.sample}/" }, + path: { "${params.outdir}/preprocessing/" }, mode: params.publish_dir_mode, pattern: "*.fastp.fastq.gz", - saveAs: { params.save_trimmed || params.save_split_fastqs ? it : null } + saveAs: { params.save_trimmed || params.save_split_fastqs ? "fastp/${meta.sample}/${it}" : null } ] ] } diff --git a/conf/test.config b/conf/test.config index 9dd0bca957..81567aed43 100644 --- a/conf/test.config +++ b/conf/test.config @@ -19,7 +19,7 @@ params { max_time = '8.h' // Base directory for nf-core/modules test data - modules_testdata_base_path = 's3://ngi-igenomes/testdata/nf-core/modules' + modules_testdata_base_path = 's3://ngi-igenomes/testdata/nf-core/modules/' // Input data input = "${projectDir}/tests/csv/3.0/fastq_single.csv" diff --git a/conf/test/alignment_from_everything.config b/conf/test/alignment_from_everything.config new file mode 100644 index 0000000000..25abd66cdf --- /dev/null +++ b/conf/test/alignment_from_everything.config @@ -0,0 +1,15 @@ +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Nextflow config file for running minimal tests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Defines input files and everything required to run a fast and simple pipeline test. + + Use as follows: + nextflow run nf-core/sarek -profile test,, --outdir +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +params { + input = "${projectDir}/tests/csv/3.0/bam_and_fastq_and_spring.csv" + tools = null +} diff --git a/docs/output.md b/docs/output.md index ff6445e89b..7f8455f95d 100644 --- a/docs/output.md +++ b/docs/output.md @@ -41,7 +41,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d - [Sentieon DNAscope joint germline variant calling](#sentieon-dnascope-joint-germline-variant-calling) - [Sentieon Haplotyper](#sentieon-haplotyper) - [Sentieon Haplotyper joint germline variant calling](#sentieon-haplotyper-joint-germline-variant-calling) - - [Strelka2](#strelka2) + - [Strelka](#strelka) - [Structural Variants](#structural-variants) - [Manta](#manta) - [TIDDIT](#tiddit) @@ -542,9 +542,9 @@ In Sentieon's package DNAseq, joint germline variant calling is done by first ru -#### Strelka2 +#### Strelka -[Strelka2](https://github.com/Illumina/strelka) is a fast and accurate small variant caller optimized for analysis of germline variation in small cohorts and somatic variation in tumor/normal sample pairs. For further reading and documentation see the [Strelka2 user guide](https://github.com/Illumina/strelka/blob/master/docs/userGuide/README.md). If [Strelka2](https://github.com/Illumina/strelka) is used for somatic variant calling and [Manta](https://github.com/Illumina/manta) is also specified in tools, the output candidate indels from [Manta](https://github.com/Illumina/manta) are used according to [Strelka Best Practices](https://github.com/Illumina/strelka/blob/master/docs/userGuide/README.md#somatic-configuration-example). +[Strelka](https://github.com/Illumina/strelka) is a fast and accurate small variant caller optimized for analysis of germline variation in small cohorts and somatic variation in tumor/normal sample pairs. For further reading and documentation see the [Strelka user guide](https://github.com/Illumina/strelka/blob/master/docs/userGuide/README.md). If [Strelka](https://github.com/Illumina/strelka) is used for somatic variant calling and [Manta](https://github.com/Illumina/manta) is also specified in tools, the output candidate indels from [Manta](https://github.com/Illumina/manta) are used according to [Strelka Best Practices](https://github.com/Illumina/strelka/blob/master/docs/userGuide/README.md#somatic-configuration-example). For further downstream analysis, take a look [here](https://github.com/Illumina/strelka/blob/v2.9.x/docs/userGuide/README.md#interpreting-the-germline-multi-sample-variants-vcf).
@@ -576,7 +576,7 @@ For further downstream analysis, take a look [here](https://github.com/Illumina/ [Manta](https://github.com/Illumina/manta) calls structural variants (SVs) and indels from mapped paired-end sequencing reads. It is optimized for analysis of germline variation in small sets of individuals and somatic variation in tumor/normal sample pairs. -[Manta](https://github.com/Illumina/manta) provides a candidate list for small indels that can be fed to [Strelka2](https://github.com/Illumina/strelka) following [Strelka Best Practices](https://github.com/Illumina/strelka/blob/master/docs/userGuide/README.md#somatic-configuration-example). For further reading and documentation see the [Manta user guide](https://github.com/Illumina/manta/blob/master/docs/userGuide/README.md). +[Manta](https://github.com/Illumina/manta) provides a candidate list for small indels that can be fed to [Strelka](https://github.com/Illumina/strelka) following [Strelka Best Practices](https://github.com/Illumina/strelka/blob/master/docs/userGuide/README.md#somatic-configuration-example). For further reading and documentation see the [Manta user guide](https://github.com/Illumina/manta/blob/master/docs/userGuide/README.md).
Output files for normal samples @@ -823,7 +823,7 @@ It requires a normal sample for each tumour to differentiate the somatic and ger ### Concatenation -Germline VCFs from `DeepVariant`, `FreeBayes`, `HaplotypeCaller`, `Haplotyper`, `Manta`, `bcftools mpileup`, `Strelka2`, or `Tiddit` are concatenated with `bcftools concat`. The field `SOURCE` is added to the VCF header to report the variant caller. +Germline VCFs from `DeepVariant`, `FreeBayes`, `HaplotypeCaller`, `Haplotyper`, `Manta`, `bcftools mpileup`, `Strelka`, or `Tiddit` are concatenated with `bcftools concat`. The field `SOURCE` is added to the VCF header to report the variant caller.
Concatenated VCF-files for normal samples @@ -924,9 +924,6 @@ The plots display:
Output files for all samples -:::note -The FastQC plots displayed in the MultiQC report shows _untrimmed_ reads. They may contain adapter sequence and potentially regions with low quality. -::: **Output directory: `{outdir}/reports/fastqc/`** - `_fastqc.html` and `_fastqc.html` @@ -934,8 +931,10 @@ The FastQC plots displayed in the MultiQC report shows _untrimmed_ reads. They m - `_fastqc.zip` and `_fastqc.zip` - Zip archive containing the [FastQC](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/) report, tab-delimited data file and plot images -> **NB:** The FastQC plots displayed in the [MultiQC](https://multiqc.info/) report shows _untrimmed_ reads. -> They may contain adapter sequence and potentially regions with low quality. +:::note +The FastQC plots displayed in the MultiQC report shows _untrimmed_ reads. +They may contain adapter sequence and potentially regions with low quality. +:::
@@ -1067,7 +1066,7 @@ For further reading and documentation see the [bcftools stats manual](https://sa Plots will show: - Stats by non-reference allele frequency, depth distribution, stats by quality and per-sample counts, singleton stats, etc. -- Note: When using [Strelka2](https://github.com/Illumina/strelka), there will be no depth distribution plot, as Strelka2 does not report the INFO/DP field +- Note: When using [Strelka](https://github.com/Illumina/strelka), there will be no depth distribution plot, as Strelka does not report the INFO/DP field
Output files for all samples diff --git a/docs/usage.md b/docs/usage.md index fbd3e8d9a6..076cbfb04e 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -80,27 +80,29 @@ Output from Variant Calling and/or Annotation will be in a specific directory fo ### Overview: Samplesheet Columns -| Column | Description | -| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `patient` | **Custom patient ID**; designates the patient/subject; must be unique for each patient, but one patient can have multiple samples (e.g. normal and tumor).
_Required_ | -| `sex` | **Sex chromosomes of the patient**; i.e. XX, XY..., only used for Copy-Number Variation analysis in a tumor/pair
_Optional, Default: `NA`_ | -| `status` | **Normal/tumor status of sample**; can be `0` (normal) or `1` (tumor).
_Optional, Default: `0`_ | -| `sample` | **Custom sample ID** for each tumor and normal sample; more than one tumor sample for each subject is possible, i.e. a tumor and a relapse; samples can have multiple lanes for which the _same_ ID must be used to merge them later (see also `lane`). Sample IDs must be unique for unique biological samples
_Required_ | -| `lane` | Lane ID, used when the `sample` is multiplexed on several lanes. Must be unique for each lane in the same sample (but does not need to be the original lane name), and must contain at least one character
_Required for `--step mapping`_ | -| `fastq_1` | Full path to FastQ file for Illumina short reads 1. File has to be gzipped and have the extension `.fastq.gz` or `.fq.gz`. | -| `fastq_2` | Full path to FastQ file for Illumina short reads 2. File has to be gzipped and have the extension `.fastq.gz` or `.fq.gz`. | -| `bam` | Full path to (u)BAM file | -| `bai` | Full path to BAM index file | -| `cram` | Full path to CRAM file | -| `crai` | Full path to CRAM index file | -| `table` | Full path to recalibration table file | -| `vcf` | Full path to vcf file | +| Column | Description | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `patient` | **Custom patient ID**; designates the patient/subject; must be unique for each patient, but one patient can have multiple samples (e.g. normal and tumor).
_Required_ | +| `sex` | **Sex chromosomes of the patient**; i.e. XX, XY..., only used for Copy-Number Variation analysis in a tumor/pair
_Optional, Default: `NA`_ | +| `status` | **Normal/tumor status of sample**; can be `0` (normal) or `1` (tumor).
_Optional, Default: `0`_ | +| `sample` | **Custom sample ID** for each tumor and normal sample; more than one tumor sample for each subject is possible, i.e. a tumor and a relapse; samples can have multiple lanes for which the _same_ ID must be used to merge them later (see also `lane`). Sample IDs must be unique for unique biological samples
_Required_ | +| `lane` | Lane ID, used when the `sample` is multiplexed on several lanes. Must be unique for each lane in the same sample (but does not need to be the original lane name), and must contain at least one character
_Required for `--step mapping`_ | +| `fastq_1` | Full path to FastQ file for Illumina short reads 1. File has to be gzipped and have the extension `.fastq.gz` or `.fq.gz`. | +| `fastq_2` | Full path to FastQ file for Illumina short reads 2. File has to be gzipped and have the extension `.fastq.gz` or `.fq.gz`. | +| `spring_1` | Full path to spring-compressed, gzipped FastQ file for read 1 or for reads 1 and 2. The Fastq file has to be first gzipped, then spring-compressed, and it must have the extension `.fastq.gz.spring` or `.fq.gz.spring`. | +| `spring_2` | Full path to spring-compressed, gzipped FastQ file for read 2. The Fastq file has to be first gzipped, then spring-compressed, and it must have the extension `.fastq.gz.spring` or `.fq.gz.spring`. | +| `bam` | Full path to (u)BAM file | +| `bai` | Full path to BAM index file | +| `cram` | Full path to CRAM file | +| `crai` | Full path to CRAM index file | +| `table` | Full path to recalibration table file | +| `vcf` | Full path to vcf file | An [example samplesheet](../assets/samplesheet.csv) has been provided with the pipeline. ### Start with mapping (`--step mapping` [default]) -This step can be started either from FastQ files or (u)BAMs. The CSV must contain at least the columns `patient`, `sample`, `lane`, and either `fastq_1/fastq_2` or `bam`. +This step can be started either from FastQ files (gzip-compressed or gzip+spring-compressed) or (u)BAMs. The CSV must contain at least the columns `patient`, `sample`, `lane`, and `fastq_1/fastq_2`, `spring_1`, `spring_1/spring_2` or `bam`. #### Examples @@ -111,6 +113,16 @@ patient,sample,lane,fastq_1,fastq_2 patient1,test_sample,lane_1,test_1.fastq.gz,test_2.fastq.gz ``` +```bash +patient,sample,lane,spring_1 +patient1,test_sample,lane_1,test_R1_and_R2.fastq.gz.spring +``` + +```bash +patient,sample,lane,spring_1,spring_2 +patient1,test_sample,lane_1,test_R1.fastq.gz.spring,test_R2.fastq.gz.spring +``` + ```bash patient,sample,lane,bam patient1,test_sample,lane_1,test.bam @@ -379,6 +391,8 @@ If `-profile` is not specified, the pipeline will run locally and expect all sof - A generic configuration profile to be used with [Charliecloud](https://hpc.github.io/charliecloud/) - `apptainer` - A generic configuration profile to be used with [Apptainer](https://apptainer.org/) +- `wave` + - A generic configuration profile to enable [Wave](https://seqera.io/wave/) containers. Use together with one of the above (requires Nextflow ` 24.03.0-edge` or later). - `conda` - A generic configuration profile to be used with [Conda](https://conda.io/docs/). Please only use Conda as a last resort i.e. when it's not possible to run the pipeline with Docker, Singularity, Podman, Shifter, Charliecloud, or Apptainer. @@ -450,7 +464,7 @@ For a thorough list, please refer the [Azure Sizes for virtual machines in Azure ## How to test the pipeline -When using default parameters only, sarek runs preprocessing and `Strelka2`. +When using default parameters only, sarek runs preprocessing and `Strelka`. This is reflected in the default test profile: ```bash @@ -568,7 +582,7 @@ This list is by no means exhaustive and it will depend on the specific analysis | [GATK HaplotypeCaller](https://gatk.broadinstitute.org/hc/en-us/articles/5358864757787-HaplotypeCaller) | x | x | x | x | - | - | | [GATK Mutect2](https://gatk.broadinstitute.org/hc/en-us/articles/5358911630107-Mutect2) | x | x | x | - | x | x | | [mpileup](https://www.htslib.org/doc/samtools-mpileup.html) | x | x | x | x | x | - | -| [Strelka2](https://github.com/Illumina/strelka) | x | x | x | x | x | x | +| [Strelka](https://github.com/Illumina/strelka) | x | x | x | x | x | x | | [Manta](https://github.com/Illumina/manta) | x | x | x | x | x | x | | [TIDDIT](https://github.com/SciLifeLab/TIDDIT) | x | x | x | x | x | x | | [ASCAT](https://github.com/VanLoo-lab/ascat) | x | x | - | - | - | x | @@ -829,9 +843,9 @@ For GATK.GRCh38 the links for each reference file and the corresponding processe | ascat_loci | ASCAT | https://www.dropbox.com/s/80cq0qgao8l1inj/G1000_loci_hg38.zip | https://github.com/VanLoo-lab/ascat/tree/master/ReferenceFiles/WGS | | ascat_loci_gc | ASCAT | https://www.dropbox.com/s/80cq0qgao8l1inj/G1000_loci_hg38.zip | https://github.com/VanLoo-lab/ascat/tree/master/ReferenceFiles/WGS | | ascat_loci_rt | ASCAT | https://www.dropbox.com/s/xlp99uneqh6nh6p/RT_G1000_hg38.zip | https://github.com/VanLoo-lab/ascat/tree/master/ReferenceFiles/WGS | -| bwa | bwa-mem | bwa index -p bwa/${fasta.baseName} $fasta | | -| bwamem2 | bwa-mem2 | bwa-mem2 index -p bwamem2/${fasta} $fasta | | -| dragmap | DragMap | dragen-os --build-hash-table true --ht-reference $fasta --output-directory dragmap | | +| bwa | bwa-mem | `bwa index -p bwa/${fasta.baseName} $fasta` | | +| bwamem2 | bwa-mem2 | `bwa-mem2 index -p bwamem2/${fasta} $fasta` | | +| dragmap | DragMap | `dragen-os --build-hash-table true --ht-reference $fasta --output-directory dragmap` | | | dbsnp | Baserecalibrator, ControlFREEC, GenotypeGVCF, HaplotypeCaller | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) | https://gatk.broadinstitute.org/hc/en-us/articles/360035890811-Resource-bundle | | dbsnp_tbi | Baserecalibrator, ControlFREEC, GenotypeGVCF, HaplotypeCaller | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) | | | dict | Baserecalibrator(Spark), CNNScoreVariant, EstimateLibraryComplexity, FilterMutectCalls, FilterVariantTranches, GatherPileupSummaries,GenotypeGVCF, GetPileupSummaries, HaplotypeCaller, MarkDulpicates(Spark), MergeVCFs, Mutect2, Variantrecalibrator | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) | https://gatk.broadinstitute.org/hc/en-us/articles/360035890811-Resource-bundle | @@ -1134,3 +1148,28 @@ Currently, Sentieon's version of BQSR, QualCal, is not available in Sarek. Recen Resource requests are difficult to generalize and are often dependent on input data size. Currently, the number of cpus and memory requested by default were adapted from tests on 5 ICGC paired whole-genome sequencing samples with approximately 40X and 80X depth. For targeted data analysis, this is overshooting by a lot. In this case resources for each process can be limited by either setting `--max_memory` and `-max_cpus` or tailoring the request by process name as described [here](#resource-requests). If you are using sarek for a certain data type regulary, and would like to make these requests available to others on your system, an institution-specific, pipeline-specific config file can be added [here](https://github.com/nf-core/configs/tree/master/conf/pipeline/sarek). + +## CNV calling with CNVkit + +The CNV calling in Sarek implements the approach proposed by [CNVkit](https://cnvkit.readthedocs.io/en/stable/). +It is possible to call CNVs with whole-genome or targeted capture data (exome and amplicons): depending on the sequencing approach, Sarek applies different [settings](https://cnvkit.readthedocs.io/en/stable/nonhybrid.html) as recommended by CNVkit. + +### Reference background + +Given the nature of this type of CNV calling algorithms, which rely on the detection of variations in the coverage profile, the definition of a background reference in control data is known to improve the calling in targeted and hybrid capture applications. This is to ensure an accurate profiling, especially in the off-target regions. +We recommend creating a background reference with the nf-core pipeline [createpanelrefs](https://nf-co.re/createpanelrefs). + +:warning: In creating a coverage reference, one should pay particular attention to: + +- the control samples should be processed with the same targeted capture and sequencing technology +- if BAM files are used to compute the background, they should have been processed with the same pipeline used to call the CNVs + +### Germline calling + +Sarek implements the [recommended germline settings](https://cnvkit.readthedocs.io/en/stable/germline.html), i.e. applying the `--filter ci` option in the CVNkit call step. +However, this is defined at a config level by adding this option to the `ext.args`: the user can therefore choose any desired different approach by changing the arguments in a custom config. + +### Somatic calling + +The [available options](https://cnvkit.readthedocs.io/en/stable/tumor.html) a user can choose from for tumour analysis depend very much on the specific design being analysed. Sarek therefore doesn't implement any of these choices, i.e. it runs the CNVkit call step with default settings. +We encourage the user to verify whether particular settings might be more appropriate for their data. diff --git a/main.nf b/main.nf index 9c272624fb..92bcc47b2b 100755 --- a/main.nf +++ b/main.nf @@ -253,6 +253,7 @@ workflow NFCORE_SAREK { params.vep_species, params.vep_cache_version, params.vep_genome, + params.vep_custom_args, "Please refer to https://nf-co.re/sarek/docs/usage/#how-to-customise-snpeff-and-vep-annotation for more information.") snpeff_cache = ANNOTATION_CACHE_INITIALISATION.out.snpeff_cache diff --git a/modules.json b/modules.json index a64bdb2c7d..26d801647b 100644 --- a/modules.json +++ b/modules.json @@ -12,38 +12,38 @@ }, "bcftools/annotate": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", "installed_by": ["modules"], "patch": "modules/nf-core/bcftools/annotate/bcftools-annotate.diff" }, "bcftools/concat": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", "installed_by": ["modules"] }, "bcftools/mpileup": { "branch": "master", - "git_sha": "44096c08ffdbc694f5f92ae174ea0f7ba0f37e09", + "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", "installed_by": ["bam_ngscheckmate"] }, "bcftools/sort": { "branch": "master", - "git_sha": "487d92367b4d7bb9f1ca694bf72736be90720b15", + "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", "installed_by": ["modules"] }, "bcftools/stats": { "branch": "master", - "git_sha": "618364f55cb88f6c283f6c6c45c24d5f9f08f998", + "git_sha": "a5ba4d59c2b248c0379b0f8aeb4e7e754566cd1f", "installed_by": ["modules"] }, "bwa/index": { "branch": "master", - "git_sha": "6278bf9afd4a4b2d00fa6052250e73da3d91546f", + "git_sha": "086fa66260595e123b0ea47a6512539b72a9afa3", "installed_by": ["modules"] }, "bwa/mem": { "branch": "master", - "git_sha": "b97197968ac12dde2463fa54541f6350c46f2035", + "git_sha": "0c34b8159f62cde451c4ff249629c9d0a4f3f9c3", "installed_by": ["modules"] }, "bwamem2/index": { @@ -63,12 +63,12 @@ }, "cat/fastq": { "branch": "master", - "git_sha": "0997b47c93c06b49aa7b3fefda87e728312cf2ca", + "git_sha": "4fc983ad0b30e6e32696fa7d980c76c7bfe1c03e", "installed_by": ["modules"] }, "cnvkit/antitarget": { "branch": "master", - "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "git_sha": "7d8eff8f0cbc20cb83ce624e86c58ede51397054", "installed_by": ["modules"] }, "cnvkit/batch": { @@ -76,6 +76,16 @@ "git_sha": "f53b071421340e6fac0806c86ba030e578e94826", "installed_by": ["modules"] }, + "cnvkit/call": { + "branch": "master", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "installed_by": ["modules"] + }, + "cnvkit/export": { + "branch": "master", + "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "installed_by": ["modules"] + }, "cnvkit/genemetrics": { "branch": "master", "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", @@ -83,7 +93,7 @@ }, "cnvkit/reference": { "branch": "master", - "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", + "git_sha": "f8693ff46b884892982d658271ed260380111c53", "installed_by": ["modules"] }, "controlfreec/assesssignificance": { @@ -136,7 +146,7 @@ }, "ensemblvep/vep": { "branch": "master", - "git_sha": "3db4f8488315cd7d7cf3fcb64251f6603210e831", + "git_sha": "b42fec6f7c6e5d0716685cabb825ef6bf6e386b5", "installed_by": ["modules", "vcf_annotate_ensemblvep"] }, "fastp": { @@ -176,7 +186,7 @@ }, "gatk4/applyvqsr": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", + "git_sha": "cee8fe33d3ef1a220dee67dac75a32f7c872f63f", "installed_by": ["modules"] }, "gatk4/baserecalibrator": { @@ -186,7 +196,7 @@ }, "gatk4/calculatecontamination": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", + "git_sha": "77ffba959bbe8b6e1d95d47688075d113e24f0d4", "installed_by": ["modules"] }, "gatk4/cnnscorevariants": { @@ -196,7 +206,7 @@ }, "gatk4/createsequencedictionary": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", + "git_sha": "e6fe277739f5894711405af3e717b2470bd956b5", "installed_by": ["modules"] }, "gatk4/estimatelibrarycomplexity": { @@ -206,7 +216,7 @@ }, "gatk4/filtermutectcalls": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", + "git_sha": "7d814815f638e1483995b24a23f5f23229036bbf", "installed_by": ["modules"] }, "gatk4/filtervarianttranches": { @@ -236,7 +246,7 @@ }, "gatk4/getpileupsummaries": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", + "git_sha": "b632dcbf8bd3d7b9cb22fd0b2416e9e6cb8f4045", "installed_by": ["modules"] }, "gatk4/haplotypecaller": { @@ -261,7 +271,7 @@ }, "gatk4/mergemutectstats": { "branch": "master", - "git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980", + "git_sha": "cafe91148ca110e52ceaa07f3e373b882800d04b", "installed_by": ["modules"] }, "gatk4/mergevcfs": { @@ -296,7 +306,7 @@ }, "gawk": { "branch": "master", - "git_sha": "da4d05d04e65227d4307e87940842f1a14de62c7", + "git_sha": "cf3ed075695639b0a0924eb0901146df1996dc08", "installed_by": ["modules"] }, "manta/germline": { @@ -336,7 +346,7 @@ }, "ngscheckmate/ncm": { "branch": "master", - "git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5", + "git_sha": "0e04b949c90e686c8b07495576832d78ab9210cf", "installed_by": ["bam_ngscheckmate"] }, "samblaster": { @@ -346,47 +356,47 @@ }, "samtools/bam2fq": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/collatefastq": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/convert": { "branch": "master", - "git_sha": "1b93e06140e6807cc408519759f68bd26da63a00", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/faidx": { "branch": "master", - "git_sha": "f153f1f10e1083c49935565844cccb7453021682", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/index": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/merge": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/mpileup": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/stats": { "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "samtools/view": { "branch": "master", - "git_sha": "0bd7d2333a88483aa0476acea172e9f5f6dd83bb", + "git_sha": "04fbbc7c43cebc0b95d5b126f6d9fe4effa33519", "installed_by": ["modules"] }, "sentieon/applyvarcal": { @@ -439,6 +449,11 @@ "git_sha": "2f3db6f45147ebbb56b371536e31bdf622b5bfee", "installed_by": ["modules", "vcf_annotate_snpeff"] }, + "spring/decompress": { + "branch": "master", + "git_sha": "0a92fa8d17d9e3c411e01a0ce41a86eff02b1599", + "installed_by": ["modules"] + }, "strelka/germline": { "branch": "master", "git_sha": "e8f2c77a6e4174ee0a48d073d4cc8ff06c44bb4c", diff --git a/modules/nf-core/bcftools/annotate/bcftools-annotate.diff b/modules/nf-core/bcftools/annotate/bcftools-annotate.diff index 34a9e2c381..d15bf86b54 100644 --- a/modules/nf-core/bcftools/annotate/bcftools-annotate.diff +++ b/modules/nf-core/bcftools/annotate/bcftools-annotate.diff @@ -2,13 +2,13 @@ Changes in module 'nf-core/bcftools/annotate' --- modules/nf-core/bcftools/annotate/main.nf +++ modules/nf-core/bcftools/annotate/main.nf @@ -8,7 +8,10 @@ - 'biocontainers/bcftools:1.18--h8b25389_0' }" + '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 annotations -+ path annotations_index ++ path annotations_index + path header_lines output: diff --git a/modules/nf-core/bcftools/annotate/environment.yml b/modules/nf-core/bcftools/annotate/environment.yml index e0abc8d23c..3d4e337992 100644 --- a/modules/nf-core/bcftools/annotate/environment.yml +++ b/modules/nf-core/bcftools/annotate/environment.yml @@ -4,4 +4,4 @@ channels: - 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 7d9dba4255..39c86bbe43 100644 --- a/modules/nf-core/bcftools/annotate/main.nf +++ b/modules/nf-core/bcftools/annotate/main.nf @@ -4,13 +4,13 @@ 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 annotations - path annotations_index + path annotations_index path header_lines output: @@ -59,8 +59,10 @@ process BCFTOOLS_ANNOTATE { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" + + def create_cmd = extension.endsWith(".gz") ? "echo '' | gzip >" : "touch" """ - touch ${prefix}.${extension} + ${create_cmd} ${prefix}.${extension} cat <<-END_VERSIONS > versions.yml "${task.process}": 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 0000000000..b8496b33c3 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/bcf.config @@ -0,0 +1,6 @@ +process { + withName: 'BCFTOOLS_ANNOTATE' { + ext.args = "-x ID,INFO/DP,FORMAT/DP --output-type u" + ext.prefix = { "${meta.id}_ann" } + } +} \ No newline at end of file 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 0000000000..609102f836 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test @@ -0,0 +1,108 @@ +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, vcf2, tbi2, []] - vcf_output") { + + config "./vcf.config" + + when { + process { + """ + input[0] = [ [ id:'test', 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_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: 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("vcf") } + ) + } + + } + + + test("sarscov2 - [vcf, [], [], [], header] - bcf_output") { + + config "./bcf.config" + + when { + process { + """ + vcf = Channel.of([ [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + [], + [], + [] + ]) + + header = Channel.of( + '##INFO=', + '##INFO=' + ) + .collectFile(name:"headers.vcf", newLine:true) + + input[0] = vcf.combine(header) + """ + } + } + + 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, vcf2, tbi2, []] - stub") { + + config "./vcf.config" + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', 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_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf_gz_tbi'], checkIfExists: true), + [] + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ 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 0000000000..359ab38dc1 --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/main.nf.test.snap @@ -0,0 +1,79 @@ +{ + "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-03T11:39:40.696827933" + }, + "vcf": { + "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-06-03T11:39:29.215629503" + }, + "sarscov2 - [vcf, tbi, vcf2, tbi2, []] - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test_vcf.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,ea53f98610d42597cf384ff1fa3eb204" + ], + "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-06-03T11:39:52.630055205" + } +} \ 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 0000000000..f97a1afc85 --- /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 0000000000..cb809f614c --- /dev/null +++ b/modules/nf-core/bcftools/annotate/tests/vcf.config @@ -0,0 +1,6 @@ +process { + withName: 'BCFTOOLS_ANNOTATE' { + ext.prefix = { "${meta.id}_vcf" } + ext.args = "-x ID,INFO/DP,FORMAT/DP --output-type z" + } +} diff --git a/modules/nf-core/bcftools/concat/environment.yml b/modules/nf-core/bcftools/concat/environment.yml index ff0200dfab..6544e949c8 100644 --- a/modules/nf-core/bcftools/concat/environment.yml +++ b/modules/nf-core/bcftools/concat/environment.yml @@ -4,4 +4,4 @@ channels: - 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 a5830a251a..092d2c62e1 100644 --- a/modules/nf-core/bcftools/concat/main.nf +++ b/modules/nf-core/bcftools/concat/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_CONCAT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bcftools:1.18--h8b25389_0': - 'biocontainers/bcftools:1.18--h8b25389_0' }" + 'https://depot.galaxyproject.org/singularity/bcftools:1.20--h8b25389_0': + 'biocontainers/bcftools:1.20--h8b25389_0' }" input: tuple val(meta), path(vcfs), path(tbi) @@ -36,7 +36,7 @@ process BCFTOOLS_CONCAT { stub: prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.vcf.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/concat/tests/main.nf.test b/modules/nf-core/bcftools/concat/tests/main.nf.test index bf1a5f3fae..d5d9f78743 100644 --- a/modules/nf-core/bcftools/concat/tests/main.nf.test +++ b/modules/nf-core/bcftools/concat/tests/main.nf.test @@ -34,10 +34,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } @@ -63,10 +60,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } @@ -96,10 +90,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - file(process.out.vcf[0][1]).name, - process.out.versions - ).match() } + { assert snapshot(process.out).match() } ) } 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 7344e6e38c..bef0ff05be 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,101 @@ { "sarscov2 - [[vcf1, vcf2], []]": { "content": [ - [ - [ - { - "id": "test3" - }, - "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "1": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "versions": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" ] - ], - [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" - ] + } ], - "timestamp": "2023-11-29T13:52:27.03724666" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:16:00.637917586" }, "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]]": { "content": [ - [ - [ - { - "id": "test3" - }, - "test3.vcf.gz:md5,4bcd0afd89f56c5d433f6b6abc44d0a6" + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "1": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,5f6796c3ae109a1a5b87353954693f5a" + ] + ], + "versions": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" ] - ], - [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" - ] + } ], - "timestamp": "2023-11-29T13:52:21.468988293" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:15:55.750767959" }, "sarscov2 - [[vcf1, vcf2], [tbi1, tbi2]] - stub": { "content": [ - "test3.vcf.gz", - [ - "versions.yml:md5,24ae05eb858733b40fbd3f89743a6d09" - ] + { + "0": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ], + "vcf": [ + [ + { + "id": "test3" + }, + "test3.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,c6e19f105510a46af1c5da9064e2e659" + ] + } ], - "timestamp": "2023-11-29T13:41:04.716017811" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:16:05.717072932" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/mpileup/environment.yml b/modules/nf-core/bcftools/mpileup/environment.yml index 114390be1f..7e479383ba 100644 --- a/modules/nf-core/bcftools/mpileup/environment.yml +++ b/modules/nf-core/bcftools/mpileup/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::bcftools=1.18 + - bioconda::bcftools=1.20 diff --git a/modules/nf-core/bcftools/mpileup/main.nf b/modules/nf-core/bcftools/mpileup/main.nf index 5e57644af7..82e14df7a7 100644 --- a/modules/nf-core/bcftools/mpileup/main.nf +++ b/modules/nf-core/bcftools/mpileup/main.nf @@ -4,8 +4,8 @@ process BCFTOOLS_MPILEUP { 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(bam), path(intervals) @@ -55,4 +55,18 @@ process BCFTOOLS_MPILEUP { bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bcftools_stats.txt + echo "" | gzip > ${prefix}.vcf.gz + touch ${prefix}.vcf.gz.tbi + echo "" | gzip > ${prefix}.mpileup.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/bcftools/mpileup/tests/main.nf.test b/modules/nf-core/bcftools/mpileup/tests/main.nf.test index 6478bbc2d3..dc35c54266 100644 --- a/modules/nf-core/bcftools/mpileup/tests/main.nf.test +++ b/modules/nf-core/bcftools/mpileup/tests/main.nf.test @@ -33,13 +33,43 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.tbi, - process.out.stats, - process.out.mpileup, - process.out.versions - ).match() } + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_fasta_false.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_fasta_false.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_fasta_false.bcftools_stats.txt") }, + { assert snapshot(process.out.versions).match("bam_fasta_false_versions") } + ) + } + + } + + test("sarscov2 - [bam, []], fasta, false stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + [] + ] + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_fasta_false_stub.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_fasta_false_stub.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_fasta_false_stub.bcftools_stats.txt") }, + { assert snapshot(process.out.versions).match("bam_fasta_false_stub_versions") } ) } @@ -67,13 +97,45 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.tbi, - process.out.stats, - process.out.mpileup, - process.out.versions - ).match() } + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_bed_fasta_true_stub.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_bed_fasta_true_stub.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_bed_fasta_true_stub.bcftools_stats.txt") }, + { assert snapshot(file(process.out.mpileup[0][1]).name).match("bam_bed_fasta_true_stub.mpileup.gz") }, + { assert snapshot(process.out.versions).match("bam_bed_fasta_true_stub_versions") } + ) + } + + } + + test("sarscov2 - [bam, []], fasta, true stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + [] + ] + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = true + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_bed_fasta_true.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_bed_fasta_true.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_bed_fasta_true.bcftools_stats.txt") }, + { assert snapshot(file(process.out.mpileup[0][1]).name).match("bam_bed_fasta_true.mpileup.gz") }, + { assert snapshot(process.out.versions).match("bam_bed_fasta_true_versions") } ) } @@ -101,13 +163,43 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot( - process.out.vcf, - process.out.tbi, - process.out.stats, - process.out.mpileup, - process.out.versions - ).match() } + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_bed_fasta_false.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_bed_fasta_false.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_bed_fasta_false.bcftools_stats.txt") }, + { assert snapshot(process.out.versions).match("bam_bed_fasta_false_versions") } + ) + } + + } + + test("sarscov2 - [bam, bed], fasta, false stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + input[1] = [ + [ id:'sarscov2' ], // meta map + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(file(process.out.vcf[0][1]).name).match("bam_bed_fasta_false_stub.vcf.gz") }, + { assert snapshot(file(process.out.tbi[0][1]).name).match("bam_bed_fasta_false_stub.vcf.gz.tbi") }, + { assert snapshot(file(process.out.stats[0][1]).name).match("bam_bed_fasta_false_stub.bcftools_stats.txt") }, + { assert snapshot(process.out.versions).match("bam_bed_fasta_false_stub_versions") } ) } diff --git a/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap b/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap index ef80ab1b7f..a772689882 100644 --- a/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/mpileup/tests/main.nf.test.snap @@ -1,112 +1,274 @@ { - "sarscov2 - [bam, []], fasta, true": { + "bam_bed_fasta_true.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:45:32.654601222" + }, + "bam_bed_fasta_false_stub.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:46:19.532461322" + }, + "bam_fasta_false_stub.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:44:44.944919263" + }, + "bam_bed_fasta_false_stub.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:57.844573" + }, + "bam_bed_fasta_true_stub.mpileup.gz": { + "content": [ + "test.mpileup.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:39.462382" + }, + "bam_bed_fasta_true.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:45:32.596363535" + }, + "bam_bed_fasta_true_stub.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:45:10.034842649" + }, + "bam_fasta_false_versions": { "content": [ [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,0f2f2c8488e97e7f13979380d5d3b6b5" - ] - ], - [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,34cb2eeb73f4d2b98218acecebd92704" - ] - ], - [ - [ - { - "id": "test" - }, - "test.bcftools_stats.txt:md5,a988fbcd2ea5d1ce30970dcb60a77ed7" - ] - ], - [ - [ - { - "id": "test" - }, - "test.mpileup.gz:md5,73b4a00398bddab2cd065b40d17ca4dc" - ] - ], - [ - "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" + "versions.yml:md5,6af9a67cd12c721ccc9702c17bc2f3a5" ] ], - "timestamp": "2023-11-29T14:11:54.549517279" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:14:23.424052671" }, - "sarscov2 - [bam, bed], fasta, false": { + "bam_fasta_false_stub.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:15.746204" + }, + "bam_bed_fasta_false_versions": { "content": [ [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,687244dbf71d05b3b973ab08ecf05310" - ] - ], - [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,3785df15f3d7faf35f3ad70d167a50f7" - ] - ], - [ - [ - { - "id": "test" - }, - "test.bcftools_stats.txt:md5,f8c5ab149c4bf0e5f51c518346cb87b5" - ] - ], - [ - - ], - [ - "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" + "versions.yml:md5,6af9a67cd12c721ccc9702c17bc2f3a5" ] ], - "timestamp": "2023-11-29T14:12:00.865439661" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:14:44.101963218" }, - "sarscov2 - [bam, []], fasta, false": { + "bam_bed_fasta_false.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:45:57.39416797" + }, + "bam_bed_fasta_true_versions": { "content": [ [ - [ - { - "id": "test" - }, - "test.vcf.gz:md5,0f2f2c8488e97e7f13979380d5d3b6b5" - ] - ], - [ - [ - { - "id": "test" - }, - "test.vcf.gz.tbi:md5,34cb2eeb73f4d2b98218acecebd92704" - ] - ], + "versions.yml:md5,6af9a67cd12c721ccc9702c17bc2f3a5" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:14:38.630394619" + }, + "bam_fasta_false.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:44:21.337711533" + }, + "bam_fasta_false.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:39:10.123726" + }, + "bam_bed_fasta_false.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:51.761517" + }, + "bam_bed_fasta_false_stub.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:46:19.593445488" + }, + "bam_bed_fasta_false.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:45:57.444615176" + }, + "bam_fasta_false_stub.vcf.gz": { + "content": [ + "test.vcf.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:44:44.888373837" + }, + "bam_bed_fasta_true_stub.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:39.453121" + }, + "bam_fasta_false.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:44:21.401424919" + }, + "bam_fasta_false_stub_versions": { + "content": [ [ - [ - { - "id": "test" - }, - "test.bcftools_stats.txt:md5,a988fbcd2ea5d1ce30970dcb60a77ed7" - ] - ], + "versions.yml:md5,6af9a67cd12c721ccc9702c17bc2f3a5" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:14:28.530439931" + }, + "bam_bed_fasta_true.bcftools_stats.txt": { + "content": [ + "test.bcftools_stats.txt" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:45.18304" + }, + "bam_bed_fasta_true_stub.vcf.gz.tbi": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.2" + }, + "timestamp": "2024-06-03T11:45:10.101920455" + }, + "bam_bed_fasta_false_stub_versions": { + "content": [ [ - - ], + "versions.yml:md5,6af9a67cd12c721ccc9702c17bc2f3a5" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:14:49.139377519" + }, + "bam_bed_fasta_true.mpileup.gz": { + "content": [ + "test.mpileup.gz" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-22T18:37:45.192888" + }, + "bam_bed_fasta_true_stub_versions": { + "content": [ [ - "versions.yml:md5,e09c59d941374bb293aadc36e2f29dbf" + "versions.yml:md5,6af9a67cd12c721ccc9702c17bc2f3a5" ] ], - "timestamp": "2023-11-29T14:11:47.814900494" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T15:14:33.646218607" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/sort/environment.yml b/modules/nf-core/bcftools/sort/environment.yml index 89cf911d61..2295ecfd17 100644 --- a/modules/nf-core/bcftools/sort/environment.yml +++ b/modules/nf-core/bcftools/sort/environment.yml @@ -4,4 +4,4 @@ channels: - 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 c982944c52..d5e3ce9af7 100644 --- a/modules/nf-core/bcftools/sort/main.nf +++ b/modules/nf-core/bcftools/sort/main.nf @@ -4,8 +4,8 @@ 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) @@ -49,9 +49,9 @@ process BCFTOOLS_SORT { args.contains("--output-type z") || args.contains("-Oz") ? "vcf.gz" : args.contains("--output-type v") || args.contains("-Ov") ? "vcf" : "vcf" - + def create_cmd = extension.endsWith(".gz") ? "echo '' | gzip >" : "touch" """ - touch ${prefix}.${extension} + ${create_cmd} ${prefix}.${extension} cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/bcftools/sort/tests/main.nf.test b/modules/nf-core/bcftools/sort/tests/main.nf.test index fec59cfe57..8a496dda7d 100644 --- a/modules/nf-core/bcftools/sort/tests/main.nf.test +++ b/modules/nf-core/bcftools/sort/tests/main.nf.test @@ -9,7 +9,29 @@ nextflow_process { tag "bcftools" tag "bcftools/sort" - test("SarsCov2 VCF") { + test("sarscov2 - vcf") { + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match("vcf") } + ) + } + + } + + test("sarscov2 - vcf - stub") { + options "-stub" when { process { """ diff --git a/modules/nf-core/bcftools/sort/tests/main.nf.test.snap b/modules/nf-core/bcftools/sort/tests/main.nf.test.snap index 7f599559fc..3f478d19d6 100644 --- a/modules/nf-core/bcftools/sort/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/sort/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "SarsCov2 VCF": { + "vcf": { "content": [ { "0": [ @@ -11,7 +11,7 @@ ] ], "1": [ - "versions.yml:md5,622bd32d4ff0fac3360cd534ae0f0168" + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" ], "vcf": [ [ @@ -22,14 +22,47 @@ ] ], "versions": [ - "versions.yml:md5,622bd32d4ff0fac3360cd534ae0f0168" + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.04.2" + "nextflow": "24.04.2" }, - "timestamp": "2024-03-18T12:50:10.340362246" + "timestamp": "2024-06-03T11:54:39.200647026" + }, + "sarscov2 - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + "versions.yml:md5,2c9f26ca356ef71199c3a7d1742974cb" + ], + "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-03T11:54:55.594155692" } } \ No newline at end of file diff --git a/modules/nf-core/bcftools/stats/environment.yml b/modules/nf-core/bcftools/stats/environment.yml index 7bb40dc0be..128fe20422 100644 --- a/modules/nf-core/bcftools/stats/environment.yml +++ b/modules/nf-core/bcftools/stats/environment.yml @@ -4,5 +4,5 @@ channels: - bioconda - defaults dependencies: - - bioconda::bcftools=1.18 - - bioconda::htslib=1.18 + - bioconda::bcftools=1.20 + - bioconda::htslib=1.20 diff --git a/modules/nf-core/bcftools/stats/main.nf b/modules/nf-core/bcftools/stats/main.nf index ffa1df6430..20e5da7713 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 index f027f6b12f..be618b0b17 100644 --- a/modules/nf-core/bcftools/stats/tests/main.nf.test +++ b/modules/nf-core/bcftools/stats/tests/main.nf.test @@ -29,7 +29,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("version") }, + { assert snapshot(process.out.versions).match("versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } @@ -57,7 +57,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("regions_version") }, + { assert snapshot(process.out.versions).match("regions_versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } @@ -86,7 +86,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("targets_version") }, + { assert snapshot(process.out.versions).match("targets_versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } @@ -114,7 +114,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("exon_version") }, + { assert snapshot(process.out.versions).match("exon_versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } @@ -143,7 +143,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.version).match("ref_version") }, + { assert snapshot(process.out.versions).match("ref_versions") }, { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() }, ) } diff --git a/modules/nf-core/bcftools/stats/tests/main.nf.test.snap b/modules/nf-core/bcftools/stats/tests/main.nf.test.snap index 30691c32f0..cd8cff6d2b 100644 --- a/modules/nf-core/bcftools/stats/tests/main.nf.test.snap +++ b/modules/nf-core/bcftools/stats/tests/main.nf.test.snap @@ -2,7 +2,7 @@ "sarscov2 - vcf_gz - reference": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats --fasta-ref genome.fasta test.vcf.gz", "#", "# Definition of sets:", @@ -12,14 +12,14 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T11:46:24.34147" + "timestamp": "2024-05-31T18:14:35.506777837" }, "sarscov2 - vcf_gz - exons": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats --exons exons.tsv.gz test.vcf.gz", "#", "# Definition of sets:", @@ -27,32 +27,28 @@ "ID\t0\ttest.vcf.gz" ] ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.0" - }, - "timestamp": "2024-03-20T11:46:18.378716" - }, - "exon_version": { - "content": null, "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:02:02.530551189" + "timestamp": "2024-05-31T18:14:30.57486244" }, - "ref_version": { - "content": null, + "versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:02:06.885381764" + "timestamp": "2024-05-31T18:16:27.637515559" }, "sarscov2 - vcf_gz - targets": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats --targets-file test2.targets.tsv.gz test.vcf.gz", "#", "# Definition of sets:", @@ -62,17 +58,33 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-31T18:14:25.732997442" + }, + "regions_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T11:46:12.48194" + "timestamp": "2024-05-31T18:16:32.559884458" }, - "targets_version": { - "content": null, + "targets_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:01:58.412147664" + "timestamp": "2024-05-31T18:16:37.512009805" }, "sarscov2 - vcf_gz - stub": { "content": [ @@ -86,7 +98,7 @@ ] ], "1": [ - "versions.yml:md5,5909d472a49b0aa2bfbbb1094c129e48" + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" ], "stats": [ [ @@ -97,36 +109,44 @@ ] ], "versions": [ - "versions.yml:md5,5909d472a49b0aa2bfbbb1094c129e48" + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nextflow": "24.04.2" }, - "timestamp": "2024-03-19T16:26:21.450513562" + "timestamp": "2024-06-03T11:57:09.614976125" }, - "version": { - "content": null, + "exon_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T09:57:04.317347424" + "timestamp": "2024-05-31T18:16:42.347397266" }, - "regions_version": { - "content": null, + "ref_versions": { + "content": [ + [ + "versions.yml:md5,17cdf9d1ad31f6b1f5935dfcc9fe7b9a" + ] + ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T10:01:54.349855366" + "timestamp": "2024-05-31T18:16:47.26823622" }, "sarscov2 - vcf_gz": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats test.vcf.gz", "#", "# Definition of sets:", @@ -136,14 +156,14 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T11:46:01.862297" + "timestamp": "2024-05-31T18:16:27.670416598" }, "sarscov2 - vcf_gz - regions": { "content": [ [ - "# This file was produced by bcftools stats (1.18+htslib-1.18) and can be plotted using plot-vcfstats.", + "# This file was produced by bcftools stats (1.20+htslib-1.20) and can be plotted using plot-vcfstats.", "# The command line was:\tbcftools stats --regions-file test3.vcf.gz test.vcf.gz", "#", "# Definition of sets:", @@ -153,8 +173,8 @@ ], "meta": { "nf-test": "0.8.4", - "nextflow": "23.10.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-03-20T11:46:07.296109" + "timestamp": "2024-05-31T18:14:20.759094062" } } \ No newline at end of file diff --git a/modules/nf-core/bwa/index/environment.yml b/modules/nf-core/bwa/index/environment.yml index 5d3cb3231b..126e003448 100644 --- a/modules/nf-core/bwa/index/environment.yml +++ b/modules/nf-core/bwa/index/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::bwa=0.7.17 + - bioconda::bwa=0.7.18 diff --git a/modules/nf-core/bwa/index/main.nf b/modules/nf-core/bwa/index/main.nf index 24b5a2ea99..2e48b6caae 100644 --- a/modules/nf-core/bwa/index/main.nf +++ b/modules/nf-core/bwa/index/main.nf @@ -4,8 +4,8 @@ process BWA_INDEX { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bwa:0.7.17--hed695b0_7' : - 'biocontainers/bwa:0.7.17--hed695b0_7' }" + 'https://depot.galaxyproject.org/singularity/bwa:0.7.18--he4a0461_0' : + 'biocontainers/bwa:0.7.18--he4a0461_0' }" input: tuple val(meta), path(fasta) diff --git a/modules/nf-core/bwa/index/meta.yml b/modules/nf-core/bwa/index/meta.yml index 730628d005..4c7d30f3aa 100644 --- a/modules/nf-core/bwa/index/meta.yml +++ b/modules/nf-core/bwa/index/meta.yml @@ -43,3 +43,4 @@ authors: maintainers: - "@drpatelh" - "@maxulysse" + - "@gallvp" diff --git a/modules/nf-core/bwa/index/tests/main.nf.test.snap b/modules/nf-core/bwa/index/tests/main.nf.test.snap index e51ad5bf2b..7c8f046578 100644 --- a/modules/nf-core/bwa/index/tests/main.nf.test.snap +++ b/modules/nf-core/bwa/index/tests/main.nf.test.snap @@ -17,7 +17,7 @@ ] ], "1": [ - "versions.yml:md5,0f20525da90e7489a7ebb02adca3265f" + "versions.yml:md5,a64462ac7dfb21f4ade9b02e7f65c5bb" ], "index": [ [ @@ -34,10 +34,14 @@ ] ], "versions": [ - "versions.yml:md5,0f20525da90e7489a7ebb02adca3265f" + "versions.yml:md5,a64462ac7dfb21f4ade9b02e7f65c5bb" ] } ], - "timestamp": "2023-10-17T17:20:20.180927714" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-05-16T11:40:09.925307" } } \ No newline at end of file diff --git a/modules/nf-core/bwa/mem/environment.yml b/modules/nf-core/bwa/mem/environment.yml index 3f136d0a3f..3aa9f0cca2 100644 --- a/modules/nf-core/bwa/mem/environment.yml +++ b/modules/nf-core/bwa/mem/environment.yml @@ -4,7 +4,7 @@ channels: - bioconda - defaults dependencies: - - bwa=0.7.17 + - bwa=0.7.18 # renovate: datasource=conda depName=bioconda/samtools - - samtools=1.19.2 - - htslib=1.19.1 + - samtools=1.20 + - htslib=1.20.0 diff --git a/modules/nf-core/bwa/mem/main.nf b/modules/nf-core/bwa/mem/main.nf index d8bd281519..9c815f0c8e 100644 --- a/modules/nf-core/bwa/mem/main.nf +++ b/modules/nf-core/bwa/mem/main.nf @@ -4,8 +4,8 @@ process BWA_MEM { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:a34558545ae1413d94bde4578787ebef08027945-0' : - 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:a34558545ae1413d94bde4578787ebef08027945-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:1bd8542a8a0b42e0981337910954371d0230828e-0' : + 'biocontainers/mulled-v2-fe8faa35dbf6dc65a0f7f5d4ea12e31a79f73e40:1bd8542a8a0b42e0981337910954371d0230828e-0' }" input: tuple val(meta) , path(reads) diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test b/modules/nf-core/bwa/mem/tests/main.nf.test index 1fa9b56dc7..463b76f81c 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test +++ b/modules/nf-core/bwa/mem/tests/main.nf.test @@ -44,7 +44,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } ) } @@ -85,7 +92,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } ) } @@ -127,7 +141,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } ) } @@ -169,7 +190,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } ) } @@ -211,7 +239,14 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out.cram, + process.out.csi, + process.out.crai, + process.out.versions, + file(process.out.bam[0][1]).name + ).match() + } ) } diff --git a/modules/nf-core/bwa/mem/tests/main.nf.test.snap b/modules/nf-core/bwa/mem/tests/main.nf.test.snap index 0d1bdb416d..038ee7b7a2 100644 --- a/modules/nf-core/bwa/mem/tests/main.nf.test.snap +++ b/modules/nf-core/bwa/mem/tests/main.nf.test.snap @@ -1,295 +1,140 @@ { "Single-End": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,a74710a0345b4717bb4431bf9c257120" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ], - "bam": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,a74710a0345b4717bb4431bf9c257120" - ] - ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - - ], - "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - } + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-14T14:14:56.820798254" + "timestamp": "2024-05-20T08:44:32.953673185" }, "Single-End Sort": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,cb1e038bc4d990683fa485d632550b54" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ], - "bam": [ - [ - { - "id": "test", - "single_end": true - }, - "test.bam:md5,cb1e038bc4d990683fa485d632550b54" - ] - ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - - ], - "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - } + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-14T14:15:20.271428534" + "timestamp": "2024-05-20T08:44:45.27066093" }, "Paired-End": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,aea123a3828a99da1906126355f15a12" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,aea123a3828a99da1906126355f15a12" - ] - ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - - ], - "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - } + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-14T14:15:38.264256823" + "timestamp": "2024-05-20T08:44:57.706852274" }, "Paired-End Sort": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,4682087bcdc3617384b375093fecd8dd" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,4682087bcdc3617384b375093fecd8dd" - ] - ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - - ], - "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - } + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-14T14:16:00.528642686" + "timestamp": "2024-05-20T08:45:10.376505036" }, "Single-end - stub": { "content": [ "test.bam", "test.csi", [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-15T09:50:33.238543011" + "timestamp": "2024-05-20T08:46:07.182072398" }, "Paired-End - no fasta": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,aea123a3828a99da1906126355f15a12" - ] - ], - "1": [ - - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ], - "bam": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,aea123a3828a99da1906126355f15a12" - ] - ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ - - ], - "versions": [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" - ] - } + [ + + ], + [ + + ], + [ + + ], + [ + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" + ], + "test.bam" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-14T14:40:16.345342005" + "timestamp": "2024-05-20T08:45:53.813076501" }, "Paired-end - stub": { "content": [ "test.bam", "test.csi", [ - "versions.yml:md5,c32f719a68bb2966c8511d808154d42d" + "versions.yml:md5,478b816fbd37871f5e8c617833d51d80" ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-15T09:50:42.268673302" + "timestamp": "2024-05-20T08:46:18.412916364" } } \ No newline at end of file diff --git a/modules/nf-core/cat/fastq/tests/main.nf.test b/modules/nf-core/cat/fastq/tests/main.nf.test index dab2e14c02..a71dcb8dfa 100644 --- a/modules/nf-core/cat/fastq/tests/main.nf.test +++ b/modules/nf-core/cat/fastq/tests/main.nf.test @@ -1,3 +1,5 @@ +// NOTE The version snaps may not be consistant +// https://github.com/nf-core/modules/pull/4087#issuecomment-1767948035 nextflow_process { name "Test Process CAT_FASTQ" diff --git a/modules/nf-core/cnvkit/antitarget/environment.yml b/modules/nf-core/cnvkit/antitarget/environment.yml index d40626a56e..a33a12e23c 100644 --- a/modules/nf-core/cnvkit/antitarget/environment.yml +++ b/modules/nf-core/cnvkit/antitarget/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::cnvkit=0.9.10 + - bioconda::cnvkit=0.9.11 diff --git a/modules/nf-core/cnvkit/antitarget/main.nf b/modules/nf-core/cnvkit/antitarget/main.nf index 795145451b..0c1f6674a4 100644 --- a/modules/nf-core/cnvkit/antitarget/main.nf +++ b/modules/nf-core/cnvkit/antitarget/main.nf @@ -4,8 +4,8 @@ process CNVKIT_ANTITARGET { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cnvkit:0.9.10--pyhdfd78af_0': - 'biocontainers/cnvkit:0.9.10--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/cnvkit:0.9.11--pyhdfd78af_0': + 'biocontainers/cnvkit:0.9.11--pyhdfd78af_0' }" input: tuple val(meta), path(targets) diff --git a/modules/nf-core/cnvkit/antitarget/tests/main.nf.test b/modules/nf-core/cnvkit/antitarget/tests/main.nf.test new file mode 100644 index 0000000000..558abb6768 --- /dev/null +++ b/modules/nf-core/cnvkit/antitarget/tests/main.nf.test @@ -0,0 +1,59 @@ +nextflow_process { + + name "Test Process CNVKIT_ANTITARGET" + script "../main.nf" + process "CNVKIT_ANTITARGET" + + tag "modules" + tag "modules_nfcore" + tag "cnvkit" + tag "cnvkit/antitarget" + + test("human - bed") { + + when { + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("version") }, + { assert snapshot(file(process.out.bed.get(0).get(1)).readLines()[0..5]).match() } + ) + } + + } + + test("human - bed - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/cnvkit/antitarget/tests/main.nf.test.snap b/modules/nf-core/cnvkit/antitarget/tests/main.nf.test.snap new file mode 100644 index 0000000000..f793a5275f --- /dev/null +++ b/modules/nf-core/cnvkit/antitarget/tests/main.nf.test.snap @@ -0,0 +1,64 @@ +{ + "human - bed - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.antitarget.bed:md5,3d4d20f9f23b39970865d29ef239d20b" + ] + ], + "1": [ + "versions.yml:md5,b5e73ea85743cedc68ca6ef8006e5030" + ], + "bed": [ + [ + { + "id": "test" + }, + "test.antitarget.bed:md5,3d4d20f9f23b39970865d29ef239d20b" + ] + ], + "versions": [ + "versions.yml:md5,b5e73ea85743cedc68ca6ef8006e5030" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-13T13:58:45.758206" + }, + "human - bed": { + "content": [ + [ + "chr21\t23354500\t23509999\tAntitarget", + "chr21\t23509999\t23665499\tAntitarget", + "chr21\t23665499\t23820999\tAntitarget", + "chr21\t23820999\t23976499\tAntitarget", + "chr21\t23976499\t24131999\tAntitarget", + "chr21\t24911498\t25066997\tAntitarget" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-13T13:58:33.088665" + }, + "version": { + "content": [ + [ + "versions.yml:md5,b5e73ea85743cedc68ca6ef8006e5030" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-13T13:58:33.070317" + } +} \ No newline at end of file diff --git a/modules/nf-core/cnvkit/antitarget/tests/tags.yml b/modules/nf-core/cnvkit/antitarget/tests/tags.yml new file mode 100644 index 0000000000..9261ab536e --- /dev/null +++ b/modules/nf-core/cnvkit/antitarget/tests/tags.yml @@ -0,0 +1,2 @@ +cnvkit/antitarget: + - "modules/nf-core/cnvkit/antitarget/**" diff --git a/modules/nf-core/cnvkit/call/environment.yml b/modules/nf-core/cnvkit/call/environment.yml new file mode 100644 index 0000000000..3b96de7008 --- /dev/null +++ b/modules/nf-core/cnvkit/call/environment.yml @@ -0,0 +1,7 @@ +name: cnvkit_call +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::cnvkit=0.9.10 diff --git a/modules/nf-core/cnvkit/call/main.nf b/modules/nf-core/cnvkit/call/main.nf new file mode 100644 index 0000000000..fade6df0fd --- /dev/null +++ b/modules/nf-core/cnvkit/call/main.nf @@ -0,0 +1,36 @@ +process CNVKIT_CALL { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cnvkit:0.9.10--pyhdfd78af_0': + 'biocontainers/cnvkit:0.9.10--pyhdfd78af_0' }" + + input: + tuple val(meta) , path(cns), path(vcf) + + output: + tuple val(meta), path("*.cns"), emit: cns + 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 vcf_cmd = vcf ? "-v $vcf" : "" + """ + cnvkit.py call \\ + $cns \\ + $vcf_cmd \\ + $args \\ + -o ${prefix}.cns + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvkit: \$(cnvkit.py version | sed -e 's/cnvkit v//g') + END_VERSIONS + """ +} diff --git a/modules/nf-core/cnvkit/call/meta.yml b/modules/nf-core/cnvkit/call/meta.yml new file mode 100644 index 0000000000..64dc336869 --- /dev/null +++ b/modules/nf-core/cnvkit/call/meta.yml @@ -0,0 +1,48 @@ +name: cnvkit_call +description: Given segmented log2 ratio estimates (.cns), derive each segment’s absolute integer copy number +keywords: + - cnvkit + - bam + - fasta + - copy number +tools: + - cnvkit: + description: | + CNVkit is a Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data. It is designed for use with hybrid capture, including both whole-exome and custom target panels, and short-read sequencing platforms such as Illumina and Ion Torrent. + homepage: https://cnvkit.readthedocs.io/en/stable/index.html + documentation: https://cnvkit.readthedocs.io/en/stable/index.html + licence: ["Apache-2.0"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cns: + type: file + description: CNVKit CNS file. + pattern: "*.cns" + - vcf: + type: file + description: Germline VCF file for BAF. + pattern: "*.vcf{,.gz}" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - output: + type: file + description: File containing copy number information in new format. + pattern: "*.{bed,vcf,cdt,jtv,seg,interval_count}" +authors: + - "@adamrtalbot" + - "@priesgo" +maintainers: + - "@adamrtalbot" + - "@priesgo" diff --git a/modules/nf-core/cnvkit/export/environment.yml b/modules/nf-core/cnvkit/export/environment.yml new file mode 100644 index 0000000000..a61b2765f6 --- /dev/null +++ b/modules/nf-core/cnvkit/export/environment.yml @@ -0,0 +1,7 @@ +name: cnvkit_export +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::cnvkit=0.9.10 diff --git a/modules/nf-core/cnvkit/export/main.nf b/modules/nf-core/cnvkit/export/main.nf new file mode 100644 index 0000000000..b65c10632d --- /dev/null +++ b/modules/nf-core/cnvkit/export/main.nf @@ -0,0 +1,35 @@ +process CNVKIT_EXPORT { + tag "$meta.id" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/cnvkit:0.9.10--pyhdfd78af_0': + 'biocontainers/cnvkit:0.9.10--pyhdfd78af_0' }" + + input: + tuple val(meta) , path(cns) + + output: + tuple val(meta), path("${prefix}.${suffix}"), emit: output + 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}" + suffix = task.ext.args.tokenize(" ")[0] + """ + cnvkit.py export \\ + $args \\ + $cns \\ + -o ${prefix}.${suffix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cnvkit: \$(cnvkit.py version | sed -e 's/cnvkit v//g') + END_VERSIONS + """ +} diff --git a/modules/nf-core/cnvkit/export/meta.yml b/modules/nf-core/cnvkit/export/meta.yml new file mode 100644 index 0000000000..836baa1b58 --- /dev/null +++ b/modules/nf-core/cnvkit/export/meta.yml @@ -0,0 +1,43 @@ +name: cnvkit_export +description: Convert copy number ratio tables (.cnr files) or segments (.cns) to another format. +keywords: + - cnvkit + - copy number + - export +tools: + - cnvkit: + description: | + CNVkit is a Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data. It is designed for use with hybrid capture, including both whole-exome and custom target panels, and short-read sequencing platforms such as Illumina and Ion Torrent. + homepage: https://cnvkit.readthedocs.io/en/stable/index.html + documentation: https://cnvkit.readthedocs.io/en/stable/index.html + licence: ["Apache-2.0"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - cns: + type: file + description: CNVKit CNS file. + pattern: "*.cns" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - cns: + type: file + description: File containing copy number segment information + pattern: "*.{cns}" +authors: + - "@adamrtalbot" + - "@priesgo" +maintainers: + - "@adamrtalbot" + - "@priesgo" diff --git a/modules/nf-core/cnvkit/reference/environment.yml b/modules/nf-core/cnvkit/reference/environment.yml index 35e890e541..e3070044d0 100644 --- a/modules/nf-core/cnvkit/reference/environment.yml +++ b/modules/nf-core/cnvkit/reference/environment.yml @@ -4,4 +4,4 @@ channels: - bioconda - defaults dependencies: - - bioconda::cnvkit=0.9.10 + - bioconda::cnvkit=0.9.11 diff --git a/modules/nf-core/cnvkit/reference/main.nf b/modules/nf-core/cnvkit/reference/main.nf index 0e0b20a01e..857996f111 100644 --- a/modules/nf-core/cnvkit/reference/main.nf +++ b/modules/nf-core/cnvkit/reference/main.nf @@ -4,8 +4,8 @@ process CNVKIT_REFERENCE { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/cnvkit:0.9.10--pyhdfd78af_0': - 'biocontainers/cnvkit:0.9.10--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/cnvkit:0.9.11--pyhdfd78af_0': + 'biocontainers/cnvkit:0.9.11--pyhdfd78af_0' }" input: path fasta diff --git a/modules/nf-core/cnvkit/reference/meta.yml b/modules/nf-core/cnvkit/reference/meta.yml index 8c561c9953..8747893b6f 100644 --- a/modules/nf-core/cnvkit/reference/meta.yml +++ b/modules/nf-core/cnvkit/reference/meta.yml @@ -34,7 +34,7 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - reference: + - cnn: type: file description: File containing a copy-number reference (required for CNV calling in tumor_only mode) pattern: "*.{cnn}" diff --git a/modules/nf-core/cnvkit/reference/tests/main.nf.test b/modules/nf-core/cnvkit/reference/tests/main.nf.test new file mode 100644 index 0000000000..47039e3086 --- /dev/null +++ b/modules/nf-core/cnvkit/reference/tests/main.nf.test @@ -0,0 +1,57 @@ +nextflow_process { + + name "Test Process CNVKIT_REFERENCE" + script "../main.nf" + process "CNVKIT_REFERENCE" + + tag "modules" + tag "modules_nfcore" + tag "cnvkit" + tag "cnvkit/reference" + + test("human - [fasta, bed]") { + + when { + process { + """ + input[0] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.antitarget.bed', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("version") }, + { assert snapshot(file(process.out.cnn.get(0)).readLines()[0]).match() } + ) + } + + } + + test("human - [fasta, bed] - stub") { + + options "-stub" + + when { + process { + """ + input[0] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.antitarget.bed', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/cnvkit/reference/tests/main.nf.test.snap b/modules/nf-core/cnvkit/reference/tests/main.nf.test.snap new file mode 100644 index 0000000000..353f6378a6 --- /dev/null +++ b/modules/nf-core/cnvkit/reference/tests/main.nf.test.snap @@ -0,0 +1,47 @@ +{ + "human - [fasta, bed]": { + "content": [ + "chromosome\tstart\tend\tgene\tlog2\tdepth\tgc\trmask\tspread" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-13T14:00:12.102517" + }, + "human - [fasta, bed] - stub": { + "content": [ + { + "0": [ + "multi_intervals.reference.cnn:md5,7c4a7902f5ab101b1f9d6038d331b3d9" + ], + "1": [ + "versions.yml:md5,85ff8911567b4e1245b883541ad3cc1e" + ], + "cnn": [ + "multi_intervals.reference.cnn:md5,7c4a7902f5ab101b1f9d6038d331b3d9" + ], + "versions": [ + "versions.yml:md5,85ff8911567b4e1245b883541ad3cc1e" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-13T14:00:30.095718" + }, + "version": { + "content": [ + [ + "versions.yml:md5,85ff8911567b4e1245b883541ad3cc1e" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-13T14:00:12.090836" + } +} \ No newline at end of file diff --git a/modules/nf-core/cnvkit/reference/tests/tags.yml b/modules/nf-core/cnvkit/reference/tests/tags.yml new file mode 100644 index 0000000000..55e13dd0a8 --- /dev/null +++ b/modules/nf-core/cnvkit/reference/tests/tags.yml @@ -0,0 +1,2 @@ +cnvkit/reference: + - "modules/nf-core/cnvkit/reference/**" diff --git a/modules/nf-core/ensemblvep/vep/main.nf b/modules/nf-core/ensemblvep/vep/main.nf index 885efcedb6..e82471aa1d 100644 --- a/modules/nf-core/ensemblvep/vep/main.nf +++ b/modules/nf-core/ensemblvep/vep/main.nf @@ -57,9 +57,9 @@ process ENSEMBLVEP_VEP { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz - touch ${prefix}.tab.gz - touch ${prefix}.json.gz + echo "" | gzip > ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.tab.gz + echo "" | gzip > ${prefix}.json.gz touch ${prefix}.summary.html cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-core/gatk4/applyvqsr/main.nf b/modules/nf-core/gatk4/applyvqsr/main.nf index 0506e28185..047321b8e9 100644 --- a/modules/nf-core/gatk4/applyvqsr/main.nf +++ b/modules/nf-core/gatk4/applyvqsr/main.nf @@ -52,7 +52,7 @@ process GATK4_APPLYVQSR { stub: 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/applyvqsr/tests/allelspecificity.config b/modules/nf-core/gatk4/applyvqsr/tests/allelspecificity.config new file mode 100644 index 0000000000..ac368bd058 --- /dev/null +++ b/modules/nf-core/gatk4/applyvqsr/tests/allelspecificity.config @@ -0,0 +1,5 @@ +process { + withName: GATK4_APPLYVQSR { + ext.args = '--mode SNP --truth-sensitivity-filter-level 99.0 -AS' + } +} diff --git a/modules/nf-core/gatk4/applyvqsr/tests/main.nf.test b/modules/nf-core/gatk4/applyvqsr/tests/main.nf.test new file mode 100644 index 0000000000..104eb7f01b --- /dev/null +++ b/modules/nf-core/gatk4/applyvqsr/tests/main.nf.test @@ -0,0 +1,106 @@ +nextflow_process { + + name "Test Process GATK4_APPLYVQSR" + script "../main.nf" + process "GATK4_APPLYVQSR" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/applyvqsr" + + test("human - vcf") { + + config "./no-allelspecificity.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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.recal', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.recal.idx', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.tranches', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.2") }, + { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match() } + ) + } + + } + + test("human - vcf - allele-specific") { + + config "./allelspecificity.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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2_allele_specific.recal', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2_allele_specific.recal.idx', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2_allele_specific.tranches', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions_allelspecific") }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.2") }, + { assert snapshot(file(process.out.tbi.get(0).get(1)).name).match() } + ) + } + + } + + test("human - vcf - stub") { + + 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), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.recal', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.recal.idx', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/variantrecalibrator/test2.tranches', checkIfExists: true) + ] + input[1] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) + input[2] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta.fai', checkIfExists: true) + input[3] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/applyvqsr/tests/main.nf.test.snap b/modules/nf-core/gatk4/applyvqsr/tests/main.nf.test.snap new file mode 100644 index 0000000000..ad2fe8be65 --- /dev/null +++ b/modules/nf-core/gatk4/applyvqsr/tests/main.nf.test.snap @@ -0,0 +1,95 @@ +{ + "human - vcf": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T13:31:50.727658" + }, + "human - vcf - allele-specific": { + "content": [ + "test.vcf.gz.tbi" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T13:29:42.331816" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,4a6890d486a62ce6f2edfd2f8961da4f" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T13:00:49.353138" + }, + "human - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,4a6890d486a62ce6f2edfd2f8961da4f" + ], + "tbi": [ + [ + { + "id": "test" + }, + "test.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,4a6890d486a62ce6f2edfd2f8961da4f" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T13:01:24.370421" + }, + "versions_allelspecific": { + "content": [ + [ + "versions.yml:md5,4a6890d486a62ce6f2edfd2f8961da4f" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T13:01:08.104194" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/applyvqsr/tests/no-allelspecificity.config b/modules/nf-core/gatk4/applyvqsr/tests/no-allelspecificity.config new file mode 100644 index 0000000000..c08c918e1a --- /dev/null +++ b/modules/nf-core/gatk4/applyvqsr/tests/no-allelspecificity.config @@ -0,0 +1,5 @@ +process { + withName: GATK4_APPLYVQSR { + ext.args = '--mode SNP --truth-sensitivity-filter-level 99.0' + } +} diff --git a/modules/nf-core/gatk4/applyvqsr/tests/tags.yml b/modules/nf-core/gatk4/applyvqsr/tests/tags.yml new file mode 100644 index 0000000000..c65706301a --- /dev/null +++ b/modules/nf-core/gatk4/applyvqsr/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/applyvqsr: + - "modules/nf-core/gatk4/applyvqsr/**" diff --git a/modules/nf-core/gatk4/calculatecontamination/main.nf b/modules/nf-core/gatk4/calculatecontamination/main.nf index 80070e5ff3..1ca3fd9d45 100644 --- a/modules/nf-core/gatk4/calculatecontamination/main.nf +++ b/modules/nf-core/gatk4/calculatecontamination/main.nf @@ -43,4 +43,16 @@ process GATK4_CALCULATECONTAMINATION { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.contamination.table + touch ${prefix}.segmentation.table + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/gatk4/calculatecontamination/tests/main.nf.test b/modules/nf-core/gatk4/calculatecontamination/tests/main.nf.test new file mode 100644 index 0000000000..81f048f67b --- /dev/null +++ b/modules/nf-core/gatk4/calculatecontamination/tests/main.nf.test @@ -0,0 +1,106 @@ +nextflow_process { + + name "Test Process GATK4_CALCULATECONTAMINATION" + script "../main.nf" + process "GATK4_CALCULATECONTAMINATION" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/calculatecontamination" + + test("human - pileup-table") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.pileups.table', checkIfExists: true), + [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(file(process.out.contamination.get(0).get(1)).readLines()[0]).match() } + ) + } + + } + + test("human - pileup-table - matched-pair") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.pileups.table', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test.pileups.table', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions_pair") }, + { assert snapshot(file(process.out.contamination.get(0).get(1)).readLines()[0]).match() } + ) + } + + } + + test("human - pileup-table - segmentation") { + + config "./nextflow.config" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.pileups.table', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test.pileups.table', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions_segmentation") }, + { assert snapshot(file(process.out.contamination.get(0).get(1)).readLines()[0]).match("contamination") }, + { assert snapshot(file(process.out.segmentation.get(0).get(1)).readLines()[0]).match("segmentation") } + ) + } + + } + + test("human - pileup-table - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test2.pileups.table', checkIfExists: true), + [] ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/calculatecontamination/tests/main.nf.test.snap b/modules/nf-core/gatk4/calculatecontamination/tests/main.nf.test.snap new file mode 100644 index 0000000000..5c2930f948 --- /dev/null +++ b/modules/nf-core/gatk4/calculatecontamination/tests/main.nf.test.snap @@ -0,0 +1,127 @@ +{ + "versions_pair": { + "content": [ + [ + "versions.yml:md5,4a72b1da18f7045d470225881e7266a6" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T11:08:17.057861" + }, + "versions": { + "content": [ + [ + "versions.yml:md5,4a72b1da18f7045d470225881e7266a6" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T11:08:07.193762" + }, + "versions_segmentation": { + "content": [ + [ + "versions.yml:md5,4a72b1da18f7045d470225881e7266a6" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T11:08:26.99069" + }, + "segmentation": { + "content": [ + "#SAMPLE=tumour" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:57:38.845287" + }, + "human - pileup-table": { + "content": [ + "sample\tcontamination\terror" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T11:09:16.292509" + }, + "human - pileup-table - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.contamination.table:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.segmentation.table:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + "versions.yml:md5,4a72b1da18f7045d470225881e7266a6" + ], + "contamination": [ + [ + { + "id": "test" + }, + "test.contamination.table:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "segmentation": [ + [ + { + "id": "test" + }, + "test.segmentation.table:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,4a72b1da18f7045d470225881e7266a6" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:56:14.817045" + }, + "human - pileup-table - matched-pair": { + "content": [ + "sample\tcontamination\terror" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T11:09:26.408848" + }, + "contamination": { + "content": [ + "sample\tcontamination\terror" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:57:38.840651" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/calculatecontamination/tests/nextflow.config b/modules/nf-core/gatk4/calculatecontamination/tests/nextflow.config new file mode 100644 index 0000000000..db836b7f80 --- /dev/null +++ b/modules/nf-core/gatk4/calculatecontamination/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: GATK4_CALCULATECONTAMINATION { + ext.args = { "--tumor-segmentation ${meta.id}.segmentation.table" } + } +} diff --git a/modules/nf-core/gatk4/calculatecontamination/tests/tags.yml b/modules/nf-core/gatk4/calculatecontamination/tests/tags.yml new file mode 100644 index 0000000000..29acb20487 --- /dev/null +++ b/modules/nf-core/gatk4/calculatecontamination/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/calculatecontamination: + - "modules/nf-core/gatk4/calculatecontamination/**" 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 0000000000..a8a9c6d2e8 --- /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 0000000000..16735f9549 --- /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 0000000000..035c5e4c74 --- /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/filtermutectcalls/main.nf b/modules/nf-core/gatk4/filtermutectcalls/main.nf index 38dd44c786..0532ec0258 100644 --- a/modules/nf-core/gatk4/filtermutectcalls/main.nf +++ b/modules/nf-core/gatk4/filtermutectcalls/main.nf @@ -59,7 +59,7 @@ process GATK4_FILTERMUTECTCALLS { stub: def prefix = task.ext.prefix ?: "${meta.id}" """ - touch ${prefix}.vcf.gz + echo "" | gzip > ${prefix}.vcf.gz touch ${prefix}.vcf.gz.tbi touch ${prefix}.vcf.gz.filteringStats.tsv diff --git a/modules/nf-core/gatk4/filtermutectcalls/tests/main.nf.test b/modules/nf-core/gatk4/filtermutectcalls/tests/main.nf.test new file mode 100644 index 0000000000..83c3703fcb --- /dev/null +++ b/modules/nf-core/gatk4/filtermutectcalls/tests/main.nf.test @@ -0,0 +1,176 @@ +nextflow_process { + + name "Test Process GATK4_FILTERMUTECTCALLS" + script "../main.nf" + process "GATK4_FILTERMUTECTCALLS" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/filtermutectcalls" + + test("human - vcf - base") { + + when { + process { + """ + input[0] = [ + [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.stats', 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 + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions_base") }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.2") }, + { assert path(process.out.tbi.get(0).get(1)).linesGzip.toString().contains("TBI")}, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0]).match() } + ) + } + + } + + test("human - vcf - with-files") { + + when { + process { + """ + input[0] = [ + [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.stats', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test_test2_paired_mutect2_calls.artifact-prior.tar.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test_test2_paired.segmentation.table', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test_test2_paired.contamination.table', 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 + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions_with-files") }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.2") }, + { assert path(process.out.tbi.get(0).get(1)).linesGzip.toString().contains("TBI")}, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0..5]).match() } + ) + } + + } + + test("human - vcf - use-val") { + + when { + process { + """ + input[0] = [ + [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.stats', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test_test2_paired_mutect2_calls.artifact-prior.tar.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/test_test2_paired.segmentation.table', checkIfExists: true), + [], + '20.0' + ] + + 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 + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions_use-val") }, + { assert path(process.out.vcf.get(0).get(1)).linesGzip.contains("##fileformat=VCFv4.2") }, + { assert path(process.out.tbi.get(0).get(1)).linesGzip.toString().contains("TBI")}, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0]).match() } + ) + } + + } + + test("human - vcf - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test'], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.stats', 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 + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/filtermutectcalls/tests/main.nf.test.snap b/modules/nf-core/gatk4/filtermutectcalls/tests/main.nf.test.snap new file mode 100644 index 0000000000..1c39e3b5d7 --- /dev/null +++ b/modules/nf-core/gatk4/filtermutectcalls/tests/main.nf.test.snap @@ -0,0 +1,140 @@ +{ + "human - vcf - use-val": { + "content": [ + "#Ln prior of deletion of length 10=-20.72326583694641" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:46:03.887912" + }, + "versions_with-files": { + "content": [ + [ + "versions.yml:md5,1e86368bd682668a6777ccf2cfd90689" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:45:43.679571" + }, + "human - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.filtered.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "test.filtered.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "test.filtered.vcf.gz.filteringStats.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + "versions.yml:md5,1e86368bd682668a6777ccf2cfd90689" + ], + "stats": [ + [ + { + "id": "test" + }, + "test.filtered.vcf.gz.filteringStats.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "tbi": [ + [ + { + "id": "test" + }, + "test.filtered.vcf.gz.tbi:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + [ + { + "id": "test" + }, + "test.filtered.vcf.gz:md5,68b329da9893e34099c7d8ad5cb9c940" + ] + ], + "versions": [ + "versions.yml:md5,1e86368bd682668a6777ccf2cfd90689" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:46:32.666273" + }, + "versions_use-val": { + "content": [ + [ + "versions.yml:md5,1e86368bd682668a6777ccf2cfd90689" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:46:03.876073" + }, + "versions_base": { + "content": [ + [ + "versions.yml:md5,1e86368bd682668a6777ccf2cfd90689" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:47:39.930795" + }, + "human - vcf - with-files": { + "content": [ + [ + "#Ln prior of deletion of length 10=-20.72326583694641", + "#Ln prior of deletion of length 9=-20.72326583694641", + "#Ln prior of deletion of length 8=-20.72326583694641", + "#Ln prior of deletion of length 7=-20.72326583694641", + "#Ln prior of deletion of length 6=-20.72326583694641", + "#Ln prior of deletion of length 5=-20.72326583694641" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:45:43.699286" + }, + "human - vcf - base": { + "content": [ + "#Ln prior of deletion of length 10=-20.72326583694641" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-15T12:47:39.949405" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/filtermutectcalls/tests/nextflow.config b/modules/nf-core/gatk4/filtermutectcalls/tests/nextflow.config new file mode 100644 index 0000000000..12fa58fb34 --- /dev/null +++ b/modules/nf-core/gatk4/filtermutectcalls/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: GATK4_FILTERMUTECTCALLS { + ext.prefix = { "${meta.id}.filtered" } + } +} diff --git a/modules/nf-core/gatk4/filtermutectcalls/tests/tags.yml b/modules/nf-core/gatk4/filtermutectcalls/tests/tags.yml new file mode 100644 index 0000000000..4473103181 --- /dev/null +++ b/modules/nf-core/gatk4/filtermutectcalls/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/filtermutectcalls: + - "modules/nf-core/gatk4/filtermutectcalls/**" diff --git a/modules/nf-core/gatk4/getpileupsummaries/main.nf b/modules/nf-core/gatk4/getpileupsummaries/main.nf index 6006e8dd42..43611271e0 100644 --- a/modules/nf-core/gatk4/getpileupsummaries/main.nf +++ b/modules/nf-core/gatk4/getpileupsummaries/main.nf @@ -50,4 +50,15 @@ process GATK4_GETPILEUPSUMMARIES { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.pileups.table + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/gatk4/getpileupsummaries/tests/main.nf.test b/modules/nf-core/gatk4/getpileupsummaries/tests/main.nf.test new file mode 100644 index 0000000000..79cd6344cb --- /dev/null +++ b/modules/nf-core/gatk4/getpileupsummaries/tests/main.nf.test @@ -0,0 +1,104 @@ +nextflow_process { + + name "Test Process GATK4_GETPILEUPSUMMARIES" + script "../main.nf" + process "GATK4_GETPILEUPSUMMARIES" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/getpileupsummaries" + + test("human - bam") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true) + ] + input[1] = [[],[]] // fasta + input[2] = [[],[]] // fai + input[3] = [[],[]] // dict + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("human - cram") { + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.recalibrated.sorted.cram.crai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', 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 + 'genomics/homo_sapiens/genome/chr21/sequence/genome.dict', checkIfExists: true) + ] + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("human - bam - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test' ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam', checkIfExists: true) , + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.recalibrated.sorted.bam.bai', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.interval_list', checkIfExists: true) + ] + input[1] = [[],[]] // fasta + input[2] = [[],[]] // fai + input[3] = [[],[]] // dict + input[4] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz', checkIfExists: true) + input[5] = file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/germlineresources/gnomAD.r2.1.1.vcf.gz.tbi', checkIfExists: true) + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/getpileupsummaries/tests/main.nf.test.snap b/modules/nf-core/gatk4/getpileupsummaries/tests/main.nf.test.snap new file mode 100644 index 0000000000..d9304bcdc5 --- /dev/null +++ b/modules/nf-core/gatk4/getpileupsummaries/tests/main.nf.test.snap @@ -0,0 +1,101 @@ +{ + "human - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.pileups.table:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,a243840d67560fd6de1209a0aa99401a" + ], + "table": [ + [ + { + "id": "test" + }, + "test.pileups.table:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,a243840d67560fd6de1209a0aa99401a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-16T10:18:25.186463" + }, + "human - bam": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.pileups.table:md5,8e0ca6f66e112bd2f7ec1d31a2d62469" + ] + ], + "1": [ + "versions.yml:md5,a243840d67560fd6de1209a0aa99401a" + ], + "table": [ + [ + { + "id": "test" + }, + "test.pileups.table:md5,8e0ca6f66e112bd2f7ec1d31a2d62469" + ] + ], + "versions": [ + "versions.yml:md5,a243840d67560fd6de1209a0aa99401a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-16T14:14:59.7414" + }, + "human - cram": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.pileups.table:md5,8e0ca6f66e112bd2f7ec1d31a2d62469" + ] + ], + "1": [ + "versions.yml:md5,a243840d67560fd6de1209a0aa99401a" + ], + "table": [ + [ + { + "id": "test" + }, + "test.pileups.table:md5,8e0ca6f66e112bd2f7ec1d31a2d62469" + ] + ], + "versions": [ + "versions.yml:md5,a243840d67560fd6de1209a0aa99401a" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-16T14:15:25.680928" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/getpileupsummaries/tests/tags.yml b/modules/nf-core/gatk4/getpileupsummaries/tests/tags.yml new file mode 100644 index 0000000000..bac8007d9e --- /dev/null +++ b/modules/nf-core/gatk4/getpileupsummaries/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/getpileupsummaries: + - "modules/nf-core/gatk4/getpileupsummaries/**" diff --git a/modules/nf-core/gatk4/mergemutectstats/main.nf b/modules/nf-core/gatk4/mergemutectstats/main.nf index af41d61507..06bce31e31 100644 --- a/modules/nf-core/gatk4/mergemutectstats/main.nf +++ b/modules/nf-core/gatk4/mergemutectstats/main.nf @@ -41,4 +41,15 @@ process GATK4_MERGEMUTECTSTATS { gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.vcf.gz.stats + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//') + END_VERSIONS + """ } diff --git a/modules/nf-core/gatk4/mergemutectstats/tests/main.nf.test b/modules/nf-core/gatk4/mergemutectstats/tests/main.nf.test new file mode 100644 index 0000000000..5f5ab40233 --- /dev/null +++ b/modules/nf-core/gatk4/mergemutectstats/tests/main.nf.test @@ -0,0 +1,57 @@ +nextflow_process { + + name "Test Process GATK4_MERGEMUTECTSTATS" + script "../main.nf" + process "GATK4_MERGEMUTECTSTATS" + + tag "modules" + tag "modules_nfcore" + tag "gatk4" + tag "gatk4/mergemutectstats" + + test("human - stats, tsv") { + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.stats', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out.versions).match("versions") }, + { assert snapshot(file(process.out.stats.get(0).get(1)).readLines()[0]).match() } + ) + } + + } + + test("human - stats,tsv - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.stats', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/gatk4/mergemutectstats/tests/main.nf.test.snap b/modules/nf-core/gatk4/mergemutectstats/tests/main.nf.test.snap new file mode 100644 index 0000000000..d0279f272e --- /dev/null +++ b/modules/nf-core/gatk4/mergemutectstats/tests/main.nf.test.snap @@ -0,0 +1,59 @@ +{ + "versions": { + "content": [ + [ + "versions.yml:md5,7298d6e6e18024f7c2ed0fe38d259a52" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-16T10:13:56.2195" + }, + "human - stats,tsv - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,7298d6e6e18024f7c2ed0fe38d259a52" + ], + "stats": [ + [ + { + "id": "test", + "single_end": false + }, + "test.vcf.gz.stats:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,7298d6e6e18024f7c2ed0fe38d259a52" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-16T10:14:10.058769" + }, + "human - stats, tsv": { + "content": [ + "statistic\tvalue" + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.0" + }, + "timestamp": "2024-05-16T10:13:56.262881" + } +} \ No newline at end of file diff --git a/modules/nf-core/gatk4/mergemutectstats/tests/tags.yml b/modules/nf-core/gatk4/mergemutectstats/tests/tags.yml new file mode 100644 index 0000000000..b750e551f9 --- /dev/null +++ b/modules/nf-core/gatk4/mergemutectstats/tests/tags.yml @@ -0,0 +1,2 @@ +gatk4/mergemutectstats: + - "modules/nf-core/gatk4/mergemutectstats/**" diff --git a/modules/nf-core/gawk/environment.yml b/modules/nf-core/gawk/environment.yml index 34513c7f4a..3d98a08b0c 100644 --- a/modules/nf-core/gawk/environment.yml +++ b/modules/nf-core/gawk/environment.yml @@ -4,4 +4,4 @@ channels: - 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 f856a1f82b..ca4689297c 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.snap b/modules/nf-core/gawk/tests/main.nf.test.snap index ce20747890..4f3a759c62 100644 --- a/modules/nf-core/gawk/tests/main.nf.test.snap +++ b/modules/nf-core/gawk/tests/main.nf.test.snap @@ -11,7 +11,7 @@ ] ], "1": [ - "versions.yml:md5,4c320d8c98ca80690afd7651da1ba520" + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" ], "output": [ [ @@ -22,15 +22,15 @@ ] ], "versions": [ - "versions.yml:md5,4c320d8c98ca80690afd7651da1ba520" + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nextflow": "24.03.0" }, - "timestamp": "2024-04-05T11:00:28.097563" + "timestamp": "2024-05-17T15:20:02.495430346" }, "convert fasta to bed": { "content": [ @@ -44,7 +44,7 @@ ] ], "1": [ - "versions.yml:md5,4c320d8c98ca80690afd7651da1ba520" + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" ], "output": [ [ @@ -55,14 +55,14 @@ ] ], "versions": [ - "versions.yml:md5,4c320d8c98ca80690afd7651da1ba520" + "versions.yml:md5,842acc9870dc8ac280954047cb2aa23a" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.02.0" + "nextflow": "24.03.0" }, - "timestamp": "2024-04-05T10:28:15.625869" + "timestamp": "2024-05-17T15:19:53.291809648" } } \ No newline at end of file diff --git a/modules/nf-core/ngscheckmate/ncm/main.nf b/modules/nf-core/ngscheckmate/ncm/main.nf index 99921ddcc5..d5500a257c 100644 --- a/modules/nf-core/ngscheckmate/ncm/main.nf +++ b/modules/nf-core/ngscheckmate/ncm/main.nf @@ -48,6 +48,7 @@ process NGSCHECKMATE_NCM { """ stub: + def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "$meta.id" """ touch ${prefix}_output_corr_matrix.txt diff --git a/modules/nf-core/ngscheckmate/ncm/tests/bam.config b/modules/nf-core/ngscheckmate/ncm/tests/bam.config new file mode 100644 index 0000000000..09805c1614 --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/bam.config @@ -0,0 +1,5 @@ +process { + withName: NGSCHECKMATE_NCM { + ext.args = '-B' + } +} diff --git a/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test new file mode 100644 index 0000000000..9dafbdf6df --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test @@ -0,0 +1,184 @@ +nextflow_process { + + name "Test Process NGSCHECKMATE_NCM" + script "../main.nf" + process "NGSCHECKMATE_NCM" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "ngscheckmate" + tag "ngscheckmate/ncm" + tag "bedtools/makewindows" + tag "bcftools/mpileup" + + setup { + + run("BEDTOOLS_MAKEWINDOWS") { + script "../../../bedtools/makewindows/main.nf" + process { + """ + input[0] = [ [ id:'test' ], + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + """ + } + } + + run("BCFTOOLS_MPILEUP", alias: "BCFTOOLS_MPILEUP1") { + script "../../../bcftools/mpileup/main.nf" + process { + """ + input[0] = [ + [ id:'test1' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + input[1] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + run("BCFTOOLS_MPILEUP", alias: "BCFTOOLS_MPILEUP2") { + script "../../../bcftools/mpileup/main.nf" + process { + """ + input[0] = [ + [ id:'test2' ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true), + file(params.test_data['sarscov2']['genome']['test_bed'], checkIfExists: true) + ] + input[1] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + input[2] = false + """ + } + } + + } + + + test("sarscov2 - bam") { + config "./bam.config" + when { + process { + """ + input[0] = [ [ id: 'combined_bams' ], + [file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'] , checkIfExists: true ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'] , checkIfExists: true ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam'] , checkIfExists: true ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam_bai'], checkIfExists: true ) + ] + ] + input[1] = BEDTOOLS_MAKEWINDOWS.out.bed + input[2] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.corr_matrix, + process.out.matched, + process.out.all, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - vcf") { + config "./vcf.config" + when { + process { + """ + input[0] = BCFTOOLS_MPILEUP1.out.vcf.combine(BCFTOOLS_MPILEUP2.out.vcf.map{it[1]}).map{meta, one, two -> [meta, [one, two]]}.map{meta, stuff -> [meta, stuff.flatten()]} + input[1] = BEDTOOLS_MAKEWINDOWS.out.bed + input[2] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out.corr_matrix, + process.out.matched, + process.out.all, + file(process.out.pdf[0][1]).name, + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - bam - stub") { + + options "-stub" + config "./bam.config" + when { + process { + """ + input[0] = [ [ id: 'combined_bams' ], + [file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'] , checkIfExists: true ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam_bai'] , checkIfExists: true ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam'] , checkIfExists: true ), + file(params.test_data['sarscov2']['illumina']['test_paired_end_methylated_sorted_bam_bai'], checkIfExists: true ) + ] + ] + input[1] = BEDTOOLS_MAKEWINDOWS.out.bed + input[2] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - vcf - stub") { + + options "-stub" + config "./vcf.config" + when { + process { + """ + input[0] = BCFTOOLS_MPILEUP1.out.vcf.combine(BCFTOOLS_MPILEUP2.out.vcf.map{it[1]}) + input[1] = BEDTOOLS_MAKEWINDOWS.out.bed + input[2] = [ [ id:'sarscov2' ], + file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test.snap b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test.snap new file mode 100644 index 0000000000..46a98ccc98 --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/main.nf.test.snap @@ -0,0 +1,249 @@ +{ + "sarscov2 - bam - stub": { + "content": [ + { + "0": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_output_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "combined_bams" + }, + "combined_bams.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ], + "all": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "corr_matrix": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_output_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "matched": [ + [ + { + "id": "combined_bams" + }, + "combined_bams_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pdf": [ + [ + { + "id": "combined_bams" + }, + "combined_bams.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T15:02:55.532427413" + }, + "sarscov2 - vcf": { + "content": [ + [ + [ + { + "id": "test1" + }, + "test1_output_corr_matrix.txt:md5,0c86bdad2721c470fe6be119f291c8e5" + ] + ], + [ + [ + { + "id": "test1" + }, + "test1_matched.txt:md5,fd74956dcac279b6f58e82ea73e344f8" + ] + ], + [ + [ + { + "id": "test1" + }, + "test1_all.txt:md5,fd74956dcac279b6f58e82ea73e344f8" + ] + ], + "test1.pdf", + [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T19:53:29.123160766" + }, + "sarscov2 - bam": { + "content": [ + [ + [ + { + "id": "combined_bams" + }, + "combined_bams_output_corr_matrix.txt:md5,b8bfd203232680b746ac91ccb290b5e3" + ] + ], + [ + [ + { + "id": "combined_bams" + }, + "combined_bams_matched.txt:md5,14d0b35765e127aab0ffa5ea5406b4ab" + ] + ], + [ + [ + { + "id": "combined_bams" + }, + "combined_bams_all.txt:md5,14d0b35765e127aab0ffa5ea5406b4ab" + ] + ], + [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ] + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T16:04:35.032277154" + }, + "sarscov2 - vcf - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test1" + }, + "test1_output_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test1" + }, + "test1_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test1" + }, + "test1_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test1" + }, + "test1.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + + ], + "5": [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ], + "all": [ + [ + { + "id": "test1" + }, + "test1_all.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "corr_matrix": [ + [ + { + "id": "test1" + }, + "test1_output_corr_matrix.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "matched": [ + [ + { + "id": "test1" + }, + "test1_matched.txt:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pdf": [ + [ + { + "id": "test1" + }, + "test1.pdf:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "vcf": [ + + ], + "versions": [ + "versions.yml:md5,7ac92d9cbf4fc44b3253832f3a8b2a80" + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "24.04.1" + }, + "timestamp": "2024-05-22T15:20:40.816531052" + } +} \ No newline at end of file diff --git a/modules/nf-core/ngscheckmate/ncm/tests/nextflow.config b/modules/nf-core/ngscheckmate/ncm/tests/nextflow.config new file mode 100644 index 0000000000..cf3d42a0e9 --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/nextflow.config @@ -0,0 +1,15 @@ +process { + withName: BEDTOOLS_MAKEWINDOWS { + ext.args = '-w 1' + ext.prefix = 'test_split' + } + withName: BCFTOOLS_MPILEUP1 { + ext.args2 = '--no-version --ploidy 1 --multiallelic-caller' + ext.args3 = '--no-version' + } + withName: BCFTOOLS_MPILEUP2 { + ext.args2 = '--no-version --ploidy 1 --multiallelic-caller' + ext.args3 = '--no-version' + } + +} diff --git a/modules/nf-core/ngscheckmate/ncm/tests/tags.yml b/modules/nf-core/ngscheckmate/ncm/tests/tags.yml new file mode 100644 index 0000000000..f9f6044516 --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/tags.yml @@ -0,0 +1,2 @@ +ngscheckmate/ncm: + - "modules/nf-core/ngscheckmate/ncm/**" diff --git a/modules/nf-core/ngscheckmate/ncm/tests/vcf.config b/modules/nf-core/ngscheckmate/ncm/tests/vcf.config new file mode 100644 index 0000000000..67053c14da --- /dev/null +++ b/modules/nf-core/ngscheckmate/ncm/tests/vcf.config @@ -0,0 +1,5 @@ + process { + withName: NGSCHECKMATE_NCM { + ext.args = '-V' + } + } diff --git a/modules/nf-core/samtools/bam2fq/environment.yml b/modules/nf-core/samtools/bam2fq/environment.yml index 6f3c6d8b1b..9c98946adc 100644 --- a/modules/nf-core/samtools/bam2fq/environment.yml +++ b/modules/nf-core/samtools/bam2fq/environment.yml @@ -4,5 +4,5 @@ channels: - 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/bam2fq/main.nf b/modules/nf-core/samtools/bam2fq/main.nf index 463c6ae20b..a34a13a984 100644 --- a/modules/nf-core/samtools/bam2fq/main.nf +++ b/modules/nf-core/samtools/bam2fq/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_BAM2FQ { 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(inputbam) diff --git a/modules/nf-core/samtools/bam2fq/tests/main.nf.test.snap b/modules/nf-core/samtools/bam2fq/tests/main.nf.test.snap index 84da35bae4..aa0f8c34d1 100644 --- a/modules/nf-core/samtools/bam2fq/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/bam2fq/tests/main.nf.test.snap @@ -51,25 +51,25 @@ "bam_versions": { "content": [ [ - "versions.yml:md5,04115f386f1c3cb2e25edc02821da2fc" + "versions.yml:md5,90c1cf8971540ef05e330db5a560195c" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:13:56.124383258" + "timestamp": "2024-05-28T15:43:52.415053401" }, "bam_split_versions": { "content": [ [ - "versions.yml:md5,04115f386f1c3cb2e25edc02821da2fc" + "versions.yml:md5,90c1cf8971540ef05e330db5a560195c" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:14:03.828077257" + "timestamp": "2024-05-28T15:43:57.740193087" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/collatefastq/environment.yml b/modules/nf-core/samtools/collatefastq/environment.yml index d1ce1a8019..93734c5670 100644 --- a/modules/nf-core/samtools/collatefastq/environment.yml +++ b/modules/nf-core/samtools/collatefastq/environment.yml @@ -4,5 +4,5 @@ channels: - 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/collatefastq/main.nf b/modules/nf-core/samtools/collatefastq/main.nf index 1e431c6e5e..a75f56e8c6 100644 --- a/modules/nf-core/samtools/collatefastq/main.nf +++ b/modules/nf-core/samtools/collatefastq/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_COLLATEFASTQ { 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) diff --git a/modules/nf-core/samtools/convert/environment.yml b/modules/nf-core/samtools/convert/environment.yml index cd4ee8c364..7a95ca614a 100644 --- a/modules/nf-core/samtools/convert/environment.yml +++ b/modules/nf-core/samtools/convert/environment.yml @@ -4,5 +4,5 @@ channels: - 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 3c539e484d..03b7b5259d 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) @@ -42,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/tests/main.nf.test b/modules/nf-core/samtools/convert/tests/main.nf.test index d2ab583901..91a0c69ea1 100644 --- a/modules/nf-core/samtools/convert/tests/main.nf.test +++ b/modules/nf-core/samtools/convert/tests/main.nf.test @@ -72,4 +72,36 @@ nextflow_process { ) } } + + 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 9d56a4ec6c..513629022b 100644 --- a/modules/nf-core/samtools/convert/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/convert/tests/main.nf.test.snap @@ -22,26 +22,91 @@ "cram_to_bam_versions": { "content": [ [ - "versions.yml:md5,dd0aaf61f39c9ce91c74090f3c7ce1d0" + "versions.yml:md5,b1040cd80ce16abb9b2c2902b62d5fcd" ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-06T11:14:51.308885706" + "timestamp": "2024-05-28T15:44:34.618037105" }, "bam_to_cram_versions": { "content": [ [ - "versions.yml:md5,dd0aaf61f39c9ce91c74090f3c7ce1d0" + "versions.yml:md5,b1040cd80ce16abb9b2c2902b62d5fcd" ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-06T11:14:36.643960504" + "timestamp": "2024-05-28T15:44:29.165839679" + }, + "stub": { + "content": [ + { + "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": "23.10.1" + }, + "timestamp": "2024-05-28T15:44:40.258233921" }, "bam_to_cram_index": { "content": [ diff --git a/modules/nf-core/samtools/faidx/environment.yml b/modules/nf-core/samtools/faidx/environment.yml index 9c24eb0ab3..f8450fa566 100644 --- a/modules/nf-core/samtools/faidx/environment.yml +++ b/modules/nf-core/samtools/faidx/environment.yml @@ -6,5 +6,5 @@ channels: - defaults dependencies: - - bioconda::htslib=1.19.1 - - bioconda::samtools=1.19.2 + - 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 cfe7ad95fa..bdcdbc954d 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/tests/main.nf.test.snap b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap index 3e651ef680..3223b72bc6 100644 --- a/modules/nf-core/samtools/faidx/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/faidx/tests/main.nf.test.snap @@ -18,7 +18,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ @@ -36,7 +36,7 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -44,7 +44,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:22:39.412601" + "timestamp": "2024-05-28T15:42:14.779784761" }, "test_samtools_faidx_bgzip": { "content": [ @@ -71,7 +71,7 @@ ] ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ @@ -95,7 +95,7 @@ ] ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -103,7 +103,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:23:22.427966" + "timestamp": "2024-05-28T15:42:20.256633877" }, "test_samtools_faidx_fasta": { "content": [ @@ -124,7 +124,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ [ @@ -142,7 +142,7 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -150,7 +150,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:24:04.107537" + "timestamp": "2024-05-28T15:42:25.632577273" }, "test_samtools_faidx_stub_fasta": { "content": [ @@ -171,7 +171,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ [ @@ -189,7 +189,7 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -197,7 +197,7 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:24:45.868463" + "timestamp": "2024-05-28T15:42:31.058424849" }, "test_samtools_faidx_stub_fai": { "content": [ @@ -218,7 +218,7 @@ ], "3": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ], "fa": [ @@ -236,7 +236,7 @@ ], "versions": [ - "versions.yml:md5,4870fc0a88c616aa937f8325a2db0c3c" + "versions.yml:md5,2db78952923a61e05d50b95518b21856" ] } ], @@ -244,6 +244,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-03-18T16:25:27.550554" + "timestamp": "2024-05-28T15:42:36.479929617" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/index/environment.yml b/modules/nf-core/samtools/index/environment.yml index a5e5064986..260d516be9 100644 --- a/modules/nf-core/samtools/index/environment.yml +++ b/modules/nf-core/samtools/index/environment.yml @@ -4,5 +4,5 @@ channels: - 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 dc14f98d63..b523c21b43 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) 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 3dc8e7de81..52756e85c6 100644 --- a/modules/nf-core/samtools/index/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/index/tests/main.nf.test.snap @@ -2,26 +2,26 @@ "crai_versions": { "content": [ [ - "versions.yml:md5,cc4370091670b64bba7c7206403ffb3e" + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:12:00.324667957" + "timestamp": "2024-05-28T15:42:04.203740976" }, "csi_versions": { "content": [ [ - "versions.yml:md5,cc4370091670b64bba7c7206403ffb3e" + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:12:07.885103162" + "timestamp": "2024-05-28T15:42:09.57475878" }, "crai": { "content": [ @@ -62,13 +62,13 @@ "bai_versions": { "content": [ [ - "versions.yml:md5,cc4370091670b64bba7c7206403ffb3e" + "versions.yml:md5,802c9776d9c5e95314e888cf18e96d77" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:11:51.641425452" + "timestamp": "2024-05-28T15:41:57.929287369" } } \ 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 fc669b1b62..cd366d6de3 100644 --- a/modules/nf-core/samtools/merge/environment.yml +++ b/modules/nf-core/samtools/merge/environment.yml @@ -4,5 +4,5 @@ channels: - 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 a3048c2836..693b1d80f4 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/tests/main.nf.test.snap b/modules/nf-core/samtools/merge/tests/main.nf.test.snap index f7da7699b4..17bc846fa2 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/samtools/mpileup/environment.yml b/modules/nf-core/samtools/mpileup/environment.yml index 6628f5dc05..add717dafc 100644 --- a/modules/nf-core/samtools/mpileup/environment.yml +++ b/modules/nf-core/samtools/mpileup/environment.yml @@ -4,5 +4,5 @@ channels: - 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/mpileup/main.nf b/modules/nf-core/samtools/mpileup/main.nf index cb96181ff1..b51f96d369 100644 --- a/modules/nf-core/samtools/mpileup/main.nf +++ b/modules/nf-core/samtools/mpileup/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_MPILEUP { 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(intervals) path fasta diff --git a/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap b/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap index fc891c1b74..76b2086b40 100644 --- a/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/mpileup/tests/main.nf.test.snap @@ -2,26 +2,26 @@ "bam_bed_versions": { "content": [ [ - "versions.yml:md5,c617148132c6a529bdf506fd58ce6a9d" + "versions.yml:md5,449485eab74a465dc9023760be2c12a1" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:13:40.600861147" + "timestamp": "2024-05-28T15:43:41.535946155" }, "bam_bed_fasta_versions": { "content": [ [ - "versions.yml:md5,c617148132c6a529bdf506fd58ce6a9d" + "versions.yml:md5,449485eab74a465dc9023760be2c12a1" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:13:48.271482127" + "timestamp": "2024-05-28T15:43:46.787790118" }, "bam_bed_mpileup": { "content": [ diff --git a/modules/nf-core/samtools/stats/environment.yml b/modules/nf-core/samtools/stats/environment.yml index 67bb0ca408..1cc83bd954 100644 --- a/modules/nf-core/samtools/stats/environment.yml +++ b/modules/nf-core/samtools/stats/environment.yml @@ -4,5 +4,5 @@ channels: - 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/stats/main.nf b/modules/nf-core/samtools/stats/main.nf index 52b00f4b6f..982bc28e7f 100644 --- a/modules/nf-core/samtools/stats/main.nf +++ b/modules/nf-core/samtools/stats/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_STATS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/samtools:1.19.2--h50ea8bc_0' : - 'biocontainers/samtools:1.19.2--h50ea8bc_0' }" + 'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' : + 'biocontainers/samtools:1.20--h50ea8bc_0' }" input: tuple val(meta), path(input), path(input_index) diff --git a/modules/nf-core/samtools/stats/tests/main.nf.test.snap b/modules/nf-core/samtools/stats/tests/main.nf.test.snap index 1b7c9ba44e..2747fd6c61 100644 --- a/modules/nf-core/samtools/stats/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/stats/tests/main.nf.test.snap @@ -8,11 +8,11 @@ "id": "test", "single_end": false }, - "test.stats:md5,01812900aa4027532906c5d431114233" + "test.stats:md5,c9d39b38c22de2057fc2f89949090975" ] ], "1": [ - "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" ], "stats": [ [ @@ -20,19 +20,19 @@ "id": "test", "single_end": false }, - "test.stats:md5,01812900aa4027532906c5d431114233" + "test.stats:md5,c9d39b38c22de2057fc2f89949090975" ] ], "versions": [ - "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:15:25.562429714" + "timestamp": "2024-05-28T15:45:24.403941966" }, "bam": { "content": [ @@ -43,11 +43,11 @@ "id": "test", "single_end": false }, - "test.stats:md5,5d8681bf541199898c042bf400391d59" + "test.stats:md5,d522a1fa016b259d6a55620ae53dcd63" ] ], "1": [ - "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" ], "stats": [ [ @@ -55,18 +55,18 @@ "id": "test", "single_end": false }, - "test.stats:md5,5d8681bf541199898c042bf400391d59" + "test.stats:md5,d522a1fa016b259d6a55620ae53dcd63" ] ], "versions": [ - "versions.yml:md5,0514ceb1769b2a88843e08c1f82624a9" + "versions.yml:md5,b3b70b126f867fdbb7dcea5e36e49d4a" ] } ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:15:07.857611509" + "timestamp": "2024-05-28T15:45:06.711251947" } } \ No newline at end of file diff --git a/modules/nf-core/samtools/view/environment.yml b/modules/nf-core/samtools/view/environment.yml index b0676f338e..150c377771 100644 --- a/modules/nf-core/samtools/view/environment.yml +++ b/modules/nf-core/samtools/view/environment.yml @@ -4,5 +4,5 @@ channels: - 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/view/main.nf b/modules/nf-core/samtools/view/main.nf index 5a8989d697..38df857604 100644 --- a/modules/nf-core/samtools/view/main.nf +++ b/modules/nf-core/samtools/view/main.nf @@ -4,8 +4,8 @@ process SAMTOOLS_VIEW { 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) diff --git a/modules/nf-core/samtools/view/tests/main.nf.test.snap b/modules/nf-core/samtools/view/tests/main.nf.test.snap index f55943a7ae..eb0c577c90 100644 --- a/modules/nf-core/samtools/view/tests/main.nf.test.snap +++ b/modules/nf-core/samtools/view/tests/main.nf.test.snap @@ -56,14 +56,14 @@ "bam_stub_versions": { "content": [ [ - "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:13:09.713353823" + "timestamp": "2024-05-28T15:43:20.390692583" }, "cram_to_bam_index_cram": { "content": [ @@ -208,14 +208,14 @@ "cram_to_bam_index_qname_versions": { "content": [ [ - "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:13:03.935041046" + "timestamp": "2024-05-28T15:43:15.007493874" }, "cram_to_bam_bam": { "content": [ @@ -240,14 +240,14 @@ "cram_to_bam_index_versions": { "content": [ [ - "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:12:55.910685496" + "timestamp": "2024-05-28T15:43:09.472376824" }, "cram_to_bam_bai": { "content": [ @@ -264,14 +264,14 @@ "cram_to_bam_versions": { "content": [ [ - "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:12:47.715221169" + "timestamp": "2024-05-28T15:43:04.080050906" }, "cram_bam": { "content": [ @@ -358,14 +358,14 @@ "bam_versions": { "content": [ [ - "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:12:31.692607421" + "timestamp": "2024-05-28T15:42:52.978954857" }, "cram_to_bam_index_qname_cram": { "content": [ @@ -430,14 +430,14 @@ "cram_versions": { "content": [ [ - "versions.yml:md5,4ea32c57d546102a1b32d9693ada7cf1" + "versions.yml:md5,6cd41a9a3b4a95271ec011ea990a2838" ] ], "meta": { "nf-test": "0.8.4", - "nextflow": "24.01.0" + "nextflow": "23.10.1" }, - "timestamp": "2024-02-13T16:12:39.913411036" + "timestamp": "2024-05-28T15:42:58.400776109" }, "bam_sam": { "content": [ diff --git a/modules/nf-core/spring/decompress/environment.yml b/modules/nf-core/spring/decompress/environment.yml new file mode 100644 index 0000000000..d960ee714a --- /dev/null +++ b/modules/nf-core/spring/decompress/environment.yml @@ -0,0 +1,7 @@ +name: spring_decompress +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - bioconda::spring=1.1.1 diff --git a/modules/nf-core/spring/decompress/main.nf b/modules/nf-core/spring/decompress/main.nf new file mode 100644 index 0000000000..4cf7829917 --- /dev/null +++ b/modules/nf-core/spring/decompress/main.nf @@ -0,0 +1,41 @@ +process SPRING_DECOMPRESS { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/spring:1.1.1--h4ac6f70_2' : + 'biocontainers/spring:1.1.1--h4ac6f70_2' }" + + input: + tuple val(meta), path(spring) + val(write_one_fastq_gz) + + output: + tuple val(meta), path("*.fastq.gz"), emit: fastq + 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 VERSION = '1.1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def output = write_one_fastq_gz ? "-o ${prefix}.fastq.gz" : "-o ${prefix}_R1.fastq.gz ${prefix}_R2.fastq.gz" + + """ + spring \\ + -d \\ + -g \\ + -t ${task.cpus} \\ + $args \\ + -i ${spring} \\ + ${output} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + spring: ${VERSION} + END_VERSIONS + """ +} diff --git a/modules/nf-core/spring/decompress/meta.yml b/modules/nf-core/spring/decompress/meta.yml new file mode 100644 index 0000000000..a3449b4fb3 --- /dev/null +++ b/modules/nf-core/spring/decompress/meta.yml @@ -0,0 +1,47 @@ +name: "spring_decompress" +description: Fast, efficient, lossless decompression of FASTQ files. +keywords: + - FASTQ + - decompression + - lossless +tools: + - "spring": + description: "SPRING is a compression tool for Fastq files (containing up to 4.29 Billion reads)" + homepage: "https://github.com/shubhamchandak94/Spring" + documentation: "https://github.com/shubhamchandak94/Spring/blob/master/README.md" + tool_dev_url: "https://github.com/shubhamchandak94/Spring" + doi: "10.1093/bioinformatics/bty1015" + licence: ["Free for non-commercial use"] +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - spring: + type: file + description: Spring file to decompress. + pattern: "*.{spring}" + - write_one_fastq_gz: + type: boolean + description: | + Controls whether spring should write one fastq.gz file with reads from both directions or two fastq.gz files with reads from distinct directions + pattern: "true or false" +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - fastq: + type: file + description: Decompressed FASTQ file(s). + pattern: "*.{fastq.gz}" +authors: + - "@xec-cm" +maintainers: + - "@xec-cm" diff --git a/nextflow.config b/nextflow.config index f26930b9d1..de95ae8c86 100644 --- a/nextflow.config +++ b/nextflow.config @@ -107,15 +107,16 @@ params { multiqc_methods_description = null // Boilerplate options - outdir = null - publish_dir_mode = 'copy' - email = null - email_on_fail = null - plaintext_email = false - monochrome_logs = false - hook_url = null - help = false - version = false + outdir = null + publish_dir_mode = 'copy' + email = null + email_on_fail = null + plaintext_email = false + monochrome_logs = false + hook_url = null + help = false + version = false + pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/' // Config options config_profile_name = null @@ -160,104 +161,102 @@ try { profiles { debug { - cleanup = false - dumpHashes = true - process.beforeScript = 'echo $HOSTNAME' - cleanup = false + dumpHashes = true + process.beforeScript = 'echo $HOSTNAME' + cleanup = false nextflow.enable.configProcessNamesValidation = true } conda { - apptainer.enabled = false - charliecloud.enabled = false - conda.enabled = true - channels = ['conda-forge', 'bioconda', 'defaults'] - docker.enabled = false - podman.enabled = false - shifter.enabled = false - singularity.enabled = false + conda.enabled = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + conda.channels = ['conda-forge', 'bioconda', 'defaults'] + apptainer.enabled = false } mamba { - apptainer.enabled = false - charliecloud.enabled = false - conda.enabled = true - conda.useMamba = true - charliecloud.enabled = false - docker.enabled = false - podman.enabled = false - shifter.enabled = false - singularity.enabled = false + conda.enabled = true + conda.useMamba = true + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } docker { - apptainer.enabled = false - charliecloud.enabled = false - conda.enabled = false - docker.enabled = true - podman.enabled = false - shifter.enabled = false - docker.runOptions = '-u $(id -u):$(id -g)' - singularity.enabled = false + docker.enabled = true + conda.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false + docker.runOptions = '-u $(id -u):$(id -g)' } arm { - docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' + docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64' } singularity { - apptainer.enabled = false - charliecloud.enabled = false - conda.enabled = false - docker.enabled = false - podman.enabled = false - shifter.enabled = false - singularity.autoMounts = true - singularity.enabled = true + singularity.enabled = true + singularity.autoMounts = true + conda.enabled = false + docker.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } podman { - apptainer.enabled = false - charliecloud.enabled = false - conda.enabled = false - docker.enabled = false - podman.enabled = true - shifter.enabled = false - singularity.enabled = false + podman.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + shifter.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } shifter { - apptainer.enabled = false - charliecloud.enabled = false - conda.enabled = false - docker.enabled = false - podman.enabled = false - shifter.enabled = true - singularity.enabled = false + shifter.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + charliecloud.enabled = false + apptainer.enabled = false } charliecloud { - apptainer.enabled = false - charliecloud.enabled = true - conda.enabled = false - docker.enabled = false - podman.enabled = false - shifter.enabled = false - singularity.enabled = false + charliecloud.enabled = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + apptainer.enabled = false } apptainer { - apptainer.enabled = true - apptainer.autoMounts = true - charliecloud.enabled = false - conda.enabled = false - docker.enabled = false - podman.enabled = false - shifter.enabled = false - singularity.enabled = false + apptainer.enabled = true + apptainer.autoMounts = true + conda.enabled = false + docker.enabled = false + singularity.enabled = false + podman.enabled = false + shifter.enabled = false + charliecloud.enabled = false } wave { - apptainer.ociAutoPull = true + apptainer.ociAutoPull = true singularity.ociAutoPull = true wave.enabled = true wave.freeze = true wave.strategy = 'conda,container' } gitpod { - executor.cpus = 4 - executor.memory = 8.GB - executor.name = 'local' + executor.name = 'local' + executor.cpus = 4 + executor.memory = 8.GB } // Basic test profile for CI test { includeConfig 'conf/test.config' } @@ -297,6 +296,7 @@ profiles { } // Extra test profiles for more complete CI + alignment_from_everything { includeConfig 'conf/test/alignment_from_everything.config' } alignment_to_fastq { includeConfig 'conf/test/alignment_to_fastq.config' } annotation { includeConfig 'conf/test/annotation.config' } markduplicates_bam { includeConfig 'conf/test/markduplicates_bam.config' } @@ -396,7 +396,7 @@ manifest { description = """An open-source analysis pipeline to detect germline or somatic variants from whole genome or targeted sequencing""" mainScript = 'main.nf' nextflowVersion = '!>=23.04.0' - version = '3.4.2' + version = '3.4.3' doi = '10.12688/f1000research.16665.2, 10.1093/nargab/lqae031, 10.5281/zenodo.3476425' } diff --git a/nextflow_schema.json b/nextflow_schema.json index 7545b9930e..1611d58f40 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -15,7 +15,7 @@ "properties": { "input": { "description": "Path to comma-separated file containing information about the samples in the experiment.", - "help_text": "A design file with information about the samples in your experiment. Use this parameter to specify the location of the input files. It has to be a comma-separated file with a header row. See [usage docs](https://nf-co.re/sarek/usage#input).\n\nIf no input file is specified, sarek will attempt to locate one in the `{outdir}` directory. If no input should be supplied, i.e. when --step is supplied or --build_from_index, then set --input false", + "help_text": "A design file with information about the samples in your experiment. Use this parameter to specify the location of the input files. It has to be a comma-separated file with a header row. See [usage docs](https://nf-co.re/sarek/usage#input).\n\nIf no input file is specified, sarek will attempt to locate one in the `{outdir}` directory. If no input should be supplied, i.e. when --step is supplied or --build_only_index, then set --input false", "fa_icon": "fas fa-file-csv", "type": "string", "format": "file-path", @@ -111,7 +111,7 @@ "type": "string", "fa_icon": "fas fa-toolbox", "description": "Tools to use for duplicate marking, variant calling and/or for annotation.", - "help_text": "Multiple tools separated with commas.\n\n**Variant Calling:**\n\nGermline variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: DeepVariant, FreeBayes, GATK HaplotypeCaller, mpileup, Sentieon Haplotyper, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit\n\nTumor-only somatic variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, mpileup, Mutect2, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit, ControlFREEC\n\nSomatic variant calling can currently only be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, Mutect2, Strelka2\n- Structural variants: Manta, TIDDIT\n- Copy-Number: ASCAT, CNVKit, Control-FREEC\n- Microsatellite Instability: MSIsensorpro\n\n> **NB** Mutect2 for somatic variant calling cannot be combined with `--no_intervals`\n\n**Annotation:**\n \n- snpEff, VEP, merge (both consecutively), and bcftools annotate (needs `--bcftools_annotation`).\n\n> **NB** As Sarek will use bgzip and tabix to compress and index VCF files annotated, it expects VCF files to be sorted when starting from `--step annotate`.", + "help_text": "Multiple tools separated with commas.\n\n**Variant Calling:**\n\nGermline variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: DeepVariant, FreeBayes, GATK HaplotypeCaller, mpileup, Sentieon Haplotyper, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit\n\nTumor-only somatic variant calling can currently be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, mpileup, Mutect2, Strelka\n- Structural Variants: Manta, TIDDIT\n- Copy-number: CNVKit, ControlFREEC\n\nSomatic variant calling can currently only be performed with the following variant callers:\n- SNPs/Indels: FreeBayes, Mutect2, Strelka\n- Structural variants: Manta, TIDDIT\n- Copy-Number: ASCAT, CNVKit, Control-FREEC\n- Microsatellite Instability: MSIsensorpro\n\n> **NB** Mutect2 for somatic variant calling cannot be combined with `--no_intervals`\n\n**Annotation:**\n \n- snpEff, VEP, merge (both consecutively), and bcftools annotate (needs `--bcftools_annotation`).\n\n> **NB** As Sarek will use bgzip and tabix to compress and index VCF files annotated, it expects VCF files to be sorted when starting from `--step annotate`.", "pattern": "^((ascat|bcfann|cnvkit|controlfreec|deepvariant|freebayes|haplotypecaller|sentieon_dnascope|sentieon_haplotyper|manta|merge|mpileup|msisensorpro|mutect2|ngscheckmate|sentieon_dedup|snpeff|strelka|tiddit|vep)?,?)*(? [meta, cns[2], []]}) + + // export to VCF for compatibility with other tools + CNVKIT_EXPORT(CNVKIT_CALL.out.cns) + ch_genemetrics = CNVKIT_BATCH.out.cnr.join(CNVKIT_BATCH.out.cns).map{ meta, cnr, cns -> [meta, cnr, cns[2]]} CNVKIT_GENEMETRICS(ch_genemetrics) versions = versions.mix(CNVKIT_BATCH.out.versions) versions = versions.mix(CNVKIT_GENEMETRICS.out.versions) - + versions = versions.mix(CNVKIT_CALL.out.versions) + versions = versions.mix(CNVKIT_EXPORT.out.versions) emit: - versions // channel: [ versions.yml ] + cnv_calls_raw = CNVKIT_CALL.out.cns // channel: [ meta, cns ] + cnv_calls_export = CNVKIT_EXPORT.out.output // channel: [ meta, export_format ] + versions // channel: [ versions.yml ] } diff --git a/subworkflows/local/bam_variant_calling_germline_all/main.nf b/subworkflows/local/bam_variant_calling_germline_all/main.nf index 79efd8bf94..0065166bd9 100644 --- a/subworkflows/local/bam_variant_calling_germline_all/main.nf +++ b/subworkflows/local/bam_variant_calling_germline_all/main.nf @@ -26,6 +26,7 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { skip_tools // Mandatory, list of tools to skip cram // channel: [mandatory] meta, cram bwa // channel: [mandatory] meta, bwa + cnvkit_reference // channel: [optional] cnvkit reference dbsnp // channel: [mandatory] meta, dbsnp dbsnp_tbi // channel: [mandatory] dbsnp_tbi dbsnp_vqsr @@ -87,7 +88,7 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL { fasta, fasta_fai, intervals_bed_combined.map{ it -> [[id:it[0].baseName], it] }, - [[id:"null"], []] + params.cnvkit_reference ? cnvkit_reference.map{ it -> [[id:it[0].baseName], it] } : [[:],[]] ) versions = versions.mix(BAM_VARIANT_CALLING_CNVKIT.out.versions) } diff --git a/subworkflows/local/samplesheet_to_channel/main.nf b/subworkflows/local/samplesheet_to_channel/main.nf index 4de0722aed..245bfaec1a 100644 --- a/subworkflows/local/samplesheet_to_channel/main.nf +++ b/subworkflows/local/samplesheet_to_channel/main.nf @@ -33,9 +33,9 @@ workflow SAMPLESHEET_TO_CHANNEL{ main: ch_from_samplesheet.dump(tag:"ch_from_samplesheet") - input_sample = ch_from_samplesheet.map{ meta, fastq_1, fastq_2, table, cram, crai, bam, bai, vcf, variantcaller -> + input_sample = ch_from_samplesheet.map{ meta, fastq_1, fastq_2, spring_1, spring_2, table, cram, crai, bam, bai, vcf, variantcaller -> // generate patient_sample key to group lanes together - [ meta.patient + meta.sample, [meta, fastq_1, fastq_2, table, cram, crai, bam, bai, vcf, variantcaller] ] + [ meta.patient + meta.sample, [meta, fastq_1, fastq_2, spring_1, spring_2, table, cram, crai, bam, bai, vcf, variantcaller] ] }.tap{ ch_with_patient_sample } // save the channel .groupTuple() //group by patient_sample to get all lanes .map { patient_sample, ch_items -> @@ -43,22 +43,33 @@ workflow SAMPLESHEET_TO_CHANNEL{ [ patient_sample, ch_items.size() ] }.combine(ch_with_patient_sample, by: 0) // for each entry add numLanes .map { patient_sample, num_lanes, ch_items -> - (meta, fastq_1, fastq_2, table, cram, crai, bam, bai, vcf, variantcaller) = ch_items + (meta, fastq_1, fastq_2, spring_1, spring_2, table, cram, crai, bam, bai, vcf, variantcaller) = ch_items if (meta.lane && fastq_2) { - meta = meta + [id: "${meta.sample}-${meta.lane}".toString()] - def CN = seq_center ? "CN:${seq_center}\\t" : '' - - def flowcell = flowcellLaneFromFastq(fastq_1) - // Don't use a random element for ID, it breaks resuming - def read_group = "\"@RG\\tID:${flowcell}.${meta.sample}.${meta.lane}\\t${CN}PU:${meta.lane}\\tSM:${meta.patient}_${meta.sample}\\tLB:${meta.sample}\\tDS:${fasta}\\tPL:${seq_platform}\"" - - meta = meta - meta.subMap('lane') + [num_lanes: num_lanes.toInteger(), read_group: read_group.toString(), data_type: 'fastq', size: 1] + meta = meta + [id: "${meta.sample}-${meta.lane}".toString(), data_type: "fastq_gz", num_lanes: num_lanes.toInteger(), size: 1] if (step == 'mapping') return [ meta, [ fastq_1, fastq_2 ] ] else { error("Samplesheet contains fastq files but step is `$step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") } + // start from TWO spring-files - one with R1 and one with R2 + } else if (meta.lane && spring_1 && spring_2) { + meta = meta + [id: "${meta.sample}-${meta.lane}".toString(), data_type: "two_fastq_gz_spring", num_lanes: num_lanes.toInteger(), size: 1] + + if (step == 'mapping') return [ meta, [ spring_1, spring_2 ] ] + else { + error("Samplesheet contains spring files (in columns `spring_1` and `spring_2`) but step is `$step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") + } + + // start from ONE spring-file containing both R1 and R2 + } else if (meta.lane && spring_1 && !spring_2) { + meta = meta + [id: "${meta.sample}-${meta.lane}".toString(), data_type: "one_fastq_gz_spring", num_lanes: num_lanes.toInteger(), size: 1] + + if (step == 'mapping') return [ meta, [ spring_1 ] ] + else { + error("Samplesheet contains a spring file (in columns `spring_1`) but step is `$step`. Please check your samplesheet or adjust the step parameter.\nhttps://nf-co.re/sarek/usage#input-samplesheet-configurations") + } + // start from BAM } else if (meta.lane && bam) { if (step != 'mapping' && !bai) { @@ -270,36 +281,3 @@ Joint germline variant calling also requires intervals in order to genotype the emit: input_sample } - -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - FUNCTIONS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ -// Parse first line of a FASTQ file, return the flowcell id and lane number. -def flowcellLaneFromFastq(path) { - // expected format: - // xx:yy:FLOWCELLID:LANE:... (seven fields) - // or - // FLOWCELLID:LANE:xx:... (five fields) - def line - path.withInputStream { - InputStream gzipStream = new java.util.zip.GZIPInputStream(it) - Reader decoder = new InputStreamReader(gzipStream, 'ASCII') - BufferedReader buffered = new BufferedReader(decoder) - line = buffered.readLine() - } - assert line.startsWith('@') - line = line.substring(1) - def fields = line.split(':') - String fcid - - if (fields.size() >= 7) { - // CASAVA 1.8+ format, from https://support.illumina.com/help/BaseSpace_OLH_009008/Content/Source/Informatics/BS/FileFormat_FASTQ-files_swBS.htm - // "@::::::: :::" - fcid = fields[2] - } else if (fields.size() == 5) { - fcid = fields[0] - } - return fcid -} diff --git a/subworkflows/local/utils_nfcore_sarek_pipeline/main.nf b/subworkflows/local/utils_nfcore_sarek_pipeline/main.nf index 0bd3c1364d..23415aed48 100644 --- a/subworkflows/local/utils_nfcore_sarek_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_sarek_pipeline/main.nf @@ -201,6 +201,10 @@ workflow PIPELINE_COMPLETION { imNotification(summary_params, hook_url) } } + + workflow.onError { + log.error "Pipeline failed. Please refer to troubleshooting docs: https://nf-co.re/docs/usage/troubleshooting" + } } /* diff --git a/tests/config/pytesttags.yml b/tests/config/pytesttags.yml index ac74cb8931..63c96d73a9 100644 --- a/tests/config/pytesttags.yml +++ b/tests/config/pytesttags.yml @@ -72,6 +72,19 @@ validation_checks: # preprocessing +## alignment_from_everything +alignment_from_everything: + - conf/modules/** + - conf/test/alignment_from_everything.config + - main.nf + - modules/** + - nextflow.config + - nextflow_schema.json + - subworkflows/** + - tests/csv/3.0/bam_and_fastq_and_spring.csv + - tests/test_alignment_from_everything.yml + - workflows/** + ## alignment_to_fastq alignment_to_fastq: - conf/modules/alignment_to_fastq.config diff --git a/tests/csv/3.0/bam_and_fastq_and_spring.csv b/tests/csv/3.0/bam_and_fastq_and_spring.csv new file mode 100644 index 0000000000..fa49cea06c --- /dev/null +++ b/tests/csv/3.0/bam_and_fastq_and_spring.csv @@ -0,0 +1,6 @@ +patient,sex,status,sample,lane,fastq_1,fastq_2,spring_1,spring_2,bam,bai +test,XX,0,test,test_L1,https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz,https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz,,,, +test2,XX,0,test2,test2_L1,,,https://raw.githubusercontent.com/nf-core/test-datasets/sarek3/data/genomics/homo_sapiens/illumina/spring/test_1.fastq.gz.spring,https://raw.githubusercontent.com/nf-core/test-datasets/sarek3/data/genomics/homo_sapiens/illumina/spring/test_2.fastq.gz.spring,, +test3,XX,0,test3,test3_L1,,,https://raw.githubusercontent.com/nf-core/test-datasets/sarek3/data/genomics/homo_sapiens/illumina/spring/test_R1_R2.fastq.gz.spring,,, +test_bam,XX,0,test_bam,test_bam_L1,,,,,https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam,https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam.bai + diff --git a/tests/test_alignment_from_everything.yml b/tests/test_alignment_from_everything.yml new file mode 100644 index 0000000000..cdbbb15b36 --- /dev/null +++ b/tests/test_alignment_from_everything.yml @@ -0,0 +1,42 @@ +- name: Run alignment to bam fastq and spring files to bam files + command: nextflow run main.nf -profile test,alignment_from_everything --outdir results --save_mapped --save_output_as_bam + tags: + - alignment_from_everything + files: + - path: results/csv/mapped.csv + md5sum: 5a10f49a6a691c84e31e7dd8e91c8201 + - path: results/csv/markduplicates.csv + md5sum: 293ae6ec0286272470dd8d6edf4b4fc9 + - path: results/csv/markduplicates_no_table.csv + md5sum: e379af37e14b94c17465654f971bd23f + - path: results/csv/recalibrated.csv + md5sum: 976529de568cdf201e6b9dfb2da3f62f + - path: results/multiqc + - path: results/preprocessing/mapped/test/test.sorted.bam + - path: results/preprocessing/mapped/test/test.sorted.bam.bai + - path: results/preprocessing/mapped/test2/test2.sorted.bam + - path: results/preprocessing/mapped/test2/test2.sorted.bam.bai + - path: results/preprocessing/mapped/test3/test3.sorted.bam + - path: results/preprocessing/mapped/test3/test3.sorted.bam.bai + - path: results/preprocessing/mapped/test_bam/test_bam.sorted.bam + - path: results/preprocessing/mapped/test_bam/test_bam.sorted.bam.bai + - path: results/preprocessing/markduplicates/test/test.md.bam + - path: results/preprocessing/markduplicates/test/test.md.bam.bai + - path: results/preprocessing/markduplicates/test2/test2.md.bam + - path: results/preprocessing/markduplicates/test2/test2.md.bam.bai + - path: results/preprocessing/markduplicates/test3/test3.md.bam + - path: results/preprocessing/markduplicates/test3/test3.md.bam.bai + - path: results/preprocessing/markduplicates/test_bam/test_bam.md.bam + - path: results/preprocessing/markduplicates/test_bam/test_bam.md.bam.bai + - path: results/preprocessing/recal_table/test/test.recal.table + - path: results/preprocessing/recal_table/test2/test2.recal.table + - path: results/preprocessing/recal_table/test3/test3.recal.table + - path: results/preprocessing/recal_table/test_bam/test_bam.recal.table + - path: results/preprocessing/recalibrated/test/test.recal.bam + - path: results/preprocessing/recalibrated/test/test.recal.bam.bai + - path: results/preprocessing/recalibrated/test2/test2.recal.bam + - path: results/preprocessing/recalibrated/test2/test2.recal.bam.bai + - path: results/preprocessing/recalibrated/test3/test3.recal.bam + - path: results/preprocessing/recalibrated/test3/test3.recal.bam.bai + - path: results/preprocessing/recalibrated/test_bam/test_bam.recal.bam + - path: results/preprocessing/recalibrated/test_bam/test_bam.recal.bam.bai diff --git a/tests/test_controlfreec.yml b/tests/test_controlfreec.yml index d72b67ed27..5483c69469 100644 --- a/tests/test_controlfreec.yml +++ b/tests/test_controlfreec.yml @@ -19,11 +19,8 @@ "window = 10", ] - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.bed - md5sum: 833920178e4f40a296d8eab029caf086 - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.circos.txt - md5sum: 92ce5ce97b27a7214dfa9c2cb20cf854 - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.normal.mpileup.gz_control.cpn - md5sum: 508a003da85b186d9a60d867ef7cdf15 - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.p.value.txt # binary changes md5sums on reruns - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.tumor.mpileup.gz_BAF.txt @@ -31,13 +28,10 @@ - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.tumor.mpileup.gz_CNVs # binary changes md5sums on reruns - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.tumor.mpileup.gz_info.txt - md5sum: 271271719c576d9218bdc859850e54ee - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.tumor.mpileup.gz_ratio.BedGraph - md5sum: 5d3321af93678f16878d59e01d3a87d3 - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.tumor.mpileup.gz_ratio.txt # binary changes md5sums on reruns - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3.tumor.mpileup.gz_sample.cpn - md5sum: befe1706c61464635a76c7323a6bd2a2 - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3_BAF.png # binary changes md5sums on reruns - path: results/variant_calling/controlfreec/sample4_vs_sample3/sample4_vs_sample3_ratio.log2.png diff --git a/tests/test_deepvariant.yml b/tests/test_deepvariant.yml index d66f2e1aef..e79be5e2f6 100644 --- a/tests/test_deepvariant.yml +++ b/tests/test_deepvariant.yml @@ -7,7 +7,7 @@ files: - path: results/multiqc - path: results/reports/bcftools/deepvariant/sample1/sample1.deepvariant.bcftools_stats.txt - md5sum: a6634ceb1c712de14009b05d273713a7 + # md5sum: a6634ceb1c712de14009b05d273713a7 - path: results/reports/vcftools/deepvariant/sample1/sample1.deepvariant.FILTER.summary md5sum: acce7a163f4070226429f9d6bc3fbd2c - path: results/reports/vcftools/deepvariant/sample1/sample1.deepvariant.TsTv.count @@ -46,7 +46,7 @@ - path: results/no_intervals.bed.gz.tbi md5sum: f3dac01ea66b95fe477446fde2d31489 - path: results/reports/bcftools/deepvariant/sample1/sample1.deepvariant.bcftools_stats.txt - md5sum: 0c48d8e315ca23c5dc2e7bf71ea0b6a6 + # md5sum: 0c48d8e315ca23c5dc2e7bf71ea0b6a6 - path: results/reports/vcftools/deepvariant/sample1/sample1.deepvariant.FILTER.summary md5sum: 7b17bd18c2d4bf129561c7c6a419a889 - path: results/reports/vcftools/deepvariant/sample1/sample1.deepvariant.TsTv.count diff --git a/tests/test_haplotypecaller.yml b/tests/test_haplotypecaller.yml index 7912e49909..43cfca38bc 100644 --- a/tests/test_haplotypecaller.yml +++ b/tests/test_haplotypecaller.yml @@ -17,7 +17,7 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/haplotypecaller/test/test.haplotypecaller.filtered.bcftools_stats.txt - md5sum: 01941d63ff87fba208320b8041738179 + # md5sum: 01941d63ff87fba208320b8041738179 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.filtered.FILTER.summary md5sum: 4e2ceea7f3ff998004691fd71192d9ee - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.filtered.TsTv.count @@ -67,7 +67,7 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/haplotypecaller/test/test.haplotypecaller.filtered.bcftools_stats.txt - md5sum: 01941d63ff87fba208320b8041738179 + # md5sum: 01941d63ff87fba208320b8041738179 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.filtered.FILTER.summary md5sum: 4e2ceea7f3ff998004691fd71192d9ee - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.filtered.TsTv.count diff --git a/tests/test_haplotypecaller_skip_filter.yml b/tests/test_haplotypecaller_skip_filter.yml index b96157f868..dd9faf7e42 100644 --- a/tests/test_haplotypecaller_skip_filter.yml +++ b/tests/test_haplotypecaller_skip_filter.yml @@ -21,7 +21,7 @@ - path: results/variant_calling/haplotypecaller/test/test.haplotypecaller.filtered.vcf.gz.tbi should_exist: false - path: results/reports/bcftools/haplotypecaller/test/test.haplotypecaller.bcftools_stats.txt - md5sum: 7fd9e6c0f677b83c7dda1f85360042d2 + # md5sum: 7fd9e6c0f677b83c7dda1f85360042d2 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.FILTER.summary md5sum: 87a84b5f8ac3d3cbeeef7d60afcdbfe7 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.TsTv.count @@ -70,7 +70,7 @@ - path: results/preprocessing/recalibrated/test/test.recal.cram.crai should_exist: false - path: results/reports/bcftools/haplotypecaller/test/test.haplotypecaller.bcftools_stats.txt - md5sum: 7fd9e6c0f677b83c7dda1f85360042d2 + # md5sum: 7fd9e6c0f677b83c7dda1f85360042d2 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.FILTER.summary md5sum: 87a84b5f8ac3d3cbeeef7d60afcdbfe7 - path: results/reports/vcftools/haplotypecaller/test/test.haplotypecaller.TsTv.count diff --git a/workflows/sarek/main.nf b/workflows/sarek/main.nf index 164a44f45e..90307f19c2 100644 --- a/workflows/sarek/main.nf +++ b/workflows/sarek/main.nf @@ -4,82 +4,87 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -include { paramsSummaryMap } from 'plugin/nf-validation' -include { paramsSummaryMultiqc } from '../../subworkflows/nf-core/utils_nfcore_pipeline' -include { softwareVersionsToYAML } from '../../subworkflows/nf-core/utils_nfcore_pipeline' -include { methodsDescriptionText } from '../../subworkflows/local/utils_nfcore_sarek_pipeline' +include { paramsSummaryMap } from 'plugin/nf-validation' +include { paramsSummaryMultiqc } from '../../subworkflows/nf-core/utils_nfcore_pipeline' +include { softwareVersionsToYAML } from '../../subworkflows/nf-core/utils_nfcore_pipeline' +include { methodsDescriptionText } from '../../subworkflows/local/utils_nfcore_sarek_pipeline' // Create samplesheets to restart from different steps -include { CHANNEL_ALIGN_CREATE_CSV } from '../../subworkflows/local/channel_align_create_csv/main' -include { CHANNEL_MARKDUPLICATES_CREATE_CSV } from '../../subworkflows/local/channel_markduplicates_create_csv/main' -include { CHANNEL_BASERECALIBRATOR_CREATE_CSV } from '../../subworkflows/local/channel_baserecalibrator_create_csv/main' -include { CHANNEL_APPLYBQSR_CREATE_CSV } from '../../subworkflows/local/channel_applybqsr_create_csv/main' -include { CHANNEL_VARIANT_CALLING_CREATE_CSV } from '../../subworkflows/local/channel_variant_calling_create_csv/main' +include { CHANNEL_ALIGN_CREATE_CSV } from '../../subworkflows/local/channel_align_create_csv/main' +include { CHANNEL_MARKDUPLICATES_CREATE_CSV } from '../../subworkflows/local/channel_markduplicates_create_csv/main' +include { CHANNEL_BASERECALIBRATOR_CREATE_CSV } from '../../subworkflows/local/channel_baserecalibrator_create_csv/main' +include { CHANNEL_APPLYBQSR_CREATE_CSV } from '../../subworkflows/local/channel_applybqsr_create_csv/main' +include { CHANNEL_VARIANT_CALLING_CREATE_CSV } from '../../subworkflows/local/channel_variant_calling_create_csv/main' // Convert BAM files to FASTQ files -include { BAM_CONVERT_SAMTOOLS as CONVERT_FASTQ_INPUT } from '../../subworkflows/local/bam_convert_samtools/main' -include { BAM_CONVERT_SAMTOOLS as CONVERT_FASTQ_UMI } from '../../subworkflows/local/bam_convert_samtools/main' +include { BAM_CONVERT_SAMTOOLS as CONVERT_FASTQ_INPUT } from '../../subworkflows/local/bam_convert_samtools/main' +include { BAM_CONVERT_SAMTOOLS as CONVERT_FASTQ_UMI } from '../../subworkflows/local/bam_convert_samtools/main' + +// Convert fastq.gz.spring files to fastq.gz files +include { SPRING_DECOMPRESS as SPRING_DECOMPRESS_TO_R1_FQ } from '../../modules/nf-core/spring/decompress/main' +include { SPRING_DECOMPRESS as SPRING_DECOMPRESS_TO_R2_FQ } from '../../modules/nf-core/spring/decompress/main' +include { SPRING_DECOMPRESS as SPRING_DECOMPRESS_TO_FQ_PAIR } from '../../modules/nf-core/spring/decompress/main' // Run FASTQC -include { FASTQC } from '../../modules/nf-core/fastqc/main' +include { FASTQC } from '../../modules/nf-core/fastqc/main' // TRIM/SPLIT FASTQ Files -include { FASTP } from '../../modules/nf-core/fastp/main' +include { FASTP } from '../../modules/nf-core/fastp/main' // Create umi consensus bams from fastq -include { FASTQ_CREATE_UMI_CONSENSUS_FGBIO } from '../../subworkflows/local/fastq_create_umi_consensus_fgbio/main' +include { FASTQ_CREATE_UMI_CONSENSUS_FGBIO } from '../../subworkflows/local/fastq_create_umi_consensus_fgbio/main' // Map input reads to reference genome -include { FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON } from '../../subworkflows/local/fastq_align_bwamem_mem2_dragmap_sentieon/main' +include { FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON } from '../../subworkflows/local/fastq_align_bwamem_mem2_dragmap_sentieon/main' // Merge and index BAM files (optional) -include { BAM_MERGE_INDEX_SAMTOOLS } from '../../subworkflows/local/bam_merge_index_samtools/main' +include { BAM_MERGE_INDEX_SAMTOOLS } from '../../subworkflows/local/bam_merge_index_samtools/main' // Convert BAM files -include { SAMTOOLS_CONVERT as BAM_TO_CRAM } from '../../modules/nf-core/samtools/convert/main' -include { SAMTOOLS_CONVERT as BAM_TO_CRAM_MAPPING } from '../../modules/nf-core/samtools/convert/main' +include { SAMTOOLS_CONVERT as BAM_TO_CRAM } from '../../modules/nf-core/samtools/convert/main' +include { SAMTOOLS_CONVERT as BAM_TO_CRAM_MAPPING } from '../../modules/nf-core/samtools/convert/main' // Convert CRAM files (optional) -include { SAMTOOLS_CONVERT as CRAM_TO_BAM } from '../../modules/nf-core/samtools/convert/main' -include { SAMTOOLS_CONVERT as CRAM_TO_BAM_RECAL } from '../../modules/nf-core/samtools/convert/main' +include { SAMTOOLS_CONVERT as CRAM_TO_BAM } from '../../modules/nf-core/samtools/convert/main' +include { SAMTOOLS_CONVERT as CRAM_TO_BAM_RECAL } from '../../modules/nf-core/samtools/convert/main' // Mark Duplicates (+QC) -include { BAM_MARKDUPLICATES } from '../../subworkflows/local/bam_markduplicates/main' -include { BAM_MARKDUPLICATES_SPARK } from '../../subworkflows/local/bam_markduplicates_spark/main' -include { BAM_SENTIEON_DEDUP } from '../../subworkflows/local/bam_sentieon_dedup/main' +include { BAM_MARKDUPLICATES } from '../../subworkflows/local/bam_markduplicates/main' +include { BAM_MARKDUPLICATES_SPARK } from '../../subworkflows/local/bam_markduplicates_spark/main' +include { BAM_SENTIEON_DEDUP } from '../../subworkflows/local/bam_sentieon_dedup/main' // QC on CRAM -include { CRAM_QC_MOSDEPTH_SAMTOOLS as CRAM_QC_NO_MD } from '../../subworkflows/local/cram_qc_mosdepth_samtools/main' -include { CRAM_SAMPLEQC } from '../../subworkflows/local/cram_sampleqc/main' +include { CRAM_QC_MOSDEPTH_SAMTOOLS as CRAM_QC_NO_MD } from '../../subworkflows/local/cram_qc_mosdepth_samtools/main' +include { CRAM_SAMPLEQC } from '../../subworkflows/local/cram_sampleqc/main' // Create recalibration tables -include { BAM_BASERECALIBRATOR } from '../../subworkflows/local/bam_baserecalibrator/main' -include { BAM_BASERECALIBRATOR_SPARK } from '../../subworkflows/local/bam_baserecalibrator_spark/main' +include { BAM_BASERECALIBRATOR } from '../../subworkflows/local/bam_baserecalibrator/main' +include { BAM_BASERECALIBRATOR_SPARK } from '../../subworkflows/local/bam_baserecalibrator_spark/main' // Create recalibrated cram files to use for variant calling (+QC) -include { BAM_APPLYBQSR } from '../../subworkflows/local/bam_applybqsr/main' -include { BAM_APPLYBQSR_SPARK } from '../../subworkflows/local/bam_applybqsr_spark/main' +include { BAM_APPLYBQSR } from '../../subworkflows/local/bam_applybqsr/main' +include { BAM_APPLYBQSR_SPARK } from '../../subworkflows/local/bam_applybqsr_spark/main' // Variant calling on a single normal sample -include { BAM_VARIANT_CALLING_GERMLINE_ALL } from '../../subworkflows/local/bam_variant_calling_germline_all/main' +include { BAM_VARIANT_CALLING_GERMLINE_ALL } from '../../subworkflows/local/bam_variant_calling_germline_all/main' // Variant calling on a single tumor sample -include { BAM_VARIANT_CALLING_TUMOR_ONLY_ALL } from '../../subworkflows/local/bam_variant_calling_tumor_only_all/main' +include { BAM_VARIANT_CALLING_TUMOR_ONLY_ALL } from '../../subworkflows/local/bam_variant_calling_tumor_only_all/main' // Variant calling on tumor/normal pair -include { BAM_VARIANT_CALLING_SOMATIC_ALL } from '../../subworkflows/local/bam_variant_calling_somatic_all/main' +include { BAM_VARIANT_CALLING_SOMATIC_ALL } from '../../subworkflows/local/bam_variant_calling_somatic_all/main' // POST VARIANTCALLING: e.g. merging -include { POST_VARIANTCALLING } from '../../subworkflows/local/post_variantcalling/main' +include { POST_VARIANTCALLING } from '../../subworkflows/local/post_variantcalling/main' // QC on VCF files -include { VCF_QC_BCFTOOLS_VCFTOOLS } from '../../subworkflows/local/vcf_qc_bcftools_vcftools/main' +include { VCF_QC_BCFTOOLS_VCFTOOLS } from '../../subworkflows/local/vcf_qc_bcftools_vcftools/main' // Annotation -include { VCF_ANNOTATE_ALL } from '../../subworkflows/local/vcf_annotate_all/main' +include { VCF_ANNOTATE_ALL } from '../../subworkflows/local/vcf_annotate_all/main' // MULTIQC -include { MULTIQC } from '../../modules/nf-core/multiqc/main' +include { MULTIQC } from '../../modules/nf-core/multiqc/main' /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -147,12 +152,36 @@ workflow SAREK { if (params.step == 'mapping') { - // Figure out if input is bam or fastq + // Figure out if input is bam, fastq, or spring input_sample_type = input_sample.branch{ - bam: it[0].data_type == "bam" - fastq: it[0].data_type == "fastq" + bam: it[0].data_type == "bam" + fastq_gz: it[0].data_type == "fastq_gz" + one_fastq_gz_spring: it[0].data_type == "one_fastq_gz_spring" + two_fastq_gz_spring: it[0].data_type == "two_fastq_gz_spring" } + // Two fastq.gz-files + fastq_gz = input_sample_type.fastq_gz.map { meta, files -> addReadgroupToMeta(meta, files) } + + // Just one fastq.gz.spring-file with both R1 and R2 + fastq_gz_pair_from_spring = SPRING_DECOMPRESS_TO_FQ_PAIR(input_sample_type.one_fastq_gz_spring, false) + + one_fastq_gz_from_spring = fastq_gz_pair_from_spring.fastq.map { meta, files -> addReadgroupToMeta(meta, files) } + + // Two fastq.gz.spring-files - one for R1 and one for R2 + r1_fastq_gz_from_spring = SPRING_DECOMPRESS_TO_R1_FQ(input_sample_type.two_fastq_gz_spring.map{ meta, files -> + [meta, files[0] ]}, + true // write_one_fastq_gz + ) + r2_fastq_gz_from_spring = SPRING_DECOMPRESS_TO_R2_FQ(input_sample_type.two_fastq_gz_spring.map{ meta, files -> + [meta, files[1] ]}, + true // write_one_fastq_gz + ) + + two_fastq_gz_from_spring = r1_fastq_gz_from_spring.fastq.join(r2_fastq_gz_from_spring.fastq).map{ meta, fastq_1, fastq_2 -> [meta, [fastq_1, fastq_2]]} + + two_fastq_gz_from_spring = two_fastq_gz_from_spring.map { meta, files -> addReadgroupToMeta(meta, files) } + // Convert any bam input to fastq // fasta are not needed when converting bam to fastq -> [ id:"fasta" ], [] // No need for fasta.fai -> [] @@ -167,7 +196,7 @@ workflow SAREK { // Theorically this could work on mixed input (fastq for one sample and bam for another) // But not sure how to handle that with the samplesheet // Or if we really want users to be able to do that - input_fastq = input_sample_type.fastq.mix(CONVERT_FASTQ_INPUT.out.reads) + input_fastq = fastq_gz.mix(CONVERT_FASTQ_INPUT.out.reads).mix(one_fastq_gz_from_spring).mix(two_fastq_gz_from_spring) // STEP 0: QC & TRIM // `--skip_tools fastqc` to skip fastqc @@ -253,6 +282,12 @@ workflow SAREK { } .set { reads_grouping_key } + reads_for_alignment = reads_for_alignment.map{ meta, reads -> + // Update meta.id to meta.sample no multiple lanes or splitted fastqs + if (meta.size * meta.num_lanes == 1) [ meta + [ id:meta.sample ], reads ] + else [ meta, reads ] + } + // reads will be sorted sort_bam = true FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON(reads_for_alignment, index_alignment, sort_bam, fasta, fasta_fai) @@ -712,6 +747,7 @@ workflow SAREK { params.skip_tools, cram_variant_calling_status_normal, [ [ id:'bwa' ], [] ], // bwa_index for tiddit; not used here + cnvkit_reference, dbsnp, dbsnp_tbi, dbsnp_vqsr, @@ -896,6 +932,52 @@ workflow SAREK { versions // channel: [ path(versions.yml) ] } +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + FUNCTIONS +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ +// Add readgroup to meta and remove lane +def addReadgroupToMeta(meta, files) { + def CN = params.seq_center ? "CN:${params.seq_center}\\t" : '' + + // Here we're assuming that fastq_1 and fastq_2 are from the same flowcell: + def flowcell = flowcellLaneFromFastq(files[0]) + // TO-DO: Would it perhaps be better to also call flowcellLaneFromFastq(files[1]) and check that we get the same flowcell-id? + + // Don't use a random element for ID, it breaks resuming + def read_group = "\"@RG\\tID:${flowcell}.${meta.sample}.${meta.lane}\\t${CN}PU:${meta.lane}\\tSM:${meta.patient}_${meta.sample}\\tLB:${meta.sample}\\tDS:${params.fasta}\\tPL:${params.seq_platform}\"" + meta = meta - meta.subMap('lane') + [read_group: read_group.toString()] + return [ meta, files ] +} +// Parse first line of a FASTQ file, return the flowcell id and lane number. +def flowcellLaneFromFastq(path) { + // expected format: + // xx:yy:FLOWCELLID:LANE:... (seven fields) + // or + // FLOWCELLID:LANE:xx:... (five fields) + def line + path.withInputStream { + InputStream gzipStream = new java.util.zip.GZIPInputStream(it) + Reader decoder = new InputStreamReader(gzipStream, 'ASCII') + BufferedReader buffered = new BufferedReader(decoder) + line = buffered.readLine() + } + assert line.startsWith('@') + line = line.substring(1) + def fields = line.split(':') + String fcid + + if (fields.size() >= 7) { + // CASAVA 1.8+ format, from https://support.illumina.com/help/BaseSpace_OLH_009008/Content/Source/Informatics/BS/FileFormat_FASTQ-files_swBS.htm + // "@::::::: :::" + fcid = fields[2] + } else if (fields.size() == 5) { + fcid = fields[0] + } + return fcid +} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END