mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-22 11:19:54 +00:00
Switch to using raw classifications for Kaiju2Krona
This commit is contained in:
parent
821dd844d8
commit
4de43040a3
3 changed files with 23 additions and 13 deletions
|
@ -21,7 +21,8 @@ workflow PROFILING {
|
||||||
main:
|
main:
|
||||||
ch_versions = Channel.empty()
|
ch_versions = Channel.empty()
|
||||||
ch_multiqc_files = Channel.empty()
|
ch_multiqc_files = Channel.empty()
|
||||||
ch_raw_profiles = Channel.empty()
|
ch_raw_classifications = Channel.empty()
|
||||||
|
ch_raw_profiles = Channel.empty()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
COMBINE READS WITH POSSIBLE DATABASES
|
COMBINE READS WITH POSSIBLE DATABASES
|
||||||
|
@ -110,6 +111,7 @@ workflow PROFILING {
|
||||||
MEGAN_RMA2INFO (ch_maltrun_for_megan, params.malt_generate_megansummary )
|
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_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_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 )
|
ch_raw_profiles = ch_raw_profiles.mix( MEGAN_RMA2INFO.out.txt )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -124,9 +126,10 @@ workflow PROFILING {
|
||||||
}
|
}
|
||||||
|
|
||||||
KRAKEN2_KRAKEN2 ( ch_input_for_kraken2.reads, ch_input_for_kraken2.db, params.kraken2_save_reads, params.kraken2_save_readclassification )
|
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_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_versions = ch_versions.mix( KRAKEN2_KRAKEN2.out.versions.first() )
|
||||||
ch_raw_profiles = ch_raw_profiles.mix( KRAKEN2_KRAKEN2.out.report )
|
ch_raw_classifications = ch_raw_classifications.mix( KRAKEN2_KRAKEN2.out.classified_reads_assignment )
|
||||||
|
ch_raw_profiles = ch_raw_profiles.mix( KRAKEN2_KRAKEN2.out.report )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,8 +148,9 @@ 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_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)
|
CENTRIFUGE_KREPORT (CENTRIFUGE_CENTRIFUGE.out.results, ch_input_for_centrifuge.db)
|
||||||
ch_versions = ch_versions.mix( CENTRIFUGE_CENTRIFUGE.out.versions.first() )
|
ch_versions = ch_versions.mix( CENTRIFUGE_CENTRIFUGE.out.versions.first() )
|
||||||
ch_raw_profiles = ch_raw_profiles.mix( CENTRIFUGE_KREPORT.out.kreport )
|
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)
|
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_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_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 )
|
ch_raw_profiles = ch_raw_profiles.mix( KAIJU_KAIJU2TABLE.out.summary )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -206,8 +211,8 @@ workflow PROFILING {
|
||||||
}
|
}
|
||||||
|
|
||||||
emit:
|
emit:
|
||||||
profiles = ch_raw_profiles // channel: [ val(meta), [ reads ] ] - should be text files or biom
|
classifications = ch_raw_classifications
|
||||||
versions = ch_versions // channel: [ versions.yml ]
|
profiles = ch_raw_profiles // channel: [ val(meta), [ reads ] ] - should be text files or biom
|
||||||
mqc = ch_multiqc_files
|
versions = ch_versions // channel: [ versions.yml ]
|
||||||
|
mqc = ch_multiqc_files
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ include { KRONA_KTIMPORTTEXT } from '../../modules/nf-core/modules/krona/
|
||||||
|
|
||||||
workflow VISUALIZATION_KRONA {
|
workflow VISUALIZATION_KRONA {
|
||||||
take:
|
take:
|
||||||
|
classifications
|
||||||
profiles
|
profiles
|
||||||
databases
|
databases
|
||||||
|
|
||||||
|
@ -23,10 +24,14 @@ 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
|
||||||
}
|
}
|
||||||
|
ch_input_classifications = classifications
|
||||||
|
.branch {
|
||||||
|
kaiju: it[0]['tool'] == 'kaiju'
|
||||||
|
unknown: true
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Convert Kraken2 formatted reports into Krona text files
|
Convert Kraken2 formatted reports into Krona text files
|
||||||
|
@ -40,7 +45,7 @@ workflow VISUALIZATION_KRONA {
|
||||||
/*
|
/*
|
||||||
Combine Kaiju profiles with their databases
|
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]] }
|
.map{ [it[0]['db_name'], it[0], it[1]] }
|
||||||
.combine( databases.map{ [it[0]['db_name'], it[1]] }, by: 0 )
|
.combine( databases.map{ [it[0]['db_name'], it[1]] }, by: 0 )
|
||||||
.multiMap{
|
.multiMap{
|
||||||
|
|
|
@ -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, 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 )
|
ch_versions = ch_versions.mix( VISUALIZATION_KRONA.out.versions )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue