Mercurial > repos > galaxytrakr > hfp_bettercallsal_awsbatch
comparison 1.0.0/modules/gather_hits/main.nf @ 0:801b85b03a17 draft default tip
planemo upload
| author | galaxytrakr |
|---|---|
| date | Thu, 28 May 2026 20:31:42 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:801b85b03a17 |
|---|---|
| 1 process GATHER_HITS { | |
| 2 tag "$meta.id" | |
| 3 label 'process_micro' | |
| 4 | |
| 5 module (params.enable_module ? "${params.swmodulepath}${params.fs}pigz${params.fs}2.7" : null) | |
| 6 conda (params.enable_conda ? "conda-forge::pigz=2.6" : null) | |
| 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | |
| 8 'https://depot.galaxyproject.org/singularity/pigz:2.3.4' : | |
| 9 'quay.io/biocontainers/pigz:2.3.4' }" | |
| 10 | |
| 11 input: | |
| 12 tuple val(meta), path(genomes_fasta) | |
| 13 | |
| 14 output: | |
| 15 tuple val(meta), path("*_template_hits.txt"), emit: sm_template_hits | |
| 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 args2 = task.ext.args2 ?: '' | |
| 24 | |
| 25 // Use input file ending as default | |
| 26 prefix = task.ext.prefix ?: "${meta.id}" | |
| 27 command = genomes_fasta.toString().endsWith('.gz') ? 'zcat' : 'cat' | |
| 28 """ | |
| 29 $command \\ | |
| 30 $args \\ | |
| 31 $genomes_fasta | \\ | |
| 32 grep -F '>' | grep -E -o 'GC[AF]\\_[0-9]+\\.*[0-9]*' > ${prefix}.sm_template_hits.txt | |
| 33 | |
| 34 cat <<-END_VERSIONS > versions.yml | |
| 35 "${task.process}": | |
| 36 pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' ) | |
| 37 END_VERSIONS | |
| 38 | |
| 39 mkdirver="" | |
| 40 catver="" | |
| 41 zver="" | |
| 42 grepver="" | |
| 43 | |
| 44 if [ "${workflow.containerEngine}" != "null" ]; then | |
| 45 mkdirver=\$( mkdir --help 2>&1 | sed -e '1!d; s/ (.*\$//' | cut -f1-2 -d' ' ) | |
| 46 catver=\$( cat --help 2>&1 | sed -e '1!d; s/ (.*\$//' | cut -f1-2 -d' ' ) | |
| 47 zver=\$( zcat --help 2>&1 | sed -e '1!d; s/ (.*\$//' ) | |
| 48 grepver="\$mkdirver" | |
| 49 else | |
| 50 catver=\$( cat --version 2>&1 | sed '1!d; s/^.*(GNU coreutils//; s/) //;' ) | |
| 51 zver=\$( zcat --version 2>&1 | sed '1!d; s/^.*(gzip) //' ) | |
| 52 grepver=\$( echo \$(grep --version 2>&1) | sed 's/^.*(GNU grep) //; s/ Copyright.*\$//' ) | |
| 53 fi | |
| 54 | |
| 55 cat <<-END_VERSIONS >> versions.yml | |
| 56 cat: \$catver | |
| 57 zcat: \$zver | |
| 58 grep: \$grepver | |
| 59 END_VERSIONS | |
| 60 """ | |
| 61 } |
