Collection: build list paired with Apply Rules
Tool
Use __APPLY_RULES__ to produce a list:paired collection by mapping one identifier column to the sample/list level and another to the paired level.
When to reach for it
Use this when identifiers already encode, or can be cleaned to encode, both the list element identifier and the paired role.
This is not the same as __ZIP_COLLECTION__. Use zip only when you already have two sibling collections, one forward and one reverse, with matching order. In IWC, zip is rare; Apply Rules dominates when pairedness is derived from existing identifiers or deeper nesting.
This page is about promoting an identifier into paired-end structure. Use collection-split-identifier-via-rules when the second derived axis is another list level, not forward/reverse.
Parameters
Minimal list:paired promotion:
Conceptual Apply Rules shape:
tool_id: __APPLY_RULES__
tool_state:
rules:
- type: add_column_metadata
value: identifier0
- type: add_column_metadata
value: identifier1
mapping:
list_identifiers: [0]
paired_identifier: [1]
For deeper inputs, add the needed identifier columns and map the innermost paired-role column.
Pitfalls
- Paired identifiers must normalize to paired roles such as forward/reverse. Do not map arbitrary replicate labels as paired ends.
- Use
paired_identifier, not a second list identifier, when the second axis is read direction. - Regex rules append new columns; check column numbers after cleanup.
- Sorting by the wrong column can separate intended pairs.
Legacy alternative
__ZIP_COLLECTION__ is the dedicated two-list pairing tool, but the survey found only two corpus uses. Prefer Apply Rules when pairedness is derived from identifiers or deeper nesting; use zip only when forward and reverse sibling collections are already aligned.
See also
- iwc-transformations-survey — Apply Rules Shape C and candidate boundary.
- galaxy-apply-rules-dsl —
paired_identifiermapping rules. - collection-split-identifier-via-rules — split one identifier into two list axes instead of paired role.
- collection-swap-nesting-with-apply-rules — swap existing list axes.