Should a pipeline have ‘if’ conditions and loops?

On the ruffus mailing list[1] I am participating in a discussion on whether a pipeline should contain ‘if‘ conditions and loops.

I don’t like to see conditions in a pipeline. In the real pipelines, the ones with pipes and water in them, there is no equivalent of ‘if‘ conditions. The tubes can be either be closed or not, but that is defined in the pipeline structure. It is not that the pipeline can change its structure and open/modify its path depending on whether there is water or oil running in it, or that the water can choose whether to enter in a tube or note.

With Makefiles, you usually avoid having if and while conditions, to keep the code easier to understand. Moreover with make, when you have to execute the same task for multiple elements (e.g. call the same program with different inputs) you rather launch a series of parallel jobs instead of having a loop: that is similar to splitting a pipeline into different tubes.

So, for me a pipeline is just a script that you call it and it executes a series of steps. If you start putting if and loops in it, then you won’t be able to tell which steps are called every time you launch it, and it will be more difficult to understand the code.

What do you think? Am I being too silly? W the pipelines!! 🙂

[1] ruffus is a tool to define bioinformatics pipelines with a python-like syntax, alternative to Makefiles

 

 

2 Comments

Leave a Reply to Giovanni Marco Dall'Olio Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">