Amrfinderplus add tool and db version as output (#1912)

* not yet working: add db version to versions.yml

* next try: db version number not in versions.yml

* Fix amrfinderplus versioning

* Update main.nf

* Apply suggestions from code review

* Update main.nf

* Dump version for syncrony with run

* Update test.yml

* Apply suggestions from code review

* add tool and db version to output

* Apply suggestions from code review

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Update meta.yml

Co-authored-by: James Fellows Yates <jfy133@gmail.com>
This commit is contained in:
louperelo 2022-07-20 11:55:44 +02:00 committed by GitHub
parent 8656636f0d
commit 839bc6b1ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -15,6 +15,8 @@ process AMRFINDERPLUS_RUN {
tuple val(meta), path("${prefix}.tsv") , emit: report tuple val(meta), path("${prefix}.tsv") , emit: report
tuple val(meta), path("${prefix}-mutations.tsv"), emit: mutation_report, optional: true tuple val(meta), path("${prefix}-mutations.tsv"), emit: mutation_report, optional: true
path "versions.yml" , emit: versions path "versions.yml" , emit: versions
env VER , emit: tool_version
env DBVER , emit: db_version
when: when:
task.ext.when == null || task.ext.when task.ext.when == null || task.ext.when
@ -46,6 +48,8 @@ process AMRFINDERPLUS_RUN {
--database amrfinderdb \\ --database amrfinderdb \\
--threads $task.cpus > ${prefix}.tsv --threads $task.cpus > ${prefix}.tsv
VER=\$(amrfinder --version)
DBVER=\$(echo \$(amrfinder --database amrfinderdb --database_version 2> stdout) | rev | cut -f 1 -d ' ' | rev)
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":

View file

@ -46,6 +46,14 @@ output:
type: file type: file
description: Report of organism-specific point-mutations description: Report of organism-specific point-mutations
pattern: "*-mutations.tsv" pattern: "*-mutations.tsv"
- tool_version:
type: string
description: The version of the tool in string format (useful for downstream tools such as hAMRronization)
- db_version:
type: string
description: The version of the used database in string format (useful for downstream tools such as hAMRronization)
authors: authors:
- "@rpetit3" - "@rpetit3"
- "@louperelo"
- "@jfy133"