MultiQC = {
    doc title: "MultiQC",
        desc:  "MultiQC is a reporting tool that parses summary statistics from results and log files generated by other bioinformatics tools",
        constraints: "",
        bpipe_version: "tested with bpipe 0.9.9.7",
        author: "Giuseppe Petrosino"

    output.dir = MultiQC_vars.outdir
    def MultiQC_FLAGS =
        (MultiQC_vars.extra ? " " + MultiQC_vars.extra : "")

    def TOOL_ENV = prepare_tool_env("multiqc", tools["multiqc"]["version"], tools["multiqc"]["runenv"])
    def PREAMBLE = get_preamble(stage:stageName, outdir:output.dir, input:new File(input1.prefix).getName())

    produce("multiqc_report.html") {
        exec """
            ${TOOL_ENV} &&
            ${PREAMBLE} &&

            multiqc $ESSENTIAL_PROJECT $MultiQC_FLAGS -o $output.dir
        ""","MULTIQC"
    }
}
