comparison 0.5.0/modules/kma/index/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 KMA_INDEX {
2 tag "$meta.id"
3 label 'process_nano'
4
5 module (params.enable_module ? "${params.swmodulepath}${params.fs}kma${params.fs}1.4.4" : null)
6 conda (params.enable_conda ? "conda-forge::libgcc-ng bioconda::kma=1.4.3 conda-forge::coreutils" : null)
7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
8 'https://depot.galaxyproject.org/singularity/kma:1.4.3--h7132678_1':
9 'quay.io/biocontainers/kma:1.4.3--h7132678_1' }"
10
11 input:
12 tuple val(meta), path(fasta)
13
14 output:
15 tuple val(meta), path("${meta.id}_kma_idx"), emit: idx
16 path "versions.yml" , emit: versions
17
18 when:
19 task.ext.when == null || task.ext.when
20
21 script:
22 def args = task.ext.args ?: ''
23 def prefix = task.ext.prefix ?: "${meta.id}_kma_idx"
24 def add_to_db = (meta.kmaindex_t_db ? "-t_db ${meta.kmaindex_t_db}" : '')
25 """
26 mkdir -p $prefix && cd $prefix || exit 1
27 kma \\
28 index \\
29 $args \\
30 $add_to_db \\
31 -i ../$fasta \\
32 -o $prefix
33 cd .. || exit 1
34
35 cat <<-END_VERSIONS > versions.yml
36 "${task.process}":
37 kma: \$( kma -v | sed -e 's%KMA-%%' )
38 END_VERSIONS
39
40 mkdirver=""
41 cutver=""
42
43 if [ "${workflow.containerEngine}" != "null" ]; then
44 mkdirver=\$( mkdir --help 2>&1 | sed -e '1!d; s/ (.*\$//' | cut -f1-2 -d' ' )
45 cutver="\$mkdirver"
46 else
47 mkdirver=\$( mkdir --version 2>&1 | sed '1!d; s/^.*(GNU coreutils//; s/) //;' )
48 cutver=\$( cut --version 2>&1 | sed '1!d; s/^.*(GNU coreutils//; s/) //;' )
49 fi
50
51 cat <<-END_VERSIONS >> versions.yml
52 mkdir: \$mkdirver
53 cut: \$cutver
54 cd: \$( bash --version 2>&1 | sed '1!d; s/^.*version //; s/ (.*\$//' )
55 END_VERSIONS
56 """
57 }