This question was also asked on Stack Overflow

I have a Nextflow pipeline that runs a BUSCO search on input data, returns the output and then creates a report based on the output. One of my parameters is the lineage dataset. I would like to have my pipeline run multiple times (preferably at the same time) based on how long my list of lineage datasets is. For example, this is my nextflow.config file. The goal is that my pipeline would run twice in this case. If there are n lineages specified I would like it to run n times.

params { 
    inputFilePath           = "$PWD/input_data/test_data.fasta"
    lineage_datasets        = [
    augustus_species        = "fumigatus"
    mode                    = "geno"
    threads                 = 16
    help                    = false
    outdir {
        main                = "$PWD/results"
    intermediate        = "$PWD/busco_outputs"

The first part of my busco process looks like this:

  publishDir params.outdir.intermediate, mode: 'copy'

    path inputFile
    string lineage_dataset
    path 'hap1/*hap1.txt'

The idea is that each of the summary.txt files will be collected inside of my outdir.intermediate folder which is where my createReport process will target. For context, this is my createReport process:

process createReport {

  publishDir params.outdir.main, mode: 'copy'

    path 'busco_outputs/*'

    path 'report.html'

    source "$launchDir/venv/bin/activate"
    report.py > report.html

I have tried the following in my workflow process but it does not seem to work:

workflow {
  runBuscoChannel = Channel.fromPath(params.inputFilePath).cross(Channel.of(params.lineage_datasets)) 
  | mix 
  | collect 
  | set { outputs }


When I try to run the pipeline it does not run properly

Does anyone have any ideas of how I could change my file to allow for this? Thanks very much!


1 Answer 1


I think the answer to your question is the each input repeaters. You can also check Nextflow FAQ for the question on how to iterate over a process or a file.

Not in front of a PC now but you could try something like each lineage_dataset.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.