diff --git a/clean.nf b/clean.nf index 5c0dab7..00f245e 100755 --- a/clean.nf +++ b/clean.nf @@ -181,7 +181,6 @@ lib_pairedness = params.input_type == 'illumina' ? 'paired' : 'single' include { prepare_contamination } from './workflows/prepare_contamination_wf' addParams( tool: tool ) include { check_own as prepare_keep } from './modules/prepare_contamination' - include { clean } from './workflows/clean_wf' addParams( tool: tool, lib_pairedness: lib_pairedness ) include { keep } from './workflows/keep_wf' addParams( tool: tool, lib_pairedness: lib_pairedness ) include { summarize } from './workflows/summarize_wf' @@ -196,13 +195,10 @@ workflow { contamination = prepare_contamination.out clean(input_ch, contamination, nanoControlBedChannel, 'map-to-remove') - - bam_sort = clean.out.sort_bam_ch - + if (!params.bbduk) { - - summarize(bam_sort) - + bam_sort = clean.out.sort_bam_ch + summarize(bam_sort) } if (params.keep){ diff --git a/workflows/clean_wf.nf b/workflows/clean_wf.nf index 6d6c234..5c76a1c 100644 --- a/workflows/clean_wf.nf +++ b/workflows/clean_wf.nf @@ -21,6 +21,7 @@ workflow clean { flagstats = Channel.empty() out_reads = bbduk.out.cleaned_reads.concat(bbduk.out.contaminated_reads) bams_bai = Channel.empty() + sort_bam_ch = Channel.empty() } else { minimap2(input, contamination) | sort_bam | index_bam | ( idxstats_from_bam & flagstats_from_bam ) @@ -50,7 +51,7 @@ workflow clean { idxstats = idxstats_from_bam.out flagstats = flagstats_from_bam.out out_reads = fastq_from_bam.out - sort_bam_ch = sort_bam.out + sort_bam_ch = sort_bam.out } emit: @@ -59,5 +60,5 @@ workflow clean { flagstats out_reads bams_bai - sort_bam_ch + sort_bam_ch }