Isabel Haubro-Suppanz
07/03/2026, 8:59 AMclair3 module for variant calling on several files but I'm struggling with getting it to run for each of my input file sets. I have a feeling it is about value vs queue channels but I'm not sure which of my inputs is the issue. Could someone point me in the right direction? I'll include details in the thread.Isabel Haubro-Suppanz
07/03/2026, 9:06 AMclair3 :
result = CLAIR3(
ch_input_clair3,
fasta,
fai.fai
)
The first two entries of ch_input_clair3 look like this:
[[id:boss_8_bc15_hschr22], boss_8_bc15_hschr22.bam, boss_8_bc15_hschr22.bam.bai, r1041_e82_400bps_hac_v500, [], ont]
[[id:boss_8_bc30_hschr12], boss_8_bc30_hschr12.bam, boss_8_bc30_hschr12.bam.bai, r1041_e82_400bps_hac_v500, [], ont]
fasta looks like this:
[[id:Homo_sapiens], Homo_sapiens.GRCh38.fa]
and fai.fai looks like this:
[[id:Homo_sapiens], Homo_sapiens.GRCh38.fa.fai]
What do I need to do so clair3 runs for each of my input file sets? Thank you in advanceNiklas Schandry
07/03/2026, 9:17 AMmultiMap to create the inputs:
clair3_in = all_inputs.multiMap {
meta, bam, bai, readmode, ont, fasta, fai ->
sample: [meta, bam, bai, readmode, [], ont]
fasta: [[id: "Hs"], fasta]
fai: [[id: "Hs"], fai]
}
CLAIR3(clair3_in.sample, clair3_in.fasta, clair3_in.fai)Isabel Haubro-Suppanz
07/03/2026, 9:18 AMIsabel Haubro-Suppanz
07/03/2026, 9:20 AMNiklas Schandry
07/03/2026, 9:21 AMNiklas Schandry
07/03/2026, 9:22 AM"${params.something}" in the closure, to avoid combiningNiklas Schandry
07/03/2026, 9:26 AMclair3_in = all_inputs.multiMap {
meta, bam, bai, readmode, ont ->
sample: [meta, bam, bai, readmode, [], ont]
fasta: [[id: "Hs"], "${params.reference_fa}"]
fai: [[id: "Hs"], "${params.reference_index}"]
}
CLAIR3(clair3_in.sample, clair3_in.fasta, clair3_in.fai)Arthur
07/03/2026, 9:34 AMArthur
07/03/2026, 9:36 AMcollect() on your reference channels to ensure a single-value channel rather than the multimap approach (I know others like this but it feels very janky to me and I don't trust it)Niklas Schandry
07/03/2026, 9:42 AMArthur
07/03/2026, 9:48 AM.collect() either works or fails loud (because multiple items would cause a weird shape) I see it as a safer alternative that.
Also collect is just the more widely used pattern for these reference channels in nf-coreIsabel Haubro-Suppanz
07/03/2026, 9:51 AMresult = CLAIR3(
ch_input_clair3,
fasta.collect(),
fai.fai.collect()
)
I just tried that and it failed with this error:
Missing process or function view([DataflowStream[?], DataflowStream[?], DataflowStream[?], DataflowStream[?], DataflowStream[?], DataflowStream[?], DataflowStream[?]])
I also couldn't make the multimap work, it complained with the same error. I'll include more of my code on how I generated the channels, maybe there's something thereIsabel Haubro-Suppanz
07/03/2026, 9:53 AMworkflow BENCHMARK_HUMAN_VCF{
take:
ch_input_bam // tuple (bam, bai)
ref // path
main:
// Model and platform presets
model_presets = [
ont: 'ont',
pacbio: 'hifi',
hifi: 'hifi'
]
platform_presets = [
ont: 'ont',
pacbio: 'hifi',
hifi: 'hifi'
]
// Resolve model and platform
resolved_model = params.clair3_model ?: model_presets[params.sequencing_platform] ?: 'ont'
resolved_platform = platform_presets[params.sequencing_platform] ?: 'ont'
// Prepare input channel with resolved values
ch_input_clair3 = ch_input_bam.map { bam, bai ->
tuple(
[id:bam.simpleName],
bam,
bai,
resolved_model, // packaged_model
[], // user_model (empty for packaged models)
resolved_platform // platform
)
}
fasta = ref.map{ it -> tuple([id:it.simpleName], it)}.collect()
fai_in_ch = fasta.map{meta, fa -> tuple(meta, fa, [])}
fai = SAMTOOLS_FAIDX(fai_in_ch, false).fai.collect()
result = CLAIR3(
ch_input_clair3,
fasta,
fai
)
}Arthur
07/03/2026, 10:00 AMIsabel Haubro-Suppanz
07/03/2026, 10:01 AMresult.view() but that apparently doesn't work for a set of output channels, I have amended that to result.vcf.view() and now it seems to run for all of the input bam/bai file sets. Thank you both for your suggestions!Arthur
07/03/2026, 10:01 AMArthur
07/03/2026, 10:02 AM