From 91e81faf22043eba610d1dcad1cf48e2c61a4815 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 21 Jun 2023 12:08:08 +0100 Subject: [PATCH 1/8] Fix #2332 --- nf_core/pipeline-template/main.nf | 8 ++++---- nf_core/pipeline-template/nextflow.config | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/nf_core/pipeline-template/main.nf b/nf_core/pipeline-template/main.nf index 561f2f6384..4835b35e0e 100644 --- a/nf_core/pipeline-template/main.nf +++ b/nf_core/pipeline-template/main.nf @@ -4,15 +4,15 @@ {{ name }} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Github : https://github.com/{{ name }} -{%- if branded %} +{% if branded %} Website: https://nf-co.re/{{ short_name }} Slack : https://nfcore.slack.com/channels/{{ short_name }} -{% endif -%} +{%- endif %} ---------------------------------------------------------------------------------------- */ nextflow.enable.dsl = 2 -{% if igenomes %} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GENOME PARAMETER VALUES @@ -20,7 +20,7 @@ nextflow.enable.dsl = 2 */ params.fasta = WorkflowMain.getGenomeAttribute(params, 'fasta') -{% endif %} + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ VALIDATE & PRINT PARAMETER SUMMARY diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index e329b3e6fe..b9ce568f46 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -13,12 +13,12 @@ params { // Input options input = null -{% if igenomes %} + {%- if igenomes %} // References genome = null igenomes_base = 's3://ngi-igenomes/igenomes' igenomes_ignore = false - {% endif -%} + {% endif %} // MultiQC options multiqc_config = null @@ -37,17 +37,18 @@ params { hook_url = null help = false version = false -{% if nf_core_configs %} // Config options + config_profile_name = null + config_profile_description = null + + {%- if nf_core_configs %} custom_config_version = 'master' custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}" - config_profile_description = null config_profile_contact = null config_profile_url = null - config_profile_name = null + {% endif %} -{% endif %} // Max resource options // Defaults only, expecting to be overwritten max_memory = '128.GB' @@ -81,7 +82,7 @@ try { // } catch (Exception e) { // System.err.println("WARNING: Could not load nf-core/config/{{ short_name }} profiles: ${params.custom_config_base}/pipeline/{{ short_name }}.config") // } -{% endif %} +{% endif -%} profiles { debug { @@ -188,14 +189,14 @@ plugins { id 'nf-validation@0.2.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet } -{% if igenomes %} +{% if igenomes -%} // Load igenomes.config if required if (!params.igenomes_ignore) { includeConfig 'conf/igenomes.config' } else { params.genomes = [:] } -{% endif %} +{% endif -%} // Export these variables to prevent local Python/R libraries from conflicting with those in the container // The JULIA depot path has been adjusted to a fixed path `/usr/local/share/julia` that needs to be used for packages in the container. From 64d43c4f2202c8a41222d4b2f71ebf54154ee23c Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 21 Jun 2023 12:12:11 +0100 Subject: [PATCH 2/8] Add in call to getGenomeAttribute --- nf_core/pipeline-template/lib/WorkflowMain.groovy | 2 -- 1 file changed, 2 deletions(-) diff --git a/nf_core/pipeline-template/lib/WorkflowMain.groovy b/nf_core/pipeline-template/lib/WorkflowMain.groovy index b6c3336f26..3a66bce6c0 100755 --- a/nf_core/pipeline-template/lib/WorkflowMain.groovy +++ b/nf_core/pipeline-template/lib/WorkflowMain.groovy @@ -49,7 +49,6 @@ class WorkflowMain { Nextflow.error("Please provide an input samplesheet to the pipeline e.g. '--input samplesheet.csv'") } } - {% if igenomes -%} // // Get attribute from genome config file e.g. fasta @@ -62,4 +61,3 @@ class WorkflowMain { } return null } -{% endif -%}} From 530695272527aff082a649d70d292a9a78a9f1f5 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 21 Jun 2023 12:17:08 +0100 Subject: [PATCH 3/8] Add missing brace --- nf_core/pipeline-template/lib/WorkflowMain.groovy | 1 + nf_core/pipeline-template/main.nf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nf_core/pipeline-template/lib/WorkflowMain.groovy b/nf_core/pipeline-template/lib/WorkflowMain.groovy index 3a66bce6c0..548b1d59c2 100755 --- a/nf_core/pipeline-template/lib/WorkflowMain.groovy +++ b/nf_core/pipeline-template/lib/WorkflowMain.groovy @@ -61,3 +61,4 @@ class WorkflowMain { } return null } +} diff --git a/nf_core/pipeline-template/main.nf b/nf_core/pipeline-template/main.nf index 4835b35e0e..f9663c9e69 100644 --- a/nf_core/pipeline-template/main.nf +++ b/nf_core/pipeline-template/main.nf @@ -4,7 +4,7 @@ {{ name }} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Github : https://github.com/{{ name }} -{% if branded %} +{% if branded -%} Website: https://nf-co.re/{{ short_name }} Slack : https://nfcore.slack.com/channels/{{ short_name }} {%- endif %} From 99749d53466f24b21c582af7e3f2402fca87eda8 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 21 Jun 2023 12:30:32 +0100 Subject: [PATCH 4/8] Set fasta as default in nextflow.config if not using igenomes --- nf_core/pipeline-template/lib/WorkflowMain.groovy | 3 ++- nf_core/pipeline-template/main.nf | 8 ++++---- nf_core/pipeline-template/nextflow.config | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/nf_core/pipeline-template/lib/WorkflowMain.groovy b/nf_core/pipeline-template/lib/WorkflowMain.groovy index 548b1d59c2..ec08066279 100755 --- a/nf_core/pipeline-template/lib/WorkflowMain.groovy +++ b/nf_core/pipeline-template/lib/WorkflowMain.groovy @@ -50,6 +50,7 @@ class WorkflowMain { } } + {% if igenomes -%} // // Get attribute from genome config file e.g. fasta // @@ -61,4 +62,4 @@ class WorkflowMain { } return null } -} +{% endif -%}} \ No newline at end of file diff --git a/nf_core/pipeline-template/main.nf b/nf_core/pipeline-template/main.nf index f9663c9e69..6a5e172d67 100644 --- a/nf_core/pipeline-template/main.nf +++ b/nf_core/pipeline-template/main.nf @@ -4,7 +4,7 @@ {{ name }} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Github : https://github.com/{{ name }} -{% if branded -%} +{%- if branded %} Website: https://nf-co.re/{{ short_name }} Slack : https://nfcore.slack.com/channels/{{ short_name }} {%- endif %} @@ -12,7 +12,7 @@ */ nextflow.enable.dsl = 2 - +{% if igenomes %} /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GENOME PARAMETER VALUES @@ -20,7 +20,7 @@ nextflow.enable.dsl = 2 */ params.fasta = WorkflowMain.getGenomeAttribute(params, 'fasta') - +{% endif %} /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ VALIDATE & PRINT PARAMETER SUMMARY @@ -78,4 +78,4 @@ workflow { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ +*/ \ No newline at end of file diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index b9ce568f46..f8f1333bde 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -18,6 +18,8 @@ params { genome = null igenomes_base = 's3://ngi-igenomes/igenomes' igenomes_ignore = false + {% else %} + fasta = null {% endif %} // MultiQC options From 9d643c2913f366fd0a0b620be1baa37dd3813055 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 21 Jun 2023 12:35:31 +0100 Subject: [PATCH 5/8] Fix spacing with jinja --- nf_core/pipeline-template/lib/WorkflowMain.groovy | 5 +++-- nf_core/pipeline-template/nextflow.config | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nf_core/pipeline-template/lib/WorkflowMain.groovy b/nf_core/pipeline-template/lib/WorkflowMain.groovy index ec08066279..5bd48e2c6d 100755 --- a/nf_core/pipeline-template/lib/WorkflowMain.groovy +++ b/nf_core/pipeline-template/lib/WorkflowMain.groovy @@ -50,7 +50,7 @@ class WorkflowMain { } } - {% if igenomes -%} + {%- if igenomes %} // // Get attribute from genome config file e.g. fasta // @@ -62,4 +62,5 @@ class WorkflowMain { } return null } -{% endif -%}} \ No newline at end of file + {%- endif %} +} \ No newline at end of file diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index f8f1333bde..91dac47a86 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -13,14 +13,14 @@ params { // Input options input = null - {%- if igenomes %} + {% if igenomes %} // References genome = null igenomes_base = 's3://ngi-igenomes/igenomes' igenomes_ignore = false {% else %} fasta = null - {% endif %} + {% endif -%} // MultiQC options multiqc_config = null From b68a67c2998b0e2844e7673588835f8d0dc29b69 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 21 Jun 2023 12:37:22 +0100 Subject: [PATCH 6/8] Fix spacing with jinja --- nf_core/pipeline-template/nextflow.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 91dac47a86..a1ca2e6157 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -13,14 +13,14 @@ params { // Input options input = null - {% if igenomes %} + {%- if igenomes %} // References genome = null igenomes_base = 's3://ngi-igenomes/igenomes' igenomes_ignore = false {% else %} fasta = null - {% endif -%} + {%- endif %} // MultiQC options multiqc_config = null From e7bc80c8196004339c8cbe0bdde665e2b7dc26fb Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 21 Jun 2023 12:40:42 +0100 Subject: [PATCH 7/8] Fix ECLint --- nf_core/pipeline-template/lib/WorkflowMain.groovy | 2 +- nf_core/pipeline-template/main.nf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/pipeline-template/lib/WorkflowMain.groovy b/nf_core/pipeline-template/lib/WorkflowMain.groovy index 5bd48e2c6d..5824dae2fb 100755 --- a/nf_core/pipeline-template/lib/WorkflowMain.groovy +++ b/nf_core/pipeline-template/lib/WorkflowMain.groovy @@ -63,4 +63,4 @@ class WorkflowMain { return null } {%- endif %} -} \ No newline at end of file +} diff --git a/nf_core/pipeline-template/main.nf b/nf_core/pipeline-template/main.nf index 6a5e172d67..73984cb8fc 100644 --- a/nf_core/pipeline-template/main.nf +++ b/nf_core/pipeline-template/main.nf @@ -78,4 +78,4 @@ workflow { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THE END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ \ No newline at end of file +*/ From fc240f5cfd95b7f79b055ab995154144c2c98a42 Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Wed, 21 Jun 2023 12:41:34 +0100 Subject: [PATCH 8/8] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0a726768a..62c5dd5765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -269,6 +269,7 @@ Another big release with lots of new features and bug fixes. Thanks to all contr - Convert `console` snippets to `bash` snippets in the template where applicable ([#1729](https://github.com/nf-core/tools/pull/1729)) - Add `branch` field to module entries in `modules.json` to record what branch a module was installed from ([#1728](https://github.com/nf-core/tools/issues/1728)) - Add customisation option to remove all GitHub support with `nf-core create` ([#1766](https://github.com/nf-core/tools/pull/1766)) +- Incorrect config parameter warnings when customising pipeline template ([#2333](https://github.com/nf-core/tools/pull/2333)) ### Linting