From e62f462d68f2d273154cd0431b2713eead0bc98e Mon Sep 17 00:00:00 2001 From: delfiterradas Date: Wed, 6 May 2026 18:29:44 +0000 Subject: [PATCH 1/4] Set blas threads to 1 and cpus to 12 --- .../nf-core/variancepartition/dream/main.nf | 2 +- .../variancepartition/dream/templates/dream.R | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/variancepartition/dream/main.nf b/modules/nf-core/variancepartition/dream/main.nf index f04388625db2..3ad082bb6b30 100644 --- a/modules/nf-core/variancepartition/dream/main.nf +++ b/modules/nf-core/variancepartition/dream/main.nf @@ -1,6 +1,6 @@ process VARIANCEPARTITION_DREAM { tag "${meta.id}" - label 'process_single' + label 'process_high' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? diff --git a/modules/nf-core/variancepartition/dream/templates/dream.R b/modules/nf-core/variancepartition/dream/templates/dream.R index d8dcb493922f..f110e3f23b50 100644 --- a/modules/nf-core/variancepartition/dream/templates/dream.R +++ b/modules/nf-core/variancepartition/dream/templates/dream.R @@ -82,6 +82,7 @@ opt <- list( contrast_string = "$comparison", # Full (complex) contrast expression comparison needed if using formula sample_id_col = "sample", # Column name for sample IDs threads = "$task.cpus", # Number of threads for multithreading + blas_threads = 1, # Number of threads for BLAS/OpenMP backends subset_to_contrast_samples = FALSE, # Whether to subset to contrast samples exclude_samples_col = NULL, # Column for excluding samples exclude_samples_values = NULL, # Values for excluding samples @@ -116,6 +117,7 @@ keys <- c("formula", "contrast_string", "contrast_target", "contrast_variable", opt[keys] <- lapply(opt[keys], nullify) opt\$threads <- as.numeric(opt\$threads) +opt\$blas_threads <- as.numeric(opt\$blas_threads) opt\$apply_voom <- as.logical(opt\$apply_voom) opt\$proportion <- as.numeric(opt\$proportion) opt\$trend <- as.logical(opt\$trend) @@ -135,6 +137,32 @@ if (!is.null(opt\$seed)) { set.seed(opt\$seed) } +if (is.na(opt\$blas_threads) || opt\$blas_threads < 1) { + stop("'blas_threads' must be a positive integer") +} +opt\$blas_threads <- as.integer(opt\$blas_threads) + +configure_blas_threads <- function(threads) { + thread_env <- c( + OPENBLAS_NUM_THREADS = threads, + OMP_NUM_THREADS = threads, + MKL_NUM_THREADS = threads, + BLIS_NUM_THREADS = threads, + VECLIB_MAXIMUM_THREADS = threads, + NUMEXPR_NUM_THREADS = threads + ) + do.call(Sys.setenv, as.list(thread_env)) + + if (requireNamespace("RhpcBLASctl", quietly = TRUE)) { + RhpcBLASctl::blas_set_num_threads(threads) + RhpcBLASctl::omp_set_num_threads(threads) + } + + cat("Configured implicit BLAS/OpenMP threads to", threads, "\n") +} + +configure_blas_threads(opt\$blas_threads) + # Load metadata metadata <- read_delim_flexible(opt\$sample_file, header = TRUE, stringsAsFactors = TRUE) rownames(metadata) <- metadata[[opt\$sample_id_col]] From 7945c106fee7d67160df15d3fdaa8e635130191f Mon Sep 17 00:00:00 2001 From: delfiterradas Date: Wed, 6 May 2026 18:55:31 +0000 Subject: [PATCH 2/4] Migrate to topics --- modules/nf-core/variancepartition/dream/main.nf | 2 +- modules/nf-core/variancepartition/dream/meta.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/variancepartition/dream/main.nf b/modules/nf-core/variancepartition/dream/main.nf index 3ad082bb6b30..c4a2937e1573 100644 --- a/modules/nf-core/variancepartition/dream/main.nf +++ b/modules/nf-core/variancepartition/dream/main.nf @@ -15,7 +15,7 @@ process VARIANCEPARTITION_DREAM { tuple val(meta), path("*.dream.results.tsv") , emit: results tuple val(meta), path("*.dream.model.txt") , emit: model tuple val(meta), path("*.normalised_counts.tsv") , emit: normalised_counts, optional: true - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/variancepartition/dream/meta.yml b/modules/nf-core/variancepartition/dream/meta.yml index a98fe8fd98eb..87e3d30c5b6d 100644 --- a/modules/nf-core/variancepartition/dream/meta.yml +++ b/modules/nf-core/variancepartition/dream/meta.yml @@ -99,6 +99,11 @@ output: pattern: "versions.yml" ontologies: - edam: http://edamontology.org/format_3750 # YAML +topics: + versions: + - versions.yml: + type: string + description: The name of the process authors: - "@alanmmobbs03" - "@nschcolnicov" From 48096bae777691406ae26051692a8734a705590a Mon Sep 17 00:00:00 2001 From: Delfina Terradas <155591053+delfiterradas@users.noreply.github.com> Date: Thu, 7 May 2026 16:04:22 +0000 Subject: [PATCH 3/4] Revert changes to label and update snapshot --- modules/nf-core/variancepartition/dream/main.nf | 2 +- .../variancepartition/dream/tests/main.nf.test.snap | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/nf-core/variancepartition/dream/main.nf b/modules/nf-core/variancepartition/dream/main.nf index c4a2937e1573..456eab69e82f 100644 --- a/modules/nf-core/variancepartition/dream/main.nf +++ b/modules/nf-core/variancepartition/dream/main.nf @@ -1,6 +1,6 @@ process VARIANCEPARTITION_DREAM { tag "${meta.id}" - label 'process_high' + label 'process_single' conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? diff --git a/modules/nf-core/variancepartition/dream/tests/main.nf.test.snap b/modules/nf-core/variancepartition/dream/tests/main.nf.test.snap index 46afa72c1495..aef27abe7845 100644 --- a/modules/nf-core/variancepartition/dream/tests/main.nf.test.snap +++ b/modules/nf-core/variancepartition/dream/tests/main.nf.test.snap @@ -332,7 +332,7 @@ "formula": "~ genotype * treatment", "comparison": "genotypeWT - treatmentTreated" }, - "genotype_WT_KO_treatment_Control_Treated.dream.results.tsv:md5,90a06e6b4945c706025582a4c9fddf2c" + "genotype_WT_KO_treatment_Control_Treated.dream.results.tsv:md5,4a367c86195204b88e4b98e3547ee753" ] ], "1": [ @@ -371,7 +371,7 @@ "formula": "~ genotype * treatment", "comparison": "genotypeWT - treatmentTreated" }, - "genotype_WT_KO_treatment_Control_Treated.dream.results.tsv:md5,90a06e6b4945c706025582a4c9fddf2c" + "genotype_WT_KO_treatment_Control_Treated.dream.results.tsv:md5,4a367c86195204b88e4b98e3547ee753" ] ], "versions": [ @@ -379,10 +379,10 @@ ] } ], - "timestamp": "2026-03-25T21:03:52.327619963", + "timestamp": "2026-05-07T15:47:46.200336836", "meta": { "nf-test": "0.9.5", - "nextflow": "25.10.4" + "nextflow": "26.04.0" } }, "Mus musculus - expression table - contrasts + formula + comparison contrast string": { From 2b1c2b97a8bdb09e874f9ff995321454a2ca893e Mon Sep 17 00:00:00 2001 From: delfiterradas Date: Thu, 7 May 2026 19:38:23 +0200 Subject: [PATCH 4/4] Update snapshot --- .../dream/tests/main.nf.test.snap | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/modules/nf-core/variancepartition/dream/tests/main.nf.test.snap b/modules/nf-core/variancepartition/dream/tests/main.nf.test.snap index aef27abe7845..987192caba7c 100644 --- a/modules/nf-core/variancepartition/dream/tests/main.nf.test.snap +++ b/modules/nf-core/variancepartition/dream/tests/main.nf.test.snap @@ -15,11 +15,11 @@ "versions.yml:md5,fc1f26eb2194018e99fc2916332676b7" ] ], - "timestamp": "2025-12-23T18:57:51.598745459", "meta": { "nf-test": "0.9.3", "nextflow": "25.04.2" - } + }, + "timestamp": "2025-12-23T18:57:51.598745459" }, "RNAseq - Feature Counts - formula + comparison contrast string - interaction": { "content": [ @@ -37,11 +37,11 @@ "versions.yml:md5,fc1f26eb2194018e99fc2916332676b7" ] ], - "timestamp": "2025-12-26T15:10:51.980662299", "meta": { "nf-test": "0.9.3", "nextflow": "25.04.2" - } + }, + "timestamp": "2025-12-26T15:10:51.980662299" }, "Mus musculus - contrasts - matrix - no formula": { "content": [ @@ -61,11 +61,11 @@ "versions.yml:md5,fc1f26eb2194018e99fc2916332676b7" ] ], - "timestamp": "2025-12-16T15:52:08.047223666", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.0" - } + }, + "timestamp": "2025-12-16T15:52:08.047223666" }, "Mus musculus - expression table - contrasts + blocking factors": { "content": [ @@ -130,11 +130,11 @@ ] } ], - "timestamp": "2025-12-16T19:59:57.947286403", "meta": { "nf-test": "0.9.3", "nextflow": "25.10.0" - } + }, + "timestamp": "2025-12-16T19:59:57.947286403" }, "Mus musculus - expression table - contrasts + blocking factors stub": { "content": [ @@ -199,11 +199,11 @@ ] } ], - "timestamp": "2025-11-10T16:18:37.294899756", "meta": { "nf-test": "0.9.2", "nextflow": "25.04.6" - } + }, + "timestamp": "2025-11-10T16:18:37.294899756" }, "Mus musculus - expression table - contrasts + formula + weighted comparison contrast string": { "content": [ @@ -221,11 +221,11 @@ "versions.yml:md5,fc1f26eb2194018e99fc2916332676b7" ] ], - "timestamp": "2025-12-23T18:57:42.761838155", "meta": { "nf-test": "0.9.3", "nextflow": "25.04.2" - } + }, + "timestamp": "2025-12-23T18:57:42.761838155" }, "Mus musculus - expression table - contrasts + formula + comparison contrast string - no intercept stub": { "content": [ @@ -284,11 +284,11 @@ ] } ], - "timestamp": "2026-01-13T15:35:07.121696674", "meta": { "nf-test": "0.9.3", "nextflow": "25.04.2" - } + }, + "timestamp": "2026-01-13T15:35:07.121696674" }, "RNAseq - Voom - Feature Counts - formula + comparison contrast string - interaction": { "content": [ @@ -316,11 +316,11 @@ "versions.yml:md5,fc1f26eb2194018e99fc2916332676b7" ] ], - "timestamp": "2026-01-13T15:53:31.743589111", "meta": { "nf-test": "0.9.3", "nextflow": "25.04.2" - } + }, + "timestamp": "2026-01-13T15:53:31.743589111" }, "RNAseq - Feature Counts - formula + comparison contrast string - interaction with seed": { "content": [ @@ -332,7 +332,7 @@ "formula": "~ genotype * treatment", "comparison": "genotypeWT - treatmentTreated" }, - "genotype_WT_KO_treatment_Control_Treated.dream.results.tsv:md5,4a367c86195204b88e4b98e3547ee753" + "genotype_WT_KO_treatment_Control_Treated.dream.results.tsv:md5,90a06e6b4945c706025582a4c9fddf2c" ] ], "1": [ @@ -371,7 +371,7 @@ "formula": "~ genotype * treatment", "comparison": "genotypeWT - treatmentTreated" }, - "genotype_WT_KO_treatment_Control_Treated.dream.results.tsv:md5,4a367c86195204b88e4b98e3547ee753" + "genotype_WT_KO_treatment_Control_Treated.dream.results.tsv:md5,90a06e6b4945c706025582a4c9fddf2c" ] ], "versions": [ @@ -379,11 +379,11 @@ ] } ], - "timestamp": "2026-05-07T15:47:46.200336836", "meta": { - "nf-test": "0.9.5", - "nextflow": "26.04.0" - } + "nf-test": "0.9.3", + "nextflow": "25.10.3" + }, + "timestamp": "2026-05-07T19:32:24.587570625" }, "Mus musculus - expression table - contrasts + formula + comparison contrast string": { "content": [ @@ -401,10 +401,10 @@ "versions.yml:md5,fc1f26eb2194018e99fc2916332676b7" ] ], - "timestamp": "2025-12-26T15:11:01.472042429", "meta": { "nf-test": "0.9.3", "nextflow": "25.04.2" - } + }, + "timestamp": "2025-12-26T15:11:01.472042429" } } \ No newline at end of file