Skip to content

Commit

Permalink
ADD argnorm module
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedanth-Ramji committed Jul 2, 2024
1 parent 95d5284 commit 02c4b6d
Show file tree
Hide file tree
Showing 6 changed files with 364 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/nf-core/argnorm/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: "argnorm"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::argnorm=0.5.0"
40 changes: 40 additions & 0 deletions modules/nf-core/argnorm/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
process ARGNORM {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/argnorm:0.5.0--pyhdfd78af_0':
'biocontainers/argnorm:0.5.0--pyhdfd78af_0' }"

input:
tuple val(meta), path(input_tsv)
val(db)
val(hamronized)
val(tool)

output:
tuple val(meta), path("*.tsv"), 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}"
def VERSION = '0.5.0'
"""
argnorm \\
$tool \\
-i $input_tsv \\
-o $prefix \\
--db $db \\
$hamronized
cat <<-END_VERSIONS > versions.yml
"${task.process}":
argnorm: $VERSION
END_VERSIONS
"""
}
65 changes: 65 additions & 0 deletions modules/nf-core/argnorm/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: "argnorm"
description: Normalize antibiotic resistance genes (ARGs) using the ARO ontology (developed by CARD).
keywords:
- amr
- antimicrobial resistance
- arg
- antimicrobial resistance genes
- genomics
- metagenomics
- normalization
- drug categorization
tools:
- "argnorm":
description: "Normalize antibiotic resistance genes (ARGs) using the ARO ontology (developed by CARD)."
homepage: "https://argnorm.readthedocs.io/en/latest/"
documentation: "https://argnorm.readthedocs.io/en/latest/"
tool_dev_url: "https://github.com/BigDataBiology/argNorm"
licence: ["MIT"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- input_tsv:
type: file
description: ARG annotation output
pattern: "*.tsv"

- db:
type: string
description: Database used for ARG annotation
pattern: "sarg|ncbi|resfinder|deeparg|megares|argannot|resfinderfg"

- hamronized:
type: string
description: Indicate ARG annotation output has been processed by hAMRonization
pattern: "|--hamronized"

- tool:
type: string
description: ARG annotation tool used
pattern: "argsoap|abricate|deeparg|resfinder|amrfinderplus"

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- tsv:
type: file
description: Normalized argNorm output
pattern: "*.tsv"

authors:
- "@Vedanth-Ramji"
maintainers:
- "@Vedanth-Ramji"
108 changes: 108 additions & 0 deletions modules/nf-core/argnorm/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
nextflow_process {
name "Test Process ARGNORM"
script "../main.nf"
process "ARGNORM"

tag "modules"
tag "modules_nfcore"
tag "argnorm"

test("argnorm - amrfinderplus_ncbi_raw - tsv") {
when {
process {
"""
input[0] = [
[ id:'test.tsv', single_end:false ], // meta map
file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/amrfinderplus/test_output.tsv", checkIfExists: true)
]
input[1] = 'ncbi'
input[2] = 'amrfinderplus'
input[3] = ''
"""
}
}

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

test("argnorm - amrfinderplus_ncbi_hamronized - tsv") {
when {
process {
"""
input[0] = [
[ id:'test.tsv', single_end:false ], // meta map
file("https://raw.githubusercontent.com/BigDataBiology/argNorm/main/examples/hamronized/amrfinderplus.ncbi.orfs.tsv", checkIfExists: true)
]
input[1] = 'ncbi'
input[2] = 'amrfinderplus'
input[3] = '--hamronized'
"""
}
}

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

test("argnorm - amrfinderplus_ncbi_hamronized - tsv - stub") {
options "-stub"

when {
process {
"""
input[0] = [
[ id:'test.tsv', single_end:false ], // meta map
file("https://raw.githubusercontent.com/BigDataBiology/argNorm/main/examples/hamronized/amrfinderplus.ncbi.orfs.tsv", checkIfExists: true)
]
input[1] = 'ncbi'
input[2] = 'amrfinderplus'
input[3] = '--hamronized'
"""
}
}

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

test("argnorm - amrfinderplus_ncbi - tsv - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test.tsv', single_end:false ], // meta map
file("https://raw.githubusercontent.com/BigDataBiology/argNorm/main/examples/raw/amrfinderplus.ncbi.orfs.tsv", checkIfExists: true)
]
input[1] = 'ncbi'
input[2] = 'amrfinderplus'
input[3] = ''
"""
}
}

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

}

}
142 changes: 142 additions & 0 deletions modules/nf-core/argnorm/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"argnorm - amrfinderplus_ncbi_raw - tsv": {
"content": [
{
"0": [
[
{
"id": "test.tsv",
"single_end": false
},
"test.tsv:md5,f870c239182592a065d9f80732b39bba"
]
],
"1": [
"versions.yml:md5,e200075d98a6f59137f105efceea0426"
],
"tsv": [
[
{
"id": "test.tsv",
"single_end": false
},
"test.tsv:md5,f870c239182592a065d9f80732b39bba"
]
],
"versions": [
"versions.yml:md5,e200075d98a6f59137f105efceea0426"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-02T14:56:50.742114812"
},
"argnorm - amrfinderplus_ncbi_hamronized - tsv": {
"content": [
{
"0": [
[
{
"id": "test.tsv",
"single_end": false
},
"test.tsv:md5,1f9a3820f09fd6a818af372dfe5cf322"
]
],
"1": [
"versions.yml:md5,e200075d98a6f59137f105efceea0426"
],
"tsv": [
[
{
"id": "test.tsv",
"single_end": false
},
"test.tsv:md5,1f9a3820f09fd6a818af372dfe5cf322"
]
],
"versions": [
"versions.yml:md5,e200075d98a6f59137f105efceea0426"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-02T14:57:19.694510786"
},
"argnorm - amrfinderplus_ncbi_hamronized - tsv - stub": {
"content": [
{
"0": [
[
{
"id": "test.tsv",
"single_end": false
},
"test.tsv:md5,1f9a3820f09fd6a818af372dfe5cf322"
]
],
"1": [
"versions.yml:md5,e200075d98a6f59137f105efceea0426"
],
"tsv": [
[
{
"id": "test.tsv",
"single_end": false
},
"test.tsv:md5,1f9a3820f09fd6a818af372dfe5cf322"
]
],
"versions": [
"versions.yml:md5,e200075d98a6f59137f105efceea0426"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-02T14:57:47.422476341"
},
"argnorm - amrfinderplus_ncbi - tsv - stub": {
"content": [
{
"0": [
[
{
"id": "test.tsv",
"single_end": false
},
"test.tsv:md5,e41b52c1213d8833c37472e3efb24db4"
]
],
"1": [
"versions.yml:md5,e200075d98a6f59137f105efceea0426"
],
"tsv": [
[
{
"id": "test.tsv",
"single_end": false
},
"test.tsv:md5,e41b52c1213d8833c37472e3efb24db4"
]
],
"versions": [
"versions.yml:md5,e200075d98a6f59137f105efceea0426"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-07-02T14:58:14.950164297"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/argnorm/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
argnorm:
- "modules/nf-core/argnorm/**"

0 comments on commit 02c4b6d

Please sign in to comment.