annotate 0.3.0/modules/seqtk/seq/main.nf @ 92:295c2597a475

"planemo upload"
author kkonganti
date Tue, 19 Jul 2022 10:07:24 -0400
parents
children
rev   line source
kkonganti@92 1 process SEQTK_SEQ {
kkonganti@92 2 tag "$meta.id"
kkonganti@92 3 label 'process_mem_low'
kkonganti@92 4
kkonganti@92 5 module (params.enable_module ? "${params.swmodulepath}${params.fs}seqtk${params.fs}1.3-r106" : null)
kkonganti@92 6 conda (params.enable_conda ? "bioconda::seqtk=1.3 conda-forge::gzip" : null)
kkonganti@92 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
kkonganti@92 8 'https://depot.galaxyproject.org/singularity/seqtk:1.3--h5bf99c6_3' :
kkonganti@92 9 'quay.io/biocontainers/seqtk:1.3--h5bf99c6_3' }"
kkonganti@92 10
kkonganti@92 11 input:
kkonganti@92 12 tuple val(meta), path(fastx)
kkonganti@92 13
kkonganti@92 14 output:
kkonganti@92 15 tuple val(meta), path("*.gz"), emit: fastx
kkonganti@92 16 path "versions.yml" , emit: versions
kkonganti@92 17
kkonganti@92 18 when:
kkonganti@92 19 task.ext.when == null || task.ext.when
kkonganti@92 20
kkonganti@92 21 script:
kkonganti@92 22 def args = task.ext.args ?: ''
kkonganti@92 23 def prefix = task.ext.prefix ?: "${meta.id}"
kkonganti@92 24
kkonganti@92 25 def extension = "fastq"
kkonganti@92 26 if ("$fastx" ==~ /.+\.fasta|.+\.fasta.gz|.+\.fa|.+\.fa.gz|.+\.fas|.+\.fas.gz|.+\.fna|.+\.fna.gz/ || "$args" ==~ /\-[aA]/ ) {
kkonganti@92 27 extension = "fasta"
kkonganti@92 28 }
kkonganti@92 29 """
kkonganti@92 30 seqtk \\
kkonganti@92 31 seq \\
kkonganti@92 32 $args \\
kkonganti@92 33 $fastx | \\
kkonganti@92 34 gzip -c > ${prefix}.seqtk-seq.${task.index}.${extension}.gz
kkonganti@92 35
kkonganti@92 36 cat <<-END_VERSIONS > versions.yml
kkonganti@92 37 "${task.process}":
kkonganti@92 38 seqtk: \$(echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
kkonganti@92 39 gzip: \$( echo \$(gzip --version 2>&1) | sed 's/^.*(gzip) //; s/gzip //; s/ Copyright.*\$//' )
kkonganti@92 40 END_VERSIONS
kkonganti@92 41 """
kkonganti@92 42 }