mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
Add hamronization/deeparg
(#1364)
* fix: remove left-over unnecessary code * Add hamronizer/deeparg * Add when condition * Apply suggestions from code review * Update modules/hamronization/deeparg/meta.yml
This commit is contained in:
parent
8e5eaf1fa4
commit
4983f77796
7 changed files with 139 additions and 1 deletions
44
modules/hamronization/deeparg/main.nf
Normal file
44
modules/hamronization/deeparg/main.nf
Normal file
|
@ -0,0 +1,44 @@
|
|||
process HAMRONIZATION_DEEPARG {
|
||||
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 \\
|
||||
deeparg \\
|
||||
${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
|
||||
"""
|
||||
}
|
60
modules/hamronization/deeparg/meta.yml
Normal file
60
modules/hamronization/deeparg/meta.yml
Normal file
|
@ -0,0 +1,60 @@
|
|||
name: hamronization_deeparg
|
||||
description: Tool to convert and summarize DeepARG outputs using the hAMRonization specification
|
||||
keywords:
|
||||
- amr
|
||||
- antimicrobial resistance
|
||||
- reporting
|
||||
- deeparg
|
||||
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 .mapping.ARG file from DeepARG
|
||||
pattern: "*.mapping.ARG"
|
||||
- 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]"
|
||||
|
||||
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:
|
||||
- "@jfy133"
|
|
@ -752,6 +752,10 @@ gunzip:
|
|||
- modules/gunzip/**
|
||||
- tests/modules/gunzip/**
|
||||
|
||||
hamronization/deeparg:
|
||||
- modules/hamronization/deeparg/**
|
||||
- tests/modules/hamronization/deeparg/**
|
||||
|
||||
hicap:
|
||||
- modules/hicap/**
|
||||
- tests/modules/hicap/**
|
||||
|
|
|
@ -321,6 +321,8 @@ params {
|
|||
'genome' {
|
||||
genome_fna_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz"
|
||||
genome_paf = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.paf"
|
||||
genome_mapping_potential_arg = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.mapping.potential.ARG"
|
||||
|
||||
}
|
||||
'illumina' {
|
||||
test1_contigs_fa_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fasta/test1.contigs.fa.gz"
|
||||
|
|
15
tests/modules/hamronization/deeparg/main.nf
Normal file
15
tests/modules/hamronization/deeparg/main.nf
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { HAMRONIZATION_DEEPARG } from '../../../../modules/hamronization/deeparg/main.nf'
|
||||
|
||||
workflow test_hamronization_deeparg {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false ], // meta map
|
||||
file(params.test_data['bacteroides_fragilis']['genome']['genome_mapping_potential_arg'], checkIfExists: true),
|
||||
]
|
||||
|
||||
HAMRONIZATION_DEEPARG ( input, 'tsv', '1.0.2', '2' )
|
||||
}
|
5
tests/modules/hamronization/deeparg/nextflow.config
Normal file
5
tests/modules/hamronization/deeparg/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
8
tests/modules/hamronization/deeparg/test.yml
Normal file
8
tests/modules/hamronization/deeparg/test.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
- name: hamronization deeparg test_hamronization_deeparg
|
||||
command: nextflow run tests/modules/hamronization/deeparg -entry test_hamronization_deeparg -c tests/config/nextflow.config
|
||||
tags:
|
||||
- hamronization
|
||||
- hamronization/deeparg
|
||||
files:
|
||||
- path: output/hamronization/test.tsv
|
||||
md5sum: 3c315605aca0c5964796bb5fd4cdd522
|
Loading…
Reference in a new issue