plot.mtree: Plot a 'mtree' tree.

Description Usage Arguments Value Examples

View source: R/S3_plot.R

Description

This S3 method plots a mtree tree, using ggraph layout functions. The tree is annotated and coloured in each node (i.e., cluster) that contain a driver event annotated. The driver id is also reported via ggrepel annotation functions.

Usage

1
2
plot.mtree(x, node_palette = colorRampPalette(RColorBrewer::brewer.pal(n
  = 9, "Set1")), tree_layout = "tree", ...)

Arguments

x

A mtree tree.

node_palette

A function that applied to a number will return a set of colors. By default this is a colorRampPalette applied to 9 colours of the RColorBrewer palette Set1. Colors are generated following a topological sort of the information transfer, which is obtained from igraph.

tree_layout

A layout that can be used by tidygraph, which wraps igraph's layouts. By default this is a 'tree' layout.

...

Extra S3 parameters

Value

A ggplot plot of the tree.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(mtree_input)

x = mtrees(
mtree_input$binary_clusters, 
mtree_input$drivers,
mtree_input$samples,
mtree_input$patient,
mtree_input$sspace.cutoff,
mtree_input$n.sampling,
mtree_input$store.max
)
   
plot(x[[1]])

caravagn/mtree documentation built on Sept. 17, 2020, 1:13 a.m.