mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-25 09:59:56 +00:00
Add Kaiju profile conversion to visualization workflow
This commit is contained in:
parent
5b80c7cab9
commit
821dd844d8
2 changed files with 23 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
// 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 { KRONA_CLEANUP } from '../../modules/local/krona_cleanup'
|
||||
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 {
|
||||
take:
|
||||
profiles
|
||||
databases
|
||||
|
||||
main:
|
||||
ch_krona_text = Channel.empty()
|
||||
|
@ -21,6 +23,7 @@ workflow VISUALIZATION_KRONA {
|
|||
ch_input_profiles = profiles
|
||||
.branch {
|
||||
centrifuge: it[0]['tool'] == 'centrifuge'
|
||||
kaiju: it[0]['tool'] == 'kaiju'
|
||||
kraken2: it[0]['tool'] == 'kraken2'
|
||||
unknown: true
|
||||
}
|
||||
|
@ -34,6 +37,25 @@ workflow VISUALIZATION_KRONA {
|
|||
ch_krona_text = ch_krona_text.mix( KRAKENTOOLS_KREPORT2KRONA.out.txt )
|
||||
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
|
||||
*/
|
||||
|
|
|
@ -214,7 +214,7 @@ workflow TAXPROFILER {
|
|||
SUBWORKFLOW: VISUALIZATION_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 )
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue