annotate 0.2.1/modules/seqtk/seq/main.nf @ 29:4c1add46ef6e

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