annotate 0.1.0/modules/multiqc/main.nf @ 0:c8597e9e1a97

"planemo upload"
author kkonganti
date Mon, 27 Nov 2023 12:37:44 -0500
parents
children 5eaaf749472c
rev   line source
kkonganti@0 1 process MULTIQC {
kkonganti@0 2 label 'process_micro'
kkonganti@0 3 tag 'MultiQC'
kkonganti@0 4
kkonganti@0 5 module (params.enable_module ? "${params.swmodulepath}${params.fs}multiqc${params.fs}1.14" : null)
kkonganti@0 6 conda (params.enable_conda ? 'bioconda::multiqc=1.14 conda-forge::spectra conda-forge::lzstring conda-forge::imp' : null)
kkonganti@0 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
kkonganti@0 8 'https://depot.galaxyproject.org/singularity/multiqc:1.14--pyhdfd78af_0' :
kkonganti@0 9 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }"
kkonganti@0 10
kkonganti@0 11 input:
kkonganti@0 12 path multiqc_files
kkonganti@0 13
kkonganti@0 14 output:
kkonganti@0 15 path "*multiqc*"
kkonganti@0 16 path "*multiqc_report.html", emit: report
kkonganti@0 17 path "*_data" , emit: data
kkonganti@0 18 path "*_plots" , emit: plots, optional: true
kkonganti@0 19 path "versions.yml" , emit: versions
kkonganti@0 20
kkonganti@0 21 when:
kkonganti@0 22 task.ext.when == null || task.ext.when
kkonganti@0 23
kkonganti@0 24 script:
kkonganti@0 25 def args = task.ext.args ?: ''
kkonganti@0 26 """
kkonganti@0 27 cp ${params.projectconf}${params.fs}multiqc${params.fs}${params.pipeline}_mqc.yml cpipes_mqc_config.yml
kkonganti@0 28 sed -i -e 's/Workflow_Name_Placeholder/${params.pipeline}/g; s/Workflow_Version_Placeholder/${params.workflow_version}/g' cpipes_mqc_config.yml
kkonganti@0 29 sed -i -e 's/CPIPES_Version_Placeholder/${workflow.manifest.version}/g; s%Workflow_Output_Placeholder%${params.output}%g' cpipes_mqc_config.yml
kkonganti@0 30 sed -i -e 's%Workflow_Input_Placeholder%${params.input}%g' cpipes_mqc_config.yml
kkonganti@0 31
kkonganti@0 32 multiqc --interactive -c cpipes_mqc_config.yml -f $args .
kkonganti@0 33
kkonganti@0 34 cat <<-END_VERSIONS > versions.yml
kkonganti@0 35 "${task.process}":
kkonganti@0 36 multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" )
kkonganti@0 37 END_VERSIONS
kkonganti@0 38
kkonganti@0 39 sedver=""
kkonganti@0 40
kkonganti@0 41 if [ "${workflow.containerEngine}" != "null" ]; then
kkonganti@0 42 sedver=\$( sed --help 2>&1 | sed -e '1!d; s/ (.*\$//' )
kkonganti@0 43 else
kkonganti@0 44 sedver=\$( echo \$(sed --version 2>&1) | sed 's/^.*(GNU sed) //; s/ Copyright.*\$//' )
kkonganti@0 45 fi
kkonganti@0 46
kkonganti@0 47 cat <<-END_VERSIONS >> versions.yml
kkonganti@0 48 sed: \$sedver
kkonganti@0 49 END_VERSIONS
kkonganti@0 50 """
kkonganti@0 51 }