Add module hamronization/abricate (#1925)

* Add hamronization/abricate

* Update input pattern in meta.yml

* Update location of hamronization test data

* Apply suggestions from code review
This commit is contained in:
Jasmin F 2022-07-26 12:55:53 +02:00 committed by GitHub
parent c363d8c37c
commit 7f7f6bc913
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 141 additions and 3 deletions

View file

@ -0,0 +1,43 @@
process HAMRONIZATION_ABRICATE {
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 \\
abricate \\
${report} \\
$args \\
--format ${format} \\
--analysis_software_version ${software_version} \\
--reference_database_version ${reference_db_version} \\
> ${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,60 @@
name: "hamronization_abricate"
description: Tool to convert and summarize ABRicate outputs using the hAMRonization specification
keywords:
- amr
- antimicrobial resistance
- reporting
- abricate
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 TSV or CSV file from ABRicate
pattern: "*.{csv,tsv}"
- format:
type: value
description: Type of report file to be produced
pattern: "tsv|json"
- software_version:
type: value
description: Version of ABRicate used
pattern: "[0-9].[0-9].[0-9]"
- reference_db_version:
type: value
description: Database version of ABRicate used
pattern: "[0-9][0-9][0-9][0-9]-[A-Z][a-z][a-z]-[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:
- "@jasmezz"

View file

@ -1035,6 +1035,10 @@ gvcftools/extractvariants:
- modules/gvcftools/extractvariants/** - modules/gvcftools/extractvariants/**
- tests/modules/gvcftools/extractvariants/** - tests/modules/gvcftools/extractvariants/**
hamronization/abricate:
- modules/hamronization/abricate/**
- tests/modules/hamronization/abricate/**
hamronization/amrfinderplus: hamronization/amrfinderplus:
- modules/hamronization/amrfinderplus/** - modules/hamronization/amrfinderplus/**
- tests/modules/hamronization/amrfinderplus/** - tests/modules/hamronization/amrfinderplus/**

View file

@ -369,10 +369,13 @@ params {
genome_fna_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz" genome_fna_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz"
genome_gbff_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gbff.gz" genome_gbff_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gbff.gz"
genome_paf = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.paf" 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" genome_gff_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gff.gz"
genome_gff_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/genome/genome.gff.gz"
} }
'hamronization' {
genome_abricate_tsv = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/hamronization/genome.abricate.tsv"
genome_mapping_potential_arg = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/hamronization/genome.mapping.potential.ARG"
}
'illumina' { 'illumina' {
test1_contigs_fa_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fasta/test1.contigs.fa.gz" test1_contigs_fa_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fasta/test1.contigs.fa.gz"
test1_1_fastq_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz" test1_1_fastq_gz = "${test_data_dir}/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz"

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { HAMRONIZATION_ABRICATE } from '../../../../modules/hamronization/abricate/main.nf'
workflow test_hamronization_abricate {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['bacteroides_fragilis']['hamronization']['genome_abricate_tsv'], checkIfExists: true),
]
HAMRONIZATION_ABRICATE ( input, 'tsv', '1.0.1', '2021-Mar-27' )
}

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 abricate test_hamronization_abricate
command: nextflow run ./tests/modules/hamronization/abricate -entry test_hamronization_abricate -c ./tests/config/nextflow.config -c ./tests/modules/hamronization/abricate/nextflow.config
tags:
- hamronization/abricate
- hamronization
files:
- path: output/hamronization/test.tsv
md5sum: 1c774f024872da954126d0ff77b77ea7

View file

@ -8,7 +8,7 @@ workflow test_hamronization_deeparg {
input = [ input = [
[ id:'test', single_end:false ], // meta map [ id:'test', single_end:false ], // meta map
file(params.test_data['bacteroides_fragilis']['genome']['genome_mapping_potential_arg'], checkIfExists: true), file(params.test_data['bacteroides_fragilis']['hamronization']['genome_mapping_potential_arg'], checkIfExists: true),
] ]
HAMRONIZATION_DEEPARG ( input, 'tsv', '1.0.2', '2' ) HAMRONIZATION_DEEPARG ( input, 'tsv', '1.0.2', '2' )