Issue with Nextflow Workflow Execution

Hi everyone,

I am struggleing with the workflow issue

process DNAm_Full_Matrix {
    input:
    path R_files, from: 'R_files/*'

    publishDir "${params.outdir}/DNAm_Full_Matrix", mode: 'copy', pattern: '*.csv'

    output:
    path "DNAm_Full_Matrix.csv", emit: DNAm_Full_Matrix, optional: true

    shell:
    """
    mkdir -p ${params.outdir}/DNAm_Full_Matrix
    Rscript ${baseDir}/bin/Full_DNAm_Matrix.R ${params.pipeline} ${params.outdir}/Methylation ${params.outdir}/DNAm_Full_Matrix
    """
}

Process 2: Estimate_cell_counts

process Estimate_cell_counts {
    input:
    path ecc, from: 'ecc/*'

    publishDir "${params.outdir}/Estimate_cell_count", mode: 'copy', pattern: '*.csv'

    output:
    path ("Estimate_cell_counts.csv"), emit: Estimate_cell_counts, optional: true

    shell:
    """
    mkdir -p ${params.outdir}/Estimate_cell_count
    Rscript ${baseDir}/bin/Estimate_cell_counts.R ${params.pipeline} ${baseDir}/data ${params.outdir}/DNAm_Full_Matrix ${params.outdir}/Estimate_cell_count
    """
}

Workflow:

Channel.empty()
    .mix(DNAm_Full_Matrix.out)
    .map { files -> files }
    .collect()
    .set { ecc }
Estimate_cell_counts(ecc)

if optional: false I m not able to create a dnam full matrix

What might be causing the workflow to not execute properly?

Welcome to the forum, @onur_oztornaci!

This is DSL1 code and won’t work on recent versions of Nextflow. My first advice is to convert it to DSL2.

Setting optional to true for an output will make the task end successfully even if the output wasn’t generated by the task. If your task is failing to produce such output, setting optional to false will make the task fail.

It’s also important to us to know what exactly people mean by sentences like “I can’t do this” or “It’s not working”. What do you mean by “I am not able to create a dnam full matrix”? Do you get an error? What error message? What Nextflow version are you using? What Operating System? Can you share the .nextflow.log file for this failed run? The more info and details you share, the better it is for us to help you :smiley: