nf-core_modules/modules/macrel/contigs/main.nf
Anan Ibrahim 1f3f2b18bb
Add new module macrel/contigs (#1109)
* Add new module macrel/contigs

* removed trailing whitespace

* removed whitespace

* linting cleanup

* Apply suggestions from code review

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Updated the test.yml

It didnt upload the updated version earlier for some reason :(

* Update test.yml

* Update test.yml

* Update test.yml as generated by pytest

* Update test.yml

* updated the version issue

* Update tests/modules/macrel/contigs/test.yml

* Update modules/macrel/contigs/main.nf

* Update modules/macrel/contigs/main.nf

* Update pytest_modules.yml

* Update pytest_modules.yml

* Update modules/macrel/contigs/main.nf

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Zipped all fasta outputs

* Update main.nf

* Update test.yml

* Update test.yml

* Update main.nf

* Update main.nf (gzip -n)

* Update test.yml

* Update main.nf

* Update main.nf

* Update test.yml

* Update tests/modules/macrel/contigs/test.yml

* Update modules/macrel/contigs/main.nf

* Apply suggestions from code review

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

Co-authored-by: darcy220606 <ananhamido@hotmail.com>
Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
2021-12-09 13:17:50 +01:00

40 lines
1.3 KiB
Text

process MACREL_CONTIGS {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::macrel=1.1.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/macrel:1.1.0--py36hc5360cc_0':
'quay.io/biocontainers/macrel:1.1.0--py36hc5360cc_0' }"
input:
tuple val(meta), path(fasta)
output:
tuple val(meta), path("*/*.smorfs.faa.gz") , emit: smorfs
tuple val(meta), path("*/*.all_orfs.faa.gz") , emit: all_orfs
tuple val(meta), path("*/*.prediction.gz") , emit: amp_prediction
tuple val(meta), path("*/*.md") , emit: readme_file
tuple val(meta), path("*/*_log.txt") , emit: log_file
path "versions.yml" , emit: versions
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
macrel contigs \\
$args \\
--fasta $fasta \\
--output ${prefix}/ \\
--tag ${prefix} \\
--log-file ${prefix}/${prefix}_log.txt \\
--threads $task.cpus
gzip --no-name ${prefix}/*.faa
cat <<-END_VERSIONS > versions.yml
"${task.process}":
macrel: \$(echo \$(macrel --version | sed 's/macrel //g'))
END_VERSIONS
"""
}