From 27e7eafee430bf4154e96621859d0ebd1a338964 Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Thu, 8 Jan 2026 17:31:46 +0100 Subject: [PATCH 01/14] update model channel structure --- subworkflows/local/prepare_reference_files.nf | 14 +++-- subworkflows/local/tumor_normal_happhase.nf | 40 +++++++------ workflows/lrsomatic.nf | 56 ++++++++++++------- 3 files changed, 65 insertions(+), 45 deletions(-) diff --git a/subworkflows/local/prepare_reference_files.nf b/subworkflows/local/prepare_reference_files.nf index d79448c..8e4e182 100644 --- a/subworkflows/local/prepare_reference_files.nf +++ b/subworkflows/local/prepare_reference_files.nf @@ -38,10 +38,12 @@ workflow PREPARE_REFERENCE_FILES { } else { ch_prepared_fasta = [ [:], fasta ] } - + + // if clair3 model is specified, then download that + // otherwise use info in bam header and download that basecall_meta.map { meta, basecall_model_meta, kinetics_meta -> - def id_new = basecall_model_meta ?: meta.clair3_model + def id_new = basecall_model_meta ? clair3_modelMap.get(basecall_model_meta) : basecall_model_meta def meta_new = [id: id_new] def model = (!meta.clair3_model || meta.clair3_model.toString().trim() in ['', '[]']) ? clair3_modelMap.get(basecall_model_meta) : meta.clair3_model def download_prefix = ( basecall_model_meta == 'hifi_revio' ? "https://www.bio8.cs.hku.hk/clair3/clair3_models/" : "https://cdn.oxfordnanoportal.com/software/analysis/models/clair3" ) @@ -49,13 +51,13 @@ workflow PREPARE_REFERENCE_FILES { return [ meta_new, url ] } .unique() - .set{ model_urls } + .set{ clair3_model_urls } // // MODULE: Download model // - WGET ( model_urls ) + WGET ( clair3_model_urls ) ch_versions = ch_versions.mix(WGET.out.versions) @@ -69,7 +71,7 @@ workflow PREPARE_REFERENCE_FILES { ch_versions = ch_versions.mix(UNTAR.out.versions) - UNTAR.out.untar.set { downloaded_model_files } + UNTAR.out.untar.set { downloaded_clair3_models } // // MODULE: Index the fasta @@ -126,7 +128,7 @@ workflow PREPARE_REFERENCE_FILES { loci_files gc_file rt_file - downloaded_model_files + downloaded_clair3_models versions = ch_versions } diff --git a/subworkflows/local/tumor_normal_happhase.nf b/subworkflows/local/tumor_normal_happhase.nf index 922da7c..3a998f6 100644 --- a/subworkflows/local/tumor_normal_happhase.nf +++ b/subworkflows/local/tumor_normal_happhase.nf @@ -13,7 +13,7 @@ workflow TUMOR_NORMAL_HAPPHASE { fai clair3_modelMap clairs_modelMap - downloaded_model_files + downloaded_clair3_models main: @@ -33,34 +33,38 @@ workflow TUMOR_NORMAL_HAPPHASE { // Get normal bams and add platform/model info for Clair3 usage // remove type from so that information can be merged easier later - downloaded_model_files + downloaded_clair3_models .map{ meta, file -> - def basecall_model = meta.id - return [basecall_model, meta, file] + def clair3_model = meta.id + return [meta, clair3_model, file] } - .set{downloaded_model_files} + .set{downloaded_clair3_models} - mixed_bams.normal + downloaded_clair3_models.view() + + mixed_bams.normal .map{ meta, bam, bai -> - def basecall_model = (!meta.clair3_model || meta.clair3_model.toString().trim() in ['', '[]']) ? meta.basecall_model : meta.clair3_model - def new_meta = [id: meta.id, - paired_data: meta.paired_data, - platform: meta.platform, - sex: meta.sex, - fiber: meta.fiber, - basecall_model: basecall_model, - clairS_model: meta.clairS_model] - return [ basecall_model, new_meta, bam, bai ] + return [ meta, meta.clair3_model, bam, bai ] } .set { normal_bams_model } + normal_bams_model.view() + normal_bams_model - .combine(downloaded_model_files,by:0) - .map{ basecall_model, meta, bam, bai, meta2, model -> + .combine(downloaded_clair3_models,by:1) + .map {clair3_model, meta_bam, bam, bai, meta_model, model -> + def platform = (meta_bam.platform == 'pb') ? 'hifi' : meta_bam.platform + return [meta_bam, bam, bai, model, platform] + } + .set{ normal_bams } + + normal_bams.view() + /* + .map{ basecall_model, meta, bam, bai, meta2, model -> def platform = (meta.platform == "pb") ? "hifi" : "ont" return [meta, bam, bai, model, platform] } - .set{ normal_bams } + */ // normal_bams -> meta: [id, paired_data, platform, sex, fiber, basecall_model] // bam: list of concatenated aligned bams diff --git a/workflows/lrsomatic.nf b/workflows/lrsomatic.nf index b33d50f..ab611a2 100644 --- a/workflows/lrsomatic.nf +++ b/workflows/lrsomatic.nf @@ -65,7 +65,7 @@ workflow LRSOMATIC { 'dna_r10.4.1_e8.2_400bps_sup@v4.2.0': 'r1041_e82_400bps_sup_v420', 'dna_r10.4.1_e8.2_400bps_sup@v4.1.0': 'r1041_e82_400bps_sup_v410', 'dna_r10.4.1_e8.2_260bps_sup@v4.0.0': 'r1041_e82_260bps_sup_v400', - 'hifi_revio' : 'hifi_revio' + 'hifi_revio' : 'hifi' ] def clairs_modelMap = [ @@ -75,7 +75,7 @@ workflow LRSOMATIC { 'dna_r10.4.1_e8.2_400bps_sup@v4.3.0': 'ont_r10_dorado_sup_5khz_ssrs', 'dna_r10.4.1_e8.2_400bps_sup@v5.0.0': 'ont_r10_dorado_sup_5khz_ssrs', 'dna_r10.4.1_e8.2_400bps_sup@v5.2.0': 'ont_r10_dorado_sup_5khz_ssrs', - 'hifi_revio' : 'hifi_revio_ss' + 'hifi_revio' : 'hifi_revio_ssrs' ] @@ -112,7 +112,19 @@ workflow LRSOMATIC { ch_samplesheet .join(basecall_meta) .map { meta, bam, basecall_model_meta, kinetics_meta -> - def meta_new = meta + [ basecall_model: basecall_model_meta, kinetics: kinetics_meta] + def chosen_clair3_model = meta.clair3_model ?: clair3_modelMap.get(basecall_model_meta) + def chosen_clairSTO_model = meta.clairSTO_model ?: clairs_modelMap.get(basecall_model_meta) + def chosen_clairS_model = meta.clairS_model ?: clairs_modelMap.get(basecall_model_meta) + def meta_new =[ id: meta.id, + paired_data: meta.paired_data, + type: meta.type, + platform: meta.platform, + sex: meta.sex, + fiber: meta.fiber, + clair3_model: chosen_clair3_model, + clairS_model : chosen_clairS_model, + clairSTO_model: chosen_clairSTO_model, + kinetics: kinetics_meta] return[ meta_new, bam ] } .groupTuple() @@ -122,6 +134,22 @@ workflow LRSOMATIC { .set{ch_samplesheet} + // + // SUBWORKFLOW: PREPARE_REFERENCE_FILES + // + + PREPARE_REFERENCE_FILES ( + params.fasta, + params.ascat_allele_files, + params.ascat_loci_files, + params.ascat_gc_file, + params.ascat_rt_file, + basecall_meta, + clair3_modelMap + ) + + downloaded_clair3_models = PREPARE_REFERENCE_FILES.out.downloaded_clair3_models + // ch_samplesheet -> meta: [id, paired_data, platform, sex, type, fiber, basecall_model] // bam: list of unaligned bams @@ -142,7 +170,7 @@ workflow LRSOMATIC { .mix ( ch_split.single ) .set { ch_cat_ubams } - + ch_cat_ubams.view() // ch_cat_ubams -> meta: [id, paired_data, platform, sex, type, fiber, basecall_model] // bam: list of concatenated unaligned bams @@ -156,20 +184,6 @@ workflow LRSOMATIC { CRAMINO_PRE ( ch_cat_ubams ) } - // - // SUBWORKFLOW: PREPARE_REFERENCE_FILES - // - - PREPARE_REFERENCE_FILES ( - params.fasta, - params.ascat_allele_files, - params.ascat_loci_files, - params.ascat_gc_file, - params.ascat_rt_file, - basecall_meta, - clair3_modelMap - ) - vep_cache = channel.empty() if (!params.skip_vep) { @@ -201,7 +215,7 @@ workflow LRSOMATIC { ch_fasta = PREPARE_REFERENCE_FILES.out.prepped_fasta ch_fai = PREPARE_REFERENCE_FILES.out.prepped_fai - downloaded_model_files = PREPARE_REFERENCE_FILES.out.downloaded_model_files + // ASCAT files allele_files = PREPARE_REFERENCE_FILES.out.allele_files @@ -328,7 +342,7 @@ workflow LRSOMATIC { // ch_minimap_bams into tumor and paired to phase the paired ones on normal // and add index - + ch_minimap_bam.view() ch_minimap_bam .join(MINIMAP2_ALIGN.out.index) .branch { meta, bams, bais -> @@ -353,7 +367,7 @@ workflow LRSOMATIC { ch_fai, clair3_modelMap, clairs_modelMap, - downloaded_model_files + downloaded_clair3_models ) ch_versions = ch_versions.mix(TUMOR_NORMAL_HAPPHASE.out.versions) From a585aee18d340ec386909fe25a43dd804402aea2 Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Thu, 8 Jan 2026 17:32:16 +0100 Subject: [PATCH 02/14] change cramino process from single to low --- modules/local/cramino/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/local/cramino/main.nf b/modules/local/cramino/main.nf index b6ab067..eff34a0 100644 --- a/modules/local/cramino/main.nf +++ b/modules/local/cramino/main.nf @@ -1,6 +1,6 @@ process CRAMINO { tag "$meta.id" - label 'process_single' + label 'process_low' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? From 0e4bab20cb262dd158324821c38cb5f19a6b7cbc Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Thu, 8 Jan 2026 17:32:33 +0100 Subject: [PATCH 03/14] update snap --- tests/default.nf.test.snap | 75 +++----------------------------------- 1 file changed, 5 insertions(+), 70 deletions(-) diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index 9640193..95ecedb 100644 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -2,18 +2,9 @@ "-profile test": { "content": [ { - "BCFTOOLS_CONCAT": { - "bcftools": 1.22 - }, - "BCFTOOLS_SORT": { - "bcftools": 1.22 - }, "CLAIR3": { "clair3": "1.2.0" }, - "CLAIRS": { - "clairs": "0.4.4" - }, "CLAIRSTO": { "clairsto": "0.4.2" }, @@ -122,8 +113,6 @@ "sample1/bamfiles", "sample1/bamfiles/sample1_normal.bam", "sample1/bamfiles/sample1_normal.bam.bai", - "sample1/bamfiles/sample1_tumor.bam", - "sample1/bamfiles/sample1_tumor.bam.bai", "sample1/qc", "sample1/qc/normal", "sample1/qc/normal/cramino_aln", @@ -153,39 +142,15 @@ "sample1/variants/clair3", "sample1/variants/clair3/merge_output.vcf.gz", "sample1/variants/clair3/merge_output.vcf.gz.tbi", - "sample1/variants/clairs", - "sample1/variants/clairs/indel.vcf.gz", - "sample1/variants/clairs/indel.vcf.gz.tbi", - "sample1/variants/clairs/snvs.vcf.gz", - "sample1/variants/clairs/snvs.vcf.gz.tbi", - "sample1/variants/severus", - "sample1/variants/severus/all_SVs", - "sample1/variants/severus/all_SVs/severus_all.vcf.gz", - "sample1/variants/severus/breakpoints_double.csv", - "sample1/variants/severus/read_ids.csv", - "sample1/variants/severus/read_qual.txt", - "sample1/variants/severus/severus.log", - "sample1/variants/severus/somatic_SVs", - "sample1/variants/severus/somatic_SVs/severus_somatic.vcf.gz", "sample1/vep", - "sample1/vep/SVs", - "sample1/vep/SVs/sample1_SV_VEP.vcf.gz", - "sample1/vep/SVs/sample1_SV_VEP.vcf.gz.tbi", - "sample1/vep/SVs/sample1_SV_VEP.vcf.gz_summary.html", "sample1/vep/germline", "sample1/vep/germline/sample1_GERMLINE_VEP.vcf.gz", "sample1/vep/germline/sample1_GERMLINE_VEP.vcf.gz.tbi", "sample1/vep/germline/sample1_GERMLINE_VEP.vcf.gz_summary.html", - "sample1/vep/somatic", - "sample1/vep/somatic/sample1_SOMATIC_VEP.vcf.gz", - "sample1/vep/somatic/sample1_SOMATIC_VEP.vcf.gz.tbi", - "sample1/vep/somatic/sample1_SOMATIC_VEP.vcf.gz_summary.html", "sample2", "sample2/bamfiles", "sample2/bamfiles/sample2_normal.bam", "sample2/bamfiles/sample2_normal.bam.bai", - "sample2/bamfiles/sample2_tumor.bam", - "sample2/bamfiles/sample2_tumor.bam.bai", "sample2/qc", "sample2/qc/normal", "sample2/qc/normal/cramino_aln", @@ -215,33 +180,11 @@ "sample2/variants/clair3", "sample2/variants/clair3/merge_output.vcf.gz", "sample2/variants/clair3/merge_output.vcf.gz.tbi", - "sample2/variants/clairs", - "sample2/variants/clairs/indel.vcf.gz", - "sample2/variants/clairs/indel.vcf.gz.tbi", - "sample2/variants/clairs/snvs.vcf.gz", - "sample2/variants/clairs/snvs.vcf.gz.tbi", - "sample2/variants/severus", - "sample2/variants/severus/all_SVs", - "sample2/variants/severus/all_SVs/severus_all.vcf.gz", - "sample2/variants/severus/breakpoints_double.csv", - "sample2/variants/severus/read_ids.csv", - "sample2/variants/severus/read_qual.txt", - "sample2/variants/severus/severus.log", - "sample2/variants/severus/somatic_SVs", - "sample2/variants/severus/somatic_SVs/severus_somatic.vcf.gz", "sample2/vep", - "sample2/vep/SVs", - "sample2/vep/SVs/sample2_SV_VEP.vcf.gz", - "sample2/vep/SVs/sample2_SV_VEP.vcf.gz.tbi", - "sample2/vep/SVs/sample2_SV_VEP.vcf.gz_summary.html", "sample2/vep/germline", "sample2/vep/germline/sample2_GERMLINE_VEP.vcf.gz", "sample2/vep/germline/sample2_GERMLINE_VEP.vcf.gz.tbi", "sample2/vep/germline/sample2_GERMLINE_VEP.vcf.gz_summary.html", - "sample2/vep/somatic", - "sample2/vep/somatic/sample2_SOMATIC_VEP.vcf.gz", - "sample2/vep/somatic/sample2_SOMATIC_VEP.vcf.gz.tbi", - "sample2/vep/somatic/sample2_SOMATIC_VEP.vcf.gz_summary.html", "sample3", "sample3/bamfiles", "sample3/bamfiles/sample3_tumor.bam", @@ -295,8 +238,6 @@ [ "sample1_normal.bam:md5,60838033f5f24aa90e16a5babcddd45b", "sample1_normal.bam.bai:md5,d77c4e82c8965132967be86d83a4992d", - "sample1_tumor.bam:md5,bd73e83253c95a5fdc4db39454ee2253", - "sample1_tumor.bam.bai:md5,8b9edeb60b0e3023c97aa4b6e2e61380", "sample1.mosdepth.global.dist.txt:md5,4e1c72f8465c18ffd854c42850eb7c5f", "sample1.mosdepth.summary.txt:md5,cf13d4b24e5ebf31b629a1195a1fff41", "sample1.flagstat:md5,815a5385bd57ef44847714130b80d630", @@ -307,12 +248,8 @@ "sample1.flagstat:md5,34e851b5504d961632f26991160ded5a", "sample1.idxstats:md5,1d43b03114bcc9b70d4333e91498efbe", "sample1.stats:md5,da6ea076dd90b4e35ab2e23b8e6ead25", - "breakpoints_double.csv:md5,57e4f0d5509db44179e7c5044c6bc259", - "read_qual.txt:md5,1ad9d1900f8dcb291c97adc65c9d341c", - "sample2_normal.bam:md5,7e6cdc6c51235a205548be160d798d38", - "sample2_normal.bam.bai:md5,7ad774be4cf80ae968f94d760bddf3c8", - "sample2_tumor.bam:md5,9938db44490835ec0e11069b4da37547", - "sample2_tumor.bam.bai:md5,202852a62fc5bf4cf1c196676068606a", + "sample2_normal.bam:md5,554b89692e84b9ddd0615649e2b15820", + "sample2_normal.bam.bai:md5,af193f1922d90b8741212d2bf690c418", "sample2.mosdepth.global.dist.txt:md5,6cdc97a81a603db702cb5a113b8bc62a", "sample2.mosdepth.summary.txt:md5,864370930ec1d695d942f4960bcf8fc6", "sample2.flagstat:md5,cce0bb7ca79e14d8369ccc714adf4be3", @@ -323,8 +260,6 @@ "sample2.flagstat:md5,83e7d7d922941691d2b023f0bd9655aa", "sample2.idxstats:md5,fe8a5d1263481ea7902d575b4d95f655", "sample2.stats:md5,defe74842396209b6cff4b32994287c7", - "breakpoints_double.csv:md5,c5a59c9ea2486f7bb9d5e40fea8f916d", - "read_qual.txt:md5,27edf87814aec6fa18546c8606aae4ed", "sample3_tumor.bam:md5,2308beb1b4be1f0e1d6c8e52bd4f9266", "sample3_tumor.bam.bai:md5,840eb3ad5ed3216a97c6a58563d4dcb1", "sample3.mosdepth.global.dist.txt:md5,e04da37ef2b7cd587fa3158b9f36d2cb", @@ -337,9 +272,9 @@ ] ], "meta": { - "nf-test": "0.9.2", - "nextflow": "25.10.0" + "nf-test": "0.9.3", + "nextflow": "25.10.2" }, - "timestamp": "2026-01-07T12:24:56.969201207" + "timestamp": "2026-01-08T17:23:32.905484266" } } \ No newline at end of file From 611b494985b5a43e1fb9f6a1b2f3c912661321cc Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Thu, 8 Jan 2026 17:39:32 +0100 Subject: [PATCH 04/14] prettier --- ro-crate-metadata.json | 2 +- subworkflows/local/prepare_reference_files.nf | 4 ++-- subworkflows/local/tumor_normal_happhase.nf | 2 +- workflows/lrsomatic.nf | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ro-crate-metadata.json b/ro-crate-metadata.json index d084d29..35fb56b 100644 --- a/ro-crate-metadata.json +++ b/ro-crate-metadata.json @@ -23,7 +23,7 @@ "@type": "Dataset", "creativeWorkStatus": "InProgress", "datePublished": "2025-12-23T12:58:53+00:00", - "description": "# IntGenomicsLab/lrsomatic\n\n[![Open in GitHub Codespaces](https://img.shields.io/badge/Open_In_GitHub_Codespaces-black?labelColor=grey&logo=github)](https://github.com/codespaces/new/IntGenomicsLab/lrsomatic)\n[![GitHub Actions CI Status](https://github.com/IntGenomicsLab/lrsomatic/actions/workflows/nf-test.yml/badge.svg)](https://github.com/IntGenomicsLab/lrsomatic/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/IntGenomicsLab/lrsomatic/actions/workflows/linting.yml/badge.svg)](https://github.com/IntGenomicsLab/lrsomatic/actions/workflows/linting.yml)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.17751829-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.17751829)\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%A525.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.5.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.5.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/IntGenomicsLab/lrsomatic)\n\n## Introduction\n\n**IntGenomicsLab/lrsomatic** is a robust bioinformatics pipeline designed for processing and analyzing **somatic DNA sequencing** data for long-read sequencing technologies from **Oxford Nanopore** and **PacBio**. It supports both canonical base DNA and modified base calling, including specialized applications such as **Fiber-seq**.\n\nThis **end-to-end pipeline** handles the entire workflow \u2014 **from raw read processing and alignment, to comprehensive somatic variant calling**, including single nucleotide variants, indels, structural variants, copy number alterations, and modified bases.\n\nIt can be run in both **matched tumour-normal** and **tumour-only mode**, offering flexibility depending on the users study design.\n\nDeveloped using **Nextflow DSL2**, it offers high portability and scalability across diverse computing environments. By leveraging Docker or Singularity containers, installation is streamlined and results are highly reproducible. Each process runs in an isolated container, simplifying dependency management and updates. Where applicable, pipeline components are sourced from **nf-core/modules**, promoting reuse, interoperability, and consistency within the broader Nextflow and nf-core ecosystems.\n\n## Pipeline summary\n\n**1) Pre-processing:**\n\na. Raw read QC ([`cramino`](https://github.com/wdecoster/cramino))\n\nb. Alignment to the reference genome ([`minimap2`](https://github.com/lh3/minimap2))\n\nc. Post alignment QC ([`cramino`](https://github.com/wdecoster/cramino), [`samtools idxstats`](https://github.com/samtools/samtools), [`samtools flagstats`](https://github.com/samtools/samtools), [`samtools stats`](https://github.com/samtools/samtools))\n\nd. Specific for calling modified base calling ([`Modkit`](https://github.com/nanoporetech/modkit), [`Fibertools`](https://github.com/fiberseq/fibertools-rs))\n\n**2i) Matched mode: small variant calling:**\n\na. Calling Germline SNPs ([`Clair3`](https://github.com/HKU-BAL/Clair3))\n\nb. Phasing and Haplotagging the SNPs in the normal and tumour BAM ([`LongPhase`](https://github.com/twolinin/longphase))\n\nc. Calling somatic SNVs ([`ClairS`](https://github.com/HKU-BAL/ClairS))\n\n**2ii) Tumour only mode: small variant calling:**\n\na. Calling Germline SNPs and somatic SNVs ([`ClairS-TO`](https://github.com/HKU-BAL/ClairS-TO))\n\nb. Phasing and Haplotagging germline SNPs in tumour BAM ([`LongPhase`](https://github.com/twolinin/longphase))\n\n**3) Large variant calling:**\n\na. Somatic structural variant calling ([`Severus`](https://github.com/KolmogorovLab/Severus))\n\nb. Copy number alterion calling; long read version of ([`ASCAT`](https://github.com/VanLoo-lab/ascat))\n\n**4) Annotation:**\n\na. Small variant annotation ([`VEP`](https://github.com/Ensembl/ensembl-vep))\n\nb. Structural variant annotation ([`VEP`](https://github.com/Ensembl/ensembl-vep))\n\n\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```csv\nsample,bam_tumor,bam_normal,platform,sex,fiber\nsample1,tumour.bam,normal.bam,ont,female,n\nsample2,tumour.bam,,ont,female,y\nsample3,tumour.bam,,pb,male,n\nsample4,tumour.bam,normal.bam,pb,male,y\n```\n\nEach row represents a sample. The bam files should always be unaligned bam files. All fields except for `bam_normal` are required. If `bam_normal` is empty, the pipeline will run in tumour only mode. `platform` should be either `ont` or `pb` for Oxford Nanopore Sequencing or PacBio sequencing, respectively. `sex` refers to the biological sex of the sample and should be either `female` or `male`. Finally, `fiber` specifies whether your sample is Fiber-seq data or not and should have either `y` for Yes or `n` for No.\n\nNow, you can run the pipeline using:\n\n```bash\nnextflow run IntGenomicsLab/lrsomatic \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \n```\n\nMore detail is given in our [usage documentation](/docs/usage.md)\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**_; see [docs](https://nf-co.re/docs/usage/getting_started/configuration#custom-configuration-files).\n\n## Credits\n\nIntGenomicsLab/lr_somatic was originally written by Luuk Harbers, Robert Forsyth, Alexandra Pan\u010d\u00edkov\u00e1, Marios Eftychiou, Ruben Cools, Laurens Lambrechts, and Jonas Demeulemeester.\n\n## Pipeline output\n\nThis pipeline produces a series of different output files. The main output is an aligned and phased tumour bam file. This bam file can be used by any typical downstream tool that uses bam files as input. Furthermore, we have sample-specific QC outputs from `cramino` (fastq), `cramino` (bam), `mosdepth`, `samtools` (stats/flagstat/idxstats), and optionally `fibertools`. Finally, we have a `multiqc` report from that combines the output from `mosdepth` and `samtools` into one html report.\n\nBesides QC and the aligned and phased bam file, we have output from (structural) variant and copy number callers, of which some are optional. The output from these variant callers can be found in their respective folders. For small and structural variant callers (`clairS`, `clairS-TO`, and `severus`) these will contain, among others, `vcf` files with called variants. For `ascat` these contain files with final copy number information and plots of the copy number profiles.\n\nExample output directory structure:\n\n```\n\u251c\u2500\u2500 Sample 1\n\u2502 \u251c\u2500\u2500 ascat\n\u2502 \u251c\u2500\u2500 bamfiles\n\u2502 \u251c\u2500\u2500 qc\n\u2502 \u2502 \u251c\u2500\u2500 tumor\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_aln\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_ubam\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 fibertoolsrs\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 mosdepth\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 samtools\n\u2502 \u251c\u2500\u2500 variants\n\u2502 \u2502 \u251c\u2500\u2500clairS-TO\n\u2502 \u2502 \u251c\u2500\u2500severus\n\u2502 \u251c\u2500\u2500 vep\n\u2502 \u2502 \u251c\u2500\u2500 germline\n\u2502 \u2502 \u251c\u2500\u2500 somatic\n\u2502 \u2502 \u251c\u2500\u2500 SVs\n\u2502\n\u251c\u2500\u2500 Sample 2\n\u2502 \u251c\u2500\u2500 ascat\n\u2502 \u251c\u2500\u2500 bamfiles\n\u2502 \u251c\u2500\u2500 qc\n\u2502 \u2502 \u251c\u2500\u2500 tumor\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_aln\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_ubam\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 fibertoolsrs\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 mosdepth\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 samtools\n\u2502 \u2502 \u251c\u2500\u2500 normal\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_aln\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_ubam\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 fibertoolsrs\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 mosdepth\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 samtools\n\u2502 \u251c\u2500\u2500 variants\n\u2502 \u2502 \u251c\u2500\u2500 clair3\n\u2502 \u2502 \u251c\u2500\u2500 clairS\n\u2502 \u2502 \u251c\u2500\u2500 severus\n\u2502 \u251c\u2500\u2500 vep\n\u2502 \u2502 \u251c\u2500\u2500 germline\n\u2502 \u2502 \u251c\u2500\u2500 somatic\n\u2502 \u2502 \u251c\u2500\u2500 SVs\n\u251c\u2500\u2500 pipeline_info\n```\n\nmore detail is given in our [output documentation](/docs/output.md)\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## Citations\n\nIf you use IntGenomicsLab/lrsomatic for your analysis, please cite it using the following doi: [10.5281/zenodo.17751829](https://doi.org/10.5281/zenodo.17751829)\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/main/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", + "description": "# IntGenomicsLab/lrsomatic\n\n[![Open in GitHub Codespaces](https://img.shields.io/badge/Open_In_GitHub_Codespaces-black?labelColor=grey&logo=github)](https://github.com/codespaces/new/IntGenomicsLab/lrsomatic)\n[![GitHub Actions CI Status](https://github.com/IntGenomicsLab/lrsomatic/actions/workflows/nf-test.yml/badge.svg)](https://github.com/IntGenomicsLab/lrsomatic/actions/workflows/nf-test.yml)\n[![GitHub Actions Linting Status](https://github.com/IntGenomicsLab/lrsomatic/actions/workflows/linting.yml/badge.svg)](https://github.com/IntGenomicsLab/lrsomatic/actions/workflows/linting.yml)[![Cite with Zenodo](http://img.shields.io/badge/DOI-10.5281/zenodo.17751829-1073c8?labelColor=000000)](https://doi.org/10.5281/zenodo.17751829)\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%A525.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.5.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.5.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/IntGenomicsLab/lrsomatic)\n\n## Introduction\n\n**IntGenomicsLab/lrsomatic** is a robust bioinformatics pipeline designed for processing and analyzing **somatic DNA sequencing** data for long-read sequencing technologies from **Oxford Nanopore** and **PacBio**. It supports both canonical base DNA and modified base calling, including specialized applications such as **Fiber-seq**.\n\nThis **end-to-end pipeline** handles the entire workflow \u2014 **from raw read processing and alignment, to comprehensive somatic variant calling**, including single nucleotide variants, indels, structural variants, copy number alterations, and modified bases.\n\nIt can be run in both **matched tumour-normal** and **tumour-only mode**, offering flexibility depending on the users study design.\n\nDeveloped using **Nextflow DSL2**, it offers high portability and scalability across diverse computing environments. By leveraging Docker or Singularity containers, installation is streamlined and results are highly reproducible. Each process runs in an isolated container, simplifying dependency management and updates. Where applicable, pipeline components are sourced from **nf-core/modules**, promoting reuse, interoperability, and consistency within the broader Nextflow and nf-core ecosystems.\n\n## Pipeline summary\n\n![image](./assets/lrsomatic_1.0.png)\n\n**1) Pre-processing:**\n\na. Raw read QC ([`cramino`](https://github.com/wdecoster/cramino))\n\nb. Alignment to the reference genome ([`minimap2`](https://github.com/lh3/minimap2))\n\nc. Post alignment QC ([`cramino`](https://github.com/wdecoster/cramino), [`samtools idxstats`](https://github.com/samtools/samtools), [`samtools flagstats`](https://github.com/samtools/samtools), [`samtools stats`](https://github.com/samtools/samtools))\n\nd. Specific for calling modified base calling ([`Modkit`](https://github.com/nanoporetech/modkit), [`Fibertools`](https://github.com/fiberseq/fibertools-rs))\n\n**2i) Matched mode: small variant calling:**\n\na. Calling Germline SNPs ([`Clair3`](https://github.com/HKU-BAL/Clair3))\n\nb. Phasing and Haplotagging the SNPs in the normal and tumour BAM ([`LongPhase`](https://github.com/twolinin/longphase))\n\nc. Calling somatic SNVs ([`ClairS`](https://github.com/HKU-BAL/ClairS))\n\n**2ii) Tumour only mode: small variant calling:**\n\na. Calling Germline SNPs and somatic SNVs ([`ClairS-TO`](https://github.com/HKU-BAL/ClairS-TO))\n\nb. Phasing and Haplotagging germline SNPs in tumour BAM ([`LongPhase`](https://github.com/twolinin/longphase))\n\n**3) Large variant calling:**\n\na. Somatic structural variant calling ([`Severus`](https://github.com/KolmogorovLab/Severus))\n\nb. Copy number alterion calling; long read version of ([`ASCAT`](https://github.com/VanLoo-lab/ascat))\n\n**4) Annotation:**\n\na. Small variant annotation ([`VEP`](https://github.com/Ensembl/ensembl-vep))\n\nb. Structural variant annotation ([`VEP`](https://github.com/Ensembl/ensembl-vep))\n\n\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```csv\nsample,bam_tumor,bam_normal,platform,sex,fiber\nsample1,tumour.bam,normal.bam,ont,female,n\nsample2,tumour.bam,,ont,female,y\nsample3,tumour.bam,,pb,male,n\nsample4,tumour.bam,normal.bam,pb,male,y\n```\n\nEach row represents a sample. The bam files should always be unaligned bam files. All fields except for `bam_normal` are required. If `bam_normal` is empty, the pipeline will run in tumour only mode. `platform` should be either `ont` or `pb` for Oxford Nanopore Sequencing or PacBio sequencing, respectively. `sex` refers to the biological sex of the sample and should be either `female` or `male`. Finally, `fiber` specifies whether your sample is Fiber-seq data or not and should have either `y` for Yes or `n` for No.\n\nNow, you can run the pipeline using:\n\n```bash\nnextflow run IntGenomicsLab/lrsomatic \\\n -profile \\\n --input samplesheet.csv \\\n --outdir \n```\n\nMore detail is given in our [usage documentation](/docs/usage.md)\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**_; see [docs](https://nf-co.re/docs/usage/getting_started/configuration#custom-configuration-files).\n\n## Credits\n\nIntGenomicsLab/lr_somatic was originally written by Luuk Harbers, Robert Forsyth, Alexandra Pan\u010d\u00edkov\u00e1, Marios Eftychiou, Ruben Cools, Laurens Lambrechts, and Jonas Demeulemeester.\n\n## Pipeline output\n\nThis pipeline produces a series of different output files. The main output is an aligned and phased tumour bam file. This bam file can be used by any typical downstream tool that uses bam files as input. Furthermore, we have sample-specific QC outputs from `cramino` (fastq), `cramino` (bam), `mosdepth`, `samtools` (stats/flagstat/idxstats), and optionally `fibertools`. Finally, we have a `multiqc` report from that combines the output from `mosdepth` and `samtools` into one html report.\n\nBesides QC and the aligned and phased bam file, we have output from (structural) variant and copy number callers, of which some are optional. The output from these variant callers can be found in their respective folders. For small and structural variant callers (`clairS`, `clairS-TO`, and `severus`) these will contain, among others, `vcf` files with called variants. For `ascat` these contain files with final copy number information and plots of the copy number profiles.\n\nExample output directory structure:\n\n```\n\u251c\u2500\u2500 Sample 1\n\u2502 \u251c\u2500\u2500 ascat\n\u2502 \u251c\u2500\u2500 bamfiles\n\u2502 \u251c\u2500\u2500 qc\n\u2502 \u2502 \u251c\u2500\u2500 tumor\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_aln\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_ubam\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 fibertoolsrs\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 mosdepth\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 samtools\n\u2502 \u251c\u2500\u2500 variants\n\u2502 \u2502 \u251c\u2500\u2500clairS-TO\n\u2502 \u2502 \u251c\u2500\u2500severus\n\u2502 \u251c\u2500\u2500 vep\n\u2502 \u2502 \u251c\u2500\u2500 germline\n\u2502 \u2502 \u251c\u2500\u2500 somatic\n\u2502 \u2502 \u251c\u2500\u2500 SVs\n\u2502\n\u251c\u2500\u2500 Sample 2\n\u2502 \u251c\u2500\u2500 ascat\n\u2502 \u251c\u2500\u2500 bamfiles\n\u2502 \u251c\u2500\u2500 qc\n\u2502 \u2502 \u251c\u2500\u2500 tumor\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_aln\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_ubam\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 fibertoolsrs\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 mosdepth\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 samtools\n\u2502 \u2502 \u251c\u2500\u2500 normal\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_aln\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 cramino_ubam\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 fibertoolsrs\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 mosdepth\n\u2502 \u2502 \u2502 \u251c\u2500\u2500 samtools\n\u2502 \u251c\u2500\u2500 variants\n\u2502 \u2502 \u251c\u2500\u2500 clair3\n\u2502 \u2502 \u251c\u2500\u2500 clairS\n\u2502 \u2502 \u251c\u2500\u2500 severus\n\u2502 \u251c\u2500\u2500 vep\n\u2502 \u2502 \u251c\u2500\u2500 germline\n\u2502 \u2502 \u251c\u2500\u2500 somatic\n\u2502 \u2502 \u251c\u2500\u2500 SVs\n\u251c\u2500\u2500 pipeline_info\n```\n\nmore detail is given in our [output documentation](/docs/output.md)\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## Citations\n\nIf you use IntGenomicsLab/lrsomatic for your analysis, please cite it using the following doi: [10.5281/zenodo.17751829](https://doi.org/10.5281/zenodo.17751829)\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/main/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": [ { "@id": "main.nf" diff --git a/subworkflows/local/prepare_reference_files.nf b/subworkflows/local/prepare_reference_files.nf index 8e4e182..6bd1195 100644 --- a/subworkflows/local/prepare_reference_files.nf +++ b/subworkflows/local/prepare_reference_files.nf @@ -38,12 +38,12 @@ workflow PREPARE_REFERENCE_FILES { } else { ch_prepared_fasta = [ [:], fasta ] } - + // if clair3 model is specified, then download that // otherwise use info in bam header and download that basecall_meta.map { meta, basecall_model_meta, kinetics_meta -> - def id_new = basecall_model_meta ? clair3_modelMap.get(basecall_model_meta) : basecall_model_meta + def id_new = basecall_model_meta ? clair3_modelMap.get(basecall_model_meta) : basecall_model_meta def meta_new = [id: id_new] def model = (!meta.clair3_model || meta.clair3_model.toString().trim() in ['', '[]']) ? clair3_modelMap.get(basecall_model_meta) : meta.clair3_model def download_prefix = ( basecall_model_meta == 'hifi_revio' ? "https://www.bio8.cs.hku.hk/clair3/clair3_models/" : "https://cdn.oxfordnanoportal.com/software/analysis/models/clair3" ) diff --git a/subworkflows/local/tumor_normal_happhase.nf b/subworkflows/local/tumor_normal_happhase.nf index 3a998f6..87ffb90 100644 --- a/subworkflows/local/tumor_normal_happhase.nf +++ b/subworkflows/local/tumor_normal_happhase.nf @@ -41,7 +41,7 @@ workflow TUMOR_NORMAL_HAPPHASE { .set{downloaded_clair3_models} downloaded_clair3_models.view() - + mixed_bams.normal .map{ meta, bam, bai -> return [ meta, meta.clair3_model, bam, bai ] diff --git a/workflows/lrsomatic.nf b/workflows/lrsomatic.nf index ab611a2..73f07f4 100644 --- a/workflows/lrsomatic.nf +++ b/workflows/lrsomatic.nf @@ -117,12 +117,12 @@ workflow LRSOMATIC { def chosen_clairS_model = meta.clairS_model ?: clairs_modelMap.get(basecall_model_meta) def meta_new =[ id: meta.id, paired_data: meta.paired_data, - type: meta.type, - platform: meta.platform, - sex: meta.sex, - fiber: meta.fiber, - clair3_model: chosen_clair3_model, - clairS_model : chosen_clairS_model, + type: meta.type, + platform: meta.platform, + sex: meta.sex, + fiber: meta.fiber, + clair3_model: chosen_clair3_model, + clairS_model : chosen_clairS_model, clairSTO_model: chosen_clairSTO_model, kinetics: kinetics_meta] return[ meta_new, bam ] @@ -215,7 +215,7 @@ workflow LRSOMATIC { ch_fasta = PREPARE_REFERENCE_FILES.out.prepped_fasta ch_fai = PREPARE_REFERENCE_FILES.out.prepped_fai - + // ASCAT files allele_files = PREPARE_REFERENCE_FILES.out.allele_files From 8829eb0da18d90fe7f50cd3bad127fd1add00008 Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Thu, 8 Jan 2026 17:52:00 +0100 Subject: [PATCH 05/14] remove views --- subworkflows/local/tumor_normal_happhase.nf | 3 --- workflows/lrsomatic.nf | 2 -- 2 files changed, 5 deletions(-) diff --git a/subworkflows/local/tumor_normal_happhase.nf b/subworkflows/local/tumor_normal_happhase.nf index 87ffb90..b183c33 100644 --- a/subworkflows/local/tumor_normal_happhase.nf +++ b/subworkflows/local/tumor_normal_happhase.nf @@ -40,7 +40,6 @@ workflow TUMOR_NORMAL_HAPPHASE { } .set{downloaded_clair3_models} - downloaded_clair3_models.view() mixed_bams.normal .map{ meta, bam, bai -> @@ -48,7 +47,6 @@ workflow TUMOR_NORMAL_HAPPHASE { } .set { normal_bams_model } - normal_bams_model.view() normal_bams_model .combine(downloaded_clair3_models,by:1) @@ -58,7 +56,6 @@ workflow TUMOR_NORMAL_HAPPHASE { } .set{ normal_bams } - normal_bams.view() /* .map{ basecall_model, meta, bam, bai, meta2, model -> def platform = (meta.platform == "pb") ? "hifi" : "ont" diff --git a/workflows/lrsomatic.nf b/workflows/lrsomatic.nf index 73f07f4..6767cfb 100644 --- a/workflows/lrsomatic.nf +++ b/workflows/lrsomatic.nf @@ -170,7 +170,6 @@ workflow LRSOMATIC { .mix ( ch_split.single ) .set { ch_cat_ubams } - ch_cat_ubams.view() // ch_cat_ubams -> meta: [id, paired_data, platform, sex, type, fiber, basecall_model] // bam: list of concatenated unaligned bams @@ -342,7 +341,6 @@ workflow LRSOMATIC { // ch_minimap_bams into tumor and paired to phase the paired ones on normal // and add index - ch_minimap_bam.view() ch_minimap_bam .join(MINIMAP2_ALIGN.out.index) .branch { meta, bams, bais -> From e7141572ea7a5e6f331b4f83096d5be44a40bfdf Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Fri, 9 Jan 2026 09:36:58 +0100 Subject: [PATCH 06/14] update ascat pdf plot schema --- nextflow_schema.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nextflow_schema.json b/nextflow_schema.json index 56fefa9..b65a6ca 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -166,6 +166,11 @@ "ascat_rt_files": { "type": "string", "description": "path to (zip) of RT files" + }, + "ascat_pdf_plots": { + "type": "string", + "description": "Boolean for ASCAT production of pdf plots (entered as string)", + "enum": ["TRUE", "FALSE"] } } }, From d6b8f5eff54169885cb1670bbfa976cb1f7fb867 Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Fri, 9 Jan 2026 09:44:19 +0100 Subject: [PATCH 07/14] update ascat to pass pdf plots as boolean and use in module as string --- modules/nf-core/ascat/main.nf | 2 +- nextflow.config | 2 +- nextflow_schema.json | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/ascat/main.nf b/modules/nf-core/ascat/main.nf index fa82efe..fb34f18 100644 --- a/modules/nf-core/ascat/main.nf +++ b/modules/nf-core/ascat/main.nf @@ -42,7 +42,7 @@ process ASCAT { def penalty = args.penalty ? "$args.penalty" : "NULL" def gc_input = gc_file ? "$gc_file" : "NULL" def rt_input = rt_file ? "$rt_file" : "NULL" - def pdf_plots = args.pdf_plots ? "$args.pdf_plots" : "NULL" + def pdf_plots = args.pdf_plots ? ("$args.pdf_plots" == true ? "TRUE": "FALSE") : "NULL" def minCounts_arg = args.minCounts ? ",minCounts = $args.minCounts" : "" def bed_file_arg = bed_file ? ",BED_file = '$bed_file'": "" diff --git a/nextflow.config b/nextflow.config index 5e93950..bdeccd8 100644 --- a/nextflow.config +++ b/nextflow.config @@ -55,7 +55,7 @@ params { ascat_penalty = 150 ascat_purity = null ascat_longread_bins = 2000 - ascat_pdf_plots = "FALSE" + ascat_pdf_plots = false ascat_allelecounter_flags = "-f 0" ascat_chroms = null // Only use if running on a subset of chromosomes (c(1:22, 'X', 'Y')) diff --git a/nextflow_schema.json b/nextflow_schema.json index b65a6ca..23fa710 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -168,9 +168,8 @@ "description": "path to (zip) of RT files" }, "ascat_pdf_plots": { - "type": "string", - "description": "Boolean for ASCAT production of pdf plots (entered as string)", - "enum": ["TRUE", "FALSE"] + "type": "boolean", + "description": "Boolean for ASCAT production of pdf plots (entered as string)" } } }, From c366f9895093484f5c26e49af02109250e3ec457 Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Fri, 9 Jan 2026 10:15:34 +0100 Subject: [PATCH 08/14] change clairs clairsto channel structure --- subworkflows/local/tumor_normal_happhase.nf | 3 +-- subworkflows/local/tumor_only_happhase.nf | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/subworkflows/local/tumor_normal_happhase.nf b/subworkflows/local/tumor_normal_happhase.nf index b183c33..5fa9fc5 100644 --- a/subworkflows/local/tumor_normal_happhase.nf +++ b/subworkflows/local/tumor_normal_happhase.nf @@ -257,8 +257,7 @@ workflow TUMOR_NORMAL_HAPPHASE { // Get ClairS input channel tumor_normal_severus .map { meta, tumor_bam, tumor_bai, normal_bam, normal_bai, vcf -> - def model = (!meta.clairS_model || meta.clairS_model.toString().trim() in ['', '[]']) ? clairs_modelMap.get(meta.basecall_model.toString().trim()) : meta.clairS_model - return[meta , tumor_bam, tumor_bai, normal_bam, normal_bai, model] + return[meta , tumor_bam, tumor_bai, normal_bam, normal_bai, meta.clairS_model] } .set { clairs_input } diff --git a/subworkflows/local/tumor_only_happhase.nf b/subworkflows/local/tumor_only_happhase.nf index 2b5b351..2077a42 100644 --- a/subworkflows/local/tumor_only_happhase.nf +++ b/subworkflows/local/tumor_only_happhase.nf @@ -25,8 +25,7 @@ workflow TUMOR_ONLY_HAPPHASE { tumor_bams .map{ meta, bam, bai -> - def clairSTO_model = (!meta.clairSTO_model || meta.clairSTO_model.toString().trim() in ['', '[]']) ? clairSTO_modelMap.get(meta.basecall_model.toString().trim()) : meta.clairSTO_model - return [meta, bam, bai, clairSTO_model] + return [meta, bam, bai, meta.clairSTO_model] } .set{ tumor_bams } From 319c28542bfbf5878e748095940a1396da039b8a Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Fri, 9 Jan 2026 10:16:17 +0100 Subject: [PATCH 09/14] remove obsolete reference --- subworkflows/local/tumor_only_happhase.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subworkflows/local/tumor_only_happhase.nf b/subworkflows/local/tumor_only_happhase.nf index 2077a42..621e2ed 100644 --- a/subworkflows/local/tumor_only_happhase.nf +++ b/subworkflows/local/tumor_only_happhase.nf @@ -166,8 +166,8 @@ workflow TUMOR_ONLY_HAPPHASE { paired_data: meta.paired_data, platform: meta.platform, sex: meta.sex, - fiber: meta.fiber, - basecall_model: meta.basecall_model] + fiber: meta.fiber + ] return [new_meta, hap_bam, hap_bai, [], [], vcf] } .set{ tumor_only_severus } From 2d155984bcfd255a2199237862b8e9e799262cf5 Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Fri, 9 Jan 2026 10:36:20 +0100 Subject: [PATCH 10/14] remove obsolete ref --- subworkflows/local/tumor_normal_happhase.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/subworkflows/local/tumor_normal_happhase.nf b/subworkflows/local/tumor_normal_happhase.nf index 5fa9fc5..c66377c 100644 --- a/subworkflows/local/tumor_normal_happhase.nf +++ b/subworkflows/local/tumor_normal_happhase.nf @@ -231,7 +231,6 @@ workflow TUMOR_NORMAL_HAPPHASE { platform: meta.platform, sex: meta.sex, fiber: meta.fiber, - basecall_model: meta.basecall_model, clairS_model: meta.clairS_model] return[new_meta, [[type: meta.type], hapbam], [[type: meta.type], hapbai]] } From fc2a4f452b796ac7b9cac9a27da5d295c1ae2b88 Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Fri, 9 Jan 2026 14:55:47 +0100 Subject: [PATCH 11/14] change channel structure --- subworkflows/local/tumor_normal_happhase.nf | 30 ++++++++++++++------- subworkflows/local/tumor_only_happhase.nf | 7 +++-- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/subworkflows/local/tumor_normal_happhase.nf b/subworkflows/local/tumor_normal_happhase.nf index c66377c..d9102cb 100644 --- a/subworkflows/local/tumor_normal_happhase.nf +++ b/subworkflows/local/tumor_normal_happhase.nf @@ -21,7 +21,6 @@ workflow TUMOR_NORMAL_HAPPHASE { tumor_only_severus = channel.empty() somatic_vep = channel.empty() germline_vep = channel.empty() - // Branch input bams in normal and tumour mixed_bams .branch{ meta, bam, bai -> @@ -43,7 +42,16 @@ workflow TUMOR_NORMAL_HAPPHASE { mixed_bams.normal .map{ meta, bam, bai -> - return [ meta, meta.clair3_model, bam, bai ] + def new_meta = [id: meta.id, + paired_data: meta.paired_data, + platform: meta.platform, + sex: meta.sex, + fiber: meta.fiber, + clair3_model: meta.clair3_model, + clairS_model : meta.clairS_model, + clairSTO_model: meta.clairSTO_model, + kinetics: meta.kinetics] + return [ new_meta, meta.clair3_model, bam, bai ] } .set { normal_bams_model } @@ -74,18 +82,20 @@ workflow TUMOR_NORMAL_HAPPHASE { // remove type from so that information can be merged easier later mixed_bams.tumor .map{ meta, bam, bai -> - def basecall_model = (!meta.clair3_model || meta.clair3_model.toString().trim() in ['', '[]']) ? meta.basecall_model : meta.clair3_model def new_meta = [id: meta.id, paired_data: meta.paired_data, platform: meta.platform, sex: meta.sex, fiber: meta.fiber, - basecall_model: basecall_model, - clairS_model: meta.clairS_model] + clair3_model: meta.clair3_model, + clairS_model : meta.clairS_model, + clairSTO_model: meta.clairSTO_model, + kinetics: meta.kinetics] return[new_meta, bam, bai] } .set{ tumor_bams } + // tumor_bams -> meta: [id, paired_data, platform, sex, fiber, basecall_model] // bam: list of concatenated aligned bams // bai: indexes for bam files @@ -163,6 +173,7 @@ workflow TUMOR_NORMAL_HAPPHASE { // Add phased vcf to tumour bams and type information // mix with the normal bams + tumor_bams .join(LONGPHASE_PHASE.out.snv_vcf) .map { meta, bam, bai, vcf -> @@ -212,13 +223,11 @@ workflow TUMOR_NORMAL_HAPPHASE { ) ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions) - // Add index to channel mixed_bams_vcf .join(mixed_hapbams) .join(SAMTOOLS_INDEX.out.bai) .set{ mixed_hapbams } - // mixed_hapbams -> meta: [id, paired_data, platform, sex, type, fiber, basecall_model] // bams: haplotagged aligned bams // bais: indexes for bam files @@ -231,7 +240,10 @@ workflow TUMOR_NORMAL_HAPPHASE { platform: meta.platform, sex: meta.sex, fiber: meta.fiber, - clairS_model: meta.clairS_model] + clair3_model: meta.clair3_model, + clairS_model : meta.clairS_model, + clairSTO_model: meta.clairSTO_model, + kinetics: meta.kinetics] return[new_meta, [[type: meta.type], hapbam], [[type: meta.type], hapbai]] } .groupTuple(size: 2) @@ -245,7 +257,6 @@ workflow TUMOR_NORMAL_HAPPHASE { } .join(LONGPHASE_PHASE.out.snv_vcf) .set{tumor_normal_severus} - // tumor_normal_severus -> meta: [id, paired_data, platform, sex, fiber, basecall_model] // tumor_bam: haplotagged aligned bam for tumor // tumor_bai: indexes for tumor bam files @@ -259,7 +270,6 @@ workflow TUMOR_NORMAL_HAPPHASE { return[meta , tumor_bam, tumor_bai, normal_bam, normal_bai, meta.clairS_model] } .set { clairs_input } - // // MODULE: CLAIRS // diff --git a/subworkflows/local/tumor_only_happhase.nf b/subworkflows/local/tumor_only_happhase.nf index 621e2ed..9cd7104 100644 --- a/subworkflows/local/tumor_only_happhase.nf +++ b/subworkflows/local/tumor_only_happhase.nf @@ -166,8 +166,11 @@ workflow TUMOR_ONLY_HAPPHASE { paired_data: meta.paired_data, platform: meta.platform, sex: meta.sex, - fiber: meta.fiber - ] + fiber: meta.fiber, + clair3_model: meta.clair3_model, + clairS_model : meta.clairS_model, + clairSTO_model: meta.clairSTO_model, + kinetics: meta.kinetics] return [new_meta, hap_bam, hap_bai, [], [], vcf] } .set{ tumor_only_severus } From 02ac2e80efb5ab3c91a9f1128cc670f390fb01fd Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Fri, 9 Jan 2026 17:09:56 +0100 Subject: [PATCH 12/14] update snapshot --- tests/default.nf.test | 24 ++++++++++++++ tests/default.nf.test.snap | 67 +++++++++++++++++++++++++++++++++++++- 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/tests/default.nf.test b/tests/default.nf.test index d4daad1..54c2e52 100644 --- a/tests/default.nf.test +++ b/tests/default.nf.test @@ -19,6 +19,30 @@ nextflow_pipeline { def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') assertAll( { assert workflow.success}, + { //files exist + assert file("$launchDir/output/sample1/variants/clair3/merge_output.vcf.gz").exists() + assert file("$launchDir/output/sample1/variants/clair3/merge_output.vcf.gz.tbi").exists() + assert file("$launchDir/output/sample1/variants/clairs/indel.vcf.gz").exists() + assert file("$launchDir/output/sample1/variants/clairs/indel.vcf.gz.tbi").exists() + assert file("$launchDir/output/sample1/variants/clairs/snvs.vcf.gz").exists() + assert file("$launchDir/output/sample1/variants/clairs/snvs.vcf.gz.tbi").exists() + assert file("$launchDir/output/sample1/variants/severus/somatic_SVs/severus_somatic.vcf.gz").exists() + assert file("$launchDir/output/sample2/variants/clair3/merge_output.vcf.gz").exists() + assert file("$launchDir/output/sample2/variants/clair3/merge_output.vcf.gz.tbi").exists() + assert file("$launchDir/output/sample2/variants/clairs/indel.vcf.gz").exists() + assert file("$launchDir/output/sample2/variants/clairs/indel.vcf.gz.tbi").exists() + assert file("$launchDir/output/sample2/variants/clairs/snvs.vcf.gz").exists() + assert file("$launchDir/output/sample2/variants/clairs/snvs.vcf.gz.tbi").exists() + assert file("$launchDir/output/sample2/variants/severus/somatic_SVs/severus_somatic.vcf.gz").exists() + assert file("$launchDir/output/sample1/bamfiles/sample1_normal.bam").exists() + assert file("$launchDir/output/sample1/bamfiles/sample1_tumor.bam").exists() + assert file("$launchDir/output/sample1/bamfiles/sample1_normal.bam.bai").exists() + assert file("$launchDir/output/sample1/bamfiles/sample1_tumor.bam.bai").exists() + assert file("$launchDir/output/sample3/variants/clairsto/indel.vcf.gz").exists() + assert file("$launchDir/output/sample3/variants/clairsto/snv.vcf.gz").exists() + assert file("$launchDir/output/sample3/variants/clairsto/somatic.vcf.gz").exists() + assert file("$launchDir/output/sample3/variants/clairsto/germline.vcf.gz").exists() + }, { assert snapshot( // pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions removeNextflowVersion("$outputDir/pipeline_info/lrsomatic_software_mqc_versions.yml"), diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index 95ecedb..6a1cd3c 100644 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -2,9 +2,18 @@ "-profile test": { "content": [ { + "BCFTOOLS_CONCAT": { + "bcftools": 1.22 + }, + "BCFTOOLS_SORT": { + "bcftools": 1.22 + }, "CLAIR3": { "clair3": "1.2.0" }, + "CLAIRS": { + "clairs": "0.4.4" + }, "CLAIRSTO": { "clairsto": "0.4.2" }, @@ -113,6 +122,8 @@ "sample1/bamfiles", "sample1/bamfiles/sample1_normal.bam", "sample1/bamfiles/sample1_normal.bam.bai", + "sample1/bamfiles/sample1_tumor.bam", + "sample1/bamfiles/sample1_tumor.bam.bai", "sample1/qc", "sample1/qc/normal", "sample1/qc/normal/cramino_aln", @@ -142,15 +153,39 @@ "sample1/variants/clair3", "sample1/variants/clair3/merge_output.vcf.gz", "sample1/variants/clair3/merge_output.vcf.gz.tbi", + "sample1/variants/clairs", + "sample1/variants/clairs/indel.vcf.gz", + "sample1/variants/clairs/indel.vcf.gz.tbi", + "sample1/variants/clairs/snvs.vcf.gz", + "sample1/variants/clairs/snvs.vcf.gz.tbi", + "sample1/variants/severus", + "sample1/variants/severus/all_SVs", + "sample1/variants/severus/all_SVs/severus_all.vcf.gz", + "sample1/variants/severus/breakpoints_double.csv", + "sample1/variants/severus/read_ids.csv", + "sample1/variants/severus/read_qual.txt", + "sample1/variants/severus/severus.log", + "sample1/variants/severus/somatic_SVs", + "sample1/variants/severus/somatic_SVs/severus_somatic.vcf.gz", "sample1/vep", + "sample1/vep/SVs", + "sample1/vep/SVs/sample1_SV_VEP.vcf.gz", + "sample1/vep/SVs/sample1_SV_VEP.vcf.gz.tbi", + "sample1/vep/SVs/sample1_SV_VEP.vcf.gz_summary.html", "sample1/vep/germline", "sample1/vep/germline/sample1_GERMLINE_VEP.vcf.gz", "sample1/vep/germline/sample1_GERMLINE_VEP.vcf.gz.tbi", "sample1/vep/germline/sample1_GERMLINE_VEP.vcf.gz_summary.html", + "sample1/vep/somatic", + "sample1/vep/somatic/sample1_SOMATIC_VEP.vcf.gz", + "sample1/vep/somatic/sample1_SOMATIC_VEP.vcf.gz.tbi", + "sample1/vep/somatic/sample1_SOMATIC_VEP.vcf.gz_summary.html", "sample2", "sample2/bamfiles", "sample2/bamfiles/sample2_normal.bam", "sample2/bamfiles/sample2_normal.bam.bai", + "sample2/bamfiles/sample2_tumor.bam", + "sample2/bamfiles/sample2_tumor.bam.bai", "sample2/qc", "sample2/qc/normal", "sample2/qc/normal/cramino_aln", @@ -180,11 +215,33 @@ "sample2/variants/clair3", "sample2/variants/clair3/merge_output.vcf.gz", "sample2/variants/clair3/merge_output.vcf.gz.tbi", + "sample2/variants/clairs", + "sample2/variants/clairs/indel.vcf.gz", + "sample2/variants/clairs/indel.vcf.gz.tbi", + "sample2/variants/clairs/snvs.vcf.gz", + "sample2/variants/clairs/snvs.vcf.gz.tbi", + "sample2/variants/severus", + "sample2/variants/severus/all_SVs", + "sample2/variants/severus/all_SVs/severus_all.vcf.gz", + "sample2/variants/severus/breakpoints_double.csv", + "sample2/variants/severus/read_ids.csv", + "sample2/variants/severus/read_qual.txt", + "sample2/variants/severus/severus.log", + "sample2/variants/severus/somatic_SVs", + "sample2/variants/severus/somatic_SVs/severus_somatic.vcf.gz", "sample2/vep", + "sample2/vep/SVs", + "sample2/vep/SVs/sample2_SV_VEP.vcf.gz", + "sample2/vep/SVs/sample2_SV_VEP.vcf.gz.tbi", + "sample2/vep/SVs/sample2_SV_VEP.vcf.gz_summary.html", "sample2/vep/germline", "sample2/vep/germline/sample2_GERMLINE_VEP.vcf.gz", "sample2/vep/germline/sample2_GERMLINE_VEP.vcf.gz.tbi", "sample2/vep/germline/sample2_GERMLINE_VEP.vcf.gz_summary.html", + "sample2/vep/somatic", + "sample2/vep/somatic/sample2_SOMATIC_VEP.vcf.gz", + "sample2/vep/somatic/sample2_SOMATIC_VEP.vcf.gz.tbi", + "sample2/vep/somatic/sample2_SOMATIC_VEP.vcf.gz_summary.html", "sample3", "sample3/bamfiles", "sample3/bamfiles/sample3_tumor.bam", @@ -238,6 +295,8 @@ [ "sample1_normal.bam:md5,60838033f5f24aa90e16a5babcddd45b", "sample1_normal.bam.bai:md5,d77c4e82c8965132967be86d83a4992d", + "sample1_tumor.bam:md5,bd73e83253c95a5fdc4db39454ee2253", + "sample1_tumor.bam.bai:md5,8b9edeb60b0e3023c97aa4b6e2e61380", "sample1.mosdepth.global.dist.txt:md5,4e1c72f8465c18ffd854c42850eb7c5f", "sample1.mosdepth.summary.txt:md5,cf13d4b24e5ebf31b629a1195a1fff41", "sample1.flagstat:md5,815a5385bd57ef44847714130b80d630", @@ -248,8 +307,12 @@ "sample1.flagstat:md5,34e851b5504d961632f26991160ded5a", "sample1.idxstats:md5,1d43b03114bcc9b70d4333e91498efbe", "sample1.stats:md5,da6ea076dd90b4e35ab2e23b8e6ead25", + "breakpoints_double.csv:md5,57e4f0d5509db44179e7c5044c6bc259", + "read_qual.txt:md5,1ad9d1900f8dcb291c97adc65c9d341c", "sample2_normal.bam:md5,554b89692e84b9ddd0615649e2b15820", "sample2_normal.bam.bai:md5,af193f1922d90b8741212d2bf690c418", + "sample2_tumor.bam:md5,26c4e52c12aa0e874fe52ae3b729beba", + "sample2_tumor.bam.bai:md5,e9e64e13328aa3621e7976f8e3f29a78", "sample2.mosdepth.global.dist.txt:md5,6cdc97a81a603db702cb5a113b8bc62a", "sample2.mosdepth.summary.txt:md5,864370930ec1d695d942f4960bcf8fc6", "sample2.flagstat:md5,cce0bb7ca79e14d8369ccc714adf4be3", @@ -260,6 +323,8 @@ "sample2.flagstat:md5,83e7d7d922941691d2b023f0bd9655aa", "sample2.idxstats:md5,fe8a5d1263481ea7902d575b4d95f655", "sample2.stats:md5,defe74842396209b6cff4b32994287c7", + "breakpoints_double.csv:md5,b71bba578c126b9217765d854b21028a", + "read_qual.txt:md5,27edf87814aec6fa18546c8606aae4ed", "sample3_tumor.bam:md5,2308beb1b4be1f0e1d6c8e52bd4f9266", "sample3_tumor.bam.bai:md5,840eb3ad5ed3216a97c6a58563d4dcb1", "sample3.mosdepth.global.dist.txt:md5,e04da37ef2b7cd587fa3158b9f36d2cb", @@ -275,6 +340,6 @@ "nf-test": "0.9.3", "nextflow": "25.10.2" }, - "timestamp": "2026-01-08T17:23:32.905484266" + "timestamp": "2026-01-09T17:08:56.493545818" } } \ No newline at end of file From 4541fb8e4c26776e5ce8f7a4d1f54af3cadeb45f Mon Sep 17 00:00:00 2001 From: robert-a-forsyth Date: Fri, 9 Jan 2026 17:10:34 +0100 Subject: [PATCH 13/14] prettier --- tests/default.nf.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/default.nf.test b/tests/default.nf.test index 54c2e52..160dc01 100644 --- a/tests/default.nf.test +++ b/tests/default.nf.test @@ -41,7 +41,7 @@ nextflow_pipeline { assert file("$launchDir/output/sample3/variants/clairsto/indel.vcf.gz").exists() assert file("$launchDir/output/sample3/variants/clairsto/snv.vcf.gz").exists() assert file("$launchDir/output/sample3/variants/clairsto/somatic.vcf.gz").exists() - assert file("$launchDir/output/sample3/variants/clairsto/germline.vcf.gz").exists() + assert file("$launchDir/output/sample3/variants/clairsto/germline.vcf.gz").exists() }, { assert snapshot( // pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions From a53b2ef6cfa86ccc52b7b064bf3326b02f8bc1a5 Mon Sep 17 00:00:00 2001 From: ljwharbers Date: Mon, 12 Jan 2026 15:28:51 +0100 Subject: [PATCH 14/14] minor fixes --- subworkflows/local/tumor_normal_happhase.nf | 10 ++++------ subworkflows/local/tumor_only_happhase.nf | 2 +- workflows/lrsomatic.nf | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/subworkflows/local/tumor_normal_happhase.nf b/subworkflows/local/tumor_normal_happhase.nf index d9102cb..81d08f9 100644 --- a/subworkflows/local/tumor_normal_happhase.nf +++ b/subworkflows/local/tumor_normal_happhase.nf @@ -21,6 +21,7 @@ workflow TUMOR_NORMAL_HAPPHASE { tumor_only_severus = channel.empty() somatic_vep = channel.empty() germline_vep = channel.empty() + // Branch input bams in normal and tumour mixed_bams .branch{ meta, bam, bai -> @@ -39,7 +40,6 @@ workflow TUMOR_NORMAL_HAPPHASE { } .set{downloaded_clair3_models} - mixed_bams.normal .map{ meta, bam, bai -> def new_meta = [id: meta.id, @@ -48,14 +48,13 @@ workflow TUMOR_NORMAL_HAPPHASE { sex: meta.sex, fiber: meta.fiber, clair3_model: meta.clair3_model, - clairS_model : meta.clairS_model, + clairS_model: meta.clairS_model, clairSTO_model: meta.clairSTO_model, kinetics: meta.kinetics] return [ new_meta, meta.clair3_model, bam, bai ] } .set { normal_bams_model } - normal_bams_model .combine(downloaded_clair3_models,by:1) .map {clair3_model, meta_bam, bam, bai, meta_model, model -> @@ -88,14 +87,13 @@ workflow TUMOR_NORMAL_HAPPHASE { sex: meta.sex, fiber: meta.fiber, clair3_model: meta.clair3_model, - clairS_model : meta.clairS_model, + clairS_model: meta.clairS_model, clairSTO_model: meta.clairSTO_model, kinetics: meta.kinetics] return[new_meta, bam, bai] } .set{ tumor_bams } - // tumor_bams -> meta: [id, paired_data, platform, sex, fiber, basecall_model] // bam: list of concatenated aligned bams // bai: indexes for bam files @@ -241,7 +239,7 @@ workflow TUMOR_NORMAL_HAPPHASE { sex: meta.sex, fiber: meta.fiber, clair3_model: meta.clair3_model, - clairS_model : meta.clairS_model, + clairS_model: meta.clairS_model, clairSTO_model: meta.clairSTO_model, kinetics: meta.kinetics] return[new_meta, [[type: meta.type], hapbam], [[type: meta.type], hapbai]] diff --git a/subworkflows/local/tumor_only_happhase.nf b/subworkflows/local/tumor_only_happhase.nf index 9cd7104..16b8ce9 100644 --- a/subworkflows/local/tumor_only_happhase.nf +++ b/subworkflows/local/tumor_only_happhase.nf @@ -168,7 +168,7 @@ workflow TUMOR_ONLY_HAPPHASE { sex: meta.sex, fiber: meta.fiber, clair3_model: meta.clair3_model, - clairS_model : meta.clairS_model, + clairS_model: meta.clairS_model, clairSTO_model: meta.clairSTO_model, kinetics: meta.kinetics] return [new_meta, hap_bam, hap_bai, [], [], vcf] diff --git a/workflows/lrsomatic.nf b/workflows/lrsomatic.nf index 6767cfb..a7eb186 100644 --- a/workflows/lrsomatic.nf +++ b/workflows/lrsomatic.nf @@ -122,7 +122,7 @@ workflow LRSOMATIC { sex: meta.sex, fiber: meta.fiber, clair3_model: chosen_clair3_model, - clairS_model : chosen_clairS_model, + clairS_model: chosen_clairS_model, clairSTO_model: chosen_clairSTO_model, kinetics: kinetics_meta] return[ meta_new, bam ] @@ -214,8 +214,6 @@ workflow LRSOMATIC { ch_fasta = PREPARE_REFERENCE_FILES.out.prepped_fasta ch_fai = PREPARE_REFERENCE_FILES.out.prepped_fai - - // ASCAT files allele_files = PREPARE_REFERENCE_FILES.out.allele_files loci_files = PREPARE_REFERENCE_FILES.out.loci_files @@ -341,6 +339,7 @@ workflow LRSOMATIC { // ch_minimap_bams into tumor and paired to phase the paired ones on normal // and add index + ch_minimap_bam .join(MINIMAP2_ALIGN.out.index) .branch { meta, bams, bais ->