From 2056b734d7a87f84dddfecda05f59a89b8d383cf Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Mon, 2 Mar 2026 19:32:11 +0100 Subject: [PATCH 1/5] fixing minor bug in version.yml --- modules/nf-core/mobster/main.nf | 10 +++++----- .../nf-core/mobster/templates/main_script.R | 7 ++++++- .../nf-core/mobster/tests/main.nf.test.snap | 20 +++++++++---------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/modules/nf-core/mobster/main.nf b/modules/nf-core/mobster/main.nf index c8a45d3398e7..3dc7807d9b5b 100644 --- a/modules/nf-core/mobster/main.nf +++ b/modules/nf-core/mobster/main.nf @@ -38,11 +38,11 @@ process MOBSTER { cat <<-END_VERSIONS > versions.yml "${task.process}": - CNAqc: \$(Rscript -e 'library(CNAqc); sessionInfo()\$otherPkgs\$CNAqc\$Version') - mobster: \$(Rscript -e 'library(mobster); sessionInfo()\$otherPkgs\$mobster\$Version') - cli: \$(Rscript -e 'library(cli); sessionInfo()\$otherPkgs\$cli\$Version') - dplyr: \$(Rscript -e 'library(dplyr); sessionInfo()\$otherPkgs\$dplyr\$Version') - ggplot2: \$(Rscript -e 'library(ggplot2); sessionInfo()\$otherPkgs\$ggplot2\$Version') + CNAqc: \$(Rscript -e "library(CNAqc); cat(as.character(packageVersion('CNAqc')))") + mobster: \$(Rscript -e "library(mobster); cat(as.character(packageVersion('mobster')))") + cli: \$(Rscript -e "library(cli); cat(as.character(packageVersion('cli')))") + dplyr: \$(Rscript -e "library(dplyr); cat(as.character(packageVersion('dplyr')))") + ggplot2: \$(Rscript -e "library(ggplot2); cat(as.character(packageVersion('ggplot2')))") END_VERSIONS """ } diff --git a/modules/nf-core/mobster/templates/main_script.R b/modules/nf-core/mobster/templates/main_script.R index 175c89b976a7..1ed8499673e1 100644 --- a/modules/nf-core/mobster/templates/main_script.R +++ b/modules/nf-core/mobster/templates/main_script.R @@ -30,6 +30,7 @@ for ( ao in names(args_opt)) opt[[ao]] = args_opt[[ao]] library(CNAqc) library(mobster) library(dplyr) +library(cli) library(ggplot2) description = "$meta.patient" @@ -43,11 +44,15 @@ if ( grepl(".rds\$", tolower("$rds_join")) ) { input_table = lapply(names(original), function(sample_name) { purity = original[[sample_name]][["purity"]] - original[[sample_name]] %>% + table_s = original[[sample_name]] %>% # keep only mutations on the diploid karyotype CNAqc::subset_by_segment_karyotype("1:1") %>% CNAqc::Mutations() %>% dplyr::mutate(sample_id=sample_name, purity=purity) + if (nrow(table_s) == 0) { + cli::cli_alert_warning("Sample {sample_name} has no diploid mutations!") + } + return(table_s) }) %>% dplyr::bind_rows() } else { cli::cli_abort("Object of class {class($rds_join)} not supported.") diff --git a/modules/nf-core/mobster/tests/main.nf.test.snap b/modules/nf-core/mobster/tests/main.nf.test.snap index 559fb1943315..c0818e8a0caa 100644 --- a/modules/nf-core/mobster/tests/main.nf.test.snap +++ b/modules/nf-core/mobster/tests/main.nf.test.snap @@ -2,26 +2,26 @@ "test rds input": { "content": [ [ - "versions.yml:md5,33352102a5ea4278214d90ca36bb4425" + "versions.yml:md5,77450c80bcd77fc67a77be48ce61201e" ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-01-21T15:14:16.168458" + "timestamp": "2026-03-02T19:09:59.525411" }, "test csv input": { "content": [ [ - "versions.yml:md5,33352102a5ea4278214d90ca36bb4425" + "versions.yml:md5,77450c80bcd77fc67a77be48ce61201e" ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-01-21T15:18:45.141969" + "timestamp": "2026-03-02T19:12:34.791592" }, "test csv input - stub": { "content": [ @@ -87,7 +87,7 @@ ] ], "6": [ - "versions.yml:md5,af4bfdb43f7b9a49e026f4508be7ea96" + "versions.yml:md5,77450c80bcd77fc67a77be48ce61201e" ], "mobster_best_plots_rds": [ [ @@ -150,7 +150,7 @@ ] ], "versions": [ - "versions.yml:md5,af4bfdb43f7b9a49e026f4508be7ea96" + "versions.yml:md5,77450c80bcd77fc67a77be48ce61201e" ] } ], @@ -158,7 +158,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-01-21T15:20:46.541349" + "timestamp": "2026-03-02T19:12:47.027351" }, "test rds input - stub": { "content": [ @@ -224,7 +224,7 @@ ] ], "6": [ - "versions.yml:md5,af4bfdb43f7b9a49e026f4508be7ea96" + "versions.yml:md5,77450c80bcd77fc67a77be48ce61201e" ], "mobster_best_plots_rds": [ [ @@ -287,7 +287,7 @@ ] ], "versions": [ - "versions.yml:md5,af4bfdb43f7b9a49e026f4508be7ea96" + "versions.yml:md5,77450c80bcd77fc67a77be48ce61201e" ] } ], @@ -295,6 +295,6 @@ "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-01-21T15:16:09.445968" + "timestamp": "2026-03-02T19:10:13.154468" } } \ No newline at end of file From 1f9c69f99b83adf91f86be3aa041e89f6c86054e Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Tue, 3 Mar 2026 11:45:36 +0100 Subject: [PATCH 2/5] Update version template --- modules/nf-core/mobster/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/mobster/main.nf b/modules/nf-core/mobster/main.nf index 3dc7807d9b5b..5a9088dfb291 100644 --- a/modules/nf-core/mobster/main.nf +++ b/modules/nf-core/mobster/main.nf @@ -17,7 +17,7 @@ process MOBSTER { tuple val(meta), path("*_mobster_report.rds") , emit: mobster_report_rds tuple val(meta), path("*_mobster_report.pdf") , emit: mobster_report_pdf tuple val(meta), path("*_mobster_report.png") , emit: mobster_report_png - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions , topic: versions when: task.ext.when == null || task.ext.when From def1e328fd49b20790582e675b08467e1f664885 Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Fri, 6 Mar 2026 19:28:11 +0100 Subject: [PATCH 3/5] update versions topic --- modules/nf-core/mobster/main.nf | 2 +- modules/nf-core/mobster/meta.yml | 19 ++++++++++++++----- modules/nf-core/mobster/tests/main.nf.test | 4 ++-- .../nf-core/mobster/tests/main.nf.test.snap | 12 ++++++------ 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/modules/nf-core/mobster/main.nf b/modules/nf-core/mobster/main.nf index 5a9088dfb291..ba800108b843 100644 --- a/modules/nf-core/mobster/main.nf +++ b/modules/nf-core/mobster/main.nf @@ -17,7 +17,7 @@ process MOBSTER { tuple val(meta), path("*_mobster_report.rds") , emit: mobster_report_rds tuple val(meta), path("*_mobster_report.pdf") , emit: mobster_report_pdf tuple val(meta), path("*_mobster_report.png") , emit: mobster_report_png - path "versions.yml" , emit: versions , topic: versions + path "versions.yml" , emit: versions_mobster , topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/mobster/meta.yml b/modules/nf-core/mobster/meta.yml index c691c0e8472f..021ee44b8bae 100644 --- a/modules/nf-core/mobster/meta.yml +++ b/modules/nf-core/mobster/meta.yml @@ -18,7 +18,8 @@ tools: documentation: https://caravagnalab.github.io/mobster/ tool_dev_url: https://github.com/caravagnalab/mobster doi: "10.1038/s41588-020-0675-5" - licence: ["GPL-3.0"] + licence: + - "GPL-3.0" identifier: biotools:mobster-R input: - - meta: @@ -32,7 +33,7 @@ input: table pattern: "*.{rds,csv}" ontologies: - - edam: "http://edamontology.org/format_3752" # csv + - edam: "http://edamontology.org/format_3752" output: mobster_rds: - - meta: @@ -89,7 +90,7 @@ output: description: Final report plots as a .pdf file pattern: "*_mobster_report.pdf" ontologies: - - edam: "http://edamontology.org/format_3508" # pdf + - edam: "http://edamontology.org/format_3508" mobster_report_png: - - meta: type: map @@ -101,14 +102,22 @@ output: description: Final report plots as a .png file pattern: "*_mobster_report.png" ontologies: - - edam: "http://edamontology.org/format_3603" # png + - edam: "http://edamontology.org/format_3603" + versions_mobster: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" + ontologies: + - edam: http://edamontology.org/format_3750 +topics: versions: - versions.yml: type: file description: File containing software versions pattern: "versions.yml" ontologies: - - edam: http://edamontology.org/format_3750 # YAML + - edam: http://edamontology.org/format_3750 authors: - "@elena-buscaroli" maintainers: diff --git a/modules/nf-core/mobster/tests/main.nf.test b/modules/nf-core/mobster/tests/main.nf.test index ce293ebf27c1..1b2c8079e9af 100644 --- a/modules/nf-core/mobster/tests/main.nf.test +++ b/modules/nf-core/mobster/tests/main.nf.test @@ -23,7 +23,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.versions).match() }, + { assert snapshot(process.out.versions_mobster).match() }, { assert file(process.out.mobster_rds[0][1]).exists() }, { assert file(process.out.mobster_best_rds[0][1]).exists() }, { assert file(process.out.mobster_best_plots_rds[0][1]).exists() }, @@ -69,7 +69,7 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out.versions).match() }, + { assert snapshot(process.out.versions_mobster).match() }, { assert file(process.out.mobster_rds[0][1]).exists() }, { assert file(process.out.mobster_best_rds[0][1]).exists() }, { assert file(process.out.mobster_best_plots_rds[0][1]).exists() }, diff --git a/modules/nf-core/mobster/tests/main.nf.test.snap b/modules/nf-core/mobster/tests/main.nf.test.snap index c0818e8a0caa..a3932f122c0a 100644 --- a/modules/nf-core/mobster/tests/main.nf.test.snap +++ b/modules/nf-core/mobster/tests/main.nf.test.snap @@ -9,7 +9,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-03-02T19:09:59.525411" + "timestamp": "2026-03-06T18:54:44.143211" }, "test csv input": { "content": [ @@ -21,7 +21,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-03-02T19:12:34.791592" + "timestamp": "2026-03-06T18:57:15.439837" }, "test csv input - stub": { "content": [ @@ -149,7 +149,7 @@ "test_mobster_report.rds:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ + "versions_mobster": [ "versions.yml:md5,77450c80bcd77fc67a77be48ce61201e" ] } @@ -158,7 +158,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-03-02T19:12:47.027351" + "timestamp": "2026-03-06T18:57:27.63698" }, "test rds input - stub": { "content": [ @@ -286,7 +286,7 @@ "test_mobster_report.rds:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "versions": [ + "versions_mobster": [ "versions.yml:md5,77450c80bcd77fc67a77be48ce61201e" ] } @@ -295,6 +295,6 @@ "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-03-02T19:10:13.154468" + "timestamp": "2026-03-06T18:54:56.789471" } } \ No newline at end of file From 57fc9ae24190372e0908af8984c3a9ed3e6a3521 Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Mon, 9 Mar 2026 10:36:46 +0100 Subject: [PATCH 4/5] Update meta.yml adding EDAM description --- modules/nf-core/mobster/meta.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/mobster/meta.yml b/modules/nf-core/mobster/meta.yml index 021ee44b8bae..9a3fcf6bc83b 100644 --- a/modules/nf-core/mobster/meta.yml +++ b/modules/nf-core/mobster/meta.yml @@ -33,7 +33,7 @@ input: table pattern: "*.{rds,csv}" ontologies: - - edam: "http://edamontology.org/format_3752" + - edam: "http://edamontology.org/format_3752" # csv output: mobster_rds: - - meta: @@ -90,7 +90,7 @@ output: description: Final report plots as a .pdf file pattern: "*_mobster_report.pdf" ontologies: - - edam: "http://edamontology.org/format_3508" + - edam: "http://edamontology.org/format_3508" # pdf mobster_report_png: - - meta: type: map @@ -102,14 +102,14 @@ output: description: Final report plots as a .png file pattern: "*_mobster_report.png" ontologies: - - edam: "http://edamontology.org/format_3603" + - edam: "http://edamontology.org/format_3603" # png versions_mobster: - versions.yml: type: file description: File containing software versions pattern: "versions.yml" ontologies: - - edam: http://edamontology.org/format_3750 + - edam: http://edamontology.org/format_3750 # YAML topics: versions: - versions.yml: @@ -117,7 +117,7 @@ topics: description: File containing software versions pattern: "versions.yml" ontologies: - - edam: http://edamontology.org/format_3750 + - edam: http://edamontology.org/format_3750 # YAML authors: - "@elena-buscaroli" maintainers: From 886e7063c3259940aaac7bc5b93352074edef28c Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Mon, 16 Mar 2026 17:03:57 +0100 Subject: [PATCH 5/5] fixing minor bug --- modules/nf-core/mobster/templates/main_script.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/mobster/templates/main_script.R b/modules/nf-core/mobster/templates/main_script.R index 1ed8499673e1..4042eb38bb63 100644 --- a/modules/nf-core/mobster/templates/main_script.R +++ b/modules/nf-core/mobster/templates/main_script.R @@ -91,7 +91,7 @@ lapply(samples, function(sample_name) { fit = run_mobster_fit(joint_table=input_table %>% dplyr::filter(sample_id == !!sample_name), descr=paste(description, sample_name, sep=":")) - if (any(fit[["fits.table"]][["tail"]])) { + if (fit[["best"]][["fit.tail"]]) { evoparams = evolutionary_parameters(fit) fit[["evolutionary_parameters"]] = evoparams fit[["best"]][["evolutionary_parameters"]] = evoparams