Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to template module that records selected pipeline parameters. #747

Closed
jfy133 opened this issue Oct 22, 2020 · 3 comments
Closed

Add to template module that records selected pipeline parameters. #747

jfy133 opened this issue Oct 22, 2020 · 3 comments
Assignees
Labels
high-priority template nf-core pipeline/component template
Milestone

Comments

@jfy133
Copy link
Member

jfy133 commented Oct 22, 2020

Suggestion

Generate a params.json file containing all selected parameters for a given run, and display this at the end of MultiQC report alongside software_versions.

Use Case/Rationale

Inspired by the tower.nf 'configuration' display, provides a 'hard' copy of the exact parameters used in a given run in the MultiQC report (which would be acommon calling-point for post-run validation).

e.g. could be useful if presenting a MultiQC report in a meeting, and a collegue asks what parameter you used for XYZ - if you can't remember exactly - you can then can scroll down to the bottom of the report to see).

Possible Implmentation

Can exploit: nextflow-io/nextflow#1682 (comment)

i.e.

log.info("workflow params")
log.info("${params}")

to be parsed into a custom MultiQC params.json or TSV file, that is also added to the MultiQC config.

Notes from @ewels:

(same as how we do it with the launch tool)
But fine to put in MultiQC if it’s a table that becomes scrollable automatically when long I guess or something

@jfy133 jfy133 self-assigned this Oct 22, 2020
@jfy133 jfy133 changed the title Add to template module that generates a params.json for display in MultiQC report Add to template module that generates a params.json of selected pipeline parameters for display in MultiQC report Oct 22, 2020
@jfy133 jfy133 added the template nf-core pipeline/component template label Oct 22, 2020
@jfy133 jfy133 changed the title Add to template module that generates a params.json of selected pipeline parameters for display in MultiQC report Add to template module that records selected pipeline parameters. Oct 22, 2020
@jfy133
Copy link
Member Author

jfy133 commented Oct 22, 2020

Originally idea was to display in MultiQC, but might be worth keeping this optional.

However, could still export a JSON/TSV file with the parameters to pipeline_results/, and leave it up to pipeline devs to export this for display in MultiQC

@jfy133
Copy link
Member Author

jfy133 commented Dec 18, 2021

nf-core/modules#1161

@ewels
Copy link
Member

ewels commented Sep 15, 2023

Suggested simple implementation for the @nf-core template by @bentsherman here:

Well, we could simplify @stevekm 's example to a regular Groovy function, or use the workflow complete handler:

import groovy.json.JsonOutput

workflow.onComplete {
    jsonStr = JsonOutput.toJson(params)
    file("${params.outdir}/params.json").text = JsonOutput.prettyPrint(jsonStr)
}

Originally posted by @bentsherman in nextflow-io/nextflow#1515 (comment)

Suggest we put this into the template for all nf-core pipelines, as a default output for the pipeline_info directory.

'cc @JoseEspinosa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high-priority template nf-core pipeline/component template
Projects
None yet
Development

No branches or pull requests

4 participants