Skip to content

Commit 237ee19

Browse files
committed
Updating multiqc to use local config file
1 parent e30fb46 commit 237ee19

File tree

27 files changed

+110
-107
lines changed

27 files changed

+110
-107
lines changed

conf/multiqc_config.yaml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1-
title: "Pipeline report"
2-
subtitle: "Best-practice workflow for EDIT_IN_conf_multiqc_config.yaml"
1+
title: "GMO-check Pipeline report"
2+
subtitle: "Best-practice workflow for detecting GMOs from short read data"
33
custom_logo: "pipelinelogo.png"
4-
custom_logo_title: "Pipeline title here"
5-
custom_logo_url: "http://www.github.com/marchoeppner"
4+
custom_logo_title: "marchoeppner/gmo-check"
5+
custom_logo_url: "http://www.github.com/marchoeppner/gmo-check"
6+
skip_versions_section: true
67

78
extra_fn_clean_exts:
89
- _R1
910
- _R2
1011
- _duplicate_metrics.txt
1112
- .pass
13+
- _noMatch
1214

1315
report_comment: >
14-
This report has been generated automatically by EDIT_IN_conf_multiqc_config.yaml.
15-
For help interpreting the outputs, please see: https://github.com/marchoeppner/update_url
16+
This report has been generated automatically by marchoeppner/gmo-check.
17+
For help interpreting the outputs, please see: https://github.com/marchoeppner/gmo-check
1618
report_header_info:
17-
- Contact E-mail: "[email protected]"
18-
- Application Type: "EDIT_IN_conf_multiqc_config.yaml"
19+
- Contact E-mail: "[email protected]"
20+
- Application Type: "Variant detection"
1921

2022
top_modules:
2123
- 'general_stats'
24+
- 'gmo_check_result'
2225

26+
report_section_order:
27+
software_versions:
28+
order: -1001

docs/output.md

+18
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
11
# Outputs
2+
3+
## Ergebnisse
4+
<details markdown=1>
5+
<summary>Reports</summary>
6+
7+
- `name_der_analyse`.xlsx: Eine Tabelle alleer Ergebnisse in Excel Format; ein Blatt pro Test mit je einer Zeile pro Probe und den dazugehörigen Analysen.
8+
- `JSON/*.json`: Die aufbereiteten Ergebnisse für jede Probe und jede Analysestrategie in einem standardisierten JSON Format.
9+
10+
</details>
11+
12+
# Qualitätskontrolle
13+
<details markdown=1>
14+
<summary>MultiQC</summary>
15+
16+
- MultiQC/`name_der_Analyse`_multiqc_report.html: Eine grafische Aufstellung aller QC Metriken, Software Versionen und der primären Ergebnisse
17+
18+
</details>
19+

lib/WorkflowPipeline.groovy

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class WorkflowPipeline {
1212
log.info 'Must provide a run_name (--run_name)'
1313
System.exit(1)
1414
}
15-
if(params.tools.contains("bwa2") && !params.reference_base) {
16-
log.info "Cannot run the alignment workflow without genome references (--reference_base). Please check the documentation!"
15+
if (params.tools.contains('bwa2') && !params.reference_base) {
16+
log.info 'Cannot run the alignment workflow without genome references (--reference_base). Please check the documentation!'
1717
System.exit(1)
1818
}
1919
}

main.nf

-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ include { BUILD_REFERENCES } from './workflows/build_references'
3333
multiqc_report = Channel.from([])
3434

3535
workflow {
36-
3736
if (params.build_references) {
3837
BUILD_REFERENCES()
3938
} else {
40-
4139
GMO()
4240

4341
multiqc_report = multiqc_report.mix(GMO.out.qc).toList()

modules/biobloomtools/categorizer/main.nf

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
process BIOBLOOMTOOLS_CATEGORIZER {
2-
32
publishDir "${params.outdir}/Processing/Bloomfilter", mode: 'copy'
43

54
label 'short_parallel'
@@ -20,13 +19,13 @@ process BIOBLOOMTOOLS_CATEGORIZER {
2019
path("*summary.tsv"), emit: results
2120

2221
script:
23-
filtered = meta.sample_id + "_" + meta.library_id + "_" + meta.readgroup_id
24-
r1_trim = filtered + "_noMatch_1.fq.gz"
25-
r2_trim = filtered + "_noMatch_2.fq.gz"
22+
filtered = meta.sample_id + '_' + meta.library_id + '_' + meta.readgroup_id
23+
r1_trim = filtered + '_noMatch_1.fq.gz'
24+
r2_trim = filtered + '_noMatch_2.fq.gz'
2625

2726
"""
2827
biobloomcategorizer -p $filtered -t ${task.cpus} -n --fq --gz_out -i -e -f "${params.bloomfilter}" $r1 $r2
29-
28+
3029
cat <<-END_VERSIONS > versions.yml
3130
"${task.process}":
3231
BioBloomtools: \$(biobloomcategorizer -version 2>&1 | head -n1 | sed -e "s/.*) //g")

modules/blast/makeblastdb/main.nf

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ process BLAST_MAKEBLASTDB {
1818
path("versions.yml"), emit: versions
1919

2020
script:
21-
def is_compressed = fasta.getExtension() == 'gz' ? true : false
22-
def fasta_name = is_compressed ? fasta.getBaseName() : fasta
21+
def isCompressed = fasta.getExtension() == 'gz' ? true : false
22+
def fastaName = is_compressed ? fasta.getBaseName() : fasta
2323

2424
"""
25-
if [ "${is_compressed}" == "true" ]; then
26-
gzip -c -d ${fasta} > ${fasta_name}
25+
if [ "${isCompressed}" == "true" ]; then
26+
gzip -c -d ${fasta} > ${fastaName}
2727
fi
2828
2929
makeblastdb \
30-
-in $fasta_name \
30+
-in $fastaName \
3131
-dbtype nucl \
32-
-out $fasta_name
32+
-out $fastaName
3333
3434
cat <<-END_VERSIONS > versions.yml
3535
"${task.process}":

modules/bwamem2/index/main.nf

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
process BWAMEM2_INDEX {
2-
32
tag "${meta.id}"
43

54
label 'medium_serial'
@@ -10,14 +9,14 @@ process BWAMEM2_INDEX {
109
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
1110

1211
input:
13-
tuple val(meta),path(fasta)
12+
tuple val(meta), path(fasta)
1413

1514
output:
1615
path('*'), emit: bwa_index
1716
path("versions.yml"), emit: versions
1817

1918
script:
20-
"""
19+
"""
2120
bwa-mem2 index $fasta
2221
2322
cat <<-END_VERSIONS > versions.yml
@@ -26,5 +25,4 @@ process BWAMEM2_INDEX {
2625
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
2726
END_VERSIONS
2827
"""
29-
3028
}

modules/bwamem2/mem/main.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ process BWAMEM2_MEM {
77

88
input:
99
tuple val(meta), path(left), path(right)
10-
tuple val(fasta),val(fai),val(dict)
10+
tuple val(fasta), val(fai), val(dict)
1111

1212
output:
1313
tuple val(meta), path(bam), emit: bam

modules/fastp/main.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ process FASTP {
3333
-w ${task.cpus} \
3434
-j $json \
3535
-h $html \
36-
--length_required 35
36+
--length_required 35
3737
3838
cat <<-END_VERSIONS > versions.yml
3939
"${task.process}":

modules/freebayes/main.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ process FREEBAYES {
1212

1313
input:
1414
tuple val(meta), path(bam), path(bai)
15-
tuple path(fasta),path(fai),path(dict)
15+
tuple path(fasta), path(fai), path(dict)
1616
path(target_bed)
1717

1818
output:

modules/gunzip/main.nf

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
process GUNZIP {
2-
32
tag "${meta.id}"
43

54
label 'medium_serial'
@@ -12,10 +11,10 @@ process GUNZIP {
1211
'nf-core/ubuntu:20.04' }"
1312

1413
input:
15-
tuple val(meta),path(zipped)
14+
tuple val(meta), path(zipped)
1615

1716
output:
18-
tuple val(meta),path(unzipped), emit: gunzip
17+
tuple val(meta), path(unzipped), emit: gunzip
1918
path("versions.yml"), emit: versions
2019

2120
script:

modules/helper/blast_to_report.nf

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
process BLAST_TO_REPORT {
2-
32
tag "${meta.sample_id}"
43

54
publishDir "${params.outdir}/Reports/JSON", mode: 'copy'
65

76
input:
8-
tuple val(meta),path(blast)
7+
tuple val(meta), path(blast)
98
path(rules)
109

1110
output:
12-
tuple val(meta),path(report), emit: json
11+
tuple val(meta), path(report), emit: json
1312

1413
script:
15-
report = blast.getBaseName() + ".report.json"
14+
report = blast.getBaseName() + '.report.json'
1615

1716
"""
1817
analyze_blast.rb -b $blast -j $rules -s ${meta.sample_id} > $report
1918
"""
20-
21-
}
19+
}

modules/helper/json_to_mqc.nf

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
process JSON_TO_MQC {
2-
32
tag 'All'
4-
3+
54
publishDir "${params.outdir}/Reports", mode: 'copy'
65

76
input:
@@ -12,7 +11,7 @@ process JSON_TO_MQC {
1211

1312
script:
1413

15-
"""
16-
reports_to_table.rb
17-
"""
14+
'''
15+
reports_to_table.rb
16+
'''
1817
}

modules/helper/json_to_xlsx.nf

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
process JSON_TO_XLSX {
2-
32
tag 'All'
4-
3+
54
publishDir "${params.outdir}/Reports", mode: 'copy'
65

76
input:
@@ -12,8 +11,8 @@ process JSON_TO_XLSX {
1211
//path(delimited), emit: csv
1312

1413
script:
15-
excel = params.run_name + ".xlsx"
16-
delimited = params.run_name + ".csv"
14+
excel = params.run_name + '.xlsx'
15+
delimited = params.run_name + '.csv'
1716

1817
"""
1918
reports_to_xls.rb --outfile $excel

modules/helper/vcf_to_report.nf

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
process VCF_TO_REPORT {
2-
32
tag "${meta.sample_id}"
43

54
publishDir "${params.outdir}/Reports/JSON", mode: 'copy'
65

76
input:
8-
tuple val(meta),path(vcf)
7+
tuple val(meta), path(vcf)
98
path(rules)
109

1110
output:
12-
tuple val(meta),path(report), emit: json
11+
tuple val(meta), path(report), emit: json
1312

1413
script:
15-
report = vcf.getBaseName() + ".report.json"
14+
report = vcf.getBaseName() + '.report.json'
1615

1716
"""
1817
analyze_vcf.rb -v $vcf -j $rules -s ${meta.sample_id} > $report
1918
"""
20-
21-
}
19+
}

modules/input_check.nf

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@ workflow INPUT_CHECK {
99
main:
1010
samplesheet
1111
.splitCsv(header:true, sep: ',')
12-
.map { create_fastq_channel(it) }
12+
.map { fastq_channel(it) }
1313
.set { reads }
1414

1515
emit:
1616
reads // channel: [ val(meta), [ reads ] ]
1717
}
1818

19-
def create_fastq_channel(LinkedHashMap row) {
19+
def fastq_channel(LinkedHashMap row) {
2020
// create meta map
2121
def meta = [:]
2222
meta.sample_id = row.sample_id
2323
meta.readgroup_id = row.readgroup_id
2424
meta.library_id = row.library_id
2525

2626
// add path(s) of the fastq file(s) to the meta map
27-
def fastq_meta = []
27+
def fastqMeta = []
2828
if (!file(row.R1).exists()) {
2929
exit 1, "ERROR: Please check input samplesheet -> Read 1 FastQ file does not exist!\n${row.R1}"
3030
}
3131
if (!file(row.R2).exists()) {
3232
exit 1, "ERROR: Please check input samplesheet -> Read 2 FastQ file does not exist!\n${row.R2}"
3333
}
34-
fastq_meta = [ meta, file(row.R1), file(row.R2) ]
34+
fastqMeta = [ meta, file(row.R1), file(row.R2) ]
3535

36-
return fastq_meta
36+
return fastqMeta
3737
}

modules/multiqc/main.nf

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ process MULTIQC {
1010
path('*')
1111

1212
output:
13-
path('multiqc_report.html'), emit: html
13+
path('*multiqc_report.html'), emit: html
1414
path("versions.yml"), emit: versions
1515

1616
script:
1717

1818
"""
19+
cp ${baseDir}/assets/pipelinelogo.png .
20+
cp $baseDir/conf/multiqc_config.yaml multiqc_config.yaml
1921
20-
multiqc .
22+
multiqc -n ${params.run_name}_multiqc_report .
2123
2224
cat <<-END_VERSIONS > versions.yml
2325
"${task.process}":

modules/ptrimmer/main.nf

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
process PTRIMMER {
2-
32
publishDir "${params.outdir}/${meta.sample_id}/VSEARCH/PTRIMMER", mode: 'copy'
43

54
label 'short_serial'
@@ -11,26 +10,24 @@ process PTRIMMER {
1110
'https://depot.galaxyproject.org/singularity/ptrimmer:1.3.3--h50ea8bc_5' :
1211
'quay.io/biocontainers/ptrimmer:1.3.3--h50ea8bc_5' }"
1312

14-
1513
input:
16-
tuple val(meta),path(r1),path(r2)
14+
tuple val(meta), path(r1), path(r2)
1715
path(amplicon_txt)
1816

1917
output:
20-
tuple val(meta),path(r1_trimmed),path(r2_trimmed), emit: reads
18+
tuple val(meta), path(r1_trimmed), path(r2_trimmed), emit: reads
2119
path('versions.yml'), emit: versions
2220

2321
script:
24-
r1_trimmed = r1.getBaseName() + "_ptrimmed.fastq"
25-
r2_trimmed = r2.getBaseName() + "_ptrimmed.fastq"
22+
r1_trimmed = r1.getBaseName() + '_ptrimmed.fastq'
23+
r2_trimmed = r2.getBaseName() + '_ptrimmed.fastq'
2624

2725
"""
28-
ptrimmer -t pair -a $amplicon_txt -f $r1 -d $r1_trimmed -r $r2 -e $r2_trimmed
26+
ptrimmer -t pair -a $amplicon_txt -f $r1 -d $r1_trimmed -r $r2 -e $r2_trimmed
2927
cat <<-END_VERSIONS > versions.yml
3028
"${task.process}":
3129
Ptrimmer: \$(ptrimmer --help 2>&1 | grep Version | sed -e "s/Version: //g")
3230
END_VERSIONS
3331
3432
"""
35-
36-
}
33+
}

0 commit comments

Comments
 (0)