diff --git a/subworkflows/local/qiime2_diversity.nf b/subworkflows/local/qiime2_diversity.nf index 8d47a3ca..296ff587 100644 --- a/subworkflows/local/qiime2_diversity.nf +++ b/subworkflows/local/qiime2_diversity.nf @@ -27,7 +27,8 @@ workflow QIIME2_DIVERSITY { ch_versions_qiime2_diversity = Channel.empty() //Phylogenetic tree for beta & alpha diversities - if (!ch_tree) { + produce_tree = !ch_tree ? true : false + if (produce_tree) { QIIME2_TREE ( ch_seq ) ch_versions_qiime2_diversity = ch_versions_qiime2_diversity.mix(QIIME2_TREE.out.versions) ch_tree = QIIME2_TREE.out.qza @@ -82,6 +83,8 @@ workflow QIIME2_DIVERSITY { } emit: + tree_qza = ch_tree + tree_nwk = produce_tree ? QIIME2_TREE.out.nwk : [] depth = !skip_diversity_indices ? QIIME2_DIVERSITY_CORE.out.depth : [] alpha = !skip_diversity_indices ? QIIME2_DIVERSITY_ALPHA.out.alpha : [] beta = !skip_diversity_indices ? QIIME2_DIVERSITY_BETA.out.beta : [] diff --git a/subworkflows/local/robject_workflow.nf b/subworkflows/local/robject_workflow.nf index dfe7e3bc..9998af44 100644 --- a/subworkflows/local/robject_workflow.nf +++ b/subworkflows/local/robject_workflow.nf @@ -11,7 +11,7 @@ workflow ROBJECT_WORKFLOW { ch_tax ch_tsv ch_meta - ch_tree + ch_robject_intree run_qiime2 main: @@ -23,12 +23,6 @@ workflow ROBJECT_WORKFLOW { ch_robject_inmeta = [] } - if ( params.pplace_tree ) { - ch_robject_intree = ch_tree.map { it = it[1] }.first() - } else { - ch_robject_intree = [] - } - if ( run_qiime2 ) { if ( params.exclude_taxa != "none" || params.min_frequency != 1 || params.min_samples != 1 ) { ch_robject_inasv = PHYLOSEQ_INASV ( ch_tsv ).tsv diff --git a/workflows/ampliseq.nf b/workflows/ampliseq.nf index 8cafd091..10a34b0c 100644 --- a/workflows/ampliseq.nf +++ b/workflows/ampliseq.nf @@ -870,7 +870,11 @@ workflow AMPLISEQ { // if ( !params.skip_taxonomy && ( !params.skip_phyloseq || !params.skip_tse ) ) { if ( params.pplace_tree ) { - ch_tree_for_robject = FASTA_NEWICK_EPANG_GAPPA.out.grafted_phylogeny + ch_tree_for_robject = FASTA_NEWICK_EPANG_GAPPA.out.grafted_phylogeny.map { it = it[1] }.first() + } else if (params.multiregion) { + ch_tree_for_robject = SIDLE_WF.out.tree_nwk + } else if ( params.metadata && (!params.skip_alpha_rarefaction || !params.skip_diversity_indices) ) { + ch_tree_for_robject = QIIME2_DIVERSITY.out.tree_nwk } else { ch_tree_for_robject = [] }