Hi!
I’m quite new in nextflow, and I already saw some other similar topics here, but none seem to work for me.
I am trying to run a process that takes the following tuple as input:
input:
tuple val(meta), path(samplesheet), path(run_dir)
For this, I defined two parameters, that I pass from the command line as:
-- samplecsv <path to csv file> --bcldata <path to BCL tar.gz or folder>
These parameters are passed from my main workflow to a subworkflow like this:
bcl_dir = params.bcldata
sample_sheet = params.samplecsv
workflow MYPIPELINE_MAIN {
take:
bcl_dir // path: BCL input
sample_sheet // path: SampleSheet CSV
main:
MYPIPELINE_CORE(bcl_dir, sample_sheet)
emit:
demux_fastq = MYPIPELINE_CORE.out
}
Inside the subworkflow (MYPIPELINE_CORE
), I pass them into the process using a tuple:
workflow MYPIPELINE_CORE {
take:
bcl_dir // path to BCL tar.gz
sample_sheet // path to samplesheet CSV
main:
Channel
.of(tuple([id: 'run1'], file(sample_sheet), file(bcl_dir)))
.set { ch_combinedTuple }
ch_combinedTuple.view { "Combined tuple-channel content: $it" }
BCL2FASTQ(ch_combinedTuple)
}
I verified via println
statements that sample_sheet
and bcl_dir
are java.lang.String
and correctly point to valid files.
However, when the process has to be run i come across this error:
Combined tuple-channel content: [[id:run1], /beegfs/home/lrenteria/my_pipeline/data/Samplesheet.csv, /beegfs/home/lrenteria/my_pipeline/data/BCL_data.tar.gz]
ERROR ~ Invalid method invocation `call` with arguments: [<data row from samplesheet>] (java.util.ArrayList) on _closure6 type
Interestingly, when I run a minimal test with only the process and the same tuple construction, everything works fine:
include { BCL2FASTQ } from './modules/nf-core/bcl2fastq'
Channel
.of( tuple([id: 'run1'], file(params.samplecsv), file(params.bcldata)) )
.set { ch_test }
workflow {
ch_test.view { "Test channel content: $it" }
BCL2FASTQ(ch_test)
}
Any idea what might be going wrong in the subworkflow context?
Thanks a lot in advance!