Skip to content

Commit

Permalink
Merge pull request #57 from grst/multiqc
Browse files Browse the repository at this point in the history
Add MultiQC report
  • Loading branch information
fasterius authored Jul 3, 2023
2 parents 7348125 + 08fda75 commit 275c895
Show file tree
Hide file tree
Showing 19 changed files with 401 additions and 79 deletions.
9 changes: 9 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ process {
]
}

// store sample-specifc results in the per-sample subfolder
withName: FASTQC {
publishDir = [
path: { "${params.outdir}/${meta.id}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: SPACERANGER_COUNT {
publishDir = [
// NOTE: the sample name is already excluded in the path that's getting published.
Expand Down
47 changes: 47 additions & 0 deletions lib/WorkflowSpatialtranscriptomics.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// This file holds several functions specific to the workflow/spatialtranscriptomics.nf in the nf-core/spatialtranscriptomics pipeline
//

import nextflow.Nextflow
import groovy.text.SimpleTemplateEngine

class WorkflowSpatialtranscriptomics {

//
Expand All @@ -14,4 +17,48 @@ class WorkflowSpatialtranscriptomics {
// }
}

//
// Get workflow summary for MultiQC
//
public static String paramsSummaryMultiqc(workflow, summary) {
String summary_section = ''
for (group in summary.keySet()) {
def group_params = summary.get(group) // This gets the parameters of that particular group
if (group_params) {
summary_section += " <p style=\"font-size:110%\"><b>$group</b></p>\n"
summary_section += " <dl class=\"dl-horizontal\">\n"
for (param in group_params.keySet()) {
summary_section += " <dt>$param</dt><dd><samp>${group_params.get(param) ?: '<span style=\"color:#999999;\">N/A</a>'}</samp></dd>\n"
}
summary_section += " </dl>\n"
}
}

String yaml_file_text = "id: '${workflow.manifest.name.replace('/','-')}-summary'\n"
yaml_file_text += "description: ' - this information is collected when the pipeline is started.'\n"
yaml_file_text += "section_name: '${workflow.manifest.name} Workflow Summary'\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 += "${summary_section}"
return yaml_file_text
}

public static String methodsDescriptionText(run_workflow, mqc_methods_yaml) {
// Convert to a named map so can be used as with familar NXF ${workflow} variable syntax in the MultiQC YML file
def meta = [:]
meta.workflow = run_workflow.toMap()
meta["manifest_map"] = run_workflow.manifest.toMap()

meta["doi_text"] = meta.manifest_map.doi ? "(doi: <a href=\'https://doi.org/${meta.manifest_map.doi}\'>${meta.manifest_map.doi}</a>)" : ""
meta["nodoi_text"] = meta.manifest_map.doi ? "": "<li>If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used. </li>"

def methods_text = mqc_methods_yaml.text

def engine = new SimpleTemplateEngine()
def description_html = engine.createTemplate(methods_text).make(meta)

return description_html
}

}
13 changes: 11 additions & 2 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@
"custom/dumpsoftwareversions": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"],
"patch": "modules/nf-core/custom/dumpsoftwareversions/custom-dumpsoftwareversions.diff"
"installed_by": ["modules"]
},
"fastqc": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"multiqc": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"spaceranger/count": {
"branch": "master",
Expand Down

This file was deleted.

5 changes: 3 additions & 2 deletions modules/nf-core/custom/dumpsoftwareversions/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions modules/nf-core/custom/dumpsoftwareversions/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions modules/nf-core/fastqc/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions modules/nf-core/fastqc/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions modules/nf-core/multiqc/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 275c895

Please sign in to comment.