This function plots a phylogenetic transmission network, showing three types of edges: two directed edges respectively in the 1->2 and 2->1 direction, and an undirected edge that represents phylogenetic support of close and adjacent individuals without evidence into the direction transmission.
phsc.plot.transmission.network(df, di, point.size = 10, point.size.couple = point.size * 1.4, edge.gap = 0.04, edge.size = 0.4, curvature = -0.2, arrow = arrow(length = unit(0.04, "npc"), type = "open"), curv.shift = 0.08, label.size = 3, node.label = "ID", node.shape = NA_character_, node.fill = NA_character_, node.shape.values = NA_integer_, node.fill.values = NA_character_, threshold.linked = NA_real_)
df | data.table with the following columns 'IDCLU','ID1', 'ID2', 'TYPE','KEFF','LKL_MAX','POSTERIOR_SCORE' |
---|---|
di | data.table with meta-data to customize the plot with columns ID, node.shape, node.label, node.fill |
point.size | size of the individual points |
edge.gap | value to adjust start / end points of edges |
edge.size | multiplier by which the size of edges is shrunk/magnified |
curvature | curvature of directed edges |
arrow | type of arrow to be plotted |
curv.shift | offset to place the label for directed edges |
label.size | size of label |
node.label | Text displayed on top of each node |
node.shape | column name in di by which the shape of each node is drawn |
node.fill | column name in di by which each node is coloured |
node.shape.values | named vector associating shapes to the values in the node.shape column |
node.fill.values | named vector associating colours to the values in the node.fill column |
threshold.linked | treshold value between 0 and 1. Edges with weight above this treshold are shown in black. |
point.sizec.couple | size of the outer ring around individuals in couples |
ggplot object