Update input in kaiju_kaiju module (#1522)

This commit is contained in:
Sofia Stamouli 2022-04-13 14:53:08 +02:00 committed by GitHub
parent 4f5274c3de
commit 8856f127c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 14 deletions

View file

@ -9,7 +9,7 @@ process KAIJU_KAIJU {
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
tuple path(db), path(dbnodes) path(db)
output: output:
tuple val(meta), path('*.tsv'), emit: results tuple val(meta), path('*.tsv'), emit: results
@ -23,11 +23,13 @@ process KAIJU_KAIJU {
def prefix = task.ext.prefix ?: "${meta.id}" def prefix = task.ext.prefix ?: "${meta.id}"
def input = meta.single_end ? "-i ${reads}" : "-i ${reads[0]} -j ${reads[1]}" 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 \\ kaiju \\
$args \\ $args \\
-z $task.cpus \\ -z $task.cpus \\
-t ${dbnodes} \\ -t \$dbnodes \\
-f ${db} \\ -f \$dbname \\
-o ${prefix}.tsv \\ -o ${prefix}.tsv \\
$input $input

View file

@ -50,3 +50,4 @@ output:
authors: authors:
- "@talnor" - "@talnor"
- "@sofstam" - "@sofstam"
- "@jfy133"

View file

@ -2,6 +2,7 @@
nextflow.enable.dsl = 2 nextflow.enable.dsl = 2
include { UNTAR } from '../../../../modules/untar/main.nf'
include { KAIJU_KAIJU } from '../../../../modules/kaiju/kaiju/main.nf' include { KAIJU_KAIJU } from '../../../../modules/kaiju/kaiju/main.nf'
workflow test_kaiju_kaiju_single_end { workflow test_kaiju_kaiju_single_end {
@ -10,12 +11,10 @@ workflow test_kaiju_kaiju_single_end {
[ id:'test', single_end:true ], // meta map [ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true) file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
] ]
db = [ db = [ [], file(params.test_data['sarscov2']['genome']['kaiju_tar_gz'], checkIfExists: true) ]
file(params.test_data['sarscov2']['genome']['kaiju_fmi'], checkIfExists: true), // database
file(params.test_data['sarscov2']['genome']['kaiju_nodes'], checkIfExists: true) // taxon nodes
]
KAIJU_KAIJU ( input, db ) UNTAR ( db )
KAIJU_KAIJU ( input, UNTAR.out.untar.map{ it[1] } )
} }
workflow test_kaiju_kaiju_paired_end { 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_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ] file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true) ]
] ]
db = [ db = [ [], file(params.test_data['sarscov2']['genome']['kaiju_tar_gz'], checkIfExists: true) ]
file(params.test_data['sarscov2']['genome']['kaiju_fmi'], checkIfExists: true), // database
file(params.test_data['sarscov2']['genome']['kaiju_nodes'], checkIfExists: true) // taxon nodes UNTAR ( db )
] KAIJU_KAIJU ( input, UNTAR.out.untar.map{ it[1] } )
KAIJU_KAIJU ( input, db )
} }