Learn R Programming

BMhyb (version 1.5.2)

SimulateNetwork: Simulate phylogenetic network

Description

Simulate network with desired number of taxa and number of hybrids.

Usage

SimulateNetwork(ntax.nonhybrid=100, ntax.hybrid=10, flow.proportion=0.5,
	origin.type=c("clade", "individual"), birth = 1, death = 1, sample.f = 0.5,
	tree.height = 1, allow.ghost=FALSE)

Arguments

ntax.nonhybrid

number of non hybrid taxa.

ntax.hybrid

number of hybrid taxa.

flow.proportion

the gene flow proportion from the parent.

origin.type

the type where the hybrids were formed. clade: hybrid formed and then speciate; individual: hybrid species formed and evolved without further speciation.

birth

birth rate for the tree speciation.

death

death rate (extinction) of the tree.

sample.f

sampling frequency.

tree.height

the height of the tree.

allow.ghost

allows ghost lineage that persists for a while, donates genes to a hybrid, and eventually goes extinct (or at least unsampled). Otherwise, hybridization event will be between coeval species with extant descendants.

Value

a list that contains

phy

a birth death tree with number of taxa of ntax.nonhybrid + ntax.hybrid

flow

The flow structure of the gene flow

Details

This function generates a tree with relevant hybridization information (the structure of gene flow information). Gene flow cannot go back in time. In general, gene flow can go forward in time via ghost lineages. If no ghost lineages are allowed, then there must be temporal overlap between the donor and recipient lineages.

References

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

Examples

Run this code
# NOT RUN {
	library(TreeSim)
	#set up the number for non hybrid species
	non.hybrid <- 3
	#set up the number for hybrid species
	hybrid <- 1
	#set up the gene flow proportion
	flow<- 0.5
	#set up the hybridization type to original
	origins<- "individual"
	#start to simulate the network
	network<-SimulateNetwork(ntax.nonhybrid=non.hybrid, ntax.hybrid=hybrid,
	flow.proportion=flow, origin.type="individual", birth = 1, death = 0.5,
	sample.f = 0.5, tree.height = 1, allow.ghost=FALSE)
	#print out the result
	(network)
	
# }

Run the code above in your browser using DataLab