Learn R Programming

BMhyb (version 1.5.2)

PlotNetwork: Phylogenetic Network Plot

Description

Plots the phylogenetic network: including the phylogenetic tree and arrows that indicate the direction of gene flows.

Usage

PlotNetwork(phy, flow, col.non="black", col.hybrid="red", col.donor="blue",
	name.padding=1.5, cex=1, xlab="", bty="n", head.length=0.2, edge.width=2,
	col.tree="darkgray", col.arrow="red", arrow.width=1, try.rotations=FALSE, ...)

Arguments

phy

a class phylo tree object.

flow

a flow structure of gene flow.

col.non

color of non hybrid taxa.

col.hybrid

color of hybrid taxa.

col.donor

color of the donor.

name.padding

the size that allowed for the plot in the x axis.

cex

number indicating the amount by which plotting text and symbols should be scaled relative to the default. 1=default, 1.5 is 50 percent larger, 0.5 is 50 percent smaller, etc.

xlab

X axis label using font and character expansion par("font.lab") and color par("col.lab").

bty

the type of box to be drawn around the legend. The allowed values are "o" (the default) and "n".

head.length

length of the head.

edge.width

width of the edges.

col.tree

color of the tree.

col.arrow

color of gene flow arrow.

arrow.width

width of the arrow.

try.rotations

Each time try randomly rotating nodes of the tree.

...

other arguments

Value

plot of the network that involves the phylogeny and the gene flow direction.

Details

This function generates plots for network models. It first draws the phylogenetic tree for the given species. Then uses the gene flow data to draw the arrow from the donor species to recipient species. The hybrid taxa are shown in \(col.hybrid\) with the gene flow direction from the donor species (colored in \(col.donor\)).

References

Jhwueng D.C. and O'Meara B.C. 2016. Trait evolution on phylogenetic networks. Submitted.

Examples

Run this code
# NOT RUN {
	#set the number of non hybrid species
	ntax.nonhybrid<-10
	#set the number of hybrid species
	ntax.hybrid<-3
	#simulate the network with desired species
	network<-SimulateNetwork(ntax.nonhybrid=ntax.nonhybrid, ntax.hybrid=ntax.hybrid,
	flow.proportion=0.5, origin.type='clade', birth = 1, death = 0.5, sample.f = 0.5,
	tree.height = 1, allow.ghost=FALSE)
	#plot the network
	PlotNetwork(network$phy,network$flow)
	
# }

Run the code above in your browser using DataLab