nf-core_modules/modules/plasmidfinder/main.nf
Robert A. Petit III 052b9f2fe9
add module for plasmidfinder (#1773)
* add module for plasmidfinder

* Update test.yml
2022-06-15 10:25:51 -06:00

48 lines
1.6 KiB
Text

def VERSION = '2.1.6' // Version information not provided by tool on CLI
process PLASMIDFINDER {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::plasmidfinder=2.1.6=py310hdfd78af_1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/plasmidfinder:2.1.6--py310hdfd78af_1':
'quay.io/biocontainers/plasmidfinder:2.1.6--py310hdfd78af_1' }"
input:
tuple val(meta), path(seqs)
output:
tuple val(meta), path("*.json") , emit: json
tuple val(meta), path("*.txt") , emit: txt
tuple val(meta), path("*.tsv") , emit: tsv
tuple val(meta), path("*-hit_in_genome_seq.fsa"), emit: genome_seq
tuple val(meta), path("*-plasmid_seqs.fsa") , emit: plasmid_seq
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}"
"""
plasmidfinder.py \\
$args \\
-i $seqs \\
-o ./ \\
-x
# Rename hard-coded outputs with prefix to avoid name collisions
mv data.json ${prefix}.json
mv results.txt ${prefix}.txt
mv results_tab.tsv ${prefix}.tsv
mv Hit_in_genome_seq.fsa ${prefix}-hit_in_genome_seq.fsa
mv Plasmid_seqs.fsa ${prefix}-plasmid_seqs.fsa
cat <<-END_VERSIONS > versions.yml
"${task.process}":
plasmidfinder: $VERSION
END_VERSIONS
"""
}