phsc.plot.most.likely.transmission.chain: Plot most likely transmission chain

View source: R/phyloscan.fun.plotting.R

phsc.plot.most.likely.transmission.chainR Documentation

Plot most likely transmission chain

Description

This function plots a most likely transmission chain, showing one edges with two labels: L indicates the proportion of deep-sequence phylogenies in whom the two individuals are phylogenetically close and adjacent. D indicates the proportion of deep-sequence phylogenies that support the indicated direction of transmission, out of all deep-sequence phylogenies that support either direction of transmission.

Usage

phsc.plot.most.likely.transmission.chain(
  df,
  di,
  point.size = 10,
  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_,
  layout = NULL
)

Arguments

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

Value

ggplot object


olli0601/phyloscan documentation built on April 19, 2024, 8:31 p.m.