diff --git a/conf/modules/qc.config b/conf/modules/qc.config index 228920e3..2966216b 100644 --- a/conf/modules/qc.config +++ b/conf/modules/qc.config @@ -55,7 +55,13 @@ process { } withName: MOSDEPTH { - ext.args = "--by 500 --no-per-base" + + // If pipeline is run with bed-file, then don't run wth '--by 500' + if(params.bed) { + ext.args = "--no-per-base" + } else { + ext.args = "--by 500 --no-per-base" + } publishDir = [ path: { "${params.outdir}/qc/mosdepth/${meta.id}" }, diff --git a/subworkflows/local/qc_aligned_reads.nf b/subworkflows/local/qc_aligned_reads.nf index 343cd1ec..74be1adf 100644 --- a/subworkflows/local/qc_aligned_reads.nf +++ b/subworkflows/local/qc_aligned_reads.nf @@ -4,26 +4,22 @@ include { MOSDEPTH } from '../../modules/nf-core/mosdepth/main.nf' workflow QC_ALIGNED_READS { take: - ch_bam // channel: [ val(meta), bam ] - ch_bai // channel: [ val(meta), bai ] - ch_fasta // channel: [ val(meta), fasta ] + ch_bam_bai // channel: [ val(meta), [bam, bai] ] + ch_fasta // channel: [ val(meta), fasta ] + ch_bed // channel: [ val(meta), bed ] main: ch_versions = Channel.empty() // Prepare inputs - ch_bam - .join(ch_bai) - .set{ ch_cramino_in } - - // Prepare inputs - ch_cramino_in - .map{ meta, bam, bai -> [ meta, bam, bai, [] ] } - .set{ ch_mosdepth_in } - - CRAMINO (ch_cramino_in) + ch_bam_bai + .combine(ch_bed.map{ meta, bed -> bed }) + //.map{ meta, bam, bai -> [ meta, bam, bai, [] ] } + .set{ ch_mosdepth_in } + + CRAMINO (ch_bam_bai) MOSDEPTH(ch_mosdepth_in, ch_fasta) - + // Gather versions ch_versions = ch_versions.mix(CRAMINO.out.versions.first()) ch_versions = ch_versions.mix(MOSDEPTH.out.versions.first()) diff --git a/workflows/skierfe.nf b/workflows/skierfe.nf index 48568c17..e224551a 100644 --- a/workflows/skierfe.nf +++ b/workflows/skierfe.nf @@ -40,6 +40,7 @@ ch_extra_snfs = params.extra_snfs ? Channel.fromSamplesheet('extra_snfs' ch_extra_gvcfs = params.extra_gvcfs ? Channel.fromSamplesheet('extra_gvcfs', immutable_meta: false) : Channel.empty() ch_tandem_repeats = params.tandem_repeats ? Channel.fromPath(params.tandem_repeats).collect() : Channel.value([]) ch_bed = params.bed ? Channel.fromPath(params.bed).map{ [ it.getSimpleName(), it]}.collect() : Channel.empty() +ch_input_bed = params.bed ? Channel.fromPath(params.bed).map{ [ it.getSimpleName(), it]}.collect() : Channel.value([]) // This should be able to in schema? if (params.split_fastq < 250 & params.split_fastq > 0 ) { exit 1, '--split_fastq must be 0 or >= 250'} @@ -241,7 +242,7 @@ workflow SKIERFE { .flatten()) .set{ ch_snv_calling_in } - QC_ALIGNED_READS( bam, bai, fasta ) + QC_ALIGNED_READS( bam_bai, fasta, ch_input_bed ) // Call SVs with Sniffles2 STRUCTURAL_VARIANT_CALLING( bam_bai , ch_extra_snfs, fasta, fai, ch_tandem_repeats )