PoonLab / Kaphi

Kernel-embedded ABC-SMC for phylodynamic inference
GNU Affero General Public License v3.0
4 stars 2 forks source link

MASTER simulation distances in .tsv are not being populated #112

Closed gtng92 closed 6 years ago

gtng92 commented 6 years ago

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 function simulate.trees, result is creating newly simulated trees. (Actually just one new tree, identical across all nsample=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 in result. The resulting tree looks like it has reverted to the obs.tree (the true tree in the simulation). Then immediately after when distances are calculated, they all result in 0.

gtng92 commented 6 years ago

Simulated tree is identical to obs.tree after ladderize(tree) is called.

ArtPoon commented 6 years ago

Thanks for catching this, @gtng92. Looks like it could be a namespace issue, or bad handling of S3 objects?

ArtPoon commented 6 years ago

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.

gtng92 commented 6 years ago

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.