add module for plasmidfinder (#1773)

* add module for plasmidfinder

* Update test.yml
This commit is contained in:
Robert A. Petit III 2022-06-15 10:25:51 -06:00 committed by GitHub
parent 1fe4cb942f
commit 052b9f2fe9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 141 additions and 0 deletions

View file

@ -0,0 +1,48 @@
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
"""
}

View file

@ -0,0 +1,58 @@
name: "plasmidfinder"
description: Identify plasmids in bacterial sequences and assemblies
keywords:
- fasta
- fastq
- plasmid
tools:
- "plasmidfinder":
description: "PlasmidFinder allows identification of plasmids in total or partial sequenced isolates of bacteria."
homepage: "https://cge.cbs.dtu.dk/services/PlasmidFinder/"
documentation: "https://bitbucket.org/genomicepidemiology/plasmidfinder"
tool_dev_url: "https://bitbucket.org/genomicepidemiology/plasmidfinder"
doi: "10.1128/AAC.02412-14"
licence: "['Apache-2.0']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- seqs:
type: file
description: Input FASTA or FASTQ formatted genome sequences
pattern: "*.{fastq.gz,fq.gz,fastq.gz,fna.gz,fa.gz}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- json:
type: file
description: The results from analysis in JSON format
pattern: "*.json"
- txt:
type: file
description: The summary of results from analysis
pattern: "*.txt"
- tsv:
type: file
description: The results from analysis in TSV format
pattern: "*.tsv"
- genome_seq:
type: file
description: FASTA of sequences in the input with a hit
pattern: "*-hit_in_genome_seq.fsa"
- plasmid_seq:
type: file
description: FASTA of plasmid sequences with a hit against the input
pattern: "*-plasmid_seqs.fsa"
authors:
- "@rpetit3"

View file

@ -1607,6 +1607,10 @@ pirate:
- modules/pirate/**
- tests/modules/pirate/**
plasmidfinder:
- modules/plasmidfinder/**
- tests/modules/plasmidfinder/**
plasmidid:
- modules/plasmidid/**
- tests/modules/plasmidid/**

View file

@ -0,0 +1,13 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { PLASMIDFINDER } from '../../../modules/plasmidfinder/main.nf'
workflow test_plasmidfinder {
input = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]
PLASMIDFINDER ( input )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,13 @@
- name: plasmidfinder test_plasmidfinder
command: nextflow run ./tests/modules/plasmidfinder -entry test_plasmidfinder -c ./tests/config/nextflow.config -c ./tests/modules/plasmidfinder/nextflow.config
tags:
- plasmidfinder
files:
- path: output/plasmidfinder/test-hit_in_genome_seq.fsa
- path: output/plasmidfinder/test-plasmid_seqs.fsa
- path: output/plasmidfinder/test.json
contains: ["plasmidfinder", "filename", "results", "Rep_trans"]
- path: output/plasmidfinder/test.tsv
contains: ["Database", "Accession", "Query"]
- path: output/plasmidfinder/test.txt
contains: ["plasmidfinder", "Results", "Contig", "found"]