Different samples can be processed differently, either by following a different path, or playing a particular role in a downstream element of the same workflow. This can be achieved by configuring the Collect and Distribute element with multiple outputs.
To configure a Collect and Distribute element, double-click on it in the workflow, and enter the names of the outputs, separated by commas (figure 11.52). Inputs to the Collect and Distribute element are split into as many groups as there are output channels, and each of those groups can then be sent to different input channels of downstream elements. These can be different input channels of the same workflow element, or to different workflow elements.
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 figure 11.52, a configured Collect and Distribute element splits the samples into cases and controls. Subsequently, each case sample is individually analyzed against all of the control samples. Note that one path from the Collect and Distribute element (the cases) continues the iteration, whereas the other path (the controls) does not.
For this workflow, the groupings for the Collect and Distribute element must be specified in addition to specifying the iteration units. The groupings are coupled to the metadata table chosen for the corresponding Iterate element when defining the batch units. It is possible to group using a different column of the metadata table than that specified for the iteration units, as long as the groupings are compatible. For example, when running the workflow in figure 11.53, it is possible to select a metadata column called "Type" to split the samples into cases and controls, even though the iteration was over the "ID" column in the same metadata table (figure 11.54).
Control flow elements are described in more detail in Workflow control flow elements.