Conversation
Introduces specification for module parameters including: - Parameter definition in meta.yaml - Two options for script-level definition (process-level vs module-level) - Parameter semantics, typing, and defaults - Configuration and CLI override mechanisms Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
✅ Deploy Preview for nextflow-docs-staging canceled.
|
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
This comment was marked as outdated.
This comment was marked as outdated.
|
One approach we are looking at with records is to refactor the ext settings as fields in the input record. For example, nf-core/methylseq uses the bedtools/intersect module, which has several ext settings: def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
extension = task.ext.suffix ?: "${intervals1.extension}"The methylseq pipeline customizes these settings further: process {
withName: BEDTOOLS_INTERSECT {
ext.args = ''
ext.prefix = { "${intervals1.baseName}" }
ext.suffix = 'targeted.bedGraph'
}
}With records, we could provide these ext settings in the input record: // process definition
input:
(
id: String,
intervals1: Path,
intervals2: Path,
args: String,
prefix: String,
suffix: String
): RecordThen define them in an extra map operator // workflow logic
ch_intersect_inputs = ch_inputs
.map { r -> record(
id: r.id,
intervals1: r.bedgraph,
args: '',
prefix: r.bedgraph.baseName,
suffix: 'targeted.bedGraph'
) }
ch_bedgraph_filtered = BEDTOOLS_INTERSECT( ch_intersect_inputs, intervals2: target_regions )If this works out, we might not need module params at all. Especially since module params are constants but these ext settings often need to be dynamic (like |
This aligns with the point that "mutable" parameters should be managed as proper inputs. It makes sense to me |
Summary
Introduces ADR for module parameters specification, defining how parameters can be declared and configured in Nextflow modules.
Key aspects covered:
meta.yamlfor documentation, validation, and IDE supportparams:block (scoped to process)params {}block (accessible in workflow)ext.argsapproachRelated
adr/20251114-module-system.md🤖 Generated with Claude Code