I'm traying to launch a Nextflow pipeline, but it throws the following error:
ERROR ~ No signature of method: groovyx.gpars.dataflow.DataflowBroadcast.into() is applicable for argument types: (Script_dd34529ec87c0dd2$_runScript_closure3) values: [Script_dd34529ec87c0dd2$_runScript_closure3@39652a30]
Possible solutions: any(), find(), bind(java.lang.Object), print(java.io.PrintWriter), find(groovy.lang.Closure), any(groovy.lang.Closure)
The error is thrown by this part of the code:
Channel
.fromFilePairs("$root/**/*.trk", size: -1) { it.parent.name }
.into{ tractogram; tractogram_for_check } // [sid, tractogram.trk]
I think the problem is that it can't find the file, but it is in the correct folder and has the correct name and extension. How could I solve it? The GitHub source code of this pipeline.
I suspect that the main issue here is the usage of DSL-1. The nextflow docs state:
In Nextflow version 22.03.0-edge, DSL2 became the default DSL version. In version 22.12.0-edge, DSL1 support was removed
So you should see if you can install a version of Nextflow < 22.03. or use >=22.03;<22.12 and add nextflow.enable.dsl=1
to main.nf
Regarding the "finding the input-files" question: As I read the code you need to put your files in subfolders of the input-directory given as parameter. E.g your datastructure may look like this:
input_dir/
sample1/
file1.trk
fileN.trk
sample2/
file1.trk
sampleN/
file1.trk
file2.trk
file3.trk
others/
sampleN_plus_1/
file1.trk
and the --input
parameter should point to input_dir/
in this example. Above file-structure would produce a channel like this (which should be fine for this pipeline):
[sample1, [input_dir/sample1/file1.trk, input_dir/sample1/fileN.trk]],
[sample2, [input_dir/sample2/file1.trk]],
[sampleN, [input_dir/sampleN/file1.trk, input_dir/sampleN/file2.trk, input_dir/sampleN/file3.trk]],
[sampleN_plus_1, [input_dir/others/sampleN_plus_1/file1.trk]]