I have a process for launching program in 2 potential types: single input channel(only tumor bam) or two input channel (tumor and normal bam). How i can figure out this problem?
Code? for understanding problem
workflow {
ch_raw_reads = channel.fromFilePairs(params.Tumor_raw_reads)
ch_raw_reads_var2= channel.fromFilePairs(params.Normal_raw_reads )
TEST(ch_raw_reads) // get error below
TEST(ch_raw_reads)
TEST(ch_raw_reads, ch_raw_reads_var2)
}
process TEST{
input:
tuple val(sample_id), path(reads) //always
tuple val(sample_id_var_2), path(reads_var_2) // sometimes
script:
def extra_param = sample_id_var_2 ? "--input2 $reads_var_2" : ""
"""
some_program \
--input1 $reads \
$extra_param
"""
}
I find solution Optional input path , but when i use them, i get next error:
ERROR ~ Path string cannot be empty
– Check ‘.nextflow.log’ file for details
ERROR ~ Path string cannot be empty
– Check ‘.nextflow.log’ file for details
How i can fix process when it can import both one and two input channel?