Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dev docs and test workflow #31

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
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
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nf-prov

Nextflow plugin to render provenance reports for pipeline runs. Now supporting [BioCompute Objects](https://biocomputeobject.org/)!
Nextflow plugin to render provenance reports for pipeline runs. Now supporting [BioCompute Object](https://biocomputeobject.org/)!

## Getting Started

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.

24 changes: 0 additions & 24 deletions nextflow.config

This file was deleted.

26 changes: 26 additions & 0 deletions tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
23 changes: 19 additions & 4 deletions tests/test.nf
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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), emit: "txt"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path(outputfile), emit: "txt"
path("${prefix}.exec_foo.txt"), emit: "txt"

I think you need to do this for the output file to be picked up correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not work for me, no difference

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the file present in the task directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes


exec:
outputfile = task.workDir.resolve("${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)
}
Loading