new module hamronization/rgi (#1844)

* new module hamronization/rgi

* remove comments

* Update modules/hamronization/rgi/main.nf

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
This commit is contained in:
louperelo 2022-07-01 12:03:08 +02:00 committed by GitHub
parent b3acfc54f5
commit 057a889d3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 139 additions and 0 deletions

View file

@ -0,0 +1,44 @@
process HAMRONIZATION_RGI {
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 \\
rgi \\
${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
"""
}

View file

@ -0,0 +1,62 @@
name: "hamronization_rgi"
description: Tool to convert and summarize RGI outputs using the hAMRonization specification.
keywords:
- amr
- antimicrobial resistance
- arg
- antimicrobial resistance genes
- reporting
- rgi
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"
doi: ""
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 .txt file from RGI
pattern: "*.txt"
- format:
type: value
description: Type of report file to be produced
pattern: "tsv|json"
- software_version:
type: value
description: Version of DeepARG used
pattern: "[0-9].[0-9].[0-9]"
- reference_db_version:
type: value
description: Database version of DeepARG used
pattern: "[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: "*.json"
authors:
- "@louperelo"

View file

@ -1011,6 +1011,10 @@ hamronization/deeparg:
- modules/hamronization/deeparg/**
- tests/modules/hamronization/deeparg/**
hamronization/rgi:
- modules/hamronization/rgi/**
- tests/modules/hamronization/rgi/**
hamronization/summarize:
- modules/hamronization/summarize/**
- tests/modules/hamronization/summarize/**

View file

@ -0,0 +1,16 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { RGI_MAIN } from '../../../../modules/rgi/main/main.nf'
include { HAMRONIZATION_RGI } from '../../../../modules/hamronization/rgi/main.nf'
workflow test_hamronization_rgi {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['haemophilus_influenzae']['genome']['genome_fna_gz'], checkIfExists: true)
]
RGI_MAIN ( input )
HAMRONIZATION_RGI ( RGI_MAIN.out.tsv, 'tsv', '1.0.2', '3.2.3' )
}

View file

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

View file

@ -0,0 +1,8 @@
- name: hamronization rgi
command: nextflow run ./tests/modules/hamronization/rgi -entry test_hamronization_rgi -c ./tests/config/nextflow.config -c ./tests/modules/hamronization/rgi/nextflow.config
tags:
- hamronization
- hamronization/rgi
files:
- path: output/hamronization/test.tsv
md5sum: 3e0f7e9321afbc947dd1ea32ce9c0559