get_loci: Separate a locus tree into loci

Description Usage Arguments Details Value Examples

View source: R/sim_multilocus.R

Description

Separate a locus tree into loci

Usage

1
get_loci(locus_tree)

Arguments

locus_tree

tree of type 'phy'

Details

This separates loci based on node labels "D[A-Z]". This is intended to be used internally, but should work with other trees where duplications are marked similarly.

Value

list of subtrees (with 'locus_tree' at the end')

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# first simulate a species tree
mu <- 0.5
lambda <- 1.0
nt <- 6
tr <- sim_stBD(sbr = lambda, sdr = mu, numbsim = 1, n_tips = nt)
# for a locus tree with 100 genes sampled per locus tree
gene_br <- 0.1
gene_dr <- 0.02
transfer_rate <- 0.0
locus_tree <- sim_ltBD(species_tree = tr[[1]],
                  gbr = gene_br,
                  gdr = gene_dr,
                  lgtr = transfer_rate,
                  num_loci = 1)
locus_tree_subtrees <- get_loci(locus_tree[[1]])

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