Home Source Pattern

Nextflow: mapped output cleanup and publishing

Route Nextflow mapped-output cleanup and publishDir-style intent to Galaxy filtering, relabeling, gating, bundling, and reports.

Revised
2026-05-04
Rev
1
Review Triggers
  • publishDir encodes filesystem layout, subdirectories, or saveAs naming.
  • Mapped outputs are optional, sparse, empty, or failed per element.
  • Cleanup drops elements from one collection while siblings keep original membership.
  • Output labels are derived by regex, dynamic closures, task metadata, or filenames.
  • Final aggregation mixes channels with overlapping identifiers or unclear ordering.
  • Per-element branch or filter behavior controls what is published.
  • Publishing expects directory structure rather than labeled Galaxy outputs.

Nextflow: mapped output cleanup and publishing

Use this when a Nextflow source has mapped process outputs, cleanup/filtering around sparse results, final output aggregation, or publishDir/output-layout intent.

Source signal

  • Repeated tuple(meta, path(...)) outputs from mapped processes.
  • Operators like map, filter, branch, collect, toList, collectFile, and mix near outputs.
  • publishDir directives, output emit: names, report channels, or version channels.
  • Naming cleanup via metadata, regex, filenames, or task-derived labels.

Galaxy translation

  1. Treat mapped process output as a Galaxy collection map-over result.
  2. Drop unusable per-element outputs with empty/failed collection filters.
  3. If cleanup changes membership, sync sibling collections from cleaned identifiers.
  4. Relabel outputs when Nextflow metadata or filenames carried element identity.
  5. Aggregate report-ready collections into tables, wide matrices, bundles, or singleton outputs.
  6. Gate report/export steps when the whole result may be empty.
  7. Translate publishDir intent to Galaxy output labels, collections, bundles, or reports; do not preserve filesystem layout literally.

Pattern handoffs

Pitfalls

  • Cleanup is not publishing.
  • Dropping bad elements changes collection membership.
  • Identifier sync is not order sync.
  • publishDir paths are source-side filesystem presentation, not Galaxy workflow structure.
  • Do not translate arbitrary Groovy output-name logic from syntax alone.

Evidence posture

This page is grounded in existing Foundry lifecycle and source-shape notes. publishDir specifics remain under-supported without direct fixture evidence.

Incoming References (1)

  • Nextflow: source pattern maprelated note— Use this source-pattern map to route recurring Nextflow channel and operator idioms to Galaxy implementation patterns.