1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-22 12:49:55 +00:00

Add Kaiju profile conversion to visualization workflow

This commit is contained in:
Thomas A. Christensen II 2022-06-27 09:23:20 -05:00
parent 5b80c7cab9
commit 821dd844d8
Signed by: millironx
GPG key ID: 139C07724802BC5D
2 changed files with 23 additions and 1 deletions

View file

@ -2,6 +2,7 @@
// Create Krona visualizations // Create Krona visualizations
// //
include { KAIJU_KAIJU2KRONA } from '../../modules/nf-core/modules/kaiju/kaiju2krona/main'
include { KRAKENTOOLS_KREPORT2KRONA } from '../../modules/nf-core/modules/krakentools/kreport2krona/main' include { KRAKENTOOLS_KREPORT2KRONA } from '../../modules/nf-core/modules/krakentools/kreport2krona/main'
include { KRONA_CLEANUP } from '../../modules/local/krona_cleanup' include { KRONA_CLEANUP } from '../../modules/local/krona_cleanup'
include { KRONA_KTIMPORTTEXT } from '../../modules/nf-core/modules/krona/ktimporttext/main' include { KRONA_KTIMPORTTEXT } from '../../modules/nf-core/modules/krona/ktimporttext/main'
@ -9,6 +10,7 @@ include { KRONA_KTIMPORTTEXT } from '../../modules/nf-core/modules/krona/
workflow VISUALIZATION_KRONA { workflow VISUALIZATION_KRONA {
take: take:
profiles profiles
databases
main: main:
ch_krona_text = Channel.empty() ch_krona_text = Channel.empty()
@ -21,6 +23,7 @@ workflow VISUALIZATION_KRONA {
ch_input_profiles = profiles ch_input_profiles = profiles
.branch { .branch {
centrifuge: it[0]['tool'] == 'centrifuge' centrifuge: it[0]['tool'] == 'centrifuge'
kaiju: it[0]['tool'] == 'kaiju'
kraken2: it[0]['tool'] == 'kraken2' kraken2: it[0]['tool'] == 'kraken2'
unknown: true unknown: true
} }
@ -34,6 +37,25 @@ workflow VISUALIZATION_KRONA {
ch_krona_text = ch_krona_text.mix( KRAKENTOOLS_KREPORT2KRONA.out.txt ) ch_krona_text = ch_krona_text.mix( KRAKENTOOLS_KREPORT2KRONA.out.txt )
ch_versions = ch_versions.mix( KRAKENTOOLS_KREPORT2KRONA.out.versions.first() ) ch_versions = ch_versions.mix( KRAKENTOOLS_KREPORT2KRONA.out.versions.first() )
/*
Combine Kaiju profiles with their databases
*/
ch_input_for_kaiju2krona = ch_input_profiles.kaiju
.map{ [it[0]['db_name'], it[0], it[1]] }
.combine( databases.map{ [it[0]['db_name'], it[1]] }, by: 0 )
.multiMap{
it ->
profiles: [it[1], it[2]]
db: it[3]
}
/*
Convert Kaiju formatted reports into Krona text files
*/
KAIJU_KAIJU2KRONA( ch_input_for_kaiju2krona.profiles, ch_input_for_kaiju2krona.db )
ch_krona_text = ch_krona_text.mix( KAIJU_KAIJU2KRONA.out.txt )
ch_versions = ch_versions.mix( KAIJU_KAIJU2KRONA.out.versions.first() )
/* /*
Remove taxonomy level annotations from the Krona text files Remove taxonomy level annotations from the Krona text files
*/ */

View file

@ -214,7 +214,7 @@ workflow TAXPROFILER {
SUBWORKFLOW: VISUALIZATION_KRONA SUBWORKFLOW: VISUALIZATION_KRONA
*/ */
if ( params.run_krona ) { if ( params.run_krona ) {
VISUALIZATION_KRONA ( PROFILING.out.profiles ) VISUALIZATION_KRONA ( PROFILING.out.profiles, DB_CHECK.out.dbs )
ch_versions = ch_versions.mix( VISUALIZATION_KRONA.out.versions ) ch_versions = ch_versions.mix( VISUALIZATION_KRONA.out.versions )
} }