Hi there! I’m following a nextflow tutorial and I’ve encountered a strange problem. My pipeline is only being run on the first element of the input channel, even though the channel contains two other elements.
I think this has to do with recycling rules, where a queue channel of length one truncates the process to the first element. I would really appreciate any suggestions!
Here’s my code:
nextflow.enable.dsl=2
params.reads = "data/yeast/reads/ref*_{1,2}.fq.gz"
params.transcriptome = "data/yeast/transcriptome/*"
params.outdir = "${projectDir}/results"
process INDEX {
    input:
    path transcriptome
    output:
    path "index"
    script:
    """
    salmon index --threads $task.cpus -t $transcriptome -i index
    """
}
process QUANT {
publishDir "${params.outdir}/quant", mode: 'symlink'
    input:
    path index
    tuple val(pair_id), path(reads)
    output:
    path(pair_id)
    script:
    """
    salmon quant --threads $task.cpus --libType=U -i $index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id
    """
}
workflow {
  read_pairs_ch = Channel.fromFilePairs( params.reads, checkIfExists:true )
  transcriptome_ch = Channel.fromPath( params.transcriptome, checkIfExists:true )
  index_ch=INDEX(transcriptome_ch)
  quant_ch=QUANT(index_ch,read_pairs_ch)
}