Fix Krona ktimporttaxonomy to allow multiple input files and simplifies database input (#1841)

* Remove quotes around input reports variable for ktImportTaxonomy as prevents supplying multiple files

* Add using prefix for output files

* Tweak meta reflecting more flexible input database specification

* Linting

* Fix finding the correct directory

* Update main.nf

* Fix database inport

* Prettier
This commit is contained in:
James A. Fellows Yates 2022-07-01 15:18:29 +02:00 committed by GitHub
parent 7d0ddbc8ab
commit 0e9fd9370a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 20 deletions

View file

@ -10,7 +10,7 @@ process KRONA_KTIMPORTTAXONOMY {
input:
tuple val(meta), path(report)
path "taxonomy/taxonomy.tab"
path taxonomy, stageAs: 'taxonomy.tab'
output:
tuple val(meta), path ('*.html'), emit: html
@ -21,12 +21,17 @@ process KRONA_KTIMPORTTAXONOMY {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '2.8' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
TAXONOMY=\$(find -L . -name '*.tab' -exec dirname {} \\;)
echo \$TAXONOMY
ktImportTaxonomy \\
$args \\
-tax taxonomy/ \\
"$report"
-o ${prefix}.html \\
-tax \$TAXONOMY/ \\
$report
cat <<-END_VERSIONS > versions.yml
"${task.process}":

View file

@ -25,9 +25,10 @@ input:
- database:
type: file
description: |
Path to the taxonomy database .tab file downloaded by krona/ktUpdateTaxonomy
The file will be saved under a folder named "taxonomy" as "taxonomy/taxonomy.tab".
The parent folder will be passed as argument to ktImportTaxonomy.
Path to a Krona taxonomy .tab file normally downloaded and generated by
krona/ktUpdateTaxonomy. Custom taxonomy files can have any name, but
must end in `.tab`.
pattern: "*tab"
- report:
type: file
description: "A tab-delimited file with taxonomy IDs and (optionally) query IDs, magnitudes, and scores. Query IDs are taken from column 1, taxonomy IDs from column 2, and scores from column 3. Lines beginning with # will be ignored."

View file

@ -1,23 +1,17 @@
- name: krona ktimporttaxonomy test_krona_ktimporttaxonomy_reads
command: nextflow run tests/modules/krona/ktimporttaxonomy -entry test_krona_ktimporttaxonomy_reads -c tests/config/nextflow.config
command: nextflow run ./tests/modules/krona/ktimporttaxonomy -entry test_krona_ktimporttaxonomy_reads -c ./tests/config/nextflow.config -c ./tests/modules/krona/ktimporttaxonomy/nextflow.config
tags:
- krona
- krona/ktimporttaxonomy
- krona
files:
- path: output/krona/taxonomy.krona.html
contains:
- "DOCTYPE html PUBLIC"
- path: output/krona/versions.yml
md5sum: 660a8c151191bf4c63bd96db2c7fe503
- path: output/krona/test.html
contains: ["Krona is a flexible tool for exploring the relative proportions of"]
- name: krona ktimporttaxonomy test_krona_ktimporttaxonomy_report
command: nextflow run tests/modules/krona/ktimporttaxonomy -entry test_krona_ktimporttaxonomy_report -c tests/config/nextflow.config
command: nextflow run ./tests/modules/krona/ktimporttaxonomy -entry test_krona_ktimporttaxonomy_report -c ./tests/config/nextflow.config -c ./tests/modules/krona/ktimporttaxonomy/nextflow.config
tags:
- krona
- krona/ktimporttaxonomy
- krona
files:
- path: output/krona/taxonomy.krona.html
contains:
- "DOCTYPE html PUBLIC"
- path: output/krona/versions.yml
md5sum: 8a593c16bb2d4132638fb0fc342fe2b7
- path: output/krona/test.html
contains: ["Krona is a flexible tool for exploring the relative proportions of"]