PoonLab / twt

Generic framework for the coalescent simulation of pathogen trees within host trees in R
GNU Affero General Public License v3.0
3 stars 2 forks source link

document load.outer.tree() for importation #111

Open davidchampredon opened 4 years ago

davidchampredon commented 4 years ago

@ArtPoon, could you please add an example in the documentation of load.outer.tree() when the outer tree has not been simulated by twt but is instead imported from another source (like my ABM)?

I used to do somthing like the code below in a recent twt version but some functions have disappeared and everything I try fails. Thanks!

settings <- yaml.load_file('../data/sampled-hosts-1.yaml')
m     <- Model$new(settings)
outer.tree <- ape::read.tree('../data/transm.nwk')
evlog <- eventlog.from.tree(tree = outer.tree)
inner <- sim.inner.tree(obj = m, e = evlog)
ArtPoon commented 4 years ago

Sorry for the confusion. I've been reworking that function so the documentation no longer fits. I'll try to get to this today.

ArtPoon commented 4 years ago

The decision we reached in #107 was to use YAML to specify an outer tree generated by another program, so eventlog.from.tree is deprecated code. (I've also renamed it to attach.tree.)

ArtPoon commented 4 years ago

You should be able to load your transmission tree as as YAML file with load.outer.tree