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` 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 36b1860..a594093 100644 --- a/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_seqinspector_pipeline/main.nf @@ -275,3 +275,34 @@ def methodsDescriptionText(mqc_methods_yaml) { return description_html.toString() } +// +// Generate report index for MultiQC +// +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" + + // Group report paths + tags + .each { tag -> + index_section += " Group report: ${tag}\n" + } + + def yaml_file_text = "id: '${workflow.manifest.name.replace('/', '-')}-index'\n" as String + 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 += "
Select a report to view (open in a new tab):
\n" + yaml_file_text += "