Skip to content
Snippets Groups Projects
Commit 5861de5f authored by nf-core-bot's avatar nf-core-bot
Browse files

Template update for nf-core/tools version 1.14

parent b94308e0
No related branches found
No related tags found
No related merge requests found
...@@ -10,13 +10,14 @@ Remember that PRs should be made against the dev branch, unless you're preparing ...@@ -10,13 +10,14 @@ Remember that PRs should be made against the dev branch, unless you're preparing
Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/hic/tree/master/.github/CONTRIBUTING.md) Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/hic/tree/master/.github/CONTRIBUTING.md)
--> -->
<!-- markdownlint-disable ul-indent -->
## PR checklist ## PR checklist
- [ ] This comment contains a description of changes (with reason). - [ ] This comment contains a description of changes (with reason).
- [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] If you've added a new tool - add to the software_versions process and a regex to `scrape_software_versions.py` - [ ] If you've added a new tool - add to the software_versions process and a regex to `scrape_software_versions.py`
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/hic/tree/master/.github/CONTRIBUTING.md) - [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](<https://github.com/>nf-core/hic/tree/master/.github/CONTRIBUTING.md)
- [ ] If necessary, also make a PR on the nf-core/hic _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository. - [ ] If necessary, also make a PR on the nf-core/hic _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
- [ ] Make sure your code lints (`nf-core lint .`). - [ ] Make sure your code lints (`nf-core lint .`).
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker`). - [ ] Ensure the test suite passes (`nextflow run . -profile test,docker`).
......
...@@ -8,6 +8,9 @@ on: ...@@ -8,6 +8,9 @@ on:
release: release:
types: [published] types: [published]
# Uncomment if we need an edge release of Nextflow again
# env: NXF_EDGE: 1
jobs: jobs:
test: test:
name: Run workflow tests name: Run workflow tests
...@@ -20,7 +23,7 @@ jobs: ...@@ -20,7 +23,7 @@ jobs:
strategy: strategy:
matrix: matrix:
# Nextflow versions: check pipeline minimum and current latest # Nextflow versions: check pipeline minimum and current latest
nxf_ver: ['20.04.0', '21.03.0-edge'] nxf_ver: ['20.04.0', '']
steps: steps:
- name: Check out pipeline code - name: Check out pipeline code
uses: actions/checkout@v2 uses: actions/checkout@v2
......
FROM nfcore/base:1.13.3 FROM nfcore/base:1.14
LABEL authors="Nicolas Servant" \ LABEL authors="Nicolas Servant" \
description="Docker image containing all software requirements for the nf-core/hic pipeline" description="Docker image containing all software requirements for the nf-core/hic pipeline"
......
...@@ -19,7 +19,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool ...@@ -19,7 +19,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io), a workflow tool
## Quick Start ## Quick Start
1. Install [`nextflow`](https://nf-co.re/usage/installation) 1. Install [`nextflow`](https://nf-co.re/usage/installation) (`>=20.04.0`)
2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/), [`Podman`](https://podman.io/), [`Shifter`](https://nersc.gitlab.io/development/shifter/how-to-use/) or [`Charliecloud`](https://hpc.github.io/charliecloud/) for full pipeline reproducibility _(please only use [`Conda`](https://conda.io/miniconda.html) as a last resort; see [docs](https://nf-co.re/usage/configuration#basic-configuration-profiles))_ 2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/), [`Podman`](https://podman.io/), [`Shifter`](https://nersc.gitlab.io/development/shifter/how-to-use/) or [`Charliecloud`](https://hpc.github.io/charliecloud/) for full pipeline reproducibility _(please only use [`Conda`](https://conda.io/miniconda.html) as a last resort; see [docs](https://nf-co.re/usage/configuration#basic-configuration-profiles))_
......
...@@ -112,10 +112,16 @@ class NfcoreSchema { ...@@ -112,10 +112,16 @@ class NfcoreSchema {
} }
// unexpected params // unexpected params
def params_ignore = params.schema_ignore_params.split(',') + 'schema_ignore_params' def params_ignore = params.schema_ignore_params.split(',') + 'schema_ignore_params'
if (!expectedParams.contains(specifiedParam) && !params_ignore.contains(specifiedParam)) { def expectedParamsLowerCase = expectedParams.collect{ it.replace("-", "").toLowerCase() }
def specifiedParamLowerCase = specifiedParam.replace("-", "").toLowerCase()
if (!expectedParams.contains(specifiedParam) && !params_ignore.contains(specifiedParam) && !expectedParamsLowerCase.contains(specifiedParamLowerCase)) {
// Temporarily remove camelCase/camel-case params #1035
def unexpectedParamsLowerCase = unexpectedParams.collect{ it.replace("-", "").toLowerCase()}
if (!unexpectedParamsLowerCase.contains(specifiedParamLowerCase)){
unexpectedParams.push(specifiedParam) unexpectedParams.push(specifiedParam)
} }
} }
}
//=====================================================================// //=====================================================================//
// Validate parameters against the schema // Validate parameters against the schema
...@@ -243,7 +249,7 @@ class NfcoreSchema { ...@@ -243,7 +249,7 @@ class NfcoreSchema {
} }
// Cast Duration to String // Cast Duration to String
if (p['value'].getClass() == nextflow.util.Duration) { if (p['value'].getClass() == nextflow.util.Duration) {
new_params.replace(p.key, p['value'].toString()) new_params.replace(p.key, p['value'].toString().replaceFirst(/d(?!\S)/, "day"))
} }
// Cast LinkedHashMap to String // Cast LinkedHashMap to String
if (p['value'].getClass() == LinkedHashMap) { if (p['value'].getClass() == LinkedHashMap) {
...@@ -482,10 +488,10 @@ class NfcoreSchema { ...@@ -482,10 +488,10 @@ class NfcoreSchema {
} }
workflow_summary['runName'] = workflow.runName workflow_summary['runName'] = workflow.runName
if (workflow.containerEngine) { if (workflow.containerEngine) {
workflow_summary['containerEngine'] = "$workflow.containerEngine" workflow_summary['containerEngine'] = workflow.containerEngine
} }
if (workflow.container) { if (workflow.container) {
workflow_summary['container'] = "$workflow.container" workflow_summary['container'] = workflow.container
} }
workflow_summary['launchDir'] = workflow.launchDir workflow_summary['launchDir'] = workflow.launchDir
workflow_summary['workDir'] = workflow.workDir workflow_summary['workDir'] = workflow.workDir
...@@ -506,17 +512,7 @@ class NfcoreSchema { ...@@ -506,17 +512,7 @@ class NfcoreSchema {
def params_value = params.get(param) def params_value = params.get(param)
def schema_value = group_params.get(param).default def schema_value = group_params.get(param).default
def param_type = group_params.get(param).type def param_type = group_params.get(param).type
if (schema_value == null) { 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 (param_type == 'string') { if (param_type == 'string') {
if (schema_value.contains('$projectDir') || schema_value.contains('${projectDir}')) { if (schema_value.contains('$projectDir') || schema_value.contains('${projectDir}')) {
def sub_string = schema_value.replace('\$projectDir', '') def sub_string = schema_value.replace('\$projectDir', '')
...@@ -535,8 +531,13 @@ class NfcoreSchema { ...@@ -535,8 +531,13 @@ class NfcoreSchema {
} }
} }
if (params_value != schema_value) { // We have a default in the schema, and this isn't it
sub_params.put("$param", params_value) 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)
} }
} }
} }
...@@ -549,22 +550,23 @@ class NfcoreSchema { ...@@ -549,22 +550,23 @@ class NfcoreSchema {
* Beautify parameters for summary and return as string * Beautify parameters for summary and return as string
*/ */
private static String params_summary_log(workflow, params, json_schema) { private static String params_summary_log(workflow, params, json_schema) {
Map colors = log_colours(params.monochrome_logs)
String output = '' String output = ''
def params_map = params_summary_map(workflow, params, json_schema) def params_map = params_summary_map(workflow, params, json_schema)
def max_chars = params_max_chars(params_map) def max_chars = params_max_chars(params_map)
for (group in params_map.keySet()) { for (group in params_map.keySet()) {
def group_params = params_map.get(group) // This gets the parameters of that particular group def group_params = params_map.get(group) // This gets the parameters of that particular group
if (group_params) { if (group_params) {
output += group + '\n' output += colors.bold + group + colors.reset + '\n'
for (param in group_params.keySet()) { 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 += '\n'
} }
} }
output += "[Only displaying parameters that differ from pipeline default]\n"
output += dashed_line(params.monochrome_logs) 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 return output
} }
......
...@@ -378,11 +378,11 @@ def checkHostname() { ...@@ -378,11 +378,11 @@ def checkHostname() {
params.hostnames.each { prof, hnames -> params.hostnames.each { prof, hnames ->
hnames.each { hname -> hnames.each { hname ->
if (hostname.contains(hname) && !workflow.profile.contains(prof)) { if (hostname.contains(hname) && !workflow.profile.contains(prof)) {
log.error '====================================================\n' + log.error "${c_red}====================================================${c_reset}\n" +
" ${c_red}WARNING!${c_reset} You are running with `-profile $workflow.profile`\n" + " ${c_red}WARNING!${c_reset} You are running with `-profile $workflow.profile`\n" +
" but your machine hostname is ${c_white}'$hostname'${c_reset}\n" + " but your machine hostname is ${c_white}'$hostname'${c_reset}\n" +
" ${c_yellow_bold}It's highly recommended that you use `-profile $prof${c_reset}`\n" + " ${c_yellow_bold}It's highly recommended that you use `-profile $prof${c_reset}`\n" +
'============================================================' "${c_red}====================================================${c_reset}\n"
} }
} }
} }
......
...@@ -25,12 +25,13 @@ params { ...@@ -25,12 +25,13 @@ params {
plaintext_email = false plaintext_email = false
monochrome_logs = false monochrome_logs = false
help = false help = false
igenomes_base = 's3://ngi-igenomes/igenomes/' igenomes_base = 's3://ngi-igenomes/igenomes'
tracedir = "${params.outdir}/pipeline_info" tracedir = "${params.outdir}/pipeline_info"
igenomes_ignore = false igenomes_ignore = false
custom_config_version = 'master' custom_config_version = 'master'
custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}"
hostnames = false hostnames = false
config_profile_name = null
config_profile_description = false config_profile_description = false
config_profile_contact = false config_profile_contact = false
config_profile_url = false config_profile_url = false
...@@ -65,7 +66,7 @@ profiles { ...@@ -65,7 +66,7 @@ profiles {
singularity.enabled = false singularity.enabled = false
podman.enabled = false podman.enabled = false
shifter.enabled = false shifter.enabled = false
charliecloud = false charliecloud.enabled = false
process.conda = "$projectDir/environment.yml" process.conda = "$projectDir/environment.yml"
} }
debug { process.beforeScript = 'echo $HOSTNAME' } debug { process.beforeScript = 'echo $HOSTNAME' }
...@@ -94,7 +95,7 @@ profiles { ...@@ -94,7 +95,7 @@ profiles {
docker.enabled = false docker.enabled = false
podman.enabled = true podman.enabled = true
shifter.enabled = false shifter.enabled = false
charliecloud = false charliecloud.enabled = false
} }
shifter { shifter {
singularity.enabled = false singularity.enabled = false
...@@ -129,21 +130,22 @@ env { ...@@ -129,21 +130,22 @@ env {
// Capture exit codes from upstream processes when piping // Capture exit codes from upstream processes when piping
process.shell = ['/bin/bash', '-euo', 'pipefail'] process.shell = ['/bin/bash', '-euo', 'pipefail']
def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
timeline { timeline {
enabled = true enabled = true
file = "${params.tracedir}/execution_timeline.html" file = "${params.tracedir}/execution_timeline_${trace_timestamp}.html"
} }
report { report {
enabled = true enabled = true
file = "${params.tracedir}/execution_report.html" file = "${params.tracedir}/execution_report_${trace_timestamp}.html"
} }
trace { trace {
enabled = true enabled = true
file = "${params.tracedir}/execution_trace.txt" file = "${params.tracedir}/execution_trace_${trace_timestamp}.txt"
} }
dag { dag {
enabled = true enabled = true
file = "${params.tracedir}/pipeline_dag.svg" file = "${params.tracedir}/pipeline_dag_${trace_timestamp}.svg"
} }
manifest { manifest {
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
"igenomes_base": { "igenomes_base": {
"type": "string", "type": "string",
"description": "Directory / URL base for iGenomes references.", "description": "Directory / URL base for iGenomes references.",
"default": "s3://ngi-igenomes/igenomes/", "default": "s3://ngi-igenomes/igenomes",
"fa_icon": "fas fa-cloud-download-alt", "fa_icon": "fas fa-cloud-download-alt",
"hidden": true "hidden": true
}, },
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
"description": "Maximum amount of memory that can be requested for any single job.", "description": "Maximum amount of memory that can be requested for any single job.",
"default": "128.GB", "default": "128.GB",
"fa_icon": "fas fa-memory", "fa_icon": "fas fa-memory",
"pattern": "^[\\d\\.]+\\s*.(K|M|G|T)?B$", "pattern": "^\\d+(\\.\\d+)?\\.?\\s*(K|M|G|T)?B$",
"hidden": true, "hidden": true,
"help_text": "Use to set an upper-limit for the memory requirement for each process. Should be a string in the format integer-unit e.g. `--max_memory '8.GB'`" "help_text": "Use to set an upper-limit for the memory requirement for each process. Should be a string in the format integer-unit e.g. `--max_memory '8.GB'`"
}, },
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
"description": "Maximum amount of time that can be requested for any single job.", "description": "Maximum amount of time that can be requested for any single job.",
"default": "240.h", "default": "240.h",
"fa_icon": "far fa-clock", "fa_icon": "far fa-clock",
"pattern": "^[\\d\\.]+\\.*(s|m|h|d)$", "pattern": "^(\\d+\\.?\\s*(s|m|h|day)\\s*)+$",
"hidden": true, "hidden": true,
"help_text": "Use to set an upper-limit for the time requirement for each process. Should be a string in the format integer-unit e.g. `--max_time '2.h'`" "help_text": "Use to set an upper-limit for the time requirement for each process. Should be a string in the format integer-unit e.g. `--max_time '2.h'`"
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment