Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/nf-core/mobsuite/typer/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::mob_suite=3.1.9"
75 changes: 75 additions & 0 deletions modules/nf-core/mobsuite/typer/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
process MOBSUITE_TYPER {
tag "${meta.id}"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/mob_suite:3.1.9--pyhdfd78af_0'
: 'quay.io/biocontainers/mob_suite:3.1.9--pyhdfd78af_0'}"

input:
tuple val(meta), path(fasta)
path db
path plasmid_mash_db
path plasmid_meta_txt
path plasmid_replicons_fas
path repetitive_mask_fas
path plasmid_mob_faa
path plasmid_mpf_faa
path plasmid_orit_fas
val generate_biomarker_report
val generate_mge_report

output:
tuple val(meta), path("*.txt"), emit: report
tuple val(meta), path("*_biomarker_report.txt"), optional: true, emit: biomarker_report
tuple val(meta), path("*_mge_report.txt"), optional: true, emit: mge_report
tuple val("${task.process}"), val('mobsuite'), eval("mob_typer --version | sed 's/mob_typer //g'"), topic: versions, emit: versions_mobsuite

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def biomarker_report_cmd = generate_biomarker_report ? "--biomarker_report_file ${prefix}_biomarker_report.txt" : ''
def mge_report_cmd = generate_mge_report ? "--mge_report_file ${prefix}_mge_report.txt" : ''
def plasmid_mash_db_cmd = plasmid_mash_db ? "-d ${plasmid_mash_db}" : ''
def plasmid_meta_cmd = plasmid_meta_txt ? "-m ${plasmid_meta_txt}" : ''
def plasmid_replicons_cmd = plasmid_replicons_fas ? "--plasmid_replicons ${plasmid_replicons_fas}" : ''
def repetitive_mask_cmd = repetitive_mask_fas ? "--repetitive_mask ${repetitive_mask_fas}" : ''
def plasmid_mob_cmd = plasmid_mob_faa ? "--plasmid_mob ${plasmid_mob_faa}" : ''
def plasmid_mpf_cmd = plasmid_mpf_faa ? "--plasmid_mpf ${plasmid_mpf_faa}" : ''
def plasmid_orit_fas_cmd = plasmid_orit_fas ? "--plasmid_orit ${plasmid_orit_fas}" : ''
def db_cmd = db ? "-d ${db}" : ''
"""
mob_typer \\
-n ${task.cpus} \\
-s ${prefix} \\
${args} \\
-i ${fasta} \\
${plasmid_mash_db_cmd} \\
${plasmid_meta_cmd} \\
${plasmid_replicons_cmd} \\
${repetitive_mask_cmd} \\
${plasmid_mob_cmd} \\
${plasmid_mpf_cmd} \\
${plasmid_orit_fas_cmd} \\
${db_cmd} \\
-o ${prefix}.txt \\
${biomarker_report_cmd} \\
${mge_report_cmd}

"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo ${args}

touch ${prefix}.txt
touch ${prefix}_biomarker_report.txt
touch ${prefix}_mge_report.txt
"""
}
139 changes: 139 additions & 0 deletions modules/nf-core/mobsuite/typer/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: "mobsuite_typer"
description: Bacterial plasmid typing and mobility prediction
keywords:
- bacteria
- plasmid
- typing
- genomics
tools:
- "mobsuite":
description: "MOB-suite is a set of tools for finding, typing and reconstruction
of plasmids from draft and complete genome assemblies."
homepage: "https://github.com/phac-nml/mob-suite/blob/master/README.md"
documentation: "https://github.com/phac-nml/mob-suite/blob/master/README.md"
tool_dev_url: "https://github.com/phac-nml/mob-suite"
doi: "10.1099/mgen.0.000435"
licence:
- "Apache-2.0"
identifier: biotools:mob_suite
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- fasta:
type: file
description: A bacterial genome assembly in FASTA format
pattern: "*.{fasta,fa,fna}"
ontologies:
- edam: "http://edamontology.org/format_1929"
- db:
type: directory
description: Optional local copy of MOB-suite database directory
pattern: "databases/"
- plasmid_mash_db:
type: file
description: Optional Companion Mash database of reference database
pattern: "*.msh"
ontologies:
- edam: http://edamontology.org/format_3911
- plasmid_meta_txt:
type: file
description: MOB-cluster plasmid cluster formatted file matched to the reference
plasmid db
pattern: "*.txt"
ontologies: []
- plasmid_replicons_fas:
type: file
description: Optional nucleotide FASTA file of plasmid replicons
pattern: "*.{fasta,fna,fa,fas}"
ontologies:
- edam: "http://edamontology.org/format_1929"
- repetitive_mask_fas:
type: file
description: Optional nucleotide FASTA file of known repetitive elements
pattern: "*.{fasta,fna,fa,fas}"
ontologies:
- edam: "http://edamontology.org/format_1929"
- plasmid_mob_faa:
type: file
description: Optional protein FASTA file of plasmid mobility proteins
pattern: "*.{fasta,faa,fa,fas}"
ontologies:
- edam: "http://edamontology.org/format_1929"
- plasmid_mpf_faa:
type: file
description: Optional protein FASTA file of plasmid mating pair formation proteins
pattern: "*.{fasta,faa,fa,fas}"
ontologies:
- edam: "http://edamontology.org/format_1929"
- plasmid_orit_fas:
type: file
description: Optional nucleotide FASTA file of known plasmid oriT dna sequences
pattern: "*.{fasta,fna,fa,fas}"
ontologies:
- edam: "http://edamontology.org/format_1929"
- generate_biomarker_report:
type: boolean
description: Whether to generate a biomarker report file
- generate_mge_report:
type: boolean
description: Whether to generate a mobile genetic element (MGE) report file
output:
report:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.txt":
type: file
description: MOB-suite typer report file
pattern: "*.txt"
ontologies: []
biomarker_report:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*_biomarker_report.txt":
type: file
description: MOB-suite biomarker report file
pattern: "*_biomarker_report.txt"
mge_report:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*_mge_report.txt":
type: file
description: MOB-suite mobile genetic element (MGE) report file
pattern: "*_mge_report.txt"
versions_mobsuite:
- - ${task.process}:
type: string
description: The name of the process
- mobsuite:
type: string
description: The name of the tool
- mob_typer --version | sed 'mob_typer '/:
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: The name of the process
- mobsuite:
type: string
description: The name of the tool
- mob_typer --version | sed 'mob_typer '/:
type: eval
description: The expression to obtain the version of the tool
authors:
- "@jfy133"
maintainers:
- "@jfy133"
81 changes: 81 additions & 0 deletions modules/nf-core/mobsuite/typer/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
nextflow_process {

name "Test Process MOBSUITE_TYPER"
script "../main.nf"
process "MOBSUITE_TYPER"

tag "modules"
tag "modules_nfcore"
tag "mobsuite"
tag "mobsuite/typer"

test("sarscov2 - fasta") {

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
]
input[1] = []
input[2] = []
input[3] = []
input[4] = []
input[5] = []
input[6] = []
input[7] = []
input[8] = []
input[9] = true
input[10] = true
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
process.out,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}

}

test("sarscov2 - fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
]
input[1] = []
input[2] = []
input[3] = []
input[4] = []
input[5] = []
input[6] = []
input[7] = []
input[8] = []
input[9] = true
input[10] = true
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(process.out).match() }
)
}

}

}
Loading
Loading