Tip_Samples: Tip Sampling Procedure

Description Usage Arguments Value Note

Description

This function uses the case network produced by any of the sims4 smulators and produces a set of dated tip sequences. The distribution and number of tips are declared as variables, with the default case choosing 1 extant tip from each clade. The effect of this being to make the easiest generation of the correct TMRCA by BEAST, with the least amount of computatonal demand.

Usage

1
2
3
Tip_Samples(case.tree, file, n.tips = length(case.tree$Seq.ID),
  all.clades = TRUE, prop.clades = 0.5, extant = TRUE, bias = FALSE,
  prop.times = 1)

Arguments

case.tree

the case tree generated from a simulator function within sims4

file

the path name where the nexus file of samples is to be save to

n.tips

the numer of tips to chosen in total

all.clades

boolean determining if all extant clades have to be sampled. Default = TRUE

prop.clades

if all.clades==FALSE, prop.clades specifies the proportion of clades to be sampled

extant

boolean determining if only extant tips are chosen. Default = TRUE. An extant tip is simply a case that was yet to be chosen to be a parent or not at the end of the simulation

prop.times

if extant = FALSE determines over what case network time window samples are to be chosen by. As such, prop.times can only take a value between 0 and 1, whereby 1 would mean all cases could be sampled at random, and 0.5 would mean only the most recent half of the cases could be sampled. An error will throw if prop.times*length(case.tree$ID)<n.tips, i.e. more tips than possible given sampling time window.

Value

a nexus file of dated tips with sequences

Note

If the combination of prop.times and extant==FALSE creates a time window that does not include all clades, and all.clades == TRUE, only all the possible clades within the time window will be sampled.


OJWatson/sims4 documentation built on May 7, 2019, 8:33 p.m.