Skip to content

Commit

Permalink
Merge pull request #121 from heylf/dev
Browse files Browse the repository at this point in the history
Dev - Adding FastQC to the pipeline, with integration into MultiQC
  • Loading branch information
apeltzer committed Jul 5, 2022
2 parents 9e8a1cc + ab4b073 commit abca10c
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 15 deletions.
14 changes: 14 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
- [:warning: Please read this documentation on the nf-core website: https://nf-co.re/scrnaseq/output](#warning-please-read-this-documentation-on-the-nf-core-website-httpsnf-corescrnaseqoutput)
- [Introduction](#introduction)
- [Pipeline overview](#pipeline-overview)
- [FastQC](#fastqc)
- [Kallisto & Bustools Results](#kallisto--bustools-results)
- [STARsolo](#starsolo)
- [Salmon Alevin & AlevinQC](#salmon-alevin--alevinqc)
Expand All @@ -20,6 +21,19 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
- [MultiQC](#multiqc)
- [Pipeline information](#pipeline-information)

## FastQC

See [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc) for details about FastQC.

The pipeline analyzes the raw data and generates for each file a FastQC report. All report are collected in MultiQC.

**Output directory: `results/fastqc`**

- `.html`
- Contains the FastQC report.
- `.zip`
- Contains additional information, such as individual plots, and FastQC raw data.

## Kallisto & Bustools Results

See [Kallisto](https://pachterlab.github.io/kallisto/about) for details about Kallisto and [Bustools](https://bustools.github.io/) for more information on BusTools.
Expand Down
35 changes: 22 additions & 13 deletions modules/local/multiqc.nf
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
process MULTIQC {
label 'process_medium'

conda (params.enable_conda ? "bioconda::multiqc=1.10.1" : null)
conda (params.enable_conda ? 'bioconda::multiqc=1.11' : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/multiqc:1.10.1--py_0' :
'quay.io/biocontainers/multiqc:1.10.1--py_0' }"
'https://depot.galaxyproject.org/singularity/multiqc:1.11--pyhdfd78af_0' :
'quay.io/biocontainers/multiqc:1.11--pyhdfd78af_0' }"

input:
path 'multiqc_config.yaml'
path multiqc_custom_config
path software_versions
path ch_multiqc_config
path ch_multiqc_custom_config
path software_versions_yaml
path workflow_summary
path ('fastqc/*')
path ("STAR/*")
path ("salmon_alevin/*")

output:
path "*multiqc_report.html" , emit: report
path "*_data" , emit: data
path "*variants_metrics_mqc.csv", optional:true, emit: csv_variants
path "*assembly_metrics_mqc.csv", optional:true, emit: csv_assembly
path "*_plots" , optional:true, emit: plots
path "*multiqc_report.html", emit: report
path "*_data" , emit: data
path "*_plots" , optional:true, emit: plots
path "versions.yml" , emit: versions

script:
def custom_config = params.multiqc_config ? "--config $multiqc_custom_config" : ''
def args = task.ext.args ?: ''
def custom_config = params.multiqc_config ? "--config $multiqc_custom_config" : ''
"""
multiqc -f $args $custom_config .
multiqc \\
-f \\
$args \\
$custom_config \\
.
cat <<-END_VERSIONS > versions.yml
"${task.process}":
multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" )
END_VERSIONS
"""
}
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ params {
igenomes_base = 's3://ngi-igenomes/igenomes'
igenomes_ignore = false

// MultiQC options
// QC and MultiQC options
skip_fastqc = false
multiqc_config = null
multiqc_title = null
max_multiqc_email_size = '25.MB'
Expand Down
4 changes: 4 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@
"hidden": true,
"fa_icon": "fas fa-bacon"
},
"skip_fastqc": {
"type": "boolean",
"description": "Skip the FastQC reporting feature in the pipeline."
},
"skip_multiqc": {
"type": "boolean",
"description": "Skip the MultiQC reporting feature in the pipeline."
Expand Down
38 changes: 38 additions & 0 deletions subworkflows/local/fastqc.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// Check input samplesheet and get read channels
//
include { FASTQC } from '../../modules/nf-core/modules/fastqc/main'

workflow FASTQC_CHECK {
take:
ch_fastq

main:
ch_fastq
.map { ch -> [ ch[0], ch[1] ] }
.set { ch_fastq }

/*
* FastQ QC using FASTQC
*/
FASTQC ( ch_fastq )
fastqc_zip = FASTQC.out.zip
fastqc_html = FASTQC.out.html

fastqc_zip
.map { it -> [ it[1] ] }
.set { fastqc_zip_only }
fastqc_html
.map { it -> [ it[1] ] }
.set { fastqc_html_only }

fastqc_multiqc = Channel.empty()
fastqc_multiqc = fastqc_multiqc.mix( fastqc_zip_only, fastqc_html_only )
fastqc_version = FASTQC.out.versions

emit:
fastqc_zip
fastqc_html
fastqc_version
fastqc_multiqc
}
13 changes: 12 additions & 1 deletion workflows/scrnaseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multi
// SUBWORKFLOW: Consisting of a mix of local and nf-core/modules
//
include { INPUT_CHECK } from '../subworkflows/local/input_check'
include { FASTQC_CHECK } from '../subworkflows/local/fastqc'
include { KALLISTO_BUSTOOLS } from '../subworkflows/local/kallisto_bustools'
include { SCRNASEQ_ALEVIN } from '../subworkflows/local/alevin'
include { STARSOLO } from '../subworkflows/local/starsolo'
Expand Down Expand Up @@ -107,6 +108,14 @@ workflow SCRNASEQ {

ch_versions = ch_versions.mix(INPUT_CHECK.out.versions)

// Run FastQC
ch_multiqc_fastqc = Channel.empty()
if (!params.skip_fastqc){
FASTQC_CHECK ( ch_fastq )
ch_versions = ch_versions.mix(FASTQC_CHECK.out.fastqc_version)
ch_multiqc_fastqc = FASTQC_CHECK.out.fastqc_multiqc.ifEmpty([])
}

// Run kallisto bustools pipeline
if (params.aligner == "kallisto") {
KALLISTO_BUSTOOLS(
Expand Down Expand Up @@ -181,15 +190,17 @@ workflow SCRNASEQ {
)

if (!params.skip_multiqc) {

ch_workflow_summary = Channel.value(
WorkflowScrnaseq.paramsSummaryMultiqc(workflow, summary_params)
).collectFile(name: 'workflow_summary_mqc.yaml')

MULTIQC(
ch_multiqc_config,
ch_multiqc_custom_config,
ch_multiqc_custom_config.collect().ifEmpty([]),
CUSTOM_DUMPSOFTWAREVERSIONS.out.mqc_yml.collect(),
ch_workflow_summary,
ch_multiqc_fastqc.collect{it[0]}.ifEmpty([]),
ch_multiqc_alevin,
ch_multiqc_star
)
Expand Down

0 comments on commit abca10c

Please sign in to comment.