Cleanup, sync, and publish non-empty results
Use this recipe when a mapped search, extraction, or classification can produce empty per-element outputs and downstream reports should only run when useful results remain.
The key decision is that cleanup is not enough. If sibling collections still represent the original sample set, they must be filtered, sorted, or relabeled to match the cleaned result collection before downstream map-over or report export.
Recipe
- Map the domain tool over the input collection.
- Drop empty/failed element outputs so the cleaned collection contains only usable results. Use replacement only when preserving shape is more important than defining a result-set truth mask.
- Extract identifiers from the cleaned collection that now represents the usable result set.
- Filter sibling collections to match those identifiers; add sorting or relabeling only when the downstream consumer needs order or label harmonization.
- Derive a whole-result non-empty boolean with the vetted collection-to-boolean chain when report/export tools should not run on empty collections.
- Gate report or export steps with Galaxy
whenconditions.
Reach For This When
- “No hits” is valid for some samples but breaks downstream aggregation.
- A cleaned result collection must stay aligned with sequence, metadata, or classification sibling collections.
- Final reports should be omitted when there is no meaningful result to publish.
Operation Handoffs
- Use collection-cleanup-after-mapover-failure immediately after sparse mapped outputs.
- Use sync-collections-by-identifier when the cleaned collection defines sibling membership.
- Use harmonize-by-sortlist-from-identifiers when downstream paired processing depends on order, not just membership.
- Use conditional-gate-on-nonempty-result for the known-good
collection_element_identifiers -> wc_gnu -> column_maker -> param_value_from_filegate.
Pitfalls
- Do not filter sibling inputs from the original collection when the cleaned result collection is the truth set.
- Do not assume identifier sync also guarantees order sync.
- Do not gate per-element routing with Galaxy
when; use filters/classifiers for per-element behavior and reservewhenfor step-level gates.
See Also
- iwc-map-over-lifecycle-survey — Shape B evidence.
- galaxy-conditionals-patterns — conditional operation map.