Home Research

Nextflow-to-Galaxy channel shape mapping

Maps common Nextflow channel, tuple, and path shapes to Galaxy dataset and collection shapes.

Raw
Revised
2026-05-06
Rev
2

Nextflow-to-Galaxy Channel Shape Mapping

This note maps source-level Nextflow channel shapes onto Galaxy data and dataset-collection shapes. Evidence quality is uneven: Galaxy collection semantics and IWC collection operations are well grounded; several Nextflow shapes are observed in the pinned fixtures; fromFilePairs and arbitrary deep tuple mapping remain low-confidence without direct fixture evidence.

Shape Mapping

Nextflow shapeGalaxy shapeConfidenceNotes
path(x) or a single Channel.fromPath(...).first()FileHighOne dataset input or output.
val(meta) aloneNo dataset shapeHighTreat as identifiers, labels, tags, sample-sheet metadata, or parameters. It is not a Galaxy dataset by itself.
Repeated tuple val(meta), path(file)listHighOne dataset per sample/key. Galaxy maps tools over list collections.
One tuple(meta, [R1, R2])pairedHighUse only when the workflow input is one paired sample or one tool consumes one pair.
Repeated tuple(meta, [R1, R2])list:pairedHighCommon paired-end workflow input shape.
Repeated tuple(meta, [single])listHighnf-core often normalizes single-end reads to one-element lists, but Galaxy should not model this as paired.
Mixed single-end and paired-end readspaired_or_unpaired or split list plus list:pairedMediumGalaxy supports mixed collections, but branch-splitting may be clearer when tools diverge.
tuple(meta, path(a), path(b))Parallel lists or per-step File inputsMediumNot automatically a paired collection. It is usually a keyed record of multiple tool inputs.
Global file plus per-sample filesBroadcast File plus mapped listMediumIf one input is global, connect it once and map the collection input.
collect() or toList()Collection reductionHighUsually one downstream invocation over a collection or multiple-input value.
collectFile(...)FileHighNextflow creates one new file; Galaxy should model a tool output, not a collection operation.
groupTuple() by keylist, list:paired, or list:listMediumDepends on grouped payload and whether the grouping axis matters downstream.
transpose() after groupingExplicit reshape or subcollection mappingMediumMay need flattening, Apply Rules, or identifier-preserving reshaping.
combine(..., by: key) or join(...)Multi-input collection map if identifiers matchMediumOtherwise use explicit synchronization by identifiers/order.
branch { ... }Branch wiring or explicit filtersMediumShape is whatever each branch returns; per-element routing needs review.
mix(...)Merge compatible streams/collectionsMediumUse direct wiring for reports/versions; use __MERGE_COLLECTION__ or __BUILD_LIST__ when materialized.
multiMap { ... }Synchronized split into Galaxy inputsMediumUsually channel-only fan-out, but downstream rejoin depends on identifier discipline.
fromFilePairspaired or list:pairedLowConceptually clean, but not directly observed in the pinned fixtures.
Arbitrary deep tuplesParallel lists, list:list, or manual modelingLowGalaxy collection types are not arbitrary tuple records. Require per-tool review.

Explicit Galaxy Operations

Use explicit Galaxy collection-operation or tabular steps when the translation changes materialized collection shape rather than only wiring an existing collection into a mapped step.

NeedCandidate Galaxy recipe
Build a collection from separate datasets__BUILD_LIST__
Pair forward/reverse files__ZIP_COLLECTION__ or Apply Rules paired mapping
Split paired reads into forward/reverse collections__UNZIP_COLLECTION__
Flatten nested collections__FLATTEN__
Regroup, swap nesting, split identifiers, or build pairs from metadata__APPLY_RULES__
Harmonize sibling collections by identifiers/orderidentifier extraction, filtering, sorting, or relabeling
Remove empty, failed, or null elements after fan-outfilter empty/failed/null collection tools
Unbox a singleton collection__EXTRACT_DATASET__
Convert a collection of tabular outputs to one tablecollapse_dataset or collection_column_join

Evidence

Corpus-observed Galaxy semantics:

Pinned fixture examples used by the research pass:

  • workflow-fixtures/pipelines/nf-core__demo/subworkflows/local/utils_nfcore_demo_pipeline/main.nf for tuple(meta, reads) paired-read handling.
  • workflow-fixtures/pipelines/nf-core__rnaseq/main.nf for single-end versus paired-end branching and reads normalization.
  • workflow-fixtures/pipelines/nf-core__taxprofiler/main.nf and workflow-fixtures/pipelines/nf-core__taxprofiler/subworkflows/local/*/main.nf for groupTuple, transpose, mix, combine, and multiMap patterns.
  • workflow-fixtures/pipelines/nf-core__fetchngs/workflows/sra/main.nf for collectFile and accession-driven data fetching.
  • $IWC_FORMAT2/virology/influenza-isolates-consensus-and-subtyping/influenza-consensus-and-subtyping.gxwf.yml as a Galaxy list:paired exemplar.

Low-Confidence TODOs

  • Confirm fromFilePairs with a direct fixture or external Nextflow documentation before treating it as corpus-observed.
  • Define a small shape grammar for summary-nextflow outputs, or explicitly require downstream Molds to preserve shape strings plus rationale.
  • Decide whether mixed single/paired reads should prefer Galaxy paired_or_unpaired or split branches.
  • Add a decision rule for grouped runs: preserve as list:list when the run axis matters; reduce to list only when downstream semantics ignore that axis.
  • Avoid using list:list just because a Nextflow tuple is nested.

Mold Use

Incoming References (35)

  • Manifest to mapped collection lifecycle related note — Use a manifest or table to build a collection, map a tool per row, then relabel or reshape outputs.
  • Parameter: map workflow enum to tool parameter related note — Use map_param_value to translate workflow enum values into downstream tool codes, flags, or snippets.
  • Collection: regex relabel via tabular related note — Derive collection element identifiers in a tabular mapping, then apply them with RELABEL_FROM_FILE.
  • Collection: relabel via rules and find/replace related note — Use Apply Rules, identifier extraction, find/replace, and relabeling for structural fan-out cleanup.
  • Reshape, relabel, and remap by collection axis related note — Use Apply Rules and deterministic relabeling when domain fan-out creates the wrong map-over axis.
  • Collection: sync collections by identifier related note — Use collection_element_identifiers with FILTER_FROM_FILE or RELABEL_FROM_FILE to align sibling collections.
  • Tabular: compute a new column related note — Append, insert, or replace computed columns with column_maker (Add_a_column1), using a shared input-typing policy and explicit failure handling.
  • Tabular: concatenate collection to table related note — Stack compatible tabular collection elements into one dataset, with one header and a sample column when needed.
  • Tabular: cut and reorder columns related note — Use Cut1 with a comma-separated cN list to project — and reorder — columns. Listing out of order is the canonical reorder idiom.
  • Tabular: filter rows by column value related note — Use Filter1 with a Python expression over cN columns to drop rows. Highest-frequency tabular row filter in IWC.
  • Tabular: filter rows by regex related note — Use tp_grep_tool for whole-line regex row filters on tabular input. Grep1 is the legacy alternative.
  • Tabular: group and aggregate related note — Group tabular rows by one-based key columns, sort when needed, and choose Datamash operations and header settings from the intended result.
  • Tabular: join on key related note — Join tabular files by key with explicit matched-row, missing-value, header, and duplicate-key policies.
  • Tabular: pivot collection to wide related note — Join a collection of keyed tabular datasets into a wide table, choosing missing-cell fill and output headers to fit the data.
  • Tabular: prepend header related note — Add a fixed first line with tp_awk_tool, choosing whether to keep or replace the input's first row and whether to rewrite its fields.
  • Tabular: relabel by row counter related note — Use tp_awk_tool and awk NR to replace each input line with a row-order label, with explicit header and numbering choices.
  • Tabular: split taxonomy string related note — Expand a prefixed taxonomy lineage into fixed rank columns with tp_awk_tool, preserving row identity and handling absent ranks.
  • Tabular: SQL query related note — Load tabular datasets into Query Tabular for SQL joins, window calculations, and queries that combine several tabular operations.
  • Tabular: synthesize BED from 3-column input related note — Convert one-based inclusive chromosome/start/end rows to six-column BED with awk, after checking the source coordinate convention.
  • Tabular: split into collection by key related note — Split a tabular file into a list collection by column value, grouping rows that share an identifier.
  • Galaxy Apply Rules DSL related note — How Apply Rules derives columns from collection metadata, filters rows, and maps them into new collection structure.
  • Galaxy collection semantics related note — Vendored formal spec of Galaxy dataset-collection mapping/reduction semantics, with labeled examples and pinned test references.
  • Galaxy collection-operation tools related note — Catalog of Galaxy collection-operation tools, with versioned inputs, outputs, defaults, mapping behavior, and diagnostic qualifications.
  • Galaxy data-flow draft contract related note — Defines the proposed boundary between Galaxy data-flow drafts, gxformat2 templates, and concrete step implementation.
  • Galaxy sample_sheet collection types related note — Galaxy's sample_sheet collection family: typed column metadata, four variants, mapping rules, validator allowlist.
  • Iwc Conditionals Survey related note — Corpus survey of Galaxy conditional step usage in IWC, covering when-gates, boolean shims, and routed output selection.
  • Iwc Map Over Lifecycle Survey related note — Survey of IWC map-over lifecycle recipes, with a Nextflow-to-Galaxy crosswalk for collection construction, cleanup, reshape, reduce, and publish phases.
  • Iwc Transformations Survey related note — Corpus survey of collection-shape transformations across IWC: built-in collection ops, toolshed transformers, and the multi-step recipes that bracket map-over.
  • Nextflow conditional to Galaxy subworkflow / when related note — Stub. Translate Nextflow conditionals into Galaxy `when:` (single-workflow v1). Subworkflow vs inline is an aesthetic call, not a rule.
  • Nextflow operators to Galaxy collection recipes related note — Classifies common Nextflow operators as Galaxy wiring, collection semantics, explicit steps, or review triggers.
  • Nextflow params to Galaxy workflow inputs related note — Rules for translating Nextflow params, sample sheets, channels, and control flags into gxformat2 inputs.
  • Nextflow path/glob to Galaxy datatype mapping related note — Rules for mapping Nextflow path, glob, sample-sheet, and output filename evidence to Galaxy datatype extensions.
  • Nextflow workflow I/O semantics related note — Defines Nextflow workflow inputs and outputs from docs plus observed fixture pipeline structures.
  • nf-schema sample sheet validation gaps in Galaxy related note — nf-schema validation mapped to Galaxy column_definitions: what survives, degrades, or is lost; Galaxy work items + cast loss-recording vocabulary.
  • Nextflow: source pattern map related note — Use this source-pattern map to route recurring Nextflow channel and operator idioms to Galaxy implementation patterns.