From efaf64489cb8cdda034bd1c15f3f38bf4eb4adbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pontus=20H=C3=B6jer?= Date: Tue, 21 Oct 2025 10:33:13 +0200 Subject: [PATCH 1/4] add index to other reports multiqc reports --- .../main.nf | 25 +++++++++++++++++++ workflows/seqinspector.nf | 21 ++++++++++++---- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf b/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf index 708d73f..1188e5e 100644 --- a/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf @@ -286,3 +286,28 @@ def methodsDescriptionText(mqc_methods_yaml) { return description_html.toString() } +// +// Generate report index for MultiQC +// +def reportIndexMultiqc(tags, global=true) { + def relative_path = global ? ".." : "../.." + + // Global report path + def index_section = "
  • Global
  • \n" + + // Group report paths + tags + .each { tag -> + index_section += "
  • ${tag}
  • \n" + } + + def yaml_file_text = "id: '${workflow.manifest.name.replace('/', '-')}-index'\n" as String + yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n" + yaml_file_text += "section_name: '${workflow.manifest.name} MultiQC Reports Index'\n" + yaml_file_text += "section_href: 'https://github.com/${workflow.manifest.name}'\n" + yaml_file_text += "plot_type: 'html'\n" + yaml_file_text += "data: |\n" + yaml_file_text += "${index_section}" + + return yaml_file_text +} diff --git a/workflows/seqinspector.nf b/workflows/seqinspector.nf index 22d37c3..ab3a742 100644 --- a/workflows/seqinspector.nf +++ b/workflows/seqinspector.nf @@ -18,6 +18,7 @@ include { paramsSummaryMap } from 'plugin/nf-schema' include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline' include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pipeline' include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_seqinspector_pipeline' +include { reportIndexMultiqc } from '../subworkflows/local/utils_nfcore_seqinspector_pipeline' /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -121,6 +122,11 @@ workflow SEQINSPECTOR { // // MODULE: MultiQC // + ch_tags = ch_multiqc_files + .map { meta, sample -> meta.tags } + .flatten() + .unique() + ch_multiqc_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config, checkIfExists: true) : Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) @@ -147,6 +153,16 @@ workflow SEQINSPECTOR { sort: true ) ) + ch_multiqc_extra_files = ch_multiqc_extra_files.mix( + ch_tags.toList() + .map { tag_list -> + reportIndexMultiqc(tag_list) + } + .collectFile( + name: 'multiqc_index_mqc.yaml', + sort: true + ).view() + ) MULTIQC_GLOBAL ( ch_multiqc_files @@ -160,11 +176,6 @@ workflow SEQINSPECTOR { [] ) - ch_tags = ch_multiqc_files - .map { meta, sample -> meta.tags } - .flatten() - .unique() - multiqc_extra_files_per_tag = ch_tags .combine(ch_multiqc_extra_files) From 7dcd35266b2c79b2bf873cc3305019a5fe24942a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pontus=20H=C3=B6jer?= Date: Mon, 27 Oct 2025 12:03:06 +0100 Subject: [PATCH 2/4] add index to group reports --- assets/multiqc_config.yml | 4 +++- .../main.nf | 9 +++++--- workflows/seqinspector.nf | 22 ++++++++++++++----- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index e960d07..df9da74 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -3,9 +3,11 @@ report_comment: > analysis pipeline. For information about how to interpret these results, please see the documentation. report_section_order: + "nf-core-seqinspector-index": + order: -999 "nf-core-seqinspector-methods-description": order: -1000 - software_versions: + multiqc_software_versions: order: -1001 "nf-core-seqinspector-summary": order: -1002 diff --git a/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf b/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf index 1188e5e..23b842b 100644 --- a/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf @@ -293,21 +293,24 @@ def reportIndexMultiqc(tags, global=true) { def relative_path = global ? ".." : "../.." // Global report path - def index_section = "
  • Global
  • \n" + def index_section = "
  • Global report
  • \n" // Group report paths tags .each { tag -> - index_section += "
  • ${tag}
  • \n" + index_section += "
  • Group: ${tag}
  • \n" } def yaml_file_text = "id: '${workflow.manifest.name.replace('/', '-')}-index'\n" as String - yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n" + yaml_file_text += "description: 'MultiQC reports collected from running the pipeline.'\n" yaml_file_text += "section_name: '${workflow.manifest.name} MultiQC Reports Index'\n" yaml_file_text += "section_href: 'https://github.com/${workflow.manifest.name}'\n" yaml_file_text += "plot_type: 'html'\n" yaml_file_text += "data: |\n" + yaml_file_text += "

    Reports

    \n" + yaml_file_text += " \n" return yaml_file_text } diff --git a/workflows/seqinspector.nf b/workflows/seqinspector.nf index ab3a742..63c6e37 100644 --- a/workflows/seqinspector.nf +++ b/workflows/seqinspector.nf @@ -153,21 +153,22 @@ workflow SEQINSPECTOR { sort: true ) ) - ch_multiqc_extra_files = ch_multiqc_extra_files.mix( + // Add index to other MultiQC reports + //ch_multiqc_extra_files_global = Channel.empty() + ch_multiqc_extra_files_global = ch_multiqc_extra_files.mix( ch_tags.toList() .map { tag_list -> reportIndexMultiqc(tag_list) } .collectFile( name: 'multiqc_index_mqc.yaml', - sort: true - ).view() + ) ) MULTIQC_GLOBAL ( ch_multiqc_files .map { meta, file -> file } - .mix(ch_multiqc_extra_files) + .mix(ch_multiqc_extra_files_global) .collect(), ch_multiqc_config.toList(), [], @@ -176,8 +177,18 @@ workflow SEQINSPECTOR { [] ) + ch_multiqc_extra_files_tag = ch_multiqc_extra_files.mix( + ch_tags.toList() + .map { tag_list -> + reportIndexMultiqc(tag_list, false) + } + .collectFile( + name: 'multiqc_index_mqc.yaml', + ) + ) + multiqc_extra_files_per_tag = ch_tags - .combine(ch_multiqc_extra_files) + .combine(ch_multiqc_extra_files_tag) // Group samples by tag tagged_mqc_files = ch_tags @@ -205,6 +216,7 @@ workflow SEQINSPECTOR { samples_per_tag: samples.flatten() config: config } + MULTIQC_PER_TAG( tagged_mqc_files.samples_per_tag, From 0fd88d081abf379e675f79eaf1567351950a45be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pontus=20H=C3=B6jer?= Date: Mon, 27 Oct 2025 16:02:10 +0100 Subject: [PATCH 3/4] update styling and open links as new tab --- .../local/utils_nfcore_seqinspector_pipeline/main.nf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf b/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf index 23b842b..10bc2e3 100644 --- a/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf @@ -292,13 +292,15 @@ def methodsDescriptionText(mqc_methods_yaml) { def reportIndexMultiqc(tags, global=true) { def relative_path = global ? ".." : "../.." + def a_attrs = "target=\"_blank\" class=\"list-group-item list-group-item-action\"" + // Global report path - def index_section = "
  • Global report
  • \n" + def index_section = " Global report\n" // Group report paths tags .each { tag -> - index_section += "
  • Group: ${tag}
  • \n" + index_section += " Group report: ${tag}\n" } def yaml_file_text = "id: '${workflow.manifest.name.replace('/', '-')}-index'\n" as String @@ -308,9 +310,10 @@ def reportIndexMultiqc(tags, global=true) { yaml_file_text += "plot_type: 'html'\n" yaml_file_text += "data: |\n" yaml_file_text += "

    Reports

    \n" - yaml_file_text += "
      \n" + yaml_file_text += "

      Select a report to view (open in a new tab):

      \n" + yaml_file_text += "
      \n" yaml_file_text += "${index_section}" - yaml_file_text += "
    \n" + yaml_file_text += " \n" return yaml_file_text } From a1a30834a57b0d4bd8b6c347380b180f271c953b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pontus=20H=C3=B6jer?= Date: Mon, 27 Oct 2025 16:16:58 +0100 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc243f3..de9b088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Initial release of nf-core/seqinspector, created with the [nf-core](https://nf-c - [#96](https://github.com/nf-core/seqinspector/pull/96) Added missing citations to citation tool - [#103](https://github.com/nf-core/seqinspector/pull/103) Configure full-tests - [#110](https://github.com/nf-core/seqinspector/pull/110) Update input schema to accept either tar file or directory as rundir, and fastq messages and patterns. +- [#135](https://github.com/nf-core/seqinspector/pull/135) Added index section to MultiQC reports to facilitate report navigation (#125) ### `Fixed`