beast2
beast2 copied to clipboard
Resume problem for monophyletic
It seems there is a bug to resume the XML containing monophyletic clade. The XML to replicate the problem is attached.
Run the XML first and then run beast -resume testP.xml
. Check the log that the monophyletic(human-chimp) column was changed to 0 after resuming XML.
For a more complex XML using cancer data, we discovered the mrca.age(taxonset.tumour)
had -1 after resuming. Not sure this is an additional issue or still the same issue caused by the "monophyletic" boolean value.
I think the mrca = -1 is the side-effect. That is presumably the value returned when the monophyly can't be found. So I think it is something to do with the taxonset having the wrong node numbers and so both the monophyletic constraint and the MRCA are probably looking for the wrong set of taxa. Curious to find out what is going on here precisely.
I forget to mention I manually changed the logger of MRCAPrior from the 1st line below into the 2nd one in order to diagnose the issue, because the 2nd line can log the monophyletic boolean value, and it was also used in the XML for cancer data analysis.
<log idref="human-chimp.prior"/>
<log spec='beast.base.evolution.tree.MRCAPrior' tree='@Tree.t:noncoding' taxonset='@human-chimp'/>
When logging like that, the MRCAPrior in the log may not be updated, since it is not on a path between StateNodes and posterior. This appears to be a logging issue.
Currently, if you want to log a clade of interest, it should be defined as an MRCAPrior inside the prior without monophyly constraint and without node distribution, then add a logger referring to the MRCAPrior. This is what BEAUti would do automatically.
It is a bit curious that for the first run in the example XML, the logged MRCAPrior values are correct, but for the resumed part, it is not, so that is something that might be fixable.
Adding
calculateLogP();
At line 390 of MRCAPrior fixes this particular issue.