Skip to content

Commit

Permalink
pain
Browse files Browse the repository at this point in the history
  • Loading branch information
famosab committed Nov 7, 2024
1 parent becb3dd commit 38f4c64
Showing 1 changed file with 42 additions and 15 deletions.
57 changes: 42 additions & 15 deletions plugins/nf-prov/src/main/nextflow/prov/WrrocRenderer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -401,23 +401,41 @@ class WrrocRenderer implements Renderer {
]
}

final multipleTools = nextflowProcesses
final perToolName = nextflowProcesses
.collect() { process ->
def metaYaml = readMetaYaml(process)
def toolList = metaYaml.get('tools').collect() as List
return toolList
//def toolNameTask = extProperties.containsKey('name') ? extProperties.get('name') as String : metaYaml.get('name')
def toolList = metaYaml.get('tools').each { tool ->
//println tool.getClass()
def toolMap = tool as Map
toolMap.each { field ->
field.value.each {entry -> [//"softwareInfo": entry]
"object" : entry.collect(file -> ["@id": file])
]
// println(entry)
// println("-------")
}
}
// for (field in toolMap) {
// for (entry in field.value) {
// println(entry)
// println("-------")
// }
// }
// toolMap.each { field ->
// for (entry in field.value) {
// println(entry)
// println("-------")
// }
// }
}

}

final perTool = multipleTools.collect { toolList ->
//println(toolList)
toolList.get(0).collect().each { entry ->
println entry.flatten().getClass()
[
"@id" : entry.toString()
]

}
}
// final perToolName = perTool
// .collect() { field ->
// //println(field)
// }

final aboutSoftware = nextflowProcesses
.collect () { process ->
Expand Down Expand Up @@ -561,7 +579,7 @@ class WrrocRenderer implements Renderer {
],
*wfSofwareApplications,
//*aboutSoftware,
*perTool,
*perToolName,
*formalParameters,
[
"@id" : "#${softwareApplicationId}",
Expand Down Expand Up @@ -605,7 +623,8 @@ class WrrocRenderer implements Renderer {
configFile,
*uniqueInputOutputFiles,
*propertyValues,
license
license,
*perToolName
].findAll { it != null }
]

Expand Down Expand Up @@ -721,6 +740,14 @@ class WrrocRenderer implements Renderer {
String content = metaFile.text
Yaml yaml = new Yaml()
Map result = yaml.load(content) as Map
// result.get('tools').each { tool ->
// println tool.getClass()
// def toolMap = tool as Map
// for (field in toolMap) {
// for (entry in field.value) {
// println(entry)
// }
// }}
return result
}
}
Expand Down

0 comments on commit 38f4c64

Please sign in to comment.