sim.bdh.age {SiPhyNetwork}R Documentation

Simulate a Phylogenetic Network to a Specified Number of Taxa

Description

Simulates a Phylogenetic Network under a birth-death-hybridization model. Simulates to a specified ages.

Usage

sim.bdh.age(
  age,
  numbsim,
  lambda,
  mu,
  nu,
  hybprops,
  hyb.inher.fxn,
  frac = 1,
  twolineages = FALSE,
  complete = TRUE,
  stochsampling = FALSE,
  hyb.rate.fxn = NULL,
  trait.model = NULL,
  mrca = deprecated()
)

Arguments

age

The time for each simulation.

numbsim

Number of networks to simulate.

lambda

Speciation rate.

mu

Extinction rate.

nu

Hybridization rate.

hybprops

Vector that represents the proportion of Hybridizations that are lineage generative, lineage degenerative, and lineage neutral respectively.

hyb.inher.fxn

A function for drawing the hybrid inheritance probabilities.

frac

Sampling fraction: The proportion of extant tips included in the phylogeny (incomplete sampling).

twolineages

If twolineages=TRUE: The process originates with two lineages that share a common ancestor. If twolineages=FALSE: The process originates with two lineages.

complete

If complete = TRUE, the tree with the extinct lineages is returned. If complete = FALSE, the extinct lineages are suppressed.

stochsampling

When stochsampling=TRUE: Each extant tip is included into the final tree with probability frac.

hyb.rate.fxn

The probability of a successful hybridization as a function of genetic distance between taxa. The default value of 'NULL“ assumes that hybridization success is independent of genetic distance between taxa.

trait.model

A list that dictates how a trait affects the hybridization process. The default value of NULL doesn't take a trait into account for simulation. See Details for more information.

mrca

[Deprecated] Use the twolineages argument

Details

hyb.inher.fxn should return values between 0 and 1 and shouldn't require any arguments. E.g. make.beta.draw and make.uniform.draw create functions that fit these specifications

hyb.rate.fxn should take one argument for the genetic distance. The function should be defined on the range [0,Inf) and return values between [0,1]

trait.model is a list with the following named elements:

Value

out Returns a list of numbsim networks with the time since origin / most recent common ancestor being 'age.' If tree goes extinct or no tips are sampled, return value is '0'. If only one extant and no extinct tips are sampled, return value is '1'. Each network has an additional attribute "inheritance" that represents the inheritance probabilities on the edges in the "reticulation" attribute.

Examples

##smallest Quartan prime as seed for reproducibility
set.seed(17)
#Generate a tree with extinct leaves
net<-sim.bdh.age(1,1,5,2,1,c(1/3,1/3,1/3),hyb.inher.fxn = make.uniform.draw(),complete=TRUE)[[1]]

[Package SiPhyNetwork version 1.1.0 Index]