@@ -191,11 +191,11 @@ class NfcoreSchema {
191
191
192
192
// Remove an element from a JSONArray
193
193
private static JSONArray removeElement (jsonArray , element ){
194
- def list = []
194
+ def list = []
195
195
int len = jsonArray. length()
196
- for (int i= 0 ;i< len;i++ ){
196
+ for (int i= 0 ;i< len;i++ ){
197
197
list. add(jsonArray. get(i). toString())
198
- }
198
+ }
199
199
list. remove(element)
200
200
JSONArray jsArray = new JSONArray (list)
201
201
return jsArray
@@ -213,7 +213,7 @@ class NfcoreSchema {
213
213
// If the param was required, change this
214
214
if (definition[key]. has(" required" )) {
215
215
def cleaned_required = removeElement(definition[key]. required, ignore_param)
216
- definition[key]. put(" required" , cleaned_required)
216
+ definition[key]. put(" required" , cleaned_required)
217
217
}
218
218
}
219
219
}
@@ -482,10 +482,10 @@ class NfcoreSchema {
482
482
}
483
483
workflow_summary[' runName' ] = workflow. runName
484
484
if (workflow. containerEngine) {
485
- workflow_summary[' containerEngine' ] = " $ workflow . containerEngine "
485
+ workflow_summary[' containerEngine' ] = workflow. containerEngine
486
486
}
487
487
if (workflow. container) {
488
- workflow_summary[' container' ] = " $ workflow . container "
488
+ workflow_summary[' container' ] = workflow. container
489
489
}
490
490
workflow_summary[' launchDir' ] = workflow. launchDir
491
491
workflow_summary[' workDir' ] = workflow. workDir
@@ -506,17 +506,7 @@ class NfcoreSchema {
506
506
def params_value = params. get(param)
507
507
def schema_value = group_params. get(param). default
508
508
def param_type = group_params. get(param). type
509
- if (schema_value == null ) {
510
- if (param_type == ' boolean' ) {
511
- schema_value = false
512
- }
513
- if (param_type == ' string' ) {
514
- schema_value = ' '
515
- }
516
- if (param_type == ' integer' ) {
517
- schema_value = 0
518
- }
519
- } else {
509
+ if (schema_value != null ) {
520
510
if (param_type == ' string' ) {
521
511
if (schema_value. contains(' $projectDir' ) || schema_value. contains(' ${projectDir}' )) {
522
512
def sub_string = schema_value. replace(' \$ projectDir' , ' ' )
@@ -535,8 +525,13 @@ class NfcoreSchema {
535
525
}
536
526
}
537
527
538
- if (params_value != schema_value) {
539
- sub_params. put(" $param " , params_value)
528
+ // We have a default in the schema, and this isn't it
529
+ if (schema_value != null && params_value != schema_value) {
530
+ sub_params. put(param, params_value)
531
+ }
532
+ // No default in the schema, and this isn't empty
533
+ else if (schema_value == null && params_value != " " && params_value != null && params_value != false ) {
534
+ sub_params. put(param, params_value)
540
535
}
541
536
}
542
537
}
@@ -549,22 +544,23 @@ class NfcoreSchema {
549
544
* Beautify parameters for summary and return as string
550
545
*/
551
546
private static String params_summary_log (workflow , params , json_schema ) {
547
+ Map colors = log_colours(params. monochrome_logs)
552
548
String output = ' '
553
549
def params_map = params_summary_map(workflow, params, json_schema)
554
550
def max_chars = params_max_chars(params_map)
555
551
for (group in params_map. keySet()) {
556
552
def group_params = params_map. get(group) // This gets the parameters of that particular group
557
553
if (group_params) {
558
- output + = group + ' \n '
554
+ output + = colors . bold + group + colors . reset + ' \n '
559
555
for (param in group_params. keySet()) {
560
- output + = " \u 001B[1m " + param. padRight(max_chars) + " : \u 001B[1m " + group_params. get(param) + ' \n '
556
+ output + = " " + colors . blue + param. padRight(max_chars) + " : " + colors . green + group_params. get(param) + colors . reset + ' \n '
561
557
}
562
558
output + = ' \n '
563
559
}
564
560
}
565
- output + = " [Only displaying parameters that differ from pipeline default]\n "
566
561
output + = dashed_line(params. monochrome_logs)
567
- output + = ' \n\n ' + dashed_line(params. monochrome_logs)
562
+ output + = colors. dim + " \n Only displaying parameters that differ from defaults.\n " + colors. reset
563
+ output + = dashed_line(params. monochrome_logs)
568
564
return output
569
565
}
570
566
0 commit comments