4
$\begingroup$

I am trying to write a nextflow script below:

/*
 * pipeline input parameters
 */
params.reads = "/path/to/fq/files/"
params.guide_library = "/path/to/guidelibrary/"
params.outdir = "results"

log.info """\
    DUAL GUIDE CRISPR QC - N F   P I P E L I N E
    ===================================
    guide library: ${params.guide_library}
reads        : ${params.reads}
    outdir       : ${params.outdir}
    """
    .stripIndent(true)

/*
 * define the `index` process that creates a binary index
 * given the transcriptome file
 */


process READCOUNT {
    input:
    path guide_library
    tuple val(sample_name) path(reads)

    output:
    path "$sample_name"

    script:
    """
    exactcounts.py -inputlibrary $guide_library -read1 ${reads[0]} -read2 ${reads[1]} -prefix $sample_name
    """
}

workflow {
    Channel
        .fromFilePairs(params.reads, checkIfExists: true)
        .set { read_pairs_ch }
   count_ch = READCOUNT(params.guide_library,read_pairs_ch)
    
}

But am getting the following error:

Process 'READCOUNT' has been already used -- If you need to reuse the same component, include it with a different name or include it in a different workflow context
$\endgroup$

1 Answer 1

6
$\begingroup$

I believe adding a comma after val(sample_name) on line tuple val(sample_name) path(reads) will solve the issue.

EDIT: Also documented here: https://github.com/nextflow-io/nextflow/discussions/2714

$\endgroup$
1
  • $\begingroup$ Good eye! I had the same and I was sure something was odd but couldn't "see" the missing comma. The resulting error message is really misleading in this case... $\endgroup$
    – dojuba
    Commented Apr 23 at 15:41

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.