annotate 0.4.2/modules/seqtk/seq/main.nf @ 143:620bffa66bbb tip

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