Skip to content

Commit

Permalink
add nwk tree
Browse files Browse the repository at this point in the history
  • Loading branch information
d4straub committed Dec 20, 2024
1 parent 945c946 commit 1a2e039
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 4 additions & 1 deletion subworkflows/local/qiime2_diversity.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 : []
Expand Down
8 changes: 1 addition & 7 deletions subworkflows/local/robject_workflow.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ workflow ROBJECT_WORKFLOW {
ch_tax
ch_tsv
ch_meta
ch_tree
ch_robject_intree
run_qiime2

main:
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion workflows/ampliseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
}
Expand Down

0 comments on commit 1a2e039

Please sign in to comment.