In some applications, we want to analyze pairs, triplets or even larger groups of data, such that they are matched up with each other in each iteration. This may be achieved without control flow elements if the results from each batch do not need to be merged later, and only one level of batching is needed, as described in Batching workflows with more than one input changing per run. If there is a need to merge the results from different batches, or multiple levels of batching, then this can be achieved using a configured Iterate element.
To configure an Iterate element, double-click on it in the workflow, and enter the number of inputs and outputs, separated by commas (figure 11.55). The effect of this will be that the Iterate element will take as many inputs as specified, and will group them into batch units while matching them up with each other.
Important note: the Collect and Distribute element always ends the ongoing iteration. To continue an iteration on a path after the data have been split, place a new Iterate element directly after the Collect and Distribute element.
In the workflow in figure 11.56, the reads and contigs will be matched for the Map Reads to Contigs tool, in the same way as described in Batching workflows with more than one input changing per run. However, the configured Iterate element makes it possible to collect the unmapped reads into a single list for the entire batch.
Figure 11.56: In this partial workflow, the Collect and Distribute element is being used so that a single sequence list is created that will contain all the unmapped reads from all the initial inputs.
Control flow elements are described in more detail in Workflow control flow elements.