Closed gtng92 closed 6 years ago
Simulated tree is identical to obs.tree after ladderize(tree)
is called.
Thanks for catching this, @gtng92. Looks like it could be a namespace issue, or bad handling of S3 objects?
After discussing this with @gtng92, it looks like this is being caused by setting the random seed to the same value for all replicate simulations as well as generating the target tree.
I missed passing the seed
parameter through to the epidem.model
function call. Distances are now being populated.
I mentioned another issue about how stepping through the code line by line generates 5 phylogenetic trees with a given nsample=5
but only 1 phylogenetic tree when the function is called one level up. In function simulate.trees
, I changed tips=workspace$tip.heights
to tips=workspace$ntips
. The former gave a vector of 100 tip heights, the latter is an integer of number of tips (ie. 100), which is required for the MASTER XML template.
Rather, all the distances in the .tsv file are being populated with a distance of 0.
Tracing through
run.smc
with 1 particle, I find that at functionsimulate.trees
,result
is creating newly simulated trees. (Actually just one new tree, identical across allnsample=5
, but that's a different issue).When annotating each tree with its self-kernel score, function
.preprocess.tree
is called on each simulated tree inresult
. The resulting tree looks like it has reverted to theobs.tree
(the true tree in the simulation). Then immediately after when distances are calculated, they all result in 0.