Mkv correction not working in BEAST2

192 views
Skip to first unread message

Yasmin97

unread,
Jun 22, 2021, 1:55:52 AM6/22/21
to beast-users
Hi all, 

I am using BEAST2 to analyse a matrix of multi-state morphological characters. When I apply the Mkv model to my data, i.e. the ascertainment correction, the resulting XML file includes two invariant characters at the end of the alignment. For example:

<alignment id="My_Data" spec="FilteredAlignment" ascertained="true" excludefrom="30" excludeto="32" filter="1-30,31-32">

However, this line is causing problems in my analysis. It fails to run, since the posterior likelihood = NaN. This is because the tree likelihood = NaN. So I get the message: 
"Fatal Exception: Could not find a proper state to initialise. Perhaps try another seed"

When I remove " excludefrom="30" excludeto="32" ", the error is solved, and the run continues. This seems to be a very strange error message to be receiving, and I have not encountered it before, despite analysing morphological characters with the Mkv model in BEAST2 previously. 

Does anyone know why this could be happening/how to resolve it? I don't think it is appropriate to remove the 'excludeto/from' from the xml file, since the ascertainment bias correction may not be implemented correctly. 

Thanks so much, 
Yasmin 

Yasmin97

unread,
Jun 22, 2021, 8:16:17 PM6/22/21
to beast-users
Just for some more information, this is the error message:
Start likelihood: NaN 
P(posterior) = NaN (was NaN)  **
P(prior) = -47856.76620700112 (was -47856.76620700112)
P(BirthDeath.t:My_Data) = -47849.67781586726 (was -47849.67781586726)
P(BirthRatePrior.t:My_Data) = -6.907755278982137 (was -6.907755278982137)
P(DeathRatePrior.t:My_Data) = 0.0 (was 0.0)
P(GammaShapePrior.s:My_Data) = -1.0 (was -1.0)
P(ucldStdevPrior.c:My_Data) = 0.819364145120802 (was 0.819364145120802)
P(likelihood) = NaN (was NaN)  **
P(morphTreeLikelihood.My_Data2) = NaN (was NaN)  **
Fatal exception: Could not find a proper state to initialise. Perhaps try another seed.
See http://www.beast2.org/2018/07/04/fatal-errors.html for other possible solutions.

Remco Bouckaert

unread,
Jun 22, 2021, 10:06:49 PM6/22/21
to beast...@googlegroups.com, Alexei Drummond
Hi Yasmin,

From what you describe, the NaN can be the sign of a zero likelihood resulting from the conditioning columns. Perhaps the starting tree is too small so that the probability for constant sites is very high. Can you try to use a different starting tree, for instance a UPGMA tree, and see if the problem persists?

Cheers,

Remco

PS See https://www.beast2.org/2014/07/28/all-about-starting-trees.html for how to change the starting tree in BEAUti.




--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beast-users/4e43caa1-77ef-483c-af4b-1e908d3adcf3n%40googlegroups.com.

Yasmin97

unread,
Jun 22, 2021, 11:51:07 PM6/22/21
to beast-users
Hi Remco, 

Thanks so much for you suggestion. Yes, when I use a UPGMA tree (to analyse multi-state morphological data under the Mkv model) the analysis runs smoothly, without any error messages.

However, since my analysis requires a specific, fixed topology, using a UPGMA tree will be a problem. 

I should also mention that when I use my fixed Newick tree for a binarised version of the morphological data, the analysis runs smoothly when using the Mkv model. The error message I mentioned in my previous post only appears when I use multi-state morphological data. 

Do you have any recommendations on how else to possibly solve this issue, whilst still using a fixed tree? 

Thanks so much for your time, 
Yasmin

Remco Bouckaert

unread,
Jul 4, 2021, 3:43:12 PM7/4/21
to beast...@googlegroups.com
Hi Yasmin,

Perhaps the clock rate for the multi-state partition is initialised at a value that makes it difficult for the  analysis to get started. So, maybe trying a different starting value may get the analysis going.

Cheers,
Remco

Yasmin97

unread,
Jul 5, 2021, 9:09:01 PM7/5/21
to beast-users
Hi Remco, 

Thank you so much for your advice. Will give this a go!

Yasmin

Yasmin97

unread,
Sep 14, 2021, 9:03:30 PM9/14/21
to beast-users
A late update, but increasing the clock rate worked just fine and the analysis managed to run. Thanks a lot for this suggestion,

Yasmin
Reply all
Reply to author
Forward
0 new messages