Home Pattern

Collection: build list paired with Apply Rules

Use Apply Rules to promote identifier columns into a list:paired collection, with optional cleanup first.

draft pattern
Revised
2026-05-03
Rev
2

Pattern health

warn
  • IWC exemplar anchors

    3 abstract workflow anchors declared.

  • Foundry verification fixture

    No structural verification fixture yet.

  • Pattern map coverage

    1 pattern map link here.

  • Metadata contract

    Pattern frontmatter matches the site contract.

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 exemplars3 anchors

IWC Exemplars

amplicon/dada2/dada2_pairedhigh

Uses identifier columns, sample sorting, list identifiers, and paired identifiers to promote rows into list:paired structure.

data-fetching/parallel-accession-download/parallel-accession-downloadhigh

Flattens deeper download output into list:paired by promoting an inner identifier to the paired role.

data-fetching/sra-manifest-to-concatenated-fastqs/sra-manifest-to-concatenated-fastqshigh

Shows paired promotion with regex cleanup of transient delimiter text before mapping.

Incoming References (7)