Git Product home page Git Product logo

Comments (4)

drpatelh avatar drpatelh commented on July 28, 2024

Copied from Slack:

As ugly as it sounds I think the easiest and possibly the most flexible option is to only define inputs and outputs in the actual module file and no other parameter definitions (other than --threads $task.cpus maybe). This follows the NF philosophy quite well.

Additional parameters would then be provided by a string of some sort with the hope that the downstream tool validates these parameters! Would be nice if we can make the variable name for optional parameters standardised e.g. --<MODULE_NAME>_options.

from modules.

ewels avatar ewels commented on July 28, 2024

Agreed - my way of saying basically the same thing (I think) is this:

I think that the default module command should be as simple as possible, with dedicated parameters for the required options (will often not be any if the essential options are covered by input and output channels). Then any additional optional flags could go in a generic string param as @drpatelh suggests above.

So using the cutadapt example above, if it was impossible to run cutadapt with the -a flag then we would have params.cutadapt_adapter_sequence and then --cutadapt_options for everything else.

As mentioned on slack, the addParams thing is cool, but I can see it struggling with edge cases such as hyphens in command-line parameters (hyphens are not allowed in groovy variable names) and other random stuff. I agree that although the generic string approach is ugly, it's also the simplest to maintain and least likely to go wrong.

Remember that pipeline authors can make these generic strings however they like, so can define their own convenience params for users where applicable.

Phil

from modules.

ewels avatar ewels commented on July 28, 2024

Note that @FelixKrueger is using the "simple string" approach in his DSL2 modules. See #30 for example.

Also note that starting with the "simple string" approach is not incompatible with manually adding other params - these can be added on to that string as done in #28 - though maybe we should avoid this and keep things simple (at risk of being a complete hypocrite here, sorry).

from modules.

drpatelh avatar drpatelh commented on July 28, 2024

We have agreed on passing all optional parameters via an options.args string and this seems to be working really well. Especially as it allows for optional parameters to be overwritten at both the user and developer level via custom configuration files.

from modules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.