Skip to content

Commit

Permalink
Merge pull request #108 from rki-mf1/fix-bbduk-after-summary-PR
Browse files Browse the repository at this point in the history
fix bbduk which has no bam channel for the new summary script
  • Loading branch information
hoelzer authored Nov 8, 2024
2 parents 5494993 + a612ecb commit 6385b01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 3 additions & 7 deletions clean.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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){
Expand Down
5 changes: 3 additions & 2 deletions workflows/clean_wf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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:
Expand All @@ -59,5 +60,5 @@ workflow clean {
flagstats
out_reads
bams_bai
sort_bam_ch
sort_bam_ch
}

0 comments on commit 6385b01

Please sign in to comment.