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

sim.inner.tree() can only be called once on a Run object #92

Open ArtPoon opened 4 years ago

ArtPoon commented 4 years ago

Otherwise this error gets thrown:

> sim.inner.tree(run)
Error in sim.inner.tree(run) : 
  There must be at least one lineage sampled at time t=0.
ArtPoon commented 4 years ago

Possible solutions:

  1. sim.inner.tree clones the Run object before proceeding
  2. sim.inner.tree checks whether the Run object has already been used to simulate an inner tree and refuses to proceed
  3. sim.inner.tree resets inner tree state of Run before proceeding
ArtPoon commented 4 years ago

I think 3 is the preferable option. To implement this, we need: