Extract the transmission tree connecting sampled individuals in a simulated epidemic

extractTree(epidemic, tips = NULL, idTips = NULL, collapse.singles = TRUE)

Arguments

epidemic

list returned by simulateEpidemic

tips, idTips

integer vectors (see details)

collapse.singles

logical indicating whether non-bifurcating internal nodes should be collapsed using the ape function collapse.singles(). Default: TRUE

Details

By default all individuals sampled during the active phase of the epidemic are included in the phylogeny. If specified, the argument tips has priority to the arugment idTips. The argument tips is sorted in increasing order and specifies the tip indices (numbers in the range 1:epidemic$nTips) to be retained in the phylogeny. If NULL (default), the argument idTips is used to identify which individuals to be included in the phylogeny. This is useful if, for example, one has searched all individuals who were sampled during a specified time interval of the epidemic.