process MULTIQC {
    label 'process_medium'

    conda (params.enable_conda ? "bioconda::multiqc=1.10.1" : 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' }"

    input:
    path 'multiqc_config.yaml'
    path multiqc_custom_config
    path software_versions
    path workflow_summary
    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

    script:
    def custom_config = params.multiqc_config ? "--config $multiqc_custom_config" : ''
    def args = task.ext.args ?: ''
    """
    multiqc -f $args $custom_config .
    """
}
