Skip to content

Commit

Permalink
Use BED file for mosdepth
Browse files Browse the repository at this point in the history
  • Loading branch information
fellen31 committed Dec 5, 2023
1 parent ee30a5d commit 16d9ebd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
8 changes: 7 additions & 1 deletion conf/modules/qc.config
Original file line number Diff line number Diff line change
Expand Up @@ -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}" },
Expand Down
24 changes: 10 additions & 14 deletions subworkflows/local/qc_aligned_reads.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
3 changes: 2 additions & 1 deletion workflows/skierfe.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 16d9ebd

Please sign in to comment.