diff --git a/.nf-core.yml b/.nf-core.yml index a9ff951..e65e667 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -32,7 +32,7 @@ template: name: sampletracking description: CMGG Sampletracking workflow author: Matthias De Smet - version: 1.0.2 + version: 1.0.3 force: true outdir: . is_nfcore: false diff --git a/CHANGELOG.md b/CHANGELOG.md index d4d9304..be9d451 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v1.0.3 + +- Fixed an issue where pool grouping for multiqc wasn't properly performed on pipeline resume + ## v1.0.2 - Fixed an issue where multiqc didn't run for each pool diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index 12dbd86..835117b 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -1,5 +1,5 @@ report_comment: > - This report has been generated by the nf-cmgg/sampletracking analysis pipeline. + This report has been generated by the nf-cmgg/sampletracking analysis pipeline. report_section_order: "nf-cmgg-sampletracking-methods-description": order: -1000 diff --git a/conf/test.config b/conf/test.config index ba22031..aa62a94 100644 --- a/conf/test.config +++ b/conf/test.config @@ -37,6 +37,7 @@ process { params { config_profile_name = 'Test profile' config_profile_description = 'Minimal test dataset to check pipeline function' + custom_config_base = null input = "${projectDir}/assets/samplesheet.csv" bwa_index = "s3://test-data/genomics/homo_sapiens/genome/bwa/" diff --git a/nextflow.config b/nextflow.config index e2fd71d..95e77bb 100644 --- a/nextflow.config +++ b/nextflow.config @@ -227,7 +227,7 @@ manifest { mainScript = 'main.nf' defaultBranch = 'master' nextflowVersion = '!>=26.04.0' - version = '1.0.2' + version = '1.0.3' doi = '' } diff --git a/pixi.lock b/pixi.lock index 70564f0..6d00260 100644 --- a/pixi.lock +++ b/pixi.lock @@ -10,7 +10,7 @@ environments: - url: https://conda.anaconda.org/bioconda/ packages: linux-64: - - conda: https://conda.anaconda.org/bioconda/noarch/nextflow-26.04.1-h2a3209d_0.conda + - conda: https://conda.anaconda.org/bioconda/noarch/nextflow-26.04.6-h2a3209d_0.conda - conda: https://conda.anaconda.org/bioconda/noarch/nf-core-4.0.2-pyhdfd78af_1.conda - conda: https://conda.anaconda.org/bioconda/noarch/nf-test-0.9.5-h2a3209d_0.conda - conda: https://conda.anaconda.org/bioconda/noarch/piper-0.15.1-pyhdfd78af_0.conda @@ -203,7 +203,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/yacman-1.0.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/zipp-4.1.0-pyhcf101f3_0.conda osx-64: - - conda: https://conda.anaconda.org/bioconda/noarch/nextflow-26.04.1-h2a3209d_0.conda + - conda: https://conda.anaconda.org/bioconda/noarch/nextflow-26.04.6-h2a3209d_0.conda - conda: https://conda.anaconda.org/bioconda/noarch/nf-core-4.0.2-pyhdfd78af_1.conda - conda: https://conda.anaconda.org/bioconda/noarch/nf-test-0.9.5-h2a3209d_0.conda - conda: https://conda.anaconda.org/bioconda/noarch/piper-0.15.1-pyhdfd78af_0.conda @@ -365,7 +365,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-64/zlib-ng-2.3.3-h8bce59a_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/zstd-1.5.7-h3eecb57_6.conda osx-arm64: - - conda: https://conda.anaconda.org/bioconda/noarch/nextflow-26.04.1-h2a3209d_0.conda + - conda: https://conda.anaconda.org/bioconda/noarch/nextflow-26.04.6-h2a3209d_0.conda - conda: https://conda.anaconda.org/bioconda/noarch/nf-core-4.0.2-pyhdfd78af_1.conda - conda: https://conda.anaconda.org/bioconda/noarch/nf-test-0.9.5-h2a3209d_0.conda - conda: https://conda.anaconda.org/bioconda/noarch/piper-0.15.1-pyhdfd78af_0.conda @@ -526,16 +526,19 @@ environments: - conda: https://conda.anaconda.org/conda-forge/osx-arm64/zlib-ng-2.3.3-hed4e4f5_1.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/zstd-1.5.7-hbf9d68e_6.conda packages: - - conda: https://conda.anaconda.org/bioconda/noarch/nextflow-26.04.1-h2a3209d_0.conda - sha256: 8e571134ec01aa022425252aa36d636a375d0d1f702574648e60051e2a5a6f56 - md5: 4e946ad85848a5b81a6ed53f8cc8766b + - conda: https://conda.anaconda.org/bioconda/noarch/nextflow-26.04.6-h2a3209d_0.conda + sha256: 4182f40edeebe27d01e23a9b2774cb52565079ad947bf2d8504214c5248a156b + md5: 30dd384c7c334c6fff49c3d3525ba554 depends: - coreutils - curl - openjdk >=17,<=24 license: Apache-2.0 - size: 37253435 - timestamp: 1778509922928 + run_exports: + weak: + - nextflow >=26.4.6,<26.5.0a0 + size: 37863668 + timestamp: 1783624848374 - conda: https://conda.anaconda.org/bioconda/noarch/nf-core-4.0.2-pyhdfd78af_1.conda sha256: a62019fbb74ba3bcb39ef037fb47b2e00a5bc1293b577468f1102137175e44cc md5: 4ab387e9266b5d792bfa86e28ef4dda8 diff --git a/ro-crate-metadata.json b/ro-crate-metadata.json index df7c8ea..3b4be85 100644 --- a/ro-crate-metadata.json +++ b/ro-crate-metadata.json @@ -1,6 +1,6 @@ { "@context": [ - "https://w3id.org/ro/crate/1.1/context", + "https://w3id.org/ro/crate/1.2/context", { "GithubService": "https://w3id.org/ro/terms/test#GithubService", "JenkinsService": "https://w3id.org/ro/terms/test#JenkinsService", @@ -22,7 +22,7 @@ "@id": "./", "@type": "Dataset", "creativeWorkStatus": "Stable", - "datePublished": "2026-05-27T11:44:13+00:00", + "datePublished": "2026-07-23T15:20:45+00:00", "description": "# ![nf-cmgg/sampletracking](docs/images/nf-cmgg-sampletracking_logo_light.svg#gh-light-mode-only) ![nf-cmgg/sampletracking](docs/images/nf-cmgg-sampletracking_logo_dark.svg#gh-dark-mode-only)\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/nf-cmgg/sampletracking)\n[![GitHub Actions CI Status](https://github.com/nf-cmgg/sampletracking/actions/workflows/nf-test.yml/badge.svg)](https://github.com/nf-cmgg/sampletracking/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/nf-cmgg/sampletracking/actions/workflows/linting.yml/badge.svg)](https://github.com/nf-cmgg/sampletracking/actions/workflows/linting.yml)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.XXXXXXX-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.XXXXXXX)\n[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)\n\n[![Nextflow](https://img.shields.io/badge/version-%E2%89%A526.04.0-green?style=flat&logo=nextflow&logoColor=white&color=%230DC09D&link=https%3A%2F%2Fnextflow.io)](https://www.nextflow.io/)\n[![nf-core template version](https://img.shields.io/badge/nf--core_template-3.4.1-green?style=flat&logo=nfcore&logoColor=white&color=%2324B064&link=https%3A%2F%2Fnf-co.re)](https://github.com/nf-core/tools/releases/tag/3.4.1)\n[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)\n[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)\n[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)\n[![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-cmgg/sampletracking)\n\n## Introduction\n\n**nf-cmgg/sampletracking** is a bioinformatics pipeline that performs sampletracking on sequencing samples. The pipeline does this by crosschecking SNP fingerprints and by checking if the expected sex matches the real sex of the sample.\n\n![metro_map](docs/images/metro_map.png)\n\n## Usage\n\n> [!NOTE]\n> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data.\n\nFirst, prepare a samplesheet with your input data that looks as follows:\n\n`samplesheet.csv`:\n\n```csv\nsample,pool,sex,sample_bam,sample_bam_index,snp_bam,snp_bam_index\nSAMPLE1,POOL1,F,SAMPLE1.bam,SAMPLE1.bam.bai,SAMPLE1_snp.cram,SAMPLE2_snp.cram.crai\n```\n\nEach row represents a sample annotated with the pool it was sequenced in and the expected sex of this sample. It also needs a BAM/CRAM file with the sample data and (optionally) a FASTQ/BAM/CRAM file with SNP tracking data for the sample. Crosschecking fingerprints will be skipped when no SNP tracking data is provided.\n\nNow, you can run the pipeline using:\n\n```bash\nnextflow run nf-cmgg/sampletracking \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \n```\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow `-params-file` option. Custom config files including those provided by the `-c` Nextflow option can be used to provide any configuration _**except for parameters**_;\n> see [docs](https://nf-co.re/usage/configuration#custom-configuration-files).\n\n## Credits\n\nnf-cmgg/sampletracking was originally written by [@matthdsm](https://github.com/matthdsm).\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n- [@nvnieuwk](https://github.com/nvnieuwk)\n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the [contributing guidelines](.github/CONTRIBUTING.md).\n\n## Development environment\n\nA [pixi](https://pixi.prefix.dev/latest/) development environment is available for this pipeline. Run the following command to install the environment:\n\n```\npixi install\n```\n\nThen run `pixi shell` to enter the environment and start developing.\n\n## Citations\n\nAn extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.\n\nThis pipeline uses code and infrastructure developed and maintained by the [nf-core](https://nf-co.re) community, reused here under the [MIT license](https://github.com/nf-core/tools/blob/master/LICENSE).\n\n> **The nf-core framework for community-curated bioinformatics pipelines.**\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).\n", "hasPart": [ { @@ -99,7 +99,7 @@ }, "mentions": [ { - "@id": "#3fade23d-b7f2-4138-bbee-fa7c35bcbcb3" + "@id": "#1afaeae5-d623-4182-864b-131038a46785" } ], "name": "nf-cmgg/sampletracking" @@ -112,7 +112,7 @@ }, "conformsTo": [ { - "@id": "https://w3id.org/ro/crate/1.1" + "@id": "https://w3id.org/ro/crate/1.2" }, { "@id": "https://w3id.org/workflowhub/workflow-ro-crate/1.0" @@ -132,7 +132,7 @@ } ], "dateCreated": "", - "dateModified": "2026-05-27T13:44:13Z", + "dateModified": "2026-07-23T17:20:45Z", "dct:conformsTo": "https://bioschemas.org/profiles/ComputationalWorkflow/1.0-RELEASE/", "image": { "@id": "docs/images/metro_map.png" @@ -163,10 +163,10 @@ }, "url": [ "https://github.com/nf-cmgg/sampletracking", - "https://nf-co.re/nf-cmgg/sampletracking/1.0.2/" + "https://nf-co.re/nf-cmgg/sampletracking/1.0.3/" ], "version": [ - "1.0.2" + "1.0.3" ] }, { @@ -190,11 +190,11 @@ "name": "Workflow diagram" }, { - "@id": "#3fade23d-b7f2-4138-bbee-fa7c35bcbcb3", + "@id": "#1afaeae5-d623-4182-864b-131038a46785", "@type": "TestSuite", "instance": [ { - "@id": "#5249f773-adaa-4bdf-a11c-7cdffb4db2e7" + "@id": "#3c6ba561-6507-48ed-b107-371fc7904400" } ], "mainEntity": { @@ -203,7 +203,7 @@ "name": "Test suite for nf-cmgg/sampletracking" }, { - "@id": "#5249f773-adaa-4bdf-a11c-7cdffb4db2e7", + "@id": "#3c6ba561-6507-48ed-b107-371fc7904400", "@type": "TestInstance", "name": "GitHub Actions workflow for testing nf-cmgg/sampletracking", "resource": "repos/nf-cmgg/sampletracking/actions/workflows/nf-test.yml", diff --git a/workflows/sampletracking.nf b/workflows/sampletracking.nf index dab6bbd..42be045 100644 --- a/workflows/sampletracking.nf +++ b/workflows/sampletracking.nf @@ -94,18 +94,14 @@ workflow SAMPLETRACKING { def ch_crosscheck_metrics_out = channel.empty() ch_samplesheet_fixed - .filter { meta, _sample_bam, _sample_bam_index, snp_fastq, snp_bam, _snp_bam_index -> - if(!snp_bam && !snp_fastq) { - log.warn("No SNP BAM/CRAM/FASTQ files were detected for '${meta.id}'. Skipping the crosscheck fingerprints step for this sample.") - return false - } - return true - } .branch { meta, sample_bam, sample_bam_index, snp_fastq, snp_bam, snp_bam_index -> aligned: snp_bam return [meta, sample_bam, sample_bam_index, snp_bam, snp_bam_index] to_align : snp_fastq return [meta, sample_bam, sample_bam_index, snp_fastq] + no_snp: true + log.warn("No SNP BAM/CRAM/FASTQ files were detected for '${meta.id}'. Skipping the crosscheck fingerprints step for this sample.") + return [[id:meta.pool], []] } .set{ ch_inputs } @@ -144,7 +140,10 @@ workflow SAMPLETRACKING { ch_fasta_fai ) ch_crosscheck_metrics_out = PICARD_CROSSCHECKFINGERPRINTS.out.crosscheck_metrics - ch_multiqc_files = ch_multiqc_files.mix(PICARD_CROSSCHECKFINGERPRINTS.out.crosscheck_metrics) + ch_multiqc_files = ch_multiqc_files.mix( + PICARD_CROSSCHECKFINGERPRINTS.out.crosscheck_metrics, + ch_inputs.no_snp.unique() // Add pools with no snp data for flow consistency + ) // @@ -283,7 +282,11 @@ workflow SAMPLETRACKING { .map { files -> [files] } .dump(tag: "Summary files for MultiQC", pretty: true) ch_multiqc_input = ch_multiqc_files - .groupTuple(by: 0) + .map { meta, files -> + // This is needed to prevent merge key mismatches on pipeline resume + tuple([id: meta.id], files) + } + .groupTuple(size:2) // size 2 for sex check + crosscheck fingerprints .combine(ch_summary_files) .map { meta, multiqc_files, summary_files -> return [meta, (multiqc_files + summary_files).flatten(), multiqc_config.flatten(), multiqc_logo, [], []]