11#! /usr/bin/env nextflow
22
33nextflow. enable. dsl = 2
4- include {ADAPTER_TRIM } from ' ./modules/local/adapter_trim'
4+ include { ADAPTER_TRIM } from ' ./modules/local/adapter_trim'
55include { STAR_GENOME_INDEX } from ' ./modules/local/index_genome'
66include { SUBSET_1KGP_VCF } from ' ./modules/local/subset_1kgp'
77include { STAR_ALIGNMENT_WASP } from ' ./modules/local/alignment'
@@ -10,7 +10,7 @@ include { REPORT } from './modules/local/report'
1010workflow {
1111 star_idx_ch = STAR_GENOME_INDEX (
1212 channel. fromPath(params. reference_fa),
13- channel. fromPath(params. gencode_gtf)
13+ channel. fromPath(params. gencode_gtf),
1414 )
1515 reads_ch = channel. fromPath(params. sample_sheet)
1616 .splitCsv(header : true , sep : " ," )
@@ -22,27 +22,27 @@ workflow {
2222 }
2323 vcf_ch_in = channel. fromPath(params. sample_sheet)
2424 .splitCsv(header : true , sep : " ," )
25- .map { row ->
25+ .map { row ->
2626 def meta = [
2727 sampleid : row. sample
2828 ]
2929 [meta, file(params. phased_vcf_dir)]
3030 }
31- regions_vcf_ch = channel. fromPath(params. regions_vcf, checkIfExists : true )
31+ def regions_vcf_ch = params . regions_vcf ? channel. fromPath(params. regions_vcf, checkIfExists : true ) : channel . empty( )
3232 trimmed_reads_ch = ADAPTER_TRIM (reads_ch)
3333 vcf_ch = SUBSET_1KGP_VCF (vcf_ch_in)
3434 align_in_ch = vcf_ch. subset_phased_vcf
3535 .join(trimmed_reads_ch. reads)
3636 .combine(star_idx_ch. star_index_dir)
3737 .map { meta, vcf, fq1, fq2, star_dir ->
38- [ meta, vcf, star_dir, fq1, fq2 ]
38+ [meta, vcf, star_dir, fq1, fq2]
3939 }
4040 ac_in_ch = STAR_ALIGNMENT_WASP (align_in_ch)
41- if (regions_vcf_ch ) {
41+ if (params . regions_vcf ) {
4242 ALLELE_COUNT (
4343 ac_in_ch. bam,
4444 file(params. reference_fa),
45- regions_vcf_ch
45+ regions_vcf_ch,
4646 )
4747 }
4848 report_in_ch = channel. empty()
@@ -51,4 +51,4 @@ workflow {
5151 report_in_ch = report_in_ch. mix(ac_in_ch. log. map { _meta , log_file -> log_file })
5252 report_in_ch = report_in_ch. mix(ac_in_ch. stats. map { _meta , log_file -> log_file })
5353 REPORT (report_in_ch. collect())
54- }
54+ }
0 commit comments