Repository navigation
plotClusterTree(gobject, tree): defaults from a giottoTree - #153
Merged
jiajic merged 1 commit intoOct 1, 2026
Merged
Conversation
labels is optional, tree is second, and cluster_column / units / view for the size track default to the tree's. Leaves are checked against the data. Renames plot_dendrogram.R to plot_cluster_tree.R.
jiajic
merged commit Oct 1, 2026
32bd7f7
into
refactor/retire-cluster-dendrogram
0 of 6 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #152 (the
showClusterDendrogram()deprecation). The base is that PR's branch. Merge #152 into gsource first and delete its branch, so GitHub retargets this PR to gsource. Otherwise, retarget this PR to gsource by hand before merging it.Brings
plotClusterTree()in line with Giotto's tree consumers after Giotto#1321, wherecalculateClusterTree()started returning agiottoTreethat records what it was built from.Changes
plotClusterTree(gobject, tree, labels = NULL, spat_unit, feat_type, cluster_column = NULL, view = NULL, k, ...).treeis now the second argument.labelsis optional.plotClusterTree(g, tree)draws the tree on its own, labelled with the cluster IDs, which makes it the in-suite ggplot replacement for the deprecatedshowClusterDendrogram().cluster_column,spat_unit,feat_typeandviewdefault to those recorded on agiottoTree, following the same rule as Giotto:hclustneedscluster_columnpassed explicitlyview: narrows the cells the size track counts, so counts and tree describe the same cells. Only cell metadata is narrowed, since that's all the plot reads from the object.R/plot_dendrogram.R→R/plot_cluster_tree.R, withCollateupdated. It follows the naming rule: "tree" for the object, "dendrogram" only for the drawing or R'sdendrogramclass.The context and leaf-check logic is a short copy of Giotto's (
.pct_tree_context(),.pct_check_leaves()). GiottoVisuals can't call Giotto, because Giotto imports GiottoVisuals, so it's duplicated rather than exported from either package.The unreleased 0.2.16 NEWS bullet for
plotClusterTree()is amended in place.Verification
Four new tests in
test-plot-cluster-tree.R:giottoTreerenders with neitherlabelsnorcluster_columnhclustneedscluster_columnAll 42 tests pass (91 expectations). The tests call
Giotto::calculateClusterTree(view =), which is on Giotto gsource as of #1320.🤖 Generated with Claude Code