Commit 6026fc1b authored by Valentina Galata's avatar Valentina Galata
Browse files

MultiQC: added prokka (added a new output in prokkaC.smk)

parent d7b53dba
################################################################# ############################################################
# MultiQC Config # MultiQC Config
################################################################# ############################################################
# Based on config_defaults.yaml from MultiQC (v1.8) # Based on config_defaults.yaml from MultiQC (v1.8)
##############################
# Info # Info
##############################
title: "IMP3 processing summary" title: "IMP3 processing summary"
subtitle: "MultiQC report" subtitle: "MultiQC report"
intro_text: "Please not that only the output of tools supported by MultiQC has been included in this report." intro_text: "Please not that only the output of tools supported by MultiQC has been included in this report."
...@@ -11,14 +14,17 @@ intro_text: "Please not that only the output of tools supported by MultiQC has b ...@@ -11,14 +14,17 @@ intro_text: "Please not that only the output of tools supported by MultiQC has b
report_header_info: report_header_info:
- IMP3 Docs: "https://imp3.readthedocs.io/en/impiris" # TODO - IMP3 Docs: "https://imp3.readthedocs.io/en/impiris" # TODO
- MultiQC Docs: "https://multiqc.info/docs" - MultiQC Docs: "https://multiqc.info/docs"
# TODO # TODO: would be nice to have here some sample info
# Logo # Logo
custom_logo: null # TODO custom_logo: null # TODO
custom_logo_url: null # TODO custom_logo_url: null # TODO
custom_logo_title: null # TODO custom_logo_title: null # TODO
##############################
# Output # Output
##############################
data_format: 'tsv' data_format: 'tsv'
force: true force: true
make_data_dir: true make_data_dir: true
...@@ -27,3 +33,12 @@ data_dump_file: true ...@@ -27,3 +33,12 @@ data_dump_file: true
export_plots: false export_plots: false
plots_force_flat: false plots_force_flat: false
plots_force_interactive: true plots_force_interactive: true
##############################
# Tools
##############################
# FastQC
# Prokka
prokka_fn_snames: true
...@@ -7,6 +7,7 @@ rule annotate: ...@@ -7,6 +7,7 @@ rule annotate:
"Analysis/annotation/prokka.fna", "Analysis/annotation/prokka.fna",
"Analysis/annotation/prokka.ffn", "Analysis/annotation/prokka.ffn",
"Analysis/annotation/prokka.fsa", "Analysis/annotation/prokka.fsa",
"Analysis/annotation/prokka.txt"
threads: 8 threads: 8
params: params:
runtime = "8:00:00", runtime = "8:00:00",
......
...@@ -6,7 +6,7 @@ MQC_MODULES = [] ...@@ -6,7 +6,7 @@ MQC_MODULES = []
# FastQC # FastQC
if MG or MT: if MG or MT:
MQC_MODULES.append("fastqc") # TODO MQC_MODULES.append("fastqc")
# data type: mg, mt or both # data type: mg, mt or both
MQC_FASTQC_T = TYPES MQC_FASTQC_T = TYPES
# read type: PE or SE or both, raw and processed # read type: PE or SE or both, raw and processed
...@@ -20,19 +20,23 @@ if MG or MT: ...@@ -20,19 +20,23 @@ if MG or MT:
MQC_FASTQC_R = expand("{rtype}_fastqc", rtype=MQC_FASTQC_R_RAW) MQC_FASTQC_R = expand("{rtype}_fastqc", rtype=MQC_FASTQC_R_RAW)
if 'preprocessing' in IMP_STEPS: if 'preprocessing' in IMP_STEPS:
MQC_FASTQC_R += expand("{rtype}.preprocessed_fastqc", rtype=MQC_FASTQC_R_PROC) MQC_FASTQC_R += expand("{rtype}.preprocessed_fastqc", rtype=MQC_FASTQC_R_PROC)
# TODO: other modules # Prokka
if "analysis" in IMP_STEPS:
MQC_MODULES.append("prokka")
rule multiqc_report: rule multiqc_report:
input: input:
# FastQC # FastQC
expand( fastqc=expand(
'Stats/{type}/{type}.{rtype}.zip', 'Stats/{type}/{type}.{rtype}.zip',
type=MQC_FASTQC_T, type=MQC_FASTQC_T,
rtype=MQC_FASTQC_R rtype=MQC_FASTQC_R
) if (MG or MT) else [] ) if (MG or MT) else [],
# TODO: other modules # Prokka
prokka=["Analysis/annotation/prokka.txt"] if "analysis" in IMP_STEPS else [],
output: output:
filelist=temp('Stats/multiqc_files.txt'), include='Stats/multiqc_files.txt', # TODO: temp
exclude='Stats/multiqc_files_excluded.txt', # TODO: temp
html='Stats/multiqc_report.html', html='Stats/multiqc_report.html',
data='Stats/multiqc_report_data.zip' data='Stats/multiqc_report_data.zip'
log: log:
...@@ -42,15 +46,28 @@ rule multiqc_report: ...@@ -42,15 +46,28 @@ rule multiqc_report:
runtime = "00:30:00", runtime = "00:30:00",
mem = MEMCORE, mem = MEMCORE,
configfile = CONFIGDIR + "/config.multiqc.yaml", configfile = CONFIGDIR + "/config.multiqc.yaml",
modules = MQC_MODULES, modules = " ".join(["--module %s" % m for m in MQC_MODULES]),
filename = lambda wildcards, output: splitext(output.html)[0] filename = lambda wildcards, output: splitext(output.html)[0]
conda: conda:
ENVDIR + "/MultiQC.yaml" ENVDIR + "/MultiQC.yaml"
message: message:
"Create MultiQC report from {input}" "Create MultiQC report from {input}"
shell: shell:
"echo '{input}' | sed 's/\s\+/\\n/g' > {output.filelist} && " """
"multiqc --file-list {output.filelist} --module {params.modules} --config {params.configfile} --filename {params.filename} &> {log}" > {output.include}
> {output.exclude}
for file in {input.fastqc}
do
if [ -s ${{file}} ] && [ ! $(unzip -l -q ${{file}} | grep -q \"No errors\") ]
then
echo ${{file}} >> {output.include}
else
echo ${{file}} >> {output.exclude}
fi
done
echo '{input.prokka}' | sed 's/\s\+/\\n/g' >> {output.include}
multiqc --file-list {output.include} {params.modules} --config {params.configfile} --filename {params.filename} &> {log}
"""
localrules: multiqc_done localrules: multiqc_done
rule multiqc_done: rule multiqc_done:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment