From b63087e4bf960a032b67b0a9d382f69a451c4f3f Mon Sep 17 00:00:00 2001 From: maxulysse Date: Thu, 2 May 2024 11:52:44 +0200 Subject: [PATCH 1/4] fix(template): fix handling of multiple DOIs in manifest --- .../local/utils_nfcore_pipeline_pipeline/main.nf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf index e02a113755..07cbb0bc56 100644 --- a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf +++ b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf @@ -243,8 +243,14 @@ def methodsDescriptionText(mqc_methods_yaml) { meta["manifest_map"] = workflow.manifest.toMap() // Pipeline DOI - meta["doi_text"] = meta.manifest_map.doi ? "(doi: ${meta.manifest_map.doi})" : "" - meta["nodoi_text"] = meta.manifest_map.doi ? "": "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " + if (meta.manifest_map.doi) { + def temp_doi_ref = "" + String[] manifest_doi = meta.manifest_map.doi.split(",") + for (String doi_ref: manifest_doi) temp_doi_ref += "(doi: ${doi_ref}), " + meta["doi_text"] = temp_doi_ref.substring(0, temp_doi_ref.length()-2) + } else { + meta["nodoi_text"] = "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " + } // Tool references meta["tool_citations"] = "" From 13e5170296524e03f7b21543841b29848fc1e600 Mon Sep 17 00:00:00 2001 From: Maxime U Garcia Date: Thu, 2 May 2024 12:04:46 +0200 Subject: [PATCH 2/4] Update nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf --- .../local/utils_nfcore_pipeline_pipeline/main.nf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf index 07cbb0bc56..479900d5a9 100644 --- a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf +++ b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf @@ -248,9 +248,8 @@ def methodsDescriptionText(mqc_methods_yaml) { String[] manifest_doi = meta.manifest_map.doi.split(",") for (String doi_ref: manifest_doi) temp_doi_ref += "(doi: ${doi_ref}), " meta["doi_text"] = temp_doi_ref.substring(0, temp_doi_ref.length()-2) - } else { - meta["nodoi_text"] = "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " - } + } else meta["doi_text"] = "" + meta["nodoi_text"] = meta.manifest_map.doi ? "" : "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " // Tool references meta["tool_citations"] = "" From f382f980a1be496e96726a8293ae9c031247f925 Mon Sep 17 00:00:00 2001 From: maxulysse Date: Thu, 2 May 2024 18:23:42 +0200 Subject: [PATCH 3/4] handles doi.org resolver + comments --- .../local/utils_nfcore_pipeline_pipeline/main.nf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf index 479900d5a9..a4bfb9f8be 100644 --- a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf +++ b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf @@ -244,10 +244,13 @@ def methodsDescriptionText(mqc_methods_yaml) { // Pipeline DOI if (meta.manifest_map.doi) { + // Using a loop to handle multiple DOIs + // Removing `https://doi.org/` to handle pipelines using DOIs vs DOI resolvers + // Removing ` ` since the manifest.doi is a string and not a proper list def temp_doi_ref = "" - String[] manifest_doi = meta.manifest_map.doi.split(",") - for (String doi_ref: manifest_doi) temp_doi_ref += "(doi: ${doi_ref}), " - meta["doi_text"] = temp_doi_ref.substring(0, temp_doi_ref.length()-2) + String[] manifest_doi = meta.manifest_map.doi.tokenize(",") + for (String doi_ref: manifest_doi) temp_doi_ref += "(doi: ${doi_ref.replace("https://doi.org/", "").replace(" ", "")}), " + meta["doi_text"] = temp_doi_ref.substring(0, temp_doi_ref.length() - 2) } else meta["doi_text"] = "" meta["nodoi_text"] = meta.manifest_map.doi ? "" : "
  • If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used.
  • " From fa0b60d642b964d7a32249d0838f6d39a0b8d9af Mon Sep 17 00:00:00 2001 From: maxulysse Date: Thu, 2 May 2024 18:24:41 +0200 Subject: [PATCH 4/4] update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0cca60b0d..d2a2bcf042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Remove `pyproject.toml` from template root - Shorten lines in pipeline template ([#2908](https://github.com/nf-core/tools/pull/2908)) - Permanently activated pipeline-specific institutional configs support for all pipelines without need for manual intervention ([#2936](https://github.com/nf-core/tools/pull/2936)) +- Handles multiple DOIs + doi.org resolver from manifest.doi ([#2946](https://github.com/nf-core/tools/pull/2946)) ### Linting