Skip to content

Commit

Permalink
Merge pull request #11 from WEHI-ResearchComputing/mosdepth
Browse files Browse the repository at this point in the history
Add mosdepth coverage to multiqc report
  • Loading branch information
JocelynSP authored Oct 16, 2024
2 parents 6f0a0dc + 6983575 commit 50a2c6a
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ RUN conda update --all -c conda-forge --override-channels && \
bwa=0.7.17 \
samtools=1.16.1 \
fastqc=0.11.8-0 \
multiqc=1.12.0 \
mosdepth=0.3.8 \
multiqc=1.12.0 \
&& conda clean -ay
5 changes: 5 additions & 0 deletions config/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ process {
memory = { 4.GB * task.attempt }
time = '12h'
}
withLabel: Mosdepth {
cpus = 5
memory = { 4.GB * task.attempt }
time = '2h'
}
withLabel: Multiqc {
cpus = 2
memory = { 1.GB * task.attempt }
Expand Down
13 changes: 12 additions & 1 deletion config/multiqc_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
extra_fn_clean_exts:
- "_R1"
export_plots: true

remove_sections:
- fastqc_per_sequence_gc_content
- fastqc_adapter_content
- fastqc_per_base_sequence_content
- mosdepth-coverage-dist-cov
mosdepth_config:
general_stats_coverage:
- 10
- 30
exclude_contigs:
- "*_API_*"
- "*_M*"
5 changes: 5 additions & 0 deletions config/nextflow_sh.config
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ profiles {
withLabel:Fastqc {
module='fastqc/0.11.8'
}
withLabel:Mosdepth {
}
withLabel:Multiqc {
module ='MultiQC/1.10.1'
}
Expand All @@ -70,6 +72,9 @@ profiles {
withLabel:Fastqc {
conda= "envs/fastqc.yaml"
}
withLabel:Mosdepth {
conda= "envs/mosdepth.yaml"
}
withLabel:Multiqc {
conda ='envs/multiqc.yaml'
}
Expand Down
8 changes: 7 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ include { RPlotFull } from './modules/stvariant.nf'
include { RPlotROI } from './modules/stvariant.nf'

include{ FastQC } from './modules/qc.nf'
include{ MosDepth } from './modules/qc.nf'
include{ MultiQC } from './modules/qc.nf'

process foo {
Expand Down Expand Up @@ -129,7 +130,12 @@ workflow {

merged_ch=Merge(parent_ch) // Emits tuple val(parentId),path(parentId.bam)
//----------------QC tools------------------------------------------
MultiQC(FastQC(bam_ch.bamnodup.map{row->row[1]}.unique({it.baseName}).collect()).zip.collect().ifEmpty([]))
//MultiQC integrates files from fastqc and mosdepth, found in input dir, into single report
fastqc_ch=FastQC(bam_ch.bamnodup.map{row->row[1]}.unique({it.baseName}).collect())

mosdepth_ch=MosDepth(bam_ch.bamnodup.join(bam_ch.bai)) // join bams with their index based on groupId

MultiQC( fastqc_ch.zip.mix(mosdepth_ch).collect().ifEmpty([]) )
//----------------BCF tools----------------------------------------
//BCF Input Channel Emits parentId,groupId,ref,bamlist,bams,parentbams
input_ch.map{row -> tuple(row[0],row[4],row[5])}
Expand Down
18 changes: 18 additions & 0 deletions modules/qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ process FastQC {
"""
}

process MosDepth {
label 'Mosdepth'
tag "${groupId}"
publishDir "${params.outdir}/QC", mode: 'copy'
cache true
input:
tuple val(sampleId), path(bam), path(bai)

output:
path("*.global.dist.txt"), emit: txt


script:
"""
mosdepth -t ${task.cpus} --no-per-base --mapq 10 ${bam.baseName} ${bam}
"""
}

process MultiQC {
label 'Multiqc'
cache true
Expand Down
4 changes: 2 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ profiles {
docker.enabled = false
singularity.pullTimeout = "3h"
process {
withLabel: 'BWAAlign|Samtools|Bcftools|Fastqc|Multiqc|RGridss|Rfilter|IndexDedup' {
withLabel: 'BWAAlign|Samtools|Bcftools|Fastqc|Mosdepth|Multiqc|RGridss|Rfilter|IndexDedup' {
container = "ghcr.io/wehi-researchcomputing/nf-malaria-variant-analysis:latest"
}
}
Expand All @@ -45,7 +45,7 @@ profiles {
apptainer.enabled = false
singularity.enabled = false
process {
withLabel: 'BWAAlign|Samtools|Bcftools|Fastqc|Multiqc|RGridss|Rfilter|IndexDedup' {
withLabel: 'BWAAlign|Samtools|Bcftools|Fastqc|Mosdepth|Multiqc|RGridss|Rfilter|IndexDedup' {
container = "ghcr.io/wehi-researchcomputing/nf-malaria-variant-analysis:latest"
}
}
Expand Down

0 comments on commit 50a2c6a

Please sign in to comment.