From 86a9b65daed94aa4dd22cffcbfed4998c8284f3f Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Wed, 9 Oct 2024 10:51:43 +0200 Subject: [PATCH 1/3] fix more jinja newlines --- CHANGELOG.md | 2 +- .../pipeline-template/.github/CONTRIBUTING.md | 4 +-- nf_core/pipeline-template/.prettierignore | 2 +- nf_core/pipeline-template/nextflow.config | 33 ++++++++++--------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 969f54636..bee878636 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - Fixed an issue where the linting CI action didn't read the correct file ([#3202](https://github.com/nf-core/tools/pull/3202)) - Fixed condition for `awsfulltest` to run ([#3203](https://github.com/nf-core/tools/pull/3203)) -- Fix too many empty lines added to .editorconfig file ([#3204](https://github.com/nf-core/tools/pull/3204)) +- Fix too many empty lines added by jinja ([#3204](https://github.com/nf-core/tools/pull/3204) and [#3205](https://github.com/nf-core/tools/pull/3205)) - Fix header blocks in local subworkflow including git merge marker-like strings ([#3201](https://github.com/nf-core/tools/pull/3201)) ## [v3.0.0 - Titanium Tapir](https://github.com/nf-core/tools/releases/tag/3.0.0) - [2024-10-08] diff --git a/nf_core/pipeline-template/.github/CONTRIBUTING.md b/nf_core/pipeline-template/.github/CONTRIBUTING.md index d02cad6f1..0200ea26c 100644 --- a/nf_core/pipeline-template/.github/CONTRIBUTING.md +++ b/nf_core/pipeline-template/.github/CONTRIBUTING.md @@ -30,7 +30,7 @@ If you're not used to this workflow with git, you can start with some [docs from ## Tests -{%- if test_config %} +{% if test_config -%} You have the option to test your changes locally by running the pipeline. For receiving warnings about process selectors and other `debug` information, it is recommended to use the debug profile. Execute all the tests with the following command: ```bash @@ -139,4 +139,4 @@ To get started: Devcontainer specs: - [DevContainer config](.devcontainer/devcontainer.json) - {% endif %} + {%- endif %} diff --git a/nf_core/pipeline-template/.prettierignore b/nf_core/pipeline-template/.prettierignore index c8e8ad9e1..7ecc9b61c 100644 --- a/nf_core/pipeline-template/.prettierignore +++ b/nf_core/pipeline-template/.prettierignore @@ -1,4 +1,4 @@ -{%- if email %} +{% if email -%} email_template.html {%- endif %} {%- if adaptivecard %} diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 4c816a2a2..f2bcda097 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 {%- endif %} - {%- if multiqc %} + {% if multiqc -%} // MultiQC options multiqc_config = null multiqc_title = null @@ -45,7 +45,7 @@ params { version = false {% if test_config %}pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/'{% endif %} - {%- if nf_core_configs %} + {% if nf_core_configs -%} // Config options config_profile_name = null config_profile_description = null @@ -56,15 +56,17 @@ params { config_profile_url = null {%- endif %} - {%- if nf_schema %} + {% if nf_schema -%} // Schema validation default options validate_params = true - {% endif %} + {%- endif %} } -{% if modules %} + +{% if modules -%} // Load base.config by default for all pipelines includeConfig 'conf/base.config' {%- else %} + process { // TODO nf-core: Check the defaults for all processes cpus = { 1 * task.attempt } @@ -75,7 +77,7 @@ process { maxRetries = 1 maxErrors = '-1' } -{% endif %} +{%- endif %} profiles { debug { @@ -171,14 +173,14 @@ profiles { wave.freeze = true wave.strategy = 'conda,container' } - {%- if gitpod %} + {% if gitpod -%} gitpod { executor.name = 'local' executor.cpus = 4 executor.memory = 8.GB } {%- endif %} - {%- if test_config %} + {% if test_config -%} test { includeConfig 'conf/test.config' } test_full { includeConfig 'conf/test_full.config' } {%- endif %} @@ -191,7 +193,7 @@ includeConfig !System.getenv('NXF_OFFLINE') && params.custom_config_base ? "${pa // Load {{ name }} custom profiles from different institutions. // TODO nf-core: Optionally, you can add a pipeline-specific nf-core config at https://github.com/nf-core/configs // includeConfig !System.getenv('NXF_OFFLINE') && params.custom_config_base ? "${params.custom_config_base}/pipeline/{{ short_name }}.config" : "/dev/null" -{% endif -%} +{%- endif %} // Set default registry for Apptainer, Docker, Podman, Charliecloud and Singularity independent of -profile // Will not be used unless Apptainer / Docker / Podman / Charliecloud / Singularity are enabled @@ -205,7 +207,7 @@ charliecloud.registry = 'quay.io' {% if igenomes -%} // Load igenomes.config if required includeConfig !params.igenomes_ignore ? 'conf/igenomes.config' : 'conf/igenomes_ignored.config' -{% 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. @@ -273,7 +275,7 @@ validation { command = "nextflow run $manifest.name -profile --input samplesheet.csv --outdir " fullParameter = "help_full" showHiddenParameter = "show_hidden" - {%- if is_nfcore %} + {% if is_nfcore -%} beforeText = """ -\033[2m----------------------------------------------------\033[0m- \033[0;32m,--.\033[0;30m/\033[0;32m,-.\033[0m @@ -297,8 +299,9 @@ validation { afterText = validation.help.afterText }{% endif %} } -{% endif -%} -{%- if modules %} +{%- endif %} + +{% if modules -%} // Load modules.config for DSL2 module specific options includeConfig 'conf/modules.config' -{% endif %} +{%- endif %} From 011354948ba0180f0af1b4d7920c19d5aa0f042b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Mir=20Pedrol?= Date: Wed, 9 Oct 2024 10:53:20 +0200 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bee878636..dfe97f4fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - Fixed an issue where the linting CI action didn't read the correct file ([#3202](https://github.com/nf-core/tools/pull/3202)) - Fixed condition for `awsfulltest` to run ([#3203](https://github.com/nf-core/tools/pull/3203)) -- Fix too many empty lines added by jinja ([#3204](https://github.com/nf-core/tools/pull/3204) and [#3205](https://github.com/nf-core/tools/pull/3205)) +- Fix too many empty lines added by jinja ([#3204](https://github.com/nf-core/tools/pull/3204) and [#3206](https://github.com/nf-core/tools/pull/3206)) - Fix header blocks in local subworkflow including git merge marker-like strings ([#3201](https://github.com/nf-core/tools/pull/3201)) ## [v3.0.0 - Titanium Tapir](https://github.com/nf-core/tools/releases/tag/3.0.0) - [2024-10-08] From 1ce2250d95f1eb68c893fcebab7c087beede4378 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Wed, 9 Oct 2024 11:08:58 +0200 Subject: [PATCH 3/3] fix jinja newlines in output.md --- nf_core/pipeline-template/docs/output.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/nf_core/pipeline-template/docs/output.md b/nf_core/pipeline-template/docs/output.md index 083c46ecd..1becf24b6 100644 --- a/nf_core/pipeline-template/docs/output.md +++ b/nf_core/pipeline-template/docs/output.md @@ -12,12 +12,16 @@ The directories listed below will be created in the results directory after the The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes data using the following steps: -{% if fastqc %}- [FastQC](#fastqc) - Raw read QC{% endif %} -{% if multiqc %}- [MultiQC](#multiqc) - Aggregate report describing results and QC from the whole pipeline{% endif %} +{% if fastqc -%} +- [FastQC](#fastqc) - Raw read QC + {%- endif %} + {%- if multiqc %} +- [MultiQC](#multiqc) - Aggregate report describing results and QC from the whole pipeline + {%- endif %} - [Pipeline information](#pipeline-information) - Report metrics generated during the workflow execution -{%- if fastqc %} +{% if fastqc -%} ### FastQC @@ -32,7 +36,8 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d [FastQC](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/) gives general quality metrics about your sequenced reads. It provides information about the quality score distribution across your reads, per base sequence content (%A/T/G/C), adapter contamination and overrepresented sequences. For further reading and documentation see the [FastQC help pages](http://www.bioinformatics.babraham.ac.uk/projects/fastqc/Help/). {%- endif %} -{%- if multiqc %} + +{% if multiqc -%} ### MultiQC @@ -49,7 +54,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d [MultiQC](http://multiqc.info) is a visualization tool that generates a single HTML report summarising all samples in your project. Most of the pipeline QC results are visualised in the report and further statistics are available in the report data directory. Results generated by MultiQC collate pipeline QC from supported tools e.g. FastQC. The pipeline has special steps which also allow the software versions to be reported in the MultiQC output for future traceability. For more information about how to use MultiQC reports, see . -{% endif %} +{%- endif %} ### Pipeline information