Description Usage Arguments Value Author(s) References Examples
View source: R/sample_phybreak.R
Function to take (additional) samples from the posterior distribution of a phylogenetic and transmission tree
(plus associated parameters), within a phybreak
object (sample.phybreak
is deprecated).
1 2 3 4 | sample_phybreak(x, nsample, thin = 1, classic = 0, keepphylo = 0,
withinhost_only = 0, parameter_frequency = 1, status_interval = 10)
sample.phybreak(...)
|
x |
An object of class |
nsample |
The number of samples to take. |
thin |
The thinning to use (values after every |
classic |
The proportion of tree updates with the classic protocol (reference see below), in which within-host minitrees are proposed by simulating coalescent times and tree topology. In the current default protocol only coalescent times are proposed with the minitree topology kept intact. This is followed by removing and reconnecting the sampling tips one by one. This results in better mixing of the mcmc-chain if there is much genetic information (many SNPs) and/or if there are many possible within-host minitree topologies (e.g. many samples per host). The classic protocol is faster in terms of updates/second and can thus be more efficient with little genetic information. |
keepphylo |
The proportion of tree updates keeping the phylogenetic tree intact, only possible if there is one
sample per host and the |
withinhost_only |
The proportion of tree updates in which only the within-host minitree is sampled, and the transmission tree and infection times are kept unchanged. |
parameter_frequency |
The relative frequency by which the model parameters are updated relative to updating each host. |
status_interval |
The number of seconds between each on-screen print of the progress of the mcmc-chain. |
The phybreak
object used to call the function, including (additional) samples from the posterior.
Don Klinkenberg don@xs4all.nl
Klinkenberg et al. (2017) Simultaneous inference of phylogenetic and transmission trees in infectious disease outbreaks. PLoS Comput Biol, 13(5): e1005495.
1 2 3 4 5 6 | #First create a phybreak-object
simulation <- sim_phybreak(obsize = 5)
MCMCstate <- phybreak(dataset = simulation)
MCMCstate <- burnin_phybreak(MCMCstate, ncycles = 20)
MCMCstate <- sample_phybreak(MCMCstate, nsample = 50, thin = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.