Merge pull request #1601 from carpanz/firstbranch

Non-breaking changes to krona modules: update kronadb module name, inclusion of ext.args, legacy module maintained
This commit is contained in:
Simone Carpanzano 2022-05-05 14:32:54 +02:00 committed by GitHub
commit e4a31e4e0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 142 additions and 12 deletions

View file

@ -18,7 +18,9 @@ process KRONA_KRONADB {
script:
def args = task.ext.args ?: ''
"""
ktUpdateTaxonomy.sh taxonomy
ktUpdateTaxonomy.sh \\
$args \\
taxonomy/
cat <<-END_VERSIONS > versions.yml
"${task.process}":

View file

@ -23,7 +23,10 @@ process KRONA_KTIMPORTTAXONOMY {
script:
def args = task.ext.args ?: ''
"""
ktImportTaxonomy "$report" -tax taxonomy
ktImportTaxonomy \\
$args \\
-tax taxonomy/ \\
"$report"
cat <<-END_VERSIONS > versions.yml
"${task.process}":

View file

@ -23,8 +23,11 @@ input:
Groovy Map containing sample information
e.g. [ id:'test']
- database:
type: path
description: "Path to the taxonomy database downloaded by krona/kronadb"
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.
- 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

@ -0,0 +1,30 @@
def VERSION='2.7.1' // Version information not provided by tool on CLI
process KRONA_KTUPDATETAXONOMY {
label 'process_low'
conda (params.enable_conda ? "bioconda::krona=2.7.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/krona:2.7.1--pl526_5' :
'quay.io/biocontainers/krona:2.7.1--pl526_5' }"
output:
path 'taxonomy/taxonomy.tab', emit: db
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
"""
ktUpdateTaxonomy.sh \\
$args \\
taxonomy/
cat <<-END_VERSIONS > versions.yml
"${task.process}":
krona: $VERSION
END_VERSIONS
"""
}

View file

@ -0,0 +1,31 @@
name: krona_ktupdatetaxonomy
description: KronaTools Update Taxonomy downloads a taxonomy database
keywords:
- database
- taxonomy
- krona
- visualisation
tools:
- krona:
description: Krona Tools is a set of scripts to create Krona charts from several Bioinformatics tools as well as from text and XML files.
homepage: https://github.com/marbl/Krona/wiki/KronaTools
documentation: https://github.com/marbl/Krona/wiki/Installing
tool_dev_url:
doi: https://doi.org/10.1186/1471-2105-12-385
licence:
input:
- none: There is no input. This module downloads a pre-built taxonomy database for use with Krona Tools.
output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- db:
type: file
description: A TAB separated file that contains a taxonomy database.
pattern: "*.{tab}"
authors:
- "@mjakobs"

View file

@ -1058,6 +1058,10 @@ krona/kronadb:
- modules/krona/kronadb/**
- tests/modules/krona/kronadb/**
krona/ktupdatetaxonomy:
- modules/krona/ktupdatetaxonomy/**
- tests/modules/krona/ktupdatetaxonomy/**
krona/ktimporttaxonomy:
- modules/krona/ktimporttaxonomy/**
- tests/modules/krona/ktimporttaxonomy/**

View file

@ -111,7 +111,9 @@ params {
test_sequencing_summary = "${test_data_dir}/genomics/sarscov2/nanopore/sequencing_summary/test.sequencing_summary.txt"
}
'metagenome' {
classified_reads_assignment = "${test_data_dir}/genomics/sarscov2/metagenome/test_1.kraken2.reads.txt"
kraken_report = "${test_data_dir}/genomics/sarscov2/metagenome/test_1.kraken2.report.txt"
krona_taxonomy = "${test_data_dir}/genomics/sarscov2/metagenome/krona_taxonomy.tab"
}
}
'homo_sapiens' {

View file

@ -2,15 +2,27 @@
nextflow.enable.dsl = 2
include { KRONA_KTIMPORTTAXONOMY } from '../../../../modules/krona/ktimporttaxonomy/main.nf'
include { KRONA_KTIMPORTTAXONOMY as KRONA_KTIMPORTTAXONOMY_READS } from '../../../../modules/krona/ktimporttaxonomy/main.nf'
include { KRONA_KTIMPORTTAXONOMY as KRONA_KTIMPORTTAXONOMY_REPORT } from '../../../../modules/krona/ktimporttaxonomy/main.nf'
workflow test_krona_ktimporttaxonomy {
workflow test_krona_ktimporttaxonomy_reads {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['generic']['txt']['hello'], checkIfExists: true)
file(params.test_data['sarscov2']['metagenome']['classified_reads_assignment'], checkIfExists: true)
]
taxonomy = file(params.test_data['generic']['txt']['hello'], checkIfExists: true)
taxonomy = file(params.test_data['sarscov2']['metagenome']['krona_taxonomy'], checkIfExists: true)
KRONA_KTIMPORTTAXONOMY ( input, taxonomy )
KRONA_KTIMPORTTAXONOMY_READS ( input, taxonomy )
}
workflow test_krona_ktimporttaxonomy_report {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['metagenome']['kraken_report'], checkIfExists: true)
]
taxonomy = file(params.test_data['sarscov2']['metagenome']['krona_taxonomy'], checkIfExists: true)
KRONA_KTIMPORTTAXONOMY_REPORT ( input, taxonomy )
}

View file

@ -2,4 +2,12 @@ process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: KRONA_KTIMPORTTAXONOMY_READS {
ext.args = '-t 3'
}
withName: KRONA_KTIMPORTTAXONOMY_REPORT {
ext.args = '-m 3 -t 5'
}
}

View file

@ -1,9 +1,23 @@
- name: krona ktimporttaxonomy test_krona_ktimporttaxonomy
command: nextflow run ./tests/modules/krona/ktimporttaxonomy -entry test_krona_ktimporttaxonomy -c ./tests/config/nextflow.config -c ./tests/modules/krona/ktimporttaxonomy/nextflow.config
- name: krona ktimporttaxonomy test_krona_ktimporttaxonomy_reads
command: nextflow run tests/modules/krona/ktimporttaxonomy -entry test_krona_ktimporttaxonomy_reads -c tests/config/nextflow.config
tags:
- krona/ktimporttaxonomy
- krona
- krona/ktimporttaxonomy
files:
- path: output/krona/taxonomy.krona.html
contains:
- "DOCTYPE html PUBLIC"
- path: output/krona/versions.yml
md5sum: 660a8c151191bf4c63bd96db2c7fe503
- name: krona ktimporttaxonomy test_krona_ktimporttaxonomy_report
command: nextflow run tests/modules/krona/ktimporttaxonomy -entry test_krona_ktimporttaxonomy_report -c tests/config/nextflow.config
tags:
- krona
- krona/ktimporttaxonomy
files:
- path: output/krona/taxonomy.krona.html
contains:
- "DOCTYPE html PUBLIC"
- path: output/krona/versions.yml
md5sum: 8a593c16bb2d4132638fb0fc342fe2b7

View file

@ -0,0 +1,9 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { KRONA_KTUPDATETAXONOMY } from '../../../../modules/krona/ktupdatetaxonomy/main.nf'
workflow test_krona_ktupdatetaxonomy {
KRONA_KTUPDATETAXONOMY ( )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,7 @@
- name: krona ktupdatetaxonomy test_krona_ktupdatetaxonomy
command: nextflow run ./tests/modules/krona/ktupdatetaxonomy -entry test_krona_ktupdatetaxonomy -c ./tests/config/nextflow.config -c ./tests/modules/krona/ktupdatetaxonomy/nextflow.config
tags:
- krona
- krona/ktupdatetaxonomy
files:
- path: output/krona/taxonomy/taxonomy.tab