Skip to content

Commit

Permalink
Merge branch 'dev' into fix-970
Browse files Browse the repository at this point in the history
  • Loading branch information
ewels authored Mar 30, 2021
2 parents df9061f + 86d83a3 commit a21fa21
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 31 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

## 1.14dev

* Fixed an issue in the pipeline template regarding explicit disabling of unused container engines [[#972](https://github.com/nf-core/tools/pull/972)]
* Fix overly strict `--max_time` formatting regex in template schema [[#973](https://github.com/nf-core/tools/issues/973)]
* Try to fix the fix for the automated sync when we submit too many PRs at once [[#970](https://github.com/nf-core/tools/issues/970)]
### Tools

* Strip values from `nf-core launch` web response which are False and have no default in the schema [[#976](https://github.com/nf-core/tools/issues/976)]
* Try to fix the fix for the automated sync when we submit too many PRs at once [[#970](https://github.com/nf-core/tools/issues/970)]

### Template

* Fixed an issue regarding explicit disabling of unused container engines [[#972](https://github.com/nf-core/tools/pull/972)]
* Removed trailing slash from `params.igenomes_base` to yield valid s3 paths (previous paths work with Nextflow but not aws cli)
* Added a timestamp to the trace + timetime + report + dag filenames to fix overwrite issue on AWS
* Rewrite the `params_summary_log()` function to properly ignore unset params and have nicer formatting [[#971](https://github.com/nf-core/tools/issues/971)]
* Fix overly strict `--max_time` formatting regex in template schema [[#973](https://github.com/nf-core/tools/issues/973)]

## [v1.13.3 - Copper Crocodile Resurrection :crocodile:](https://github.com/nf-core/tools/releases/tag/1.13.2) - [2021-03-24]

Expand Down
5 changes: 4 additions & 1 deletion nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ def lint(pipeline_dir, release, fix, show_passed, fail_ignored, markdown, json):
Runs a large number of automated tests to ensure that the supplied pipeline
meets the nf-core guidelines. Documentation of all lint tests can be found
on the nf-core website: https://nf-co.re/errors
on the nf-core website: https://nf-co.re/tools-docs/
You can ignore tests using a file called .nf-core-lint.yaml (if you have a good reason!).
See the documentation for details.
"""

# Run the lint tests!
Expand Down
42 changes: 19 additions & 23 deletions nf_core/pipeline-template/lib/NfcoreSchema.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ class NfcoreSchema {

// Remove an element from a JSONArray
private static JSONArray removeElement(jsonArray, element){
def list = []
def list = []
int len = jsonArray.length()
for (int i=0;i<len;i++){
for (int i=0;i<len;i++){
list.add(jsonArray.get(i).toString())
}
}
list.remove(element)
JSONArray jsArray = new JSONArray(list)
return jsArray
Expand All @@ -213,7 +213,7 @@ class NfcoreSchema {
// If the param was required, change this
if (definition[key].has("required")) {
def cleaned_required = removeElement(definition[key].required, ignore_param)
definition[key].put("required", cleaned_required)
definition[key].put("required", cleaned_required)
}
}
}
Expand Down Expand Up @@ -482,10 +482,10 @@ class NfcoreSchema {
}
workflow_summary['runName'] = workflow.runName
if (workflow.containerEngine) {
workflow_summary['containerEngine'] = "$workflow.containerEngine"
workflow_summary['containerEngine'] = workflow.containerEngine
}
if (workflow.container) {
workflow_summary['container'] = "$workflow.container"
workflow_summary['container'] = workflow.container
}
workflow_summary['launchDir'] = workflow.launchDir
workflow_summary['workDir'] = workflow.workDir
Expand All @@ -506,17 +506,7 @@ class NfcoreSchema {
def params_value = params.get(param)
def schema_value = group_params.get(param).default
def param_type = group_params.get(param).type
if (schema_value == null) {
if (param_type == 'boolean') {
schema_value = false
}
if (param_type == 'string') {
schema_value = ''
}
if (param_type == 'integer') {
schema_value = 0
}
} else {
if (schema_value != null) {
if (param_type == 'string') {
if (schema_value.contains('$projectDir') || schema_value.contains('${projectDir}')) {
def sub_string = schema_value.replace('\$projectDir', '')
Expand All @@ -535,8 +525,13 @@ class NfcoreSchema {
}
}

if (params_value != schema_value) {
sub_params.put("$param", params_value)
// We have a default in the schema, and this isn't it
if (schema_value != null && params_value != schema_value) {
sub_params.put(param, params_value)
}
// No default in the schema, and this isn't empty
else if (schema_value == null && params_value != "" && params_value != null && params_value != false) {
sub_params.put(param, params_value)
}
}
}
Expand All @@ -549,22 +544,23 @@ class NfcoreSchema {
* Beautify parameters for summary and return as string
*/
private static String params_summary_log(workflow, params, json_schema) {
Map colors = log_colours(params.monochrome_logs)
String output = ''
def params_map = params_summary_map(workflow, params, json_schema)
def max_chars = params_max_chars(params_map)
for (group in params_map.keySet()) {
def group_params = params_map.get(group) // This gets the parameters of that particular group
if (group_params) {
output += group + '\n'
output += colors.bold + group + colors.reset + '\n'
for (param in group_params.keySet()) {
output += " \u001B[1m" + param.padRight(max_chars) + ": \u001B[1m" + group_params.get(param) + '\n'
output += " " + colors.blue + param.padRight(max_chars) + ": " + colors.green + group_params.get(param) + colors.reset + '\n'
}
output += '\n'
}
}
output += "[Only displaying parameters that differ from pipeline default]\n"
output += dashed_line(params.monochrome_logs)
output += '\n\n' + dashed_line(params.monochrome_logs)
output += colors.dim + "\n Only displaying parameters that differ from defaults.\n" + colors.reset
output += dashed_line(params.monochrome_logs)
return output
}

Expand Down
9 changes: 5 additions & 4 deletions nf_core/pipeline-template/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,22 @@ env {
// Capture exit codes from upstream processes when piping
process.shell = ['/bin/bash', '-euo', 'pipefail']

def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
timeline {
enabled = true
file = "${params.tracedir}/execution_timeline.html"
file = "${params.tracedir}/execution_timeline_${trace_timestamp}.html"
}
report {
enabled = true
file = "${params.tracedir}/execution_report.html"
file = "${params.tracedir}/execution_report_${trace_timestamp}.html"
}
trace {
enabled = true
file = "${params.tracedir}/execution_trace.txt"
file = "${params.tracedir}/execution_trace_${trace_timestamp}.txt"
}
dag {
enabled = true
file = "${params.tracedir}/pipeline_dag.svg"
file = "${params.tracedir}/pipeline_dag_${trace_timestamp}.svg"
}

manifest {
Expand Down

0 comments on commit a21fa21

Please sign in to comment.