mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
add module for abricate (#1280)
* add module for abricate * rename abricate/abricate to abricate/run * Update test.yml Co-authored-by: Sateesh <33637490+sateeshperi@users.noreply.github.com>
This commit is contained in:
parent
45466684e7
commit
be798861c6
11 changed files with 231 additions and 0 deletions
34
modules/abricate/run/main.nf
Normal file
34
modules/abricate/run/main.nf
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
process ABRICATE_RUN {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_medium'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::abricate=1.0.1" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/abricate%3A1.0.1--ha8f3691_1':
|
||||||
|
'quay.io/biocontainers/abricate:1.0.1--ha8f3691_1' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(assembly)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.txt"), emit: report
|
||||||
|
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}"
|
||||||
|
"""
|
||||||
|
abricate \\
|
||||||
|
$assembly \\
|
||||||
|
$args \\
|
||||||
|
--threads $task.cpus > ${prefix}.txt
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
abricate: \$(echo \$(abricate --version 2>&1) | sed 's/^.*abricate //' )
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
43
modules/abricate/run/meta.yml
Normal file
43
modules/abricate/run/meta.yml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
name: abricate_run
|
||||||
|
description: Screen assemblies for antimicrobial resistance against multiple databases
|
||||||
|
keywords:
|
||||||
|
- bacteria
|
||||||
|
- assembly
|
||||||
|
- antimicrobial reistance
|
||||||
|
tools:
|
||||||
|
- abricate:
|
||||||
|
description: Mass screening of contigs for antibiotic resistance genes
|
||||||
|
homepage: https://github.com/tseemann/abricate
|
||||||
|
documentation: https://github.com/tseemann/abricate
|
||||||
|
tool_dev_url: https://github.com/tseemann/abricate
|
||||||
|
doi: ""
|
||||||
|
licence: ['GPL v2', 'GPL v2']
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- assembly:
|
||||||
|
type: file
|
||||||
|
description: FASTA, GenBank or EMBL formatted file
|
||||||
|
pattern: "*.{fa,fasta,fna,fa.gz,fasta.gz,fna.gz,gbk,gbk.gz,embl,embl.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"
|
||||||
|
- report:
|
||||||
|
type: file
|
||||||
|
description: Tab-delimited report of results
|
||||||
|
pattern: "*.{txt}"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@rpetit3"
|
33
modules/abricate/summary/main.nf
Normal file
33
modules/abricate/summary/main.nf
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
process ABRICATE_SUMMARY {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_medium'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::abricate=1.0.1" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/abricate%3A1.0.1--ha8f3691_1':
|
||||||
|
'quay.io/biocontainers/abricate:1.0.1--ha8f3691_1' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(reports)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.txt"), emit: report
|
||||||
|
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}"
|
||||||
|
"""
|
||||||
|
abricate \\
|
||||||
|
--summary \\
|
||||||
|
$reports > ${prefix}.txt
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
abricate: \$(echo \$(abricate --version 2>&1) | sed 's/^.*abricate //' )
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
43
modules/abricate/summary/meta.yml
Normal file
43
modules/abricate/summary/meta.yml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
name: abricate_summary
|
||||||
|
description: Screen assemblies for antimicrobial resistance against multiple databases
|
||||||
|
keywords:
|
||||||
|
- bacteria
|
||||||
|
- assembly
|
||||||
|
- antimicrobial reistance
|
||||||
|
tools:
|
||||||
|
- abricate:
|
||||||
|
description: Mass screening of contigs for antibiotic resistance genes
|
||||||
|
homepage: https://github.com/tseemann/abricate
|
||||||
|
documentation: https://github.com/tseemann/abricate
|
||||||
|
tool_dev_url: https://github.com/tseemann/abricate
|
||||||
|
doi: ""
|
||||||
|
licence: ['GPL v2', 'GPL v2']
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- assembly:
|
||||||
|
type: file
|
||||||
|
description: FASTA, GenBank or EMBL formatted file
|
||||||
|
pattern: "*.{fa,fasta,fna,fa.gz,fasta.gz,fna.gz,gbk,gbk.gz,embl,embl.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"
|
||||||
|
- summary:
|
||||||
|
type: file
|
||||||
|
description: Tab-delimited report of aggregated results
|
||||||
|
pattern: "*.{txt}"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@rpetit3"
|
|
@ -2,6 +2,14 @@ abacas:
|
||||||
- modules/abacas/**
|
- modules/abacas/**
|
||||||
- tests/modules/abacas/**
|
- tests/modules/abacas/**
|
||||||
|
|
||||||
|
abricate/run:
|
||||||
|
- modules/abricate/run/**
|
||||||
|
- tests/modules/abricate/run/**
|
||||||
|
|
||||||
|
abricate/summary:
|
||||||
|
- modules/abricate/summary/**
|
||||||
|
- tests/modules/abricate/summary/**
|
||||||
|
|
||||||
adapterremoval:
|
adapterremoval:
|
||||||
- modules/adapterremoval/**
|
- modules/adapterremoval/**
|
||||||
- tests/modules/adapterremoval/**
|
- tests/modules/adapterremoval/**
|
||||||
|
|
15
tests/modules/abricate/run/main.nf
Normal file
15
tests/modules/abricate/run/main.nf
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { ABRICATE_RUN } from '../../../../modules/abricate/run/main.nf'
|
||||||
|
|
||||||
|
workflow test_abricate_run {
|
||||||
|
|
||||||
|
input = [
|
||||||
|
[ id:'test', single_end:false ], // meta map
|
||||||
|
file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true)
|
||||||
|
]
|
||||||
|
|
||||||
|
ABRICATE_RUN ( input )
|
||||||
|
}
|
5
tests/modules/abricate/run/nextflow.config
Normal file
5
tests/modules/abricate/run/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
|
}
|
10
tests/modules/abricate/run/test.yml
Normal file
10
tests/modules/abricate/run/test.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
- name: abricate run
|
||||||
|
command: nextflow run tests/modules/abricate/run -entry test_abricate_run -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- abricate
|
||||||
|
- abricate/run
|
||||||
|
files:
|
||||||
|
- path: output/abricate/test.txt
|
||||||
|
md5sum: cd07e2953b127aed8d09bf1b2b903a1f
|
||||||
|
- path: output/abricate/versions.yml
|
||||||
|
md5sum: ae9cafaae96a644bb852e337aa7251f3
|
21
tests/modules/abricate/summary/main.nf
Normal file
21
tests/modules/abricate/summary/main.nf
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
|
||||||
|
include { ABRICATE_RUN } from '../../../../modules/abricate/run/main.nf'
|
||||||
|
include { ABRICATE_SUMMARY } from '../../../../modules/abricate/summary/main.nf'
|
||||||
|
|
||||||
|
workflow test_abricate_summary {
|
||||||
|
|
||||||
|
inputs = [
|
||||||
|
tuple([ id:'test1', single_end:false ], // meta map
|
||||||
|
file(params.test_data['bacteroides_fragilis']['genome']['genome_fna_gz'], checkIfExists: true)),
|
||||||
|
tuple([ id:'test2', single_end:false ],
|
||||||
|
file(params.test_data['haemophilus_influenzae']['genome']['genome_fna_gz'], checkIfExists: true))
|
||||||
|
]
|
||||||
|
|
||||||
|
ABRICATE_RUN ( Channel.fromList(inputs) )
|
||||||
|
ABRICATE_SUMMARY (
|
||||||
|
ABRICATE_RUN.out.report.collect{ meta, report -> report }.map{ report -> [[ id: 'test_summary'], report]}
|
||||||
|
)
|
||||||
|
}
|
5
tests/modules/abricate/summary/nextflow.config
Normal file
5
tests/modules/abricate/summary/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
|
}
|
14
tests/modules/abricate/summary/test.yml
Normal file
14
tests/modules/abricate/summary/test.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
- name: abricate summary
|
||||||
|
command: nextflow run tests/modules/abricate/summary -entry test_abricate_summary -c tests/config/nextflow.config
|
||||||
|
tags:
|
||||||
|
- abricate
|
||||||
|
- abricate/summary
|
||||||
|
files:
|
||||||
|
- path: output/abricate/test1.txt
|
||||||
|
md5sum: cd07e2953b127aed8d09bf1b2b903a1f
|
||||||
|
- path: output/abricate/test2.txt
|
||||||
|
md5sum: 69af3321b0bc808b7ef85f102395736f
|
||||||
|
- path: output/abricate/test_summary.txt
|
||||||
|
md5sum: a4ec7010e75404ce3a1033f0c4b4a7f9
|
||||||
|
- path: output/abricate/versions.yml
|
||||||
|
md5sum: a18f0471c49e5f25ec0b0c4ad5fab08e
|
Loading…
Reference in a new issue