diff --git a/modules/kaiju/kaiju/main.nf b/modules/kaiju/kaiju/main.nf index 4050ede5..ae8f99e6 100644 --- a/modules/kaiju/kaiju/main.nf +++ b/modules/kaiju/kaiju/main.nf @@ -9,11 +9,11 @@ process KAIJU_KAIJU { input: tuple val(meta), path(reads) - tuple path(db), path(dbnodes) + path(db) output: tuple val(meta), path('*.tsv'), emit: results - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -23,11 +23,13 @@ process KAIJU_KAIJU { def prefix = task.ext.prefix ?: "${meta.id}" def input = meta.single_end ? "-i ${reads}" : "-i ${reads[0]} -j ${reads[1]}" """ + dbnodes=`find -L ${db} -name "*nodes.dmp"` + dbname=`find -L ${db} -name "*.fmi" -not -name "._*"` kaiju \\ $args \\ -z $task.cpus \\ - -t ${dbnodes} \\ - -f ${db} \\ + -t \$dbnodes \\ + -f \$dbname \\ -o ${prefix}.tsv \\ $input diff --git a/modules/kaiju/kaiju/meta.yml b/modules/kaiju/kaiju/meta.yml index 69a74037..e24c8efc 100644 --- a/modules/kaiju/kaiju/meta.yml +++ b/modules/kaiju/kaiju/meta.yml @@ -50,3 +50,4 @@ output: authors: - "@talnor" - "@sofstam" + - "@jfy133" diff --git a/tests/modules/kaiju/kaiju/main.nf b/tests/modules/kaiju/kaiju/main.nf index 00da82a9..10849ff8 100644 --- a/tests/modules/kaiju/kaiju/main.nf +++ b/tests/modules/kaiju/kaiju/main.nf @@ -2,6 +2,7 @@ nextflow.enable.dsl = 2 +include { UNTAR } from '../../../../modules/untar/main.nf' include { KAIJU_KAIJU } from '../../../../modules/kaiju/kaiju/main.nf' workflow test_kaiju_kaiju_single_end { @@ -10,12 +11,10 @@ workflow test_kaiju_kaiju_single_end { [ id:'test', single_end:true ], // meta map file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) ] - db = [ - file(params.test_data['sarscov2']['genome']['kaiju_fmi'], checkIfExists: true), // database - file(params.test_data['sarscov2']['genome']['kaiju_nodes'], checkIfExists: true) // taxon nodes - ] + db = [ [], file(params.test_data['sarscov2']['genome']['kaiju_tar_gz'], checkIfExists: true) ] - KAIJU_KAIJU ( input, db ) + UNTAR ( db ) + KAIJU_KAIJU ( input, UNTAR.out.untar.map{ it[1] } ) } workflow test_kaiju_kaiju_paired_end { @@ -25,10 +24,9 @@ workflow test_kaiju_kaiju_paired_end { [ file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true), file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] ] - db = [ - file(params.test_data['sarscov2']['genome']['kaiju_fmi'], checkIfExists: true), // database - file(params.test_data['sarscov2']['genome']['kaiju_nodes'], checkIfExists: true) // taxon nodes - ] + db = [ [], file(params.test_data['sarscov2']['genome']['kaiju_tar_gz'], checkIfExists: true) ] + + UNTAR ( db ) + KAIJU_KAIJU ( input, UNTAR.out.untar.map{ it[1] } ) - KAIJU_KAIJU ( input, db ) }