From 5e87aa7c93b4ddd1c18b256a06e3032aa5924f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Mir=20Pedrol?= Date: Thu, 26 Jun 2025 14:19:30 +0200 Subject: [PATCH 1/3] don't modify n_trials if tune_trials_range is null --- .../local/custom/modify_model_config/main.nf | 6 +++++- .../main.nf | 18 +++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/local/custom/modify_model_config/main.nf b/modules/local/custom/modify_model_config/main.nf index 2ccb2cc..aa9367f 100644 --- a/modules/local/custom/modify_model_config/main.nf +++ b/modules/local/custom/modify_model_config/main.nf @@ -20,7 +20,11 @@ process CUSTOM_MODIFY_MODEL_CONFIG { meta_updated = meta + ["n_trials": "${n_trials}"] """ # substitte the line containing n_trials in the config file with n_trials: \${n_trials} - awk -v n_trials=${n_trials} '/n_trials: [0-9]+/ {gsub(/n_trials: [0-9]+/, "n_trials: " n_trials)}1' ${config} > ${prefix}.yaml + if [ "${n_trials}" = "[]" ]; then + cp "${config}" "${prefix}.yaml" + else + awk -v n_trials="${n_trials}" '/n_trials: [0-9]+/ {gsub(/n_trials: [0-9]+/, "n_trials: " n_trials)}1' "${config}" > "${prefix}.yaml" + fi cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/subworkflows/local/utils_nfcore_deepmodeloptim_pipeline/main.nf b/subworkflows/local/utils_nfcore_deepmodeloptim_pipeline/main.nf index c5c3cd6..a5abc83 100644 --- a/subworkflows/local/utils_nfcore_deepmodeloptim_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_deepmodeloptim_pipeline/main.nf @@ -110,12 +110,16 @@ workflow PIPELINE_INITIALISATION { // range = validate_range(params.tune_trials_range) - val_tune_trials_range = Channel.from(range) - .map { rangeStr -> - def (min, max, step) = rangeStr.tokenize(',')*.toInteger() - (min..max).step(step).toList() - } - .flatten() + if (range) { + val_tune_trials_range = Channel.from(range) + .map { rangeStr -> + def (min, max, step) = rangeStr.tokenize(',')*.toInteger() + (min..max).step(step).toList() + } + .flatten() + } else { + val_tune_trials_range = [] + } // // Create the channels for the number of replicates // @@ -217,7 +221,7 @@ def validateInputSamplesheet(input) { def validate_range(range) { if (range == null) { - return "1,1,1" + return range } def (min, max, step) = range.tokenize(',')*.toInteger() if (min > max) { From 1d517605944f904fb3deaca05f72fb3358afb75e Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Thu, 26 Jun 2025 12:22:10 +0000 Subject: [PATCH 2/3] [automated] Fix code linting --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 65098e9..6dca052 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,9 @@ ## Introduction -**nf-core/deepmodeloptim** augments your bio data towards an optimal task-specific training set. - -Methods in deep learning are vastly equivalent (see neural scaling laws paper), most of the performance is driven by the training data. +**nf-core/deepmodeloptim** augments your bio data towards an optimal task-specific training set. +Methods in deep learning are vastly equivalent (see neural scaling laws paper), most of the performance is driven by the training data. From a2d0a973e13517db0dce858c39945804bb2b15da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Mir=20Pedrol?= Date: Thu, 26 Jun 2025 14:25:03 +0200 Subject: [PATCH 3/3] fix pre-commit linting --- modules/local/stimulus/split_yaml/main.nf | 2 +- subworkflows/local/split_data_config_unified/main.nf | 8 ++++---- subworkflows/local/transform_csv/main.nf | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/local/stimulus/split_yaml/main.nf b/modules/local/stimulus/split_yaml/main.nf index 2938df2..630c153 100644 --- a/modules/local/stimulus/split_yaml/main.nf +++ b/modules/local/stimulus/split_yaml/main.nf @@ -38,4 +38,4 @@ process STIMULUS_SPLIT_YAML { stimulus: \$(stimulus -v | cut -d ' ' -f 3) END_VERSIONS """ -} \ No newline at end of file +} diff --git a/subworkflows/local/split_data_config_unified/main.nf b/subworkflows/local/split_data_config_unified/main.nf index 9132f77..7a5d5f2 100644 --- a/subworkflows/local/split_data_config_unified/main.nf +++ b/subworkflows/local/split_data_config_unified/main.nf @@ -26,13 +26,13 @@ workflow SPLIT_DATA_CONFIG_UNIFIED_WF { // Process split configs - transpose and add split_id to meta ch_split_configs = STIMULUS_SPLIT_YAML.out.split_config .transpose() - .map { meta, yaml -> + .map { meta, yaml -> // Extract split info from descriptive filename def split_id = yaml.baseName.replaceAll(/.*_([^_]+_[^_]+)_split$/, '$1') - [ meta + [split_id: split_id], yaml] + [ meta + [split_id: split_id], yaml] } - // Process transform configs - transpose and add transform_id to meta + // Process transform configs - transpose and add transform_id to meta ch_transform_configs = STIMULUS_SPLIT_YAML.out.transform_config .transpose() .map { meta, yaml -> @@ -55,4 +55,4 @@ workflow SPLIT_DATA_CONFIG_UNIFIED_WF { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ \ No newline at end of file +*/ diff --git a/subworkflows/local/transform_csv/main.nf b/subworkflows/local/transform_csv/main.nf index 3280eab..abb8970 100644 --- a/subworkflows/local/transform_csv/main.nf +++ b/subworkflows/local/transform_csv/main.nf @@ -46,7 +46,7 @@ workflow TRANSFORM_CSV_WF { data: item.data config: item.config } - + // run stimulus transform STIMULUS_TRANSFORM_CSV( ch_input.data,