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

Switch to using raw classifications for Kaiju2Krona

This commit is contained in:
Thomas A. Christensen II 2022-06-27 12:12:16 -05:00
parent 821dd844d8
commit 4de43040a3
Signed by: millironx
GPG key ID: 139C07724802BC5D
3 changed files with 23 additions and 13 deletions

View file

@ -21,6 +21,7 @@ workflow PROFILING {
main:
ch_versions = Channel.empty()
ch_multiqc_files = Channel.empty()
ch_raw_classifications = Channel.empty()
ch_raw_profiles = Channel.empty()
/*
@ -110,6 +111,7 @@ workflow PROFILING {
MEGAN_RMA2INFO (ch_maltrun_for_megan, params.malt_generate_megansummary )
ch_multiqc_files = ch_multiqc_files.mix( MALT_RUN.out.log.collect{it[1]}.ifEmpty([]) )
ch_versions = ch_versions.mix( MALT_RUN.out.versions.first(), MEGAN_RMA2INFO.out.versions.first() )
ch_raw_classifications = ch_raw_classifications.mix( ch_maltrun_for_megan )
ch_raw_profiles = ch_raw_profiles.mix( MEGAN_RMA2INFO.out.txt )
}
@ -126,6 +128,7 @@ workflow PROFILING {
KRAKEN2_KRAKEN2 ( ch_input_for_kraken2.reads, ch_input_for_kraken2.db, params.kraken2_save_reads, params.kraken2_save_readclassification )
ch_multiqc_files = ch_multiqc_files.mix( KRAKEN2_KRAKEN2.out.report.collect{it[1]}.ifEmpty([]) )
ch_versions = ch_versions.mix( KRAKEN2_KRAKEN2.out.versions.first() )
ch_raw_classifications = ch_raw_classifications.mix( KRAKEN2_KRAKEN2.out.classified_reads_assignment )
ch_raw_profiles = ch_raw_profiles.mix( KRAKEN2_KRAKEN2.out.report )
}
@ -146,6 +149,7 @@ workflow PROFILING {
CENTRIFUGE_CENTRIFUGE ( ch_input_for_centrifuge.reads, ch_input_for_centrifuge.db, params.centrifuge_save_reads, params.centrifuge_save_reads, params.centrifuge_save_reads )
CENTRIFUGE_KREPORT (CENTRIFUGE_CENTRIFUGE.out.results, ch_input_for_centrifuge.db)
ch_versions = ch_versions.mix( CENTRIFUGE_CENTRIFUGE.out.versions.first() )
ch_raw_classifications = ch_raw_classifications.mix( CENTRIFUGE_CENTRIFUGE.out.results )
ch_raw_profiles = ch_raw_profiles.mix( CENTRIFUGE_KREPORT.out.kreport )
}
@ -182,6 +186,7 @@ workflow PROFILING {
KAIJU_KAIJU2TABLE (KAIJU_KAIJU.out.results, ch_input_for_kaiju.db, params.kaiju_taxon_name)
ch_multiqc_files = ch_multiqc_files.mix( KAIJU_KAIJU2TABLE.out.summary.collect{it[1]}.ifEmpty([]) )
ch_versions = ch_versions.mix( KAIJU_KAIJU.out.versions.first() )
ch_raw_classifications = ch_raw_classifications.mix( KAIJU_KAIJU.out.results )
ch_raw_profiles = ch_raw_profiles.mix( KAIJU_KAIJU2TABLE.out.summary )
}
@ -206,8 +211,8 @@ workflow PROFILING {
}
emit:
classifications = ch_raw_classifications
profiles = ch_raw_profiles // channel: [ val(meta), [ reads ] ] - should be text files or biom
versions = ch_versions // channel: [ versions.yml ]
mqc = ch_multiqc_files
}

View file

@ -9,6 +9,7 @@ include { KRONA_KTIMPORTTEXT } from '../../modules/nf-core/modules/krona/
workflow VISUALIZATION_KRONA {
take:
classifications
profiles
databases
@ -23,10 +24,14 @@ 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
}
ch_input_classifications = classifications
.branch {
kaiju: it[0]['tool'] == 'kaiju'
unknown: true
}
/*
Convert Kraken2 formatted reports into Krona text files
@ -40,7 +45,7 @@ workflow VISUALIZATION_KRONA {
/*
Combine Kaiju profiles with their databases
*/
ch_input_for_kaiju2krona = ch_input_profiles.kaiju
ch_input_for_kaiju2krona = ch_input_classifications.kaiju
.map{ [it[0]['db_name'], it[0], it[1]] }
.combine( databases.map{ [it[0]['db_name'], it[1]] }, by: 0 )
.multiMap{

View file

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