This function is a wrapper around plot.igraph, written
to group parasite genotypes by episode both spatially and using vertex
colour (specifically, parasite genotypes within episodes are vertically
distributed with some horizontal jitter when layout.by.group = TRUE
(default), and equicolored), and to ensure clone and sibling edges
are plotted using different line types.
plot_RG(
RG,
layout.by.group = TRUE,
vertex.palette = "Set2",
edge.lty = c(sibling = "dashed", clone = "solid"),
edge.col = c(sibling = "black", clone = "black"),
edge.width = 1.5,
...
)None
igraph object encoding an RG; see
RG_to_igraph.
Logical; if TRUE (default) overrides
the default layout of plot.igraph so that vertices
that represent parasite genotypes from different episodes are distributed
horizontally and vertices that represent genotypes within episodes are
distributed vertically.
A character string specifying an RColorBrewer palette.
Overrides the default palette of plot.igraph.
Named vector of edge line types corresponding to different relationships.
Named vector of edge colours corresponding to different relationships.
Overrides the default edge.width of
plot.igraph.
Additional arguments to pass to plot.igraph, e.g.,
edge.curved.
To see how to plot relationship graphs outputted by
compute_posterior, please refer to Exploration of relationship graphs in
{demonstrate-usage}{exploration-of-relationship-graphs}{Demonstrate Pv3Rs usage}.
Provenance
This function was adapted from plot_Vivax_model at
https://github.com/jwatowatson/RecurrentVivax/blob/master/Genetic_Model/iGraph_functions.R.
RGs <- enumerate_RGs(c(2, 1, 1), progress.bar = FALSE) oldpar <- par(no.readonly = TRUE) # record user's options par(mfrow = c(3, 4), mar = c(0.1, 0.1, 0.1, 0.1)) for (i in 12:23) plot_RG(RGs[[i]], edge.col = c(sibling = "gray", clone = "black"), edge.lty = c(sibling = "dotted", clone = "solid"), edge.curved = 0.1) box()par(oldpar) # restore user's options