annotate 0.4.0/modules/seqtk/seq/main.nf @ 101:ce6d9548fe89

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