Skip to content
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to the nf-prov plugin will be documented here.

See [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [dev]

- Add `recordCommandLine` option for BCO and WRROC formats

## [1.7.0] - 2026-01-05

- Add GEXF renderer (#57)
Expand Down
14 changes: 14 additions & 0 deletions src/main/groovy/nextflow/prov/ProvConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,16 @@ class ProvBcoConfig implements ConfigScope {
''')
final boolean overwrite

@ConfigOption
@Description('''
When `true` records the execution command-line in the usability domain (default: `false`).
''')
final boolean recordCommandLine

ProvBcoConfig(Map opts) {
file = opts.file
overwrite = opts.overwrite as boolean
recordCommandLine = opts.recordCommandLine as boolean
}
}

Expand Down Expand Up @@ -180,9 +187,16 @@ class ProvWrrocConfig implements ConfigScope {
''')
final String license

@ConfigOption
@Description('''
When `true` records the execution command-line in the action description (default: `false`).
''')
final boolean recordCommandLine

ProvWrrocConfig(Map opts) {
file = opts.file
overwrite = opts.overwrite as boolean
license = opts.license
recordCommandLine = opts.recordCommandLine as boolean
}
}
7 changes: 7 additions & 0 deletions src/main/groovy/nextflow/prov/renderers/BcoRenderer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ class BcoRenderer implements Renderer {

private boolean overwrite

private boolean recordCommandLine

@Delegate
private PathNormalizer normalizer

BcoRenderer(ProvBcoConfig config) {
path = (config.file as Path).complete()
overwrite = config.overwrite
recordCommandLine = config.recordCommandLine

ProvHelper.checkFileOverwrite(path, overwrite)
}
Expand Down Expand Up @@ -85,6 +88,10 @@ class BcoRenderer implements Renderer {
final external_data_endpoints = config.navigate('prov.formats.bco.execution_domain.external_data_endpoints', []) as List<Map<String,String>>
final environment_variables = config.navigate('prov.formats.bco.execution_domain.environment_variables', []) as List<String>

if( recordCommandLine && metadata.commandLine ) {
usability.add(0, "Command-line: " + metadata.commandLine)
}

// create BCO manifest
final bco = [
"object_id": null,
Expand Down
8 changes: 6 additions & 2 deletions src/main/groovy/nextflow/prov/renderers/WrrocRenderer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class WrrocRenderer implements Renderer {

private boolean overwrite

private boolean recordCommandLine

@Delegate
private PathNormalizer normalizer

Expand All @@ -66,6 +68,7 @@ class WrrocRenderer implements Renderer {
WrrocRenderer(ProvWrrocConfig config) {
path = (config.file as Path).complete()
overwrite = config.overwrite
recordCommandLine = config.recordCommandLine

ProvHelper.checkFileOverwrite(path, overwrite)
}
Expand Down Expand Up @@ -617,11 +620,12 @@ class WrrocRenderer implements Renderer {
"startTime" : dateStarted,
"endTime" : dateCompleted
],
[
withoutNulls([
"@id" : "#${session.uniqueId}",
"@type" : "CreateAction",
"agent" : agent ? ["@id": agent["@id"]] : null,
"name" : "Nextflow workflow run ${session.uniqueId}",
"description": recordCommandLine && metadata.commandLine ? "Command-line: " + metadata.commandLine : null,
"startTime" : dateStarted,
"endTime" : dateCompleted,
"instrument": ["@id": mainScriptId],
Expand All @@ -630,7 +634,7 @@ class WrrocRenderer implements Renderer {
*asReferences(inputFiles),
],
"result" : asReferences(outputFiles)
],
]),
agent,
organization,
*contactPoints,
Expand Down