Mercurial > repos > kkonganti > cfsan_bettercallsal
comparison 0.5.0/modules/cat/tables/main.nf @ 1:365849f031fd
"planemo upload"
author | kkonganti |
---|---|
date | Mon, 05 Jun 2023 18:48:51 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:a4b1ee4b68b1 | 1:365849f031fd |
---|---|
1 process TABLE_SUMMARY { | |
2 tag "$table_sum_on" | |
3 label 'process_low' | |
4 | |
5 // Requires `pyyaml` which does not have a dedicated container but is in the MultiQC container | |
6 module (params.enable_module ? "${params.swmodulepath}${params.fs}python${params.fs}3.8.1" : null) | |
7 conda (params.enable_conda ? "conda-forge::python=3.9 conda-forge::pyyaml conda-forge::coreutils" : null) | |
8 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | |
9 'https://depot.galaxyproject.org/singularity/multiqc:1.11--pyhdfd78af_0' : | |
10 'quay.io/biocontainers/multiqc:1.11--pyhdfd78af_0' }" | |
11 | |
12 input: | |
13 tuple val(table_sum_on), path(tables) | |
14 | |
15 output: | |
16 tuple val(table_sum_on), path("*.tblsum.txt"), emit: tblsummed | |
17 path "*_mqc.yml" , emit: mqc_yml | |
18 path "versions.yml" , emit: versions | |
19 | |
20 when: | |
21 task.ext.when == null || task.ext.when || tables | |
22 | |
23 script: | |
24 def args = task.ext.args ?: '' | |
25 def onthese = tables.collect().join('\\n') | |
26 """ | |
27 filenum="1" | |
28 header="" | |
29 | |
30 echo -e "$onthese" | while read -r file; do | |
31 | |
32 if [ "\${filenum}" == "1" ]; then | |
33 header=\$( head -n1 "\${file}" ) | |
34 echo -e "\${header}" > ${table_sum_on}.tblsum.txt | |
35 fi | |
36 | |
37 tail -n+2 "\${file}" >> ${table_sum_on}.tblsum.txt | |
38 | |
39 filenum=\$((filenum+1)) | |
40 done | |
41 | |
42 create_mqc_data_table.py $table_sum_on ${workflow.manifest.name} | |
43 | |
44 cat <<-END_VERSIONS > versions.yml | |
45 "${task.process}": | |
46 bash: \$( bash --version 2>&1 | sed '1!d; s/^.*version //; s/ (.*\$//' ) | |
47 python: \$( python --version | sed 's/Python //g' ) | |
48 END_VERSIONS | |
49 | |
50 headver=\$( head --version 2>&1 | sed '1!d; s/^.*(GNU coreutils//; s/) //;' ) | |
51 tailver=\$( tail --version 2>&1 | sed '1!d; s/^.*(GNU coreutils//; s/) //;' ) | |
52 | |
53 cat <<-END_VERSIONS >> versions.yml | |
54 head: \$headver | |
55 tail: \$tailver | |
56 END_VERSIONS | |
57 """ | |
58 } |