plot.ctree: Plot a 'ctree' tree.

View source: R/S3_plot.R

plot.ctreeR Documentation

Plot a ctree tree.

Description

This S3 method plots a ctree 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

## S3 method for class 'ctree'
plot(
  x,
  node_palette = colorRampPalette(RColorBrewer::brewer.pal(n = 9, "Set1")),
  tree_layout = "tree",
  ...
)

Arguments

x

A ctree 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

data('ctree_input')

x = ctrees(
   ctree_input$CCF_clusters,
   ctree_input$drivers,
   ctree_input$samples,
   ctree_input$patient,
   ctree_input$sspace.cutoff,
   ctree_input$n.sampling,
   ctree_input$store.max
   )
   
plot(x[[1]])

caravagnalab/ctree documentation built on May 12, 2022, 4:42 p.m.