This function generates a visual representation of an event tree using the provided edge event table and tree structure. The tree is plotted with edges labeled by event information and nodes colored by their type (normal or tumor). The function returns both the graph object and the plot for further customization or analysis.
plot_event_tree(edge_event_table, tree)A data frame containing edge event information. This is typically generated by the
create_edge_event_table function:
edge_name: Edge identifier ("parent_child" format)
edge_label: Event labels for the edge
n_events: Number of events on the edge
An igraph tree object representing the phylogenetic structure
A list containing two elements:
graph_ob: The igraph object with added event information
tree_plot: A ggplot2 object showing the rendered tree
The function performs these steps:
Converts tree to edge list format
Creates node table with clone types (normal/tumor)
Merges edge event information with tree structure
Creates a dendrogram layout visualization with:
Edges labeled with copy number events
Nodes colored by clone type
Node labels showing clone names
The visualization uses:
Node size of 20
Text size of 5
Grey edges
2.5mm label dodge for edge labels
void theme for clean background