Skip to content

Commit

Permalink
Fix validation issues
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
  • Loading branch information
bentsherman committed Jan 17, 2025
1 parent 9a4ff8a commit 85c089e
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions plugins/nf-prov/src/main/nextflow/prov/WrrocRenderer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,9 @@ class WrrocRenderer implements Renderer {
}

// -- main script
final mainScriptId = metadata.scriptFile.name
metadata.scriptFile.copyTo(crateDir)

datasetParts.add([
"@id" : "main.nf",
"@type" : "File",
"name" : "Main script",
"description" : "The main script of the workflow.",
"encodingFormat": "application/nextflow"
])

// -- parameter schema
final schemaPath = scriptFile.getParent().resolve("nextflow_schema.json")
Map<String,Map> paramSchema = [:]
Expand Down Expand Up @@ -173,6 +166,9 @@ class WrrocRenderer implements Renderer {
? getEncodingFormat(value as Path)
: null

if( !type )
log.warn "Could not determine type of parameter `${name}` for Workflow Run RO-crate"

return withoutNulls([
"@id" : getFormalParameterId(metadata.projectName, name),
"@type" : "FormalParameter",
Expand Down Expand Up @@ -422,16 +418,16 @@ class WrrocRenderer implements Renderer {
"name" : "Workflow run of " + manifest.name ?: metadata.projectName,
"description": manifest.description ?: null,
"hasPart" : withoutNulls([
["@id": metadata.projectName],
["@id": mainScriptId],
*asReferences(datasetParts),
*asReferences(inputFiles),
*asReferences(taskOutputs),
*asReferences(outputFiles)
]),
"mainEntity" : ["@id": metadata.projectName],
"mainEntity" : ["@id": mainScriptId],
"mentions" : [
["@id": "#${session.uniqueId}"],
*asReferences(taskCreateActions),
*asReferences(taskOutputs),
*asReferences(publishCreateActions),
],
"license" : manifest.license
Expand Down Expand Up @@ -461,7 +457,7 @@ class WrrocRenderer implements Renderer {
"version": "1.0"
],
withoutNulls([
"@id" : metadata.projectName,
"@id" : mainScriptId,
"@type" : ["File", "SoftwareSourceCode", "ComputationalWorkflow", "HowTo"],
"conformsTo" : ["@id": "https://bioschemas.org/profiles/ComputationalWorkflow/1.0-RELEASE"],
"name" : manifest.name ?: metadata.projectName,
Expand All @@ -471,7 +467,7 @@ class WrrocRenderer implements Renderer {
"codeRepository" : metadata.repository,
"version" : metadata.commitId,
"license" : manifest.license,
"url" : normalizePath(metadata.scriptFile),
"url" : metadata.repository ? normalizePath(metadata.scriptFile) : null,
"encodingFormat" : "application/nextflow",
"runtimePlatform" : "Nextflow " + nextflowVersion,
"hasPart" : asReferences(moduleSoftwareApplications),
Expand Down Expand Up @@ -516,7 +512,7 @@ class WrrocRenderer implements Renderer {
"name" : "Nextflow workflow run ${session.uniqueId}",
"startTime" : dateStarted,
"endTime" : dateCompleted,
"instrument": ["@id": metadata.projectName],
"instrument": ["@id": mainScriptId],
"object" : [
*asReferences(propertyValues),
*asReferences(inputFiles),
Expand Down

0 comments on commit 85c089e

Please sign in to comment.