Skip to content

Add composition fan tree, ANCOM-BC2 volcano, and MicrobiotaProcess difftree - #10

Merged
dsmutin merged 3 commits into
mainfrom
cursor/composition-ancombc-difftree-49fb
Sep 25, 2026
Merged

dsmutin merged 3 commits into
mainfrom
cursor/composition-ancombc-difftree-49fb

Conversation

@dsmutin

@dsmutin dsmutin commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • df2composition_tree() draws a ggtree fan cladogram (open.angle = 10, rotate_tree(-90)) with a ggtreeExtra boxplot of relative abundance, coloured by phylum when a rank table is available. References: Yu et al. 2017 (ggtree) and Xu et al. 2021 (ggtreeExtra).
  • df2volcano() fits ANCOMBC::ancombc2 on raw counts. The first legend_detect pattern is the reference. Current ANCOMBC receives a count matrix and sample metadata, so the check does not need the microbiome package. Older ANCOMBC receives a phyloseq object. Taxa absent from one group are omitted, because ANCOM-BC2 stops when their sampling variance is zero.
  • df2difftree() defaults to a relative-abundance heatmap; fruit = "bar" keeps the fold-change column. engine = "microbiota" runs MicrobiotaProcess::mp_diff_analysis and draws the vignette biomarker tree (radial ggtree, phylum highlight, abundance stars, LDA, FDR). MicrobiotaProcess, ggstar, and phyloseq are optional Suggests.

Test plan

  • Composition tree builds on the bundled genus table
  • ANCOM-BC2 volcano builds on larvae vs pupa (balanced 3+3, top genera; gallery uses all 17 samples)
  • Default difftree heatmap and fruit = "bar" build
  • engine = "microbiota" builds a ggtree on the Kraken genus counts
Open in Web Open in Cursor 

cursoragent and others added 3 commits September 25, 2026 11:00
…difftree.

The default differential tree is now an abundance heatmap. df2volcano fits ANCOMBC::ancombc2, and engine = "microbiota" draws the biomarker tree when MicrobiotaProcess is installed.

Co-authored-by: dvsmutin <dvsmutin@gmail.com>
Current ancombc2 pulls microbiome only for phyloseq input. Older releases still receive a phyloseq object.

Co-authored-by: dvsmutin <dvsmutin@gmail.com>
A one-column metadata table drops to a vector when ANCOMBC subsets samples, so the group column was missing.

Co-authored-by: dvsmutin <dvsmutin@gmail.com>
@dsmutin
dsmutin marked this pull request as ready for review September 25, 2026 15:31
@dsmutin
dsmutin merged commit d281dc6 into main Sep 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants