comparison 0.2.0/modules/quast/main.nf @ 11:a5f31c44f8c9

planemo upload
author kkonganti
date Mon, 15 Jul 2024 16:11:44 -0400
parents
children bc5d019d2c3a
comparison
equal deleted inserted replaced
10:ddf7a172bf30 11:a5f31c44f8c9
1 process QUAST {
2 tag "$meta.id"
3 label "process_micro"
4
5 module (params.enable_module ? "${params.swmodulepath}${params.fs}quast${params.fs}5.2.0" : null)
6 conda (params.enable_conda ? "bioconda::quast=5.2.0 conda-forge::libgcc-ng" : null)
7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
8 'https://depot.galaxyproject.org/singularity/quast:5.2.0--py39pl5321h2add14b_1' :
9 'biocontainers/quast:5.2.0--py39pl5321h2add14b_1' }"
10
11 input:
12 tuple val(meta) , path(consensus)
13 tuple val(meta2), path(fasta)
14 tuple val(meta3), path(gff)
15
16 output:
17 tuple val(meta), path("${prefix}") , emit: results
18 tuple val(meta), path("${prefix}.quastreport.tsv") , emit: tsv
19 tuple val(meta), path("${prefix}_transcriptome.tsv"), emit: transcriptome, optional: true
20 tuple val(meta), path("${prefix}_misassemblies.tsv"), emit: misassemblies, optional: true
21 tuple val(meta), path("${prefix}_unaligned.tsv") , emit: unaligned , optional: true
22 path "versions.yml" , emit: versions
23
24 when:
25 task.ext.when == null || task.ext.when
26
27 script:
28 def args = task.ext.args ?: ''
29 prefix = task.ext.prefix ?: "${meta.id}"
30 def reference = fasta ? "-r $fasta" : ''
31 def features = gff ? "--features $gff" : ''
32 """
33 quast.py \\
34 -l $prefix \\
35 --output-dir $prefix \\
36 $reference \\
37 $features \\
38 --threads $task.cpus \\
39 $args \\
40 ${consensus.join(' ')}
41
42 ln -s ${prefix}/report.tsv ${prefix}.quastreport.tsv
43 [ -f ${prefix}/contigs_reports/all_alignments_transcriptome.tsv ] && ln -s ${prefix}/contigs_reports/all_alignments_transcriptome.tsv ${prefix}_transcriptome.tsv
44 [ -f ${prefix}/contigs_reports/misassemblies_report.tsv ] && ln -s ${prefix}/contigs_reports/misassemblies_report.tsv ${prefix}_misassemblies.tsv
45 [ -f ${prefix}/contigs_reports/unaligned_report.tsv ] && ln -s ${prefix}/contigs_reports/unaligned_report.tsv ${prefix}_unaligned.tsv
46
47 cat <<-END_VERSIONS > versions.yml
48 "${task.process}":
49 quast: \$(quast.py --version 2>&1 | sed 's/^.*QUAST v//; s/ .*\$//')
50 bash: \$( bash --version 2>&1 | sed '1!d; s/^.*version //; s/ (.*\$//' )
51 END_VERSIONS
52
53 zcmd=""
54 zver=""
55
56 if type pigz > /dev/null 2>&1; then
57 zcmd="pigz"
58 zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed -e '1!d' | sed "s/\$zcmd //" )
59 elif type gzip > /dev/null 2>&1; then
60 zcmd="gzip"
61
62 if [ "${workflow.containerEngine}" != "null" ]; then
63 zver=\$( echo \$( \$zcmd --help 2>&1 ) | sed -e '1!d; s/ (.*\$//' )
64 else
65 zver=\$( echo \$( \$zcmd --version 2>&1 ) | sed "s/^.*(\$zcmd) //; s/\$zcmd //; s/ Copyright.*\$//" )
66 fi
67 fi
68
69 cat <<-END_VERSIONS >> versions.yml
70 \$zcmd: \$zver
71 END_VERSIONS
72 """
73 }