Description Usage Arguments Functions Author(s) References Examples
Extracting from a phybreak object
1 2 3 4 5 6 7 8 9 10 11 12 13 | get_data(x)
get_parameters(x, whichpars = "posterior")
get_transtree(x)
get_phylo(x, simmap = FALSE, samplenr = 0)
get_multiPhylo(x, thin = 1, nkeep = Inf)
get_mcmc(x, thin = 1, nkeep = Inf)
get_bottlenecks(x)
|
x |
An object of class |
whichpars |
Which parameters to return. Either a vector with parameter names, or |
simmap |
Whether to include class |
samplenr |
The posterior tree sample to choose. If |
thin |
Thinning interval. |
nkeep |
Number of samples to keep, counting from tail of the chain. |
get_data
: The data in class phybreakdata
.
get_parameters
: A named vector with current parameter values.
get_transtree
: A data.frame
with current infectors and infection times.
get_phylo
: Returns an object of class phylo
ans optionally of class
"simmap"
(package phytools).
get_multiPhylo
: Returns an object of class multiphylo
.
get_mcmc
: An object of class "mcmc"
(package coda), with sampled parameters,
infection times, and infectors.
get_bottlenecks
: A vector with for each host the current number of extant lineages in its phylogenetic minitree
at the time of infection (the bottleneck size).
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 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #First build 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)
get_transtree(MCMCstate)
get_parameters(MCMCstate)
mcmcobject <- get_mcmc(MCMCstate, thin = 2)
plot.phylo(get_phylo(MCMCstate))
get_data(MCMCstate)
get_bottlenecks(MCMCstate)
#function from package phangorn:
phangorn::parsimony(get_phylo(MCMCstate), get_data(MCMCstate)$sequences)
tree0 <- get_phylo(MCMCstate)
seqdata <- get_data(MCMCstate)$sequences
phangorn::pml(tree0, seqdata,
rate = 0.75*get_parameters(MCMCstate, "mu"))
logLik(MCMCstate, genetic = TRUE, withinhost = FALSE,
sampling = FALSE, generation = FALSE) #should give the same result as 'pml'
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.