tt.generator: Enumerate transmission trees for the given pathogen...

Description Usage Arguments Value Examples

View source: R/enumeration.R

Description

This function produces a list of class tt.generator which can be used to randomly sample transmission trees for the input phylogeny, and contains information on the number of compatible transmission trees.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tt.generator(
  tree,
  max.unsampled = 0,
  max.infection.to.sampling = Inf,
  max.sampling.to.noninfectious = Inf,
  minimum.heights = NULL,
  maximum.heights = NULL,
  tip.map = tree$tip.label,
  bigz = FALSE
)

Arguments

tree

A phylo object

max.unsampled

The maximum number of unsampled hosts in the transmission chain. The default is 0.

max.infection.to.sampling

The greatest time period (in tree branch length units) that can have elapsed between the infection of a host and a tip from that host appearing. The default is infinity, meaning that no such time limit exists.

max.sampling.to.noninfectious

The greatest time period (in tree branch length units) that can have elapsed between a tip from a host appearing and that host becoming noninfectious. If this is 0, a host's infection ends at the time of its last tip. The default is infinity, meaning that no such time limit exists.

minimum.heights

A vector of the same length as the set of sampled hosts (at present this is always the number of tips of the tree) dictating the minimum height at which nodes can be allocated to each host. The order is the same as the order of tips in tree$tip.label. If absent, no such restrictions will be placed. Each must be equal to or smaller than the height of the last tip from the corresponding host. This overrides the given value of max.sampling.to.noninfectious.

maximum.heights

A vector of the same length as the set of sampled hosts (at present this is always the number of tips of the tree) dictating the maximum height at which nodes can be allocated to each host. The order is the same as the order of tips in tree$tip.label. If absent, no such restrictions will be placed. Each must be equal to or greater than the height of the last tip from the corresponding host. This overrides the given value of max.infection.to.sampling.

tip.map

A vector of the same length as the tip set of the tree listing a string giving the host from which the corresponding sample was derived. If absent, each tip is assumed to come from a different host and the tip names are taken to be the host names.

bigz

Use bigz from gmp for integers, recommended for large trees

Value

A list of class tt.info with the following fields:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# make a generator for the example tree
generator <- tt.generator(stratus.example.tree)
# count the total number of transmission trees
generator$tt.count
# make a generator for the example tree with at most two unsampled hosts
generator.2us <- tt.generator(stratus.example.tree, max.unsampled = 2)
# make a generator for the example tree with no infection after sampling
generator.limits <- tt.generator(stratus.example.tree, max.sampling.to.noninfectious = 0)
# make a generator with multiple sampling defined by the vector grouping.map
generator.ms <- tt.generator(stratus.example.tree, tip.map = grouping.map)

STraTUS documentation built on April 4, 2020, 5:07 p.m.