Nextflow - using mutiple input channels
2
1
Entering edit mode
10 months ago

Hi, I'm writing a Nextflow module for a CNV caller, and I'm having issues with the input files. It requires 2 input files from other processes which have been ported into channels, but when I try to call the required channels I get the error

Multiple channels are not allowed on 'from' input declaration

Is there a way to combine channels? I have tried joining the channels but it still came back with the error. The full code block is below. This is written in DSL1.

// Calculate Copy Number Variation from RNAseq data
process runRNAseqCNV {

tag { filename + ' - RNAseq CNV Caller' }

publishDir "${params.outDir}/${group}/${filename}/RNAseqCNV", mode: 'copy'

label 'rEnv'

input:
set group,
    sample,
    filename
    file(vcf) from results_GATK
    file("counts.Rdata") from ch_counts

output:
file("cnv_metadata.csv"),
file("config"),
file("estimations_table.tsv"),
file("manual_an_table.tsv"),
file("sampleCounts.csv"),
set group,
    sample,
    filename

script:
"""
${workflow.projectDir}/scripts/nf-cnv_caller.R \
-f ${filename} \
-g ${group} \
-o ${params.outDir}

"""
}
channels nextflow • 1.5k views
ADD COMMENT
0
Entering edit mode

You are using the old deprecated DSL1 syntax. A recent nextflow will not de-facto accept your code.

ADD REPLY
1
Entering edit mode
10 months ago

(not tested) your code is missing some commas to separate multiple input output channels.




// Calculate Copy Number Variation from RNAseq data
process runRNAseqCNV {

tag "${filename}"


input:
tuple group,  sample,  filename,   path(vcf) from results_GATK
path("counts.Rdata") from ch_counts

output:
path("cnv_metadata.csv")
path("config")
path("estimations_table.tsv")
file("manual_an_table.tsv")
path("sampleCounts.csv")
tuple group, sample, filename

script:
"""
${workflow.projectDir}/scripts/nf-cnv_caller.R \
-f ${filename} \
-g ${group} \
-o .
"""
}
ADD COMMENT
1
Entering edit mode
10 months ago

Probably not too helpful in this specific instance, but if you are just learning, then why learn NF DSL1 and not DSL2 ? I think DSL2 is cleaner and easier, even if you don't make it hyper-modular using all the modules and multiple containers per pipeline (I don't). AFAIK DSL1 will be deprecated in the future, and most pipelines I see now are DSL2.

You probably know, but there are docs for DSL2 here https://www.nextflow.io/docs/latest/dsl2.html

Just my 2 cents.

ADD COMMENT
1
Entering edit mode

Most importantly, you'll get good support for DSL2 as everyone is using that now, while learning deprecation-ware is a waste of time. +1 for dsl2! I see though that many tutorials online are still dsl1 so it is easy to fall into that trap as a beginner. Be sure to learn dsl2 though.

ADD REPLY
1
Entering edit mode

Unfortunately, I'm dealing with an existing workflow that is written in DSL1. I'm adding in some new modules as a short-term solution, but the long-term plan is to rewrite the whole workflow in DSL2. I'm used to working in DSL2 for all my other Nexflow pipelines, which is why this is a bit of a headscratcher for me. I'll try the above suggestion and see how I go.

ADD REPLY

Login before adding your answer.

Traffic: 2082 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6