From 463a0ac0704a1b819a2979d6734f04003e00b0bf Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Wed, 21 Jan 2026 14:50:25 +0100 Subject: [PATCH 1/5] update package version and containers --- modules/nf-core/viber/environment.yml | 2 +- modules/nf-core/viber/main.nf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/viber/environment.yml b/modules/nf-core/viber/environment.yml index 64a211905fb..bd0bd05d358 100644 --- a/modules/nf-core/viber/environment.yml +++ b/modules/nf-core/viber/environment.yml @@ -3,7 +3,7 @@ channels: - bioconda dependencies: - - bioconda::r-cnaqc=1.1.2 + - bioconda::r-cnaqc=1.1.3 - bioconda::r-viber=1.0.0 - conda-forge::r-cli=3.6.5 - conda-forge::r-dplyr=1.1.4 diff --git a/modules/nf-core/viber/main.nf b/modules/nf-core/viber/main.nf index 850f39ecc75..e2d9f1244bf 100644 --- a/modules/nf-core/viber/main.nf +++ b/modules/nf-core/viber/main.nf @@ -4,8 +4,8 @@ process VIBER { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'oras://community.wave.seqera.io/library/r-cnaqc_r-viber:014077a3164189d5': - 'community.wave.seqera.io/library/r-cnaqc_r-viber:2314592f7d2f9abe'}" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/21/21e21fc0c84576a262f02779cb091dbe2734a12e3b9a2c41e08cb8393bd3953f/data': + 'community.wave.seqera.io/library/r-cnaqc_r-viber_r-cli_r-dplyr_pruned:f00a3b14d68a7bac'}" input: tuple val(meta), path(rds_join), val(tumour_samples) From 0bb5cb0849c60779ac00e87db5f9c545ea058e55 Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Wed, 21 Jan 2026 14:50:42 +0100 Subject: [PATCH 2/5] avoid fitting in parallel --- modules/nf-core/viber/templates/viber_main_script.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/nf-core/viber/templates/viber_main_script.R b/modules/nf-core/viber/templates/viber_main_script.R index ec402bb3994..9f7782c6028 100644 --- a/modules/nf-core/viber/templates/viber_main_script.R +++ b/modules/nf-core/viber/templates/viber_main_script.R @@ -1,5 +1,7 @@ #!/usr/bin/env Rscript +options(easypar.parallel=FALSE) + parse_args = function(x) { x = gsub("\\\\[","",x) x = gsub("\\\\]","",x) From 46dc4e85a7a0992d1a7d74ed00903d7ae18cf4e0 Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Wed, 21 Jan 2026 14:50:46 +0100 Subject: [PATCH 3/5] Update main.nf.test.snap --- modules/nf-core/viber/tests/main.nf.test.snap | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/nf-core/viber/tests/main.nf.test.snap b/modules/nf-core/viber/tests/main.nf.test.snap index 18e2d115958..e6cd8bee446 100644 --- a/modules/nf-core/viber/tests/main.nf.test.snap +++ b/modules/nf-core/viber/tests/main.nf.test.snap @@ -2,14 +2,14 @@ "viber - csv": { "content": [ [ - "versions.yml:md5,d27db9579ed0b91c5131d11f037ec121" + "versions.yml:md5,0aff4c2ae3de260cbef5870e5f4f0374" ] ], "meta": { - "nf-test": "0.9.3", - "nextflow": "25.04.7" + "nf-test": "0.9.2", + "nextflow": "25.10.2" }, - "timestamp": "2025-10-10T17:31:00.066038" + "timestamp": "2026-01-21T13:09:28.963732" }, "viber - csv - stub": { "content": [ @@ -171,14 +171,14 @@ "viber - rds": { "content": [ [ - "versions.yml:md5,d27db9579ed0b91c5131d11f037ec121" + "versions.yml:md5,0aff4c2ae3de260cbef5870e5f4f0374" ] ], "meta": { - "nf-test": "0.9.3", - "nextflow": "25.04.7" + "nf-test": "0.9.2", + "nextflow": "25.10.2" }, - "timestamp": "2025-10-10T17:27:18.630026" + "timestamp": "2026-01-21T13:04:28.189463" }, "viber - rds - stub": { "content": [ From ced829d1949667cff0c1f3aeab53c81038a3ee18 Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Wed, 21 Jan 2026 18:16:55 +0100 Subject: [PATCH 4/5] Update viber_main_script.R --- .../viber/templates/viber_main_script.R | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/modules/nf-core/viber/templates/viber_main_script.R b/modules/nf-core/viber/templates/viber_main_script.R index 9f7782c6028..5f83543639a 100644 --- a/modules/nf-core/viber/templates/viber_main_script.R +++ b/modules/nf-core/viber/templates/viber_main_script.R @@ -39,22 +39,24 @@ library(ggpubr) samples = substr("$tumour_samples", 2, nchar("$tumour_samples")-1) samples = strsplit(samples, ", ")[[1]] -print("$meta.patient") -print("$tumour_samples") -print("$rds_join") -print(samples) + +cli::cli_text("Patient {$meta.patient} with samples {$tumour_samples}.") +cli::cli_text("Input file: {$rds_join}.") if ( grepl(".rds\$", tolower("$rds_join")) ) { input_obj = readRDS("$rds_join") if (class(input_obj) == "m_cnaqc") { shared = input_obj %>% get_sample(sample=samples, which_obj="shared") joint_table = lapply(names(shared), - function(sample_name) - shared[[sample_name]] %>% - CNAqc::subset_by_segment_karyotype("1:1") %>% - CNAqc::Mutations() %>% - dplyr::mutate(sample_id=sample_name) - ) %>% dplyr::bind_rows() + function(sample_name) { + table_s = shared[[sample_name]] %>% + CNAqc::subset_by_segment_karyotype("1:1") %>% + CNAqc::Mutations() %>% + dplyr::mutate(sample_id=sample_name) + if (nrow(table_s) == 0) { + cli::cli_alert_warning("Sample {sample_name} has no diploid mutations!") + } + }) %>% dplyr::bind_rows() } else { cli::cli_alert_warning("Object of class {class(input_obj)} not supported.") return() @@ -63,7 +65,11 @@ if ( grepl(".rds\$", tolower("$rds_join")) ) { joint_table = read.csv("$rds_join") } -print("Subset joint done") +if (nrow(joint_table) == 0) { + cli::cli_alert_warning("No samples contain diploid mutations!") +} + +cli::cli_text("Joint table created.") ## Read input joint table input_tab = joint_table %>% @@ -90,12 +96,12 @@ nv = reads_data %>% # Standard fit viber_K = as.integer(opt[["K"]]) -message("Starting standard fit") +cli::cli_text("Starting standard fit") st_fit = VIBER::variational_fit(nv, dp, K=viber_K, data=reads_data) st_fit[["description"]]="$meta.patient" -message("End standard fit") +cli::cli_text("End standard fit") best_fit = best_fit_heuristic = st_fit # If all clusters are removed -> keep the origianl best fit From 93b8d91d44e084ff24216787c546ec80e656f1bf Mon Sep 17 00:00:00 2001 From: Elena Buscaroli Date: Wed, 21 Jan 2026 18:56:23 +0100 Subject: [PATCH 5/5] mc --- modules/nf-core/viber/templates/viber_main_script.R | 5 +++-- modules/nf-core/viber/tests/main.nf.test.snap | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/nf-core/viber/templates/viber_main_script.R b/modules/nf-core/viber/templates/viber_main_script.R index 5f83543639a..b1e7a50be4e 100644 --- a/modules/nf-core/viber/templates/viber_main_script.R +++ b/modules/nf-core/viber/templates/viber_main_script.R @@ -40,8 +40,8 @@ library(ggpubr) samples = substr("$tumour_samples", 2, nchar("$tumour_samples")-1) samples = strsplit(samples, ", ")[[1]] -cli::cli_text("Patient {$meta.patient} with samples {$tumour_samples}.") -cli::cli_text("Input file: {$rds_join}.") +cli::cli_text("Patient $meta.patient with samples $tumour_samples.") +cli::cli_text("Input file: $rds_join.") if ( grepl(".rds\$", tolower("$rds_join")) ) { input_obj = readRDS("$rds_join") @@ -56,6 +56,7 @@ if ( grepl(".rds\$", tolower("$rds_join")) ) { 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_alert_warning("Object of class {class(input_obj)} not supported.") diff --git a/modules/nf-core/viber/tests/main.nf.test.snap b/modules/nf-core/viber/tests/main.nf.test.snap index e6cd8bee446..09a6a620019 100644 --- a/modules/nf-core/viber/tests/main.nf.test.snap +++ b/modules/nf-core/viber/tests/main.nf.test.snap @@ -9,7 +9,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-01-21T13:09:28.963732" + "timestamp": "2026-01-21T18:29:55.951523" }, "viber - csv - stub": { "content": [ @@ -178,7 +178,7 @@ "nf-test": "0.9.2", "nextflow": "25.10.2" }, - "timestamp": "2026-01-21T13:04:28.189463" + "timestamp": "2026-01-21T18:34:41.655887" }, "viber - rds - stub": { "content": [