mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
add module hamronization/amrfinderplus (#1888)
* add module hamronization/amrfinderplus * deleted comments * Apply suggestions from code review Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
This commit is contained in:
parent
9bda3dc7f0
commit
1368164eb5
6 changed files with 136 additions and 0 deletions
44
modules/hamronization/amrfinderplus/main.nf
Normal file
44
modules/hamronization/amrfinderplus/main.nf
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
|
||||||
|
process HAMRONIZATION_AMRFINDERPLUS {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_low'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::hamronization=1.0.3" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/hamronization:1.0.3--py_0':
|
||||||
|
'quay.io/biocontainers/hamronization:1.0.3--py_0' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(report)
|
||||||
|
val(format)
|
||||||
|
val(software_version)
|
||||||
|
val(reference_db_version)
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.json") , optional: true, emit: json
|
||||||
|
tuple val(meta), path("*.tsv") , optional: true, emit: tsv
|
||||||
|
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}"
|
||||||
|
"""
|
||||||
|
hamronize \\
|
||||||
|
amrfinderplus \\
|
||||||
|
${report} \\
|
||||||
|
$args \\
|
||||||
|
--format ${format} \\
|
||||||
|
--analysis_software_version ${software_version} \\
|
||||||
|
--reference_database_version ${reference_db_version} \\
|
||||||
|
--input_file_name ${prefix} \\
|
||||||
|
> ${prefix}.${format}
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
hamronization: \$(echo \$(hamronize --version 2>&1) | cut -f 2 -d ' ' )
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
61
modules/hamronization/amrfinderplus/meta.yml
Normal file
61
modules/hamronization/amrfinderplus/meta.yml
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
name: "hamronization_amrfinderplus"
|
||||||
|
description: Tool to convert and summarize AMRfinderPlus outputs using the hAMRonization specification.
|
||||||
|
keywords:
|
||||||
|
- amr
|
||||||
|
- antimicrobial resistance
|
||||||
|
- arg
|
||||||
|
- antimicrobial resistance genes
|
||||||
|
- reporting
|
||||||
|
- amrfinderplus
|
||||||
|
tools:
|
||||||
|
- "hamronization":
|
||||||
|
description: "Tool to convert and summarize AMR gene detection outputs using the hAMRonization specification"
|
||||||
|
homepage: "https://github.com/pha4ge/hAMRonization/blob/master/README.md"
|
||||||
|
documentation: "https://github.com/pha4ge/hAMRonization/blob/master/README.md"
|
||||||
|
tool_dev_url: "https://github.com/pha4ge/hAMRonization"
|
||||||
|
licence: "['GNU Lesser General Public v3 (LGPL v3)']"
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test', single_end:false ]
|
||||||
|
- report:
|
||||||
|
type: file
|
||||||
|
description: Output .tsv file from AMRfinderPlus
|
||||||
|
pattern: "*.tsv"
|
||||||
|
- format:
|
||||||
|
type: value
|
||||||
|
description: Type of report file to be produced
|
||||||
|
pattern: "tsv|json"
|
||||||
|
- software_version:
|
||||||
|
type: value
|
||||||
|
description: Version of AMRfinder used
|
||||||
|
pattern: "[0-9].[0-9].[0-9]"
|
||||||
|
- reference_db_version:
|
||||||
|
type: value
|
||||||
|
description: Database version of ncbi_AMRfinder used
|
||||||
|
pattern: "[0-9]-[0-9]-[0-9].[0-9]"
|
||||||
|
|
||||||
|
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: hAMRonised report in JSON format
|
||||||
|
pattern: "*.json"
|
||||||
|
- tsv:
|
||||||
|
type: file
|
||||||
|
description: hAMRonised report in TSV format
|
||||||
|
pattern: "*.tsv"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@louperelo"
|
|
@ -1023,6 +1023,10 @@ gunzip:
|
||||||
- modules/gunzip/**
|
- modules/gunzip/**
|
||||||
- tests/modules/gunzip/**
|
- tests/modules/gunzip/**
|
||||||
|
|
||||||
|
hamronization/amrfinderplus:
|
||||||
|
- modules/hamronization/amrfinderplus/**
|
||||||
|
- tests/modules/hamronization/amrfinderplus/**
|
||||||
|
|
||||||
hamronization/deeparg:
|
hamronization/deeparg:
|
||||||
- modules/hamronization/deeparg/**
|
- modules/hamronization/deeparg/**
|
||||||
- tests/modules/hamronization/deeparg/**
|
- tests/modules/hamronization/deeparg/**
|
||||||
|
|
14
tests/modules/hamronization/amrfinderplus/main.nf
Normal file
14
tests/modules/hamronization/amrfinderplus/main.nf
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env nextflow
|
||||||
|
|
||||||
|
nextflow.enable.dsl = 2
|
||||||
|
include { HAMRONIZATION_AMRFINDERPLUS } from '../../../../modules/hamronization/amrfinderplus/main.nf'
|
||||||
|
|
||||||
|
workflow test_hamronization_amrfinderplus {
|
||||||
|
|
||||||
|
input = [
|
||||||
|
[ id:'test', single_end:false ], // meta map
|
||||||
|
file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/amrfinderplus/test_output.tsv", checkIfExists: true)
|
||||||
|
]
|
||||||
|
|
||||||
|
HAMRONIZATION_AMRFINDERPLUS ( input, 'tsv', '3.10.30', '2022-05-26.1' )
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
|
}
|
8
tests/modules/hamronization/amrfinderplus/test.yml
Normal file
8
tests/modules/hamronization/amrfinderplus/test.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
- name: hamronization amrfinderplus test_hamronization_amrfinderplus
|
||||||
|
command: nextflow run ./tests/modules/hamronization/amrfinderplus -entry test_hamronization_amrfinderplus -c ./tests/config/nextflow.config -c ./tests/modules/hamronization/amrfinderplus/nextflow.config
|
||||||
|
tags:
|
||||||
|
- hamronization
|
||||||
|
- hamronization/amrfinderplus
|
||||||
|
files:
|
||||||
|
- path: output/hamronization/test.tsv
|
||||||
|
md5sum: 6ed7f74659df7bce285ca80fd531e138
|
Loading…
Reference in a new issue