sim_ltBD: Simulates locus tree using constant rate birth-death-transfer...

Description Usage Arguments Details Value References Examples

View source: R/RcppExports.R

Description

Given a species tree simulates a locus or gene family tree along the species tree. Short for simulates a locus tree under a birth-death-transfer process.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sim_ltBD(species_tree, gbr, gdr, lgtr, num_loci, transfer_type = "random")

sim_locustree_bdp(
  species_tree,
  gbr,
  gdr,
  lgtr,
  num_loci,
  transfer_type = "random"
)

Arguments

species_tree

species tree to simulate along

gbr

gene birth rate

gdr

gene death rate

lgtr

gene transfer rate

num_loci

number of locus trees to simulate

transfer_type

The type of transfer input. Acceptable options: "cladewise" or "random"

Details

Given a species tree will perform a birth-death process coupled with transfer. The simulation runs along the species tree speciating and going extinct in addition to locus tree birth and deaths. Thus with parameters set to 0.0 a tree identical to the species tree is returned (it is relabel however).

Transfers are implemented as a birth-death process. One descendant lineage retains its species identity the other gains a new identity. At present, two types of transfers are implemented: "random" an "cladewise". The random transfer mode transfers one randomly chooses a contemporaneous lineage. Cladewise transfers choose lineages based on relatedness with more closely related lineages being more likely.

Value

List of objects of the tree class (as implemented in APE)

References

Rasmussen MD, Kellis M. Unified modeling of gene duplication, loss, and coalescence using a locus tree. Genome Res. 2012;22(4):755–765. doi:10.1101/gr.123901.111

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# first simulate a species tree
mu <- 0.5 # death rate
lambda <- 2.0 # birth rate
numb_replicates <- 10
numb_extant_tips <- 4
# simulate trees under the GSA so first simulates a tree with
# numb_extant_tips * 100 tips counting each time we have a tree with 10 tips
# then randomly picks one of those trees

sp_tree <- sim_stBD(sbr = lambda,
                sdr = mu,
                numbsim = numb_replicates,
                n_tips = numb_extant_tips)

gene_br <- 1.0
gene_dr <- 0.2
transfer_rate <- 0.2
sim_ltBD(species_tree = sp_tree[[1]],
                  gbr = gene_br,
                  gdr = gene_dr,
                  lgtr = transfer_rate,
                  num_loci = 10)

treeducken documentation built on March 3, 2021, 1:11 a.m.