Split dendrogram at each node and keep the leave (label) information.

getDendrogramSplits(
  gobject,
  spat_unit = NULL,
  feat_type = NULL,
  expression_values = c("normalized", "scaled", "custom"),
  cluster_column,
  cor = c("pearson", "spearman"),
  distance = "ward.D",
  h = NULL,
  h_color = "red",
  show_dend = TRUE,
  verbose = TRUE
)

Arguments

gobject

giotto object

spat_unit

spatial unit

feat_type

feature type

expression_values

expression values to use

cluster_column

name of column to use for clusters

cor

correlation score to calculate distance

distance

distance method to use for hierarchical clustering

h

height of horizontal lines to plot

h_color

color of horizontal lines

show_dend

show dendrogram

verbose

be verbose

Value

data.table object

Details

Creates a data.table with three columns and each row represents a node in the dendrogram. For each node the height of the node is given together with the two subdendrograms. This information can be used to determine in a hierarchical manner differentially expressed marker genes at each node.

Examples

g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> cell_spatInfo_spatVector.shp
#> cell
#> 
#> 3.2 read Giotto spatial centroid information
#> cell
#> 
#> 3.3 read Giotto spatial overlap information
#> No overlaps were found, overlap loading will be
#>  skipped
#> 
#> 4. read Giotto image information
#> a giotto python environment was found
#> Using python path:
#>  "/Users/yuanlab/Library/r-miniconda/envs/giotto_env/bin/pythonw"

getDendrogramSplits(g, cluster_column = "leiden_clus")

#> height  0.9390206 
#> height  0.5534887 
#> height  0.3766879 
#> height  0.1956274 
#> height  0.1330244 
#> height  0.1259414 
#>          node_h  tree_1     tree_2 nodeID
#>          <list>  <list>     <list> <char>
#> 1: 0.939020.... 2, 1, 3 7, 4, 5, 6 node_1
#> 2: 0.553488....       7    4, 5, 6 node_2
#> 3: 0.376687....       4       5, 6 node_3
#> 4: 0.195627....       2       1, 3 node_4
#> 5: 0.133024....       1          3 node_5
#> 6: 0.125941....       5          6 node_6