8000 Dump pipeline parameters into a json file by JoseEspinosa · Pull Request #2425 · nf-core/tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Dump pipeline parameters into a json file #2425

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

Merged
merged 3 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- ([#2415](https://github.com/nf-core/tools/pull/2415#issuecomment-1709847086)) Add autoMounts for apptainer.
- Remove `igenomes_base` from the schema, so that nf-validation doesn't create a file path and throw errors offline for s3 objects.
- Update Gitpod profile resources to reflect base environment settings.
- ([#747](https://github.com/nf-core/tools/issues/747)) Add to the template the code to dump the selected pipeline parameters into a json file.

### Download

Expand Down
1 change: 1 addition & 0 deletions nf_core/pipeline-template/docs/output.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Results generated by MultiQC collate pipeline QC from supported tools e.g. FastQ
- Reports generated by Nextflow: `execution_report.html`, `execution_timeline.html`, `execution_trace.txt` and `pipeline_dag.dot`/`pipeline_dag.svg`.
- Reports generated by the pipeline: `pipeline_report.html`, `pipeline_report.txt` and `software_versions.yml`. The `pipeline_report*` files will only be present if the `--email` / `--email_on_fail` parameter's are used when running the pipeline.
- Reformatted samplesheet files used as input to the pipeline: `samplesheet.valid.csv`.
- Parameters used by the pipeline run: `params.json`.

</details>

Expand Down
16 changes: 16 additions & 0 deletions nf_core/pipeline-template/lib/NfcoreTemplate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import org.ya 8000 ml.snakeyaml.Yaml
import groovy.json.JsonOutput

class NfcoreTemplate {

Expand Down Expand Up @@ -222,6 +223,21 @@ class NfcoreTemplate {
}
}

//
// Dump pipeline parameters in a json file
//
public static void dump_parameters(workflow, params) {
def output_d = new File("${params.outdir}/pipeline_info/")
if (!output_d.exists()) {
output_d.mkdirs()
}

def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
def output_pf = new File(output_d, "params_${timestamp}.json")
def jsonStr = JsonOutput.toJson(params)
output_pf.text = JsonOutput.prettyPrint(jsonStr)
}

//
// Print pipeline summary on completion
//
Expand Down
1 change: 1 addition & 0 deletions nf_core/pipeline-template/workflows/pipeline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ workflow.onComplete {
if (params.email || params.email_on_fail) {
NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report)
}
NfcoreTemplate.dump_parameters(workflow, params)
NfcoreTemplate.summary(workflow, params, log)
if (params.hook_url) {
NfcoreTemplate.IM_notification(workflow, params, summary_params, projectDir, log)
Expand Down
0