Nextflow: branch, filter, and ifEmpty to Galaxy filters and gates
Use this when a Nextflow summary reports .branch, .filter, or .ifEmpty. Do not translate syntax directly; first classify the source intent.
Source idiom classification
- Static workflow-level condition -> Galaxy
whengate. - Mutually exclusive alternative route ->
whenalternatives pluspick_value. - Optional transform with original fallback -> optional branch plus
pick_value. - Per-element cleanup after sparse map-over -> collection cleanup/filter recipes.
- Whole-result empty/non-empty report admission -> data-derived boolean gate.
- Arbitrary per-element branch/filter -> review trigger.
Translation table
| Nextflow source shape | Galaxy target pattern | Notes |
|---|---|---|
branch separates workflow modes from a user parameter | conditional-run-optional-step or conditional-route-between-alternative-outputs | Gate whole steps; merge if downstream needs one value. |
branch selects among peer outputs | conditional-route-between-alternative-outputs | Require compatible branch outputs. |
filter removes empty or failed mapped outputs | collection-cleanup-after-mapover-failure | Prefer empty/failed filters, not when. |
| Cleaned result membership subsets a sibling collection | sync-collections-by-identifier | Extract identifiers from the truth collection. |
ifEmpty controls final report/export | conditional-gate-on-nonempty-result | Derive a boolean, then gate report/export. |
| cleanup + sibling sync + publish gate | cleanup-sync-and-publish-nonempty-results | Use the lifecycle recipe. |
Pitfalls
- Galaxy
whenis step-level, not arbitrary per-channel-item routing. - Collection filters clean collection elements; they do not choose branches.
- Identifier filtering filters by labels; it does not inspect dataset state.
- If dropping elements, decide whether sibling collections need membership or order sync.
Evidence posture
This page is grounded in existing Foundry conditional and transformation surveys. Direct .filter and .ifEmpty fixture evidence was not regenerated during authoring.