diff --git a/pipeline/inputs.nf b/pipeline/inputs.nf index d73f38ab600f540c264ce8d8dbb20efa9c74c095..de6222f608a033af8080c9e515d7d090ab8bae1d 100644 --- a/pipeline/inputs.nf +++ b/pipeline/inputs.nf @@ -39,7 +39,7 @@ workflow read_inputs { /* - ch_samplesheet_info - Tuple channel of individual ID, r1 fastqs and r2 fastqs: + ch_samplesheet_info - Tuple channel of individual ID, r1 fastqs and r2 fastqs -OR- BAM and BAI files: [ [ indv1, @@ -53,11 +53,19 @@ workflow read_inputs { ] */ ch_samplesheet = Channel.fromPath(params.sample_sheet, checkIfExists: true) - ch_samplesheet_info = ch_samplesheet.splitCsv(sep:'\t', header: true) - .map( - { line -> [line.individual_id, file(line.read_1), file(line.read_2), line.bam]} - ) - .groupTuple() + + if (params.workflow == 'variant-calling') { + ch_samplesheet_info = ch_samplesheet.splitCsv(sep:'\t', header: true) + .map( + { line -> [line.individual_id, file(line.read_1), file(line.read_2)]} + ) + .groupTuple() + } else if (params.workflow == 'cnv-calling') { + ch_samplesheet_info = ch_samplesheet.splitCsv(sep:'\t', header: true) + .map( + { line -> [line.individual_id, file(line.bam), file(line.bai)]} + ) + } /* ch_individuals - merge of samplesheet and ped file information: @@ -97,7 +105,7 @@ workflow read_inputs { ] */ ch_individuals_by_family = ch_individuals.map({[it[1], it]}) - + emit: ch_ped_file = ch_ped_file ch_ped_file_info = ch_ped_file_info