Nextflow: Runs without error, produce few but not all output files into output channel
I suspect your HRC_1000G_check_bim and hrc_sites_file channels are queue channels when they should be value channels. Please again see how multiple channels work. Also, third-party scripts, like your Perl script, would be better placed in a directory called bin/ at the root of your project repository. Nextflow adds this directory to your $PATH, so scripts in this directory will be automatically accessible in your pipeline without needing to localize them using a separate channel. This way also avoids having to specify an absolute path to invoke them. Just make sure your script is executable: chmod +x your_script.pl
hrc_sites = file( params.hrc_sites_file )

process step5 {

    input:
    tuple val(prefix), val(chr_name), path(bfiles) from step4_frq
    path hrc_sites

    &quot;&quot;&quot;
    your_script.pl \\
        -b &quot;${prefix}${chr_name}.step4.bim&quot; \\
        -f &quot;${prefix}${chr_name}.step4.frq&quot; \\
        -r &quot;${hrc_sites}&quot; \\
        -h
    &quot;&quot;&quot;
}