I'm writing a subworkflow which has two processes....
# nostupidquestions
a
I'm writing a subworkflow which has two processes. When testing it, I find that only the first input is processed. The input:
Copy code
input[1] = channel.fromList([
    [
        [id:'test3'],
        file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
        file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true),
    ],
    [
        [id:'test4'],
        file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/bam/sars-cov-2_v5.3.2.bam', checkIfExists: true),
        file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/bam/sars-cov-2_v5.3.2.bam.bai', checkIfExists: true),
    ],
])
input[2] = channel.of([1,2])
input[3] = 20
"""
Using
view
I can see the input channel is accepting both test3 and test4 but only test3 is processed. Also checked the output which should be combined into one tsv file, it only contains test3 results. Any idea why this would happen?
m
input[2]
is only one value ( a list of two elements ). So it only get's paired up with the first element of
input[1]
.
input[2]
should either be a value channel (
input[2] = channel.value([1,2])
) or you need to give it two values ( I'm not sure if you also intended that to be channel.fromList or the square brackets are just extra )
a
That was it! Thanks Mahesh ❤️
input[2]
is meant meant to mimic
params.pools
, in other words parsed from the nextflow.config.
So why does
input[3]
not cause the issue?
a
Because it's a plain value. So it gets turned into a value channel implicitly. It's not documented (that I can see) but I think that
channel.of
always returns a queue channel even when it's only a single value
a
Right, so to be explicit I should
channel.value(20)
?
m
yes, exactly
🙏 1