Learn R Programming

BMhyb (version 1.5.2)

AttachHybridsToDonor: Attach hybrids to the donor species

Description

This function attaches the hybrid to the donor species.

Usage

AttachHybridsToDonor(phy, flow, suffix="_DUPLICATE")

Arguments

phy

a phylogeny of phylo class.

flow

structure of gene flow.

suffix

a duplicated species that used for hybrid information in advanced.

Value

a merged tree that identifies the hybrid species from the original tree.

Details

This function attaches hybrid to the donor and return the new phylogeny. It first identifies the flow clades using the function LumpIntoClades. Then for each clade containing the flow, it searches the donor taxa and then attaches the hybrid into the clade ancestor. For empirical analysis, users shall have the correct format for the flow structure to ensure the hybrid information.

References

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

Examples

Run this code
# NOT RUN {
	#set the number of non hybrid species
	ntax.nonhybrid<-4
	#set the number of hybrid species
	ntax.hybrid<-1
	#simulate a network
	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)
	#show the tree.
	network$phy
	#show the flow information
	network$flow
 	#Attach hybrid species to the donor and show the new tree.
 	#The name of the hybrid is displayed with suffix  "_DUPLICATE"
	AttachHybridsToDonor(network$phy, network$flow, suffix="_DUPLICATE")
	
# }

Run the code above in your browser using DataLab