colourTree: colourTree

View source: R/visualiseTree.R

colourTreeR Documentation

colourTree

Description

Adding statistical test results onto the tree by using colourful nodes and branches Takes a ggtree object with test results for each node and returns a ggtree graph object

Usage

colourTree(
  tree,
  point_size = 1.5,
  high = "#00c434",
  low = "purple",
  mid = "ivory2"
)

Arguments

tree

a tree plot created from the ggtree() function with p$data containing test statisic and p-

point_size

size of nodes in the tree

high

colour for large values

low

colour for low values

mid

colour for middle values

Value

an interactive ggplot graph object, plotting the hierarchical tree of clusters with nodes and branches coloured by the significance testing results.

Examples

library(SingleCellExperiment)
data(COVIDSampleData)

sce <- DeBiasi_COVID_CD8_samp
exprs <- t(assay(sce, "exprs"))
clusters <- colData(sce)$cluster_id
classes <- colData(sce)$condition
samples <- colData(sce)$sample_id

clust_tree <- getClusterTree(exprs,
                             clusters,
                             hierarchy_method="hopach")

tested_tree <- testTree(clust_tree$clust_tree,
                        clusters=clusters,
                        samples=samples,
                        classes=classes)

colourTree(tested_tree)

adam2o1o/treekoR documentation built on June 2, 2023, 11:42 p.m.