diff --git a/plugins/nf-prov/build.gradle b/plugins/nf-prov/build.gradle index 3eee961..6065014 100644 --- a/plugins/nf-prov/build.gradle +++ b/plugins/nf-prov/build.gradle @@ -56,21 +56,18 @@ sourceSets { dependencies { // This dependency is exported to consumers, that is to say found on their compile classpath. - compileOnly 'io.nextflow:nextflow:23.04.0' + compileOnly 'io.nextflow:nextflow:24.10.0' compileOnly 'org.slf4j:slf4j-api:1.7.10' - compileOnly 'org.pf4j:pf4j:3.4.1' - // add here plugins depepencies + compileOnly 'org.pf4j:pf4j:3.12.0' // test configuration - testImplementation "org.codehaus.groovy:groovy:3.0.8" - testImplementation "org.codehaus.groovy:groovy-nio:3.0.8" - testImplementation 'io.nextflow:nextflow:23.04.0' - testImplementation ("org.codehaus.groovy:groovy-test:3.0.8") { exclude group: 'org.codehaus.groovy' } + testImplementation 'io.nextflow:nextflow:24.10.0' + testImplementation ("org.codehaus.groovy:groovy-test:4.0.23") { exclude group: 'org.codehaus.groovy' } testImplementation ("cglib:cglib-nodep:3.3.0") - testImplementation ("org.objenesis:objenesis:3.1") - testImplementation ("org.spockframework:spock-core:2.0-M3-groovy-3.0") { exclude group: 'org.codehaus.groovy'; exclude group: 'net.bytebuddy' } - testImplementation ('org.spockframework:spock-junit4:2.0-M3-groovy-3.0') { exclude group: 'org.codehaus.groovy'; exclude group: 'net.bytebuddy' } - testImplementation ('com.google.jimfs:jimfs:1.1') + testImplementation ("org.objenesis:objenesis:3.2") + testImplementation ("org.spockframework:spock-core:2.3-groovy-4.0") { exclude group: 'org.codehaus.groovy'; exclude group: 'net.bytebuddy' } + testImplementation ('org.spockframework:spock-junit4:2.3-groovy-4.0') { exclude group: 'org.codehaus.groovy'; exclude group: 'net.bytebuddy' } + testImplementation ('com.google.jimfs:jimfs:1.2') // see https://docs.gradle.org/4.1/userguide/dependency_management.html#sec:module_replacement modules { diff --git a/plugins/nf-prov/src/main/nextflow/prov/BcoRenderer.groovy b/plugins/nf-prov/src/main/nextflow/prov/BcoRenderer.groovy index 130a3a4..aededdb 100644 --- a/plugins/nf-prov/src/main/nextflow/prov/BcoRenderer.groovy +++ b/plugins/nf-prov/src/main/nextflow/prov/BcoRenderer.groovy @@ -24,10 +24,13 @@ import groovy.json.JsonOutput import groovy.transform.CompileStatic import nextflow.Session import nextflow.SysEnv +import nextflow.config.Manifest import nextflow.processor.TaskRun import nextflow.script.WorkflowMetadata import nextflow.util.CacheHelper +import static nextflow.config.Manifest.ContributionType + /** * Renderer for the BioCompute Object (BCO) format. * @@ -64,7 +67,7 @@ class BcoRenderer implements Renderer { final nextflowMeta = metadata.nextflow final dateCreated = DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(metadata.start) - final authors = (manifest.author ?: '').tokenize(',')*.trim() + final contributors = getContributors(manifest) final nextflowVersion = nextflowMeta.version.toString() final params = session.config.params as Map @@ -88,15 +91,13 @@ class BcoRenderer implements Renderer { "name": manifest.name ?: "", "version": manifest.version ?: "", "review": review, + "derived_from": derived_from, "obsolete_after": obsolete_after, "embargo": embargo, "created": dateCreated, "modified": dateCreated, - "contributors": authors.collect( name -> [ - "contribution": ["authoredBy"], - "name": name - ] ), - "license": "" + "contributors": contributors, + "license": manifest.license ], "usability_domain": usability, "extension_domain": [], @@ -191,4 +192,20 @@ class BcoRenderer implements Renderer { path.text = JsonOutput.prettyPrint(JsonOutput.toJson(bco)) } + private List getContributors(Manifest manifest) { + manifest.contributors.collect { c -> [ + "name": c.name, + "affiliation": c.affiliation, + "email": c.email, + "contribution": c.contribution.collect { ct -> CONTRIBUTION_TYPES[ct] }, + "orcid": c.orcid + ] } + } + + private static Map CONTRIBUTION_TYPES = [ + (ContributionType.AUTHOR) : "authoredBy", + (ContributionType.MAINTAINER) : "curatedBy", + (ContributionType.CONTRIBUTOR) : "curatedBy", + ] + } diff --git a/plugins/nf-prov/src/main/nextflow/prov/DagRenderer.groovy b/plugins/nf-prov/src/main/nextflow/prov/DagRenderer.groovy index 6cd3448..af23828 100644 --- a/plugins/nf-prov/src/main/nextflow/prov/DagRenderer.groovy +++ b/plugins/nf-prov/src/main/nextflow/prov/DagRenderer.groovy @@ -64,8 +64,8 @@ class DagRenderer implements Renderer { } private Map getVertices(Set tasks) { - def result = [:] - for( def task : tasks ) { + Map result = [:] + for( final task : tasks ) { final inputs = task.getInputFilesMap() final outputs = ProvHelper.getTaskOutputs(task) @@ -154,7 +154,7 @@ class DagRenderer implements Renderer { } // render task outputs - final outputs = [:] as Map + Map outputs = [:] dag.vertices.each { task, vertex -> vertex.outputs.each { path -> @@ -184,11 +184,11 @@ class DagRenderer implements Renderer { * @param vertices */ private Map getTaskTree(Map vertices) { - def taskTree = [:] + final taskTree = [:] - for( def entry : vertices ) { - def task = entry.key - def vertex = entry.value + for( final entry : vertices ) { + final task = entry.key + final vertex = entry.value // infer subgraph keys from fully qualified process name final result = getSubgraphKeys(task.processor.name) @@ -200,7 +200,7 @@ class DagRenderer implements Renderer { // navigate to given subgraph def subgraph = taskTree - for( def key : keys ) { + for( final key : keys ) { if( key !in subgraph ) subgraph[key] = [:] subgraph = subgraph[key] diff --git a/plugins/nf-prov/src/resources/META-INF/MANIFEST.MF b/plugins/nf-prov/src/resources/META-INF/MANIFEST.MF index 1bb2525..0497576 100644 --- a/plugins/nf-prov/src/resources/META-INF/MANIFEST.MF +++ b/plugins/nf-prov/src/resources/META-INF/MANIFEST.MF @@ -3,4 +3,4 @@ Plugin-Id: nf-prov Plugin-Version: 1.2.4 Plugin-Class: nextflow.prov.ProvPlugin Plugin-Provider: nextflow -Plugin-Requires: >=23.04.0 +Plugin-Requires: >=24.10.0