nf-core_modules/modules/dastool/fastatocontig2bin/main.nf
James A. Fellows Yates 90aef30f43
Set process label to process_single for modules with no task.cpus usage (#2076)
* Set process label to `process_single` for modules with no `task.cpus` usage

* Fix tests of 'borked' modules

* prettier

* More modules are single-threaded and can use process_single

* Adding process_single to hmmer/esl* modules

* Fix failing tests

* Prettier

Co-authored-by: Matthieu Muffato <mm49@sanger.ac.uk>
Co-authored-by: Daniel Lundin <erik.rikard.daniel@gmail.com>
2022-09-19 11:54:47 +02:00

41 lines
1.2 KiB
Text

process DASTOOL_FASTATOCONTIG2BIN {
tag "$meta.id"
label 'process_single'
conda (params.enable_conda ? "bioconda::das_tool=1.1.4" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/das_tool:1.1.4--r41hdfd78af_1' :
'quay.io/biocontainers/das_tool:1.1.4--r41hdfd78af_1' }"
input:
tuple val(meta), path(fasta)
val(extension)
output:
tuple val(meta), path("*.tsv"), emit: fastatocontig2bin
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def file_extension = extension ? extension : "fasta"
def clean_fasta = fasta.toString() - ".gz"
def decompress_fasta = fasta.toString() == clean_fasta ? "" : "gunzip -q -f $fasta"
"""
$decompress_fasta
Fasta_to_Contig2Bin.sh \\
$args \\
-i . \\
-e $file_extension \\
> ${prefix}.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
dastool: \$( DAS_Tool --version 2>&1 | grep "DAS Tool" | sed 's/DAS Tool //' )
END_VERSIONS
"""
}