mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
add mobsuite_recon module (#1270)
* add mobsuite_recon module * Update main.nf * Update nextflow.config * Update test.yml Co-authored-by: Sateesh <33637490+sateeshperi@users.noreply.github.com>
This commit is contained in:
parent
425939a108
commit
45466684e7
6 changed files with 133 additions and 0 deletions
45
modules/mobsuite/recon/main.nf
Normal file
45
modules/mobsuite/recon/main.nf
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
process MOBSUITE_RECON {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_medium'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::mob_suite=3.0.3" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/mob_suite%3A3.0.3--pyhdfd78af_0':
|
||||||
|
'quay.io/biocontainers/mob_suite:3.0.3--pyhdfd78af_0' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(fasta)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("results/chromosome.fasta") , emit: chromosome
|
||||||
|
tuple val(meta), path("results/contig_report.txt") , emit: contig_report
|
||||||
|
tuple val(meta), path("results/plasmid_*.fasta") , emit: plasmids , optional: true
|
||||||
|
tuple val(meta), path("results/mobtyper_results.txt"), emit: mobtyper_results, optional: true
|
||||||
|
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 is_compressed = fasta.getName().endsWith(".gz") ? true : false
|
||||||
|
def fasta_name = fasta.getName().replace(".gz", "")
|
||||||
|
"""
|
||||||
|
if [ "$is_compressed" == "true" ]; then
|
||||||
|
gzip -c -d $fasta > $fasta_name
|
||||||
|
fi
|
||||||
|
|
||||||
|
mob_recon \\
|
||||||
|
--infile $fasta_name \\
|
||||||
|
$args \\
|
||||||
|
--num_threads $task.cpus \\
|
||||||
|
--outdir results \\
|
||||||
|
--sample_id $prefix
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
mobsuite: \$(echo \$(mob_recon --version 2>&1) | sed 's/^.*mob_recon //; s/ .*\$//')
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
54
modules/mobsuite/recon/meta.yml
Normal file
54
modules/mobsuite/recon/meta.yml
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
name: mobsuite_recon
|
||||||
|
description: A tool to reconstruct plasmids in bacterial assemblies
|
||||||
|
keywords:
|
||||||
|
- bacteria
|
||||||
|
- plasmid
|
||||||
|
tools:
|
||||||
|
- mobsuite:
|
||||||
|
description: Software tools for clustering, reconstruction and typing of plasmids from draft assemblies.
|
||||||
|
homepage: https://github.com/phac-nml/mob-suite
|
||||||
|
documentation: https://github.com/phac-nml/mob-suite
|
||||||
|
tool_dev_url: https://github.com/phac-nml/mob-suite
|
||||||
|
doi: "10.1099/mgen.0.000435"
|
||||||
|
licence: ['Apache License, Version 2.0']
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- fasta:
|
||||||
|
type: file
|
||||||
|
description: A bacterial genome assembly in FASTA format
|
||||||
|
pattern: "*.{fasta,fa,fna}"
|
||||||
|
|
||||||
|
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"
|
||||||
|
- chromosome:
|
||||||
|
type: file
|
||||||
|
description: FASTA file of all contigs found to belong to the chromosome
|
||||||
|
pattern: "chromosome.fasta"
|
||||||
|
- contig_report:
|
||||||
|
type: file
|
||||||
|
description: Assignment of the contig to chromosome or a particular plasmid grouping
|
||||||
|
pattern: "contig_report.txt"
|
||||||
|
- plasmids:
|
||||||
|
type: file
|
||||||
|
description: Each plasmid group is written to an individual FASTA
|
||||||
|
pattern: "plasmid_*.fasta"
|
||||||
|
- mobtyper_results:
|
||||||
|
type: file
|
||||||
|
description: Aggregate MOB-typer report files for all identified plasmid
|
||||||
|
pattern: "mobtyper_results.txt"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@rpetit3"
|
|
@ -1024,6 +1024,10 @@ mlst:
|
||||||
- modules/mlst/**
|
- modules/mlst/**
|
||||||
- tests/modules/mlst/**
|
- tests/modules/mlst/**
|
||||||
|
|
||||||
|
mobsuite/recon:
|
||||||
|
- modules/mobsuite/recon/**
|
||||||
|
- tests/modules/mobsuite/recon/**
|
||||||
|
|
||||||
mosdepth:
|
mosdepth:
|
||||||
- modules/mosdepth/**
|
- modules/mosdepth/**
|
||||||
- tests/modules/mosdepth/**
|
- tests/modules/mosdepth/**
|
||||||
|
|
13
tests/modules/mobsuite/recon/main.nf
Normal file
13
tests/modules/mobsuite/recon/main.nf
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { MOBSUITE_RECON } from '../../../../modules/mobsuite/recon/main.nf'
|
||||||
|
|
||||||
|
workflow test_mobsuite_recon {
|
||||||
|
|
||||||
|
input = [ [ id:'test', single_end:false ], // meta map
|
||||||
|
file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) ]
|
||||||
|
|
||||||
|
MOBSUITE_RECON ( input )
|
||||||
|
}
|
5
tests/modules/mobsuite/recon/nextflow.config
Normal file
5
tests/modules/mobsuite/recon/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
|
}
|
12
tests/modules/mobsuite/recon/test.yml
Normal file
12
tests/modules/mobsuite/recon/test.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
- name: mobsuite recon test_mobsuite_recon
|
||||||
|
command: nextflow run tests/modules/mobsuite/recon -entry test_mobsuite_recon -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- mobsuite/recon
|
||||||
|
- mobsuite
|
||||||
|
files:
|
||||||
|
- path: output/mobsuite/results/chromosome.fasta
|
||||||
|
md5sum: 33b2a0fa321c73c6ba8d8272dd53c6d4
|
||||||
|
- path: output/mobsuite/results/contig_report.txt
|
||||||
|
md5sum: a0ae364a9f2b475f77588d0b3c24b857
|
||||||
|
- path: output/mobsuite/versions.yml
|
||||||
|
md5sum: 7f7a0f8957394b0e526233a0edb8e20a
|
Loading…
Reference in a new issue