From cee7fd00b680dabccec32384ff9b15e942993ac7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 25 Mar 2024 12:28:08 -0400 Subject: [PATCH 1/2] merge nextflow.config files and add exec test case in test workflow --- nextflow.config | 24 ------------------------ tests/nextflow.config | 26 ++++++++++++++++++++++++++ tests/test.nf | 23 +++++++++++++++++++---- 3 files changed, 45 insertions(+), 28 deletions(-) delete mode 100644 nextflow.config diff --git a/nextflow.config b/nextflow.config deleted file mode 100644 index 6219b1b..0000000 --- a/nextflow.config +++ /dev/null @@ -1,24 +0,0 @@ -plugins { - id 'nf-prov' -} - -params { - outdir = 'results' -} - -prov { - formats { - bco { - file = "${params.outdir}/bco.json" - overwrite = true - } - dag { - file = "${params.outdir}/dag.html" - overwrite = true - } - legacy { - file = "${params.outdir}/manifest.json" - overwrite = true - } - } -} diff --git a/tests/nextflow.config b/tests/nextflow.config index 3044716..c18d0bb 100644 --- a/tests/nextflow.config +++ b/tests/nextflow.config @@ -1,3 +1,29 @@ +plugins { + id 'nf-prov' +} + +params { + outdir = "results" + constant = "foo" +} + +prov { + formats { + bco { + file = "${params.outdir}/bco.json" + overwrite = true + } + dag { + file = "${params.outdir}/dag.html" + overwrite = true + } + legacy { + file = "${params.outdir}/manifest.json" + overwrite = true + } + } +} + manifest { name = "nf-prov-test" author = "Bruno Grande" diff --git a/tests/test.nf b/tests/test.nf index 4e050cd..d2edacc 100644 --- a/tests/test.nf +++ b/tests/test.nf @@ -1,10 +1,8 @@ nextflow.enable.dsl=2 -params.constant = "foo" - process RNG { - - publishDir "results", mode: 'copy' + tag "${prefix}" + publishDir "${params.outdir}", mode: 'copy' input: tuple val(prefix), val(constant) @@ -21,10 +19,27 @@ process RNG { } +// shows nf-prov behavior with exec tasks +process EXEC_FOO { + tag "${prefix}" + publishDir "${params.outdir}", mode: 'copy' + + input: + tuple val(prefix), val(constant) + + output: + path(outputfile) + + exec: + outputfile = new File("${task.workDir}/${prefix}.exec_foo.txt") + outputfile.write(prefix) +} + workflow { prefixes_ch = channel.from('r1', 'r2', 'r3') constant_ch = channel.of(params.constant) inputs_ch = prefixes_ch.combine(constant_ch) RNG(inputs_ch) RNG.output.values.view() + EXEC_FOO(inputs_ch) } From 74babc73ee7b445343dfeab29e26830d7583088c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 25 Mar 2024 12:31:59 -0400 Subject: [PATCH 2/2] update README dev instructions --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fcdd3ce..55b99f3 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,17 @@ mv -f settings.gradle.bkp settings.gradle ./launch.sh run test.nf -plugins nf-prov ``` +An alternative method to build and test the plugin for development purposes; + +```bash +# builds the plugin .zip and copies it to the local ${HOME}/.nextflow/plugins, +# removing any pre-existing version +make install + +# run with an externally installed nextflow using the included test workflow & config +nextflow run tests/test.nf +``` + ## Package, Upload, and Publish The project should hosted in a GitHub repository whose name should match the name of the plugin, @@ -122,6 +133,6 @@ Following these step to package, upload and publish the plugin: ./gradlew :plugins:nf-prov:upload ``` -4. Create a pull request against the [nextflow-io/plugins](https://github.com/nextflow-io/plugins/blob/main/plugins.json) - project to make the plugin public accessible to Nextflow app. +4. Create a pull request against the [nextflow-io/plugins](https://github.com/nextflow-io/plugins/blob/main/plugins.json) + project to make the plugin public accessible to Nextflow app.