Hi Manuel,
Your contribution is more than welcome. However the main problem is to outline a module/component mechanism that is coherent with the framework design, more than an implementation issue.
Currently this is not yet very clear, maybe it's time to start a discussion about this topic. In my opinion the main points to be taken in considerations are:
1) Component granularity i.e. what a component defines (functions? processes? a flow interaction?)
2) Interface definition, how the component communicate with the outside world.
3) Shareability and discovery mechanism, how a component is shared between projects.
It's definitively not an easy tasks, and the first step is to understand what are the users requirements. Could you (and everybody maybe interested) please elaborate a bit more what are your needs and how would you like to manage components in a Nextflow pipeline?
Also it must be taken in consideration that since Nextflow runs on the JVM and it's an extension of the Groovy programming language, all the mechanisms provided by these environments are available.
For example it's possible to create a functions library writing a Groovy or a Java class and import it in your script, like you would do in any Groovy/Java source:
For example, you can create the following class:
class Library {
static def foo() {
return "echo foo"
}
static def bar() {
return "echo bar"
}
}
And save it as Library.groovy in a folder called "lib/" in your pipeline project root. By doing that Nextflow will add it to your classpath, compile it automatically, and you will be able to use it in your script as shown below:
import Library
process Foo {
script:
Library.foo()
}
This can be useful to have a library of helper methods and script wrappers, that can tested at unit level with any of the many tools available in the Java/Groovy community.
But I think you are interested in a higher level component mechanism that is able to "capture" the data flow between different processes. Let me know more about that.
Also, did you manage to solve the proxy problem you've reported in Github?
Cheers,
Paolo