Nextflow: grouped channel to regrouped Galaxy collection
Use this when Nextflow groups records with groupTuple(), reshapes grouped records with transpose(), or passes grouped tuple payloads that must become Galaxy collection structure.
Source signal
groupTuple()gathers records by key.transpose()can expand or rotate grouped tuple payloads.- Grouped payloads often look collection-like, but Galaxy collections are typed axes, not arbitrary tuple records.
Translation rule
First decide whether the grouping key is a real Galaxy axis such as sample, region, segment, replicate, or method.
- If yes, model it as
list,list:list,list:paired, or another concrete collection shape. - If the axis order is wrong, use collection-swap-nesting-with-apply-rules or reshape-relabel-remap-by-collection-axis.
- If one identifier encodes multiple axes, use collection-split-identifier-via-rules.
- If the outer axis no longer matters, use collection-flatten-after-fanout.
- If the grouped result is a known singleton, use collection-unbox-singleton.
- If grouping only feeds a domain merge/reduce tool, implement the reducer rather than a synthetic reshape.
Decision checklist
- Name the group key.
- Name the grouped payload fields.
- Identify the Galaxy mapped axis needed by the next tool.
- Choose preserve, swap, split, flatten, unbox, or reduce.
- Add review if tuple shape is arbitrary or lossy.
Evidence posture
This page is grounded in existing Foundry notes that map groupTuple() and transpose() to collection reshape decisions. Direct fixture evidence was not regenerated during authoring.