Matching up inputs with each other and analyzing them together later in the workflow

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.53). 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.

Image configure_iterate
Figure 11.53: Double-click the Iterate element to configure its inputs and outputs.

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.54, 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.

Image tandem_iterate
Figure 11.54: 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.