It would be great to have a tighter integration with jupyter notebooks/Rmd notebooks.
See also Reportsrender v2 / Executable book project Reportsrender v2.
Parametrization with papermill/rmarkdown works, but is quite a bit of overhead. It should be possible to execute the notebooks from outside the pipeline (for development) and from within the pipeline using the results from the previous processes (in production)
Maybe a Python/R package could help abstracting the file loading.
This is how it should look like:
import nextflowreporter as nfx
input_file = nfx.channel["input_file"]
param = nfx.channel["value_channel"]
input_file2 = nfx.get_input("input_file2", "/path/used/outside/nextflow.fasta")
# takes care of writing to a temporary file / default directory
# when outside nextflow.
with nfx.output_file("figure.png") as f:
fig.savefig(f)
// can this be represented in a more compact way using DSL2 modules?
process foo {
input:
input_file from Channel.fromPath("allInputFiles*")
input_file2 from inputfiles2
//or anything supported by jupytext
notebook from Channel.fromPath("notebook.ipynb")
output:
"figure.png" into output
// this will be collected and turned into a website using sphinx.
"report.md" into reportxxx
"""
# need to perform some groovy magic to automatically
# get the notebook name and all input names.
nfxreport
"""
}