Skip to content

Commit 4682fcd

Browse files
refactor(versions): simplify softwareVersionsToYAML using named params
Use the named parameter API (softwareVersions: + nextflowVersion:) from nf-core-utils plugin instead of manually constructing workflow version YAML and mixing it into the channel. Co-authored-by: maxulysse <maxulysse@users.noreply.github.com>
1 parent 8a6d1de commit 4682fcd

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

workflows/nf_aggregate/main.nf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ workflow NF_AGGREGATE {
109109
//
110110
// Collate software versions
111111
//
112-
ch_workflow_versions = Channel.of(
113-
"Workflow:\n Nextflow: ${workflow.nextflow.version}\n ${workflow.manifest.name}: ${workflow.manifest.version}".toString()
114-
).collectFile(name: 'workflow_versions.yml', newLine: true)
115-
ch_versions = ch_versions.mix(ch_workflow_versions)
116-
117-
softwareVersionsToYAML(ch_versions.unique())
118-
.collectFile(storeDir: "${params.outdir}/pipeline_info", name: 'collated_software_versions.yml', newLine: true)
112+
softwareVersionsToYAML(
113+
softwareVersions: ch_versions.unique(),
114+
nextflowVersion: workflow.nextflow.version,
115+
).collectFile(
116+
storeDir: "${params.outdir}/pipeline_info",
117+
name: 'collated_software_versions.yml',
118+
sort: true,
119+
newLine: true,
120+
)
119121

120122
emit:
121123
versions = ch_versions

0 commit comments

Comments
 (0)