Description Usage Arguments Functions Author(s) References Examples
Accessing a phybreak object
1 2 3 4 5 6 7 8 9 10 11 | get.tree(phybreak.object, samplenr = 0)
get.parameters(phybreak.object, samplenr = 0, whichpars = "posterior")
get.mcmc(phybreak.object, thin = 1, nkeep = Inf)
get.phylo(phybreak.object, samplenr = 0, simmap = FALSE)
get.multiPhylo(phybreak.object, thin = 1, nkeep = Inf)
get.seqdata(phybreak.object)
|
phybreak.object |
An object of class |
samplenr |
The posterior tree sample to choose. If |
whichpars |
Which parameters to return. Either a vector with parameter names, or |
thin |
Thinning interval. |
nkeep |
Number of samples to keep, counting from tail of the chain. |
simmap |
Whether to include class |
get.tree: A data.frame with current (samplenr = 0) or sampled infectors and infection times.
get.parameters: A named vector with current (samplenr = 0) or sampled parameter values.
get.mcmc: An object of class "mcmc" (package coda), with sampled parameters,
infection times, and infectors.
get.phylo: Returns an object of class phylo ans optionally of class
"simmap" (package phytools).
get.multiPhylo: Returns an object of class multiphylo.
get.seqdata: The sequence data in class "phyDat" (package phangorn).
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(data = simulation)
MCMCstate <- burnin.phybreak(MCMCstate, ncycles = 20)
MCMCstate <- sample.phybreak(MCMCstate, nsample = 50, thin = 2)
get.tree(MCMCstate)
get.parameters(MCMCstate)
codaobject <- get.mcmc(MCMCstate, thin = 2)
plot.phylo(get.phylo(MCMCstate))
get.seqdata(MCMCstate)
#function from package phangorn:
phangorn::parsimony(get.phylo(MCMCstate), get.seqdata(MCMCstate))
tree0 <- get.phylo(MCMCstate)
seqdata <- get.seqdata(MCMCstate)
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.