Skip to content

Commit 16e6fa3

Browse files
Merge pull request #252 from mirpedrol/n_trials_null
don't modify n_trials if tune_trials_range is null
2 parents 889727e + a2d0a97 commit 16e6fa3

File tree

6 files changed

+24
-17
lines changed

6 files changed

+24
-17
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121

2222
## Introduction
2323

24-
**nf-core/deepmodeloptim** augments your bio data towards an optimal task-specific training set.
25-
26-
Methods in deep learning are vastly equivalent (see neural scaling laws paper), most of the performance is driven by the training data.
24+
**nf-core/deepmodeloptim** augments your bio data towards an optimal task-specific training set.
2725

26+
Methods in deep learning are vastly equivalent (see neural scaling laws paper), most of the performance is driven by the training data.
2827

2928
<picture>
3029
<source media="(prefers-color-scheme: dark)" srcset="assets/metromap.png">

modules/local/custom/modify_model_config/main.nf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ process CUSTOM_MODIFY_MODEL_CONFIG {
2020
meta_updated = meta + ["n_trials": "${n_trials}"]
2121
"""
2222
# substitte the line containing n_trials in the config file with n_trials: \${n_trials}
23-
awk -v n_trials=${n_trials} '/n_trials: [0-9]+/ {gsub(/n_trials: [0-9]+/, "n_trials: " n_trials)}1' ${config} > ${prefix}.yaml
23+
if [ "${n_trials}" = "[]" ]; then
24+
cp "${config}" "${prefix}.yaml"
25+
else
26+
awk -v n_trials="${n_trials}" '/n_trials: [0-9]+/ {gsub(/n_trials: [0-9]+/, "n_trials: " n_trials)}1' "${config}" > "${prefix}.yaml"
27+
fi
2428
2529
cat <<-END_VERSIONS > versions.yml
2630
"${task.process}":

modules/local/stimulus/split_yaml/main.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ process STIMULUS_SPLIT_YAML {
3838
stimulus: \$(stimulus -v | cut -d ' ' -f 3)
3939
END_VERSIONS
4040
"""
41-
}
41+
}

subworkflows/local/split_data_config_unified/main.nf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ workflow SPLIT_DATA_CONFIG_UNIFIED_WF {
2626
// Process split configs - transpose and add split_id to meta
2727
ch_split_configs = STIMULUS_SPLIT_YAML.out.split_config
2828
.transpose()
29-
.map { meta, yaml ->
29+
.map { meta, yaml ->
3030
// Extract split info from descriptive filename
3131
def split_id = yaml.baseName.replaceAll(/.*_([^_]+_[^_]+)_split$/, '$1')
32-
[ meta + [split_id: split_id], yaml]
32+
[ meta + [split_id: split_id], yaml]
3333
}
3434

35-
// Process transform configs - transpose and add transform_id to meta
35+
// Process transform configs - transpose and add transform_id to meta
3636
ch_transform_configs = STIMULUS_SPLIT_YAML.out.transform_config
3737
.transpose()
3838
.map { meta, yaml ->
@@ -55,4 +55,4 @@ workflow SPLIT_DATA_CONFIG_UNIFIED_WF {
5555
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5656
THE END
5757
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58-
*/
58+
*/

subworkflows/local/transform_csv/main.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ workflow TRANSFORM_CSV_WF {
4646
data: item.data
4747
config: item.config
4848
}
49-
49+
5050
// run stimulus transform
5151
STIMULUS_TRANSFORM_CSV(
5252
ch_input.data,

subworkflows/local/utils_nfcore_deepmodeloptim_pipeline/main.nf

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,16 @@ workflow PIPELINE_INITIALISATION {
110110
//
111111

112112
range = validate_range(params.tune_trials_range)
113-
val_tune_trials_range = Channel.from(range)
114-
.map { rangeStr ->
115-
def (min, max, step) = rangeStr.tokenize(',')*.toInteger()
116-
(min..max).step(step).toList()
117-
}
118-
.flatten()
113+
if (range) {
114+
val_tune_trials_range = Channel.from(range)
115+
.map { rangeStr ->
116+
def (min, max, step) = rangeStr.tokenize(',')*.toInteger()
117+
(min..max).step(step).toList()
118+
}
119+
.flatten()
120+
} else {
121+
val_tune_trials_range = []
122+
}
119123
//
120124
// Create the channels for the number of replicates
121125
//
@@ -217,7 +221,7 @@ def validateInputSamplesheet(input) {
217221
def validate_range(range) {
218222

219223
if (range == null) {
220-
return "1,1,1"
224+
return range
221225
}
222226
def (min, max, step) = range.tokenize(',')*.toInteger()
223227
if (min > max) {

0 commit comments

Comments
 (0)