Merge branch 'add-params-table' into 'dev'

Add params table in report and process

See merge request epi2melabs/workflow-containers/wf-template!20
This commit is contained in:
Thomas Rich 2021-08-19 14:48:39 +00:00
commit 62425e1d89
2 changed files with 23 additions and 2 deletions

View File

@ -16,6 +16,9 @@ def main():
parser.add_argument(
"--versions", required=True,
help="directory containing CSVs containing name,version.")
parser.add_argument(
"--params", default=None, required=True,
help="A JSON file containing the workflow parameter key/values")
parser.add_argument(
"--revision", default='unknown',
help="git branch/tag of the executed workflow")
@ -32,6 +35,8 @@ def main():
section=fastcat.full_report(args.summaries))
report.add_section(
section=scomponents.version_table(args.versions))
report.add_section(
section=scomponents.params_table(args.params))
# write report
report.write(args.report)

20
main.nf
View File

@ -10,6 +10,7 @@
// iii) a second concreate, but anonymous, workflow scope to be used
// as an entry point when using this workflow in isolation.
import groovy.json.JsonBuilder
nextflow.enable.dsl = 2
include { fastq_ingress } from './lib/fastqingress'
@ -58,15 +59,29 @@ process getVersions {
"""
}
process getParams {
label "pysam"
cpus 1
output:
path "params.json"
script:
def paramsJSON = new JsonBuilder(params).toPrettyString()
"""
# Output nextflow params object to JSON
echo '$paramsJSON' > params.json
"""
}
process makeReport {
label "pysam"
input:
path "seqs.txt"
path "versions/*"
path "params.json"
output:
path "wf-template-report.html"
"""
report.py wf-template-report.html --versions versions seqs.txt
report.py wf-template-report.html --versions versions seqs.txt --params params.json
"""
}
@ -95,7 +110,8 @@ workflow pipeline {
main:
summary = summariseReads(reads)
software_versions = getVersions()
report = makeReport(summary, software_versions.collect())
workflow_params = getParams()
report = makeReport(summary, software_versions.collect(), workflow_params)
emit:
summary.concat(report)
}