diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 97aa453..05aa2a9 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -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 diff --git a/config/modules.config b/config/modules.config index 2760781..4a65233 100644 --- a/config/modules.config +++ b/config/modules.config @@ -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 } diff --git a/config/multiqc_config.yaml b/config/multiqc_config.yaml index 93ea0fb..12d007d 100644 --- a/config/multiqc_config.yaml +++ b/config/multiqc_config.yaml @@ -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*" diff --git a/config/nextflow_sh.config b/config/nextflow_sh.config index 715f9f0..fac9785 100644 --- a/config/nextflow_sh.config +++ b/config/nextflow_sh.config @@ -47,6 +47,8 @@ profiles { withLabel:Fastqc { module='fastqc/0.11.8' } + withLabel:Mosdepth { + } withLabel:Multiqc { module ='MultiQC/1.10.1' } @@ -70,6 +72,9 @@ profiles { withLabel:Fastqc { conda= "envs/fastqc.yaml" } + withLabel:Mosdepth { + conda= "envs/mosdepth.yaml" + } withLabel:Multiqc { conda ='envs/multiqc.yaml' } diff --git a/main.nf b/main.nf index ff88e08..bf8c9c3 100644 --- a/main.nf +++ b/main.nf @@ -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 { @@ -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])} diff --git a/modules/qc.nf b/modules/qc.nf index 9236d42..59041c7 100644 --- a/modules/qc.nf +++ b/modules/qc.nf @@ -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 diff --git a/nextflow.config b/nextflow.config index 7bf730a..d2a23aa 100644 --- a/nextflow.config +++ b/nextflow.config @@ -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" } } @@ -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" } }