NBISweden / MrBayes

MrBayes is a program for Bayesian inference and model choice across a wide range of phylogenetic and evolutionary models. For documentation and downloading the program, please see the home page:
http://NBISweden.github.io/MrBayes/
GNU General Public License v3.0
233 stars 80 forks source link

Can't use FBD with fixed user-specified node times #303

Open davidcerny opened 2 months ago

davidcerny commented 2 months ago

I wanted to run an FBD analysis where both the topology and node times (and, by extension, temporal branch lengths as well) are fixed to a user-specified tree. While fixing the topology is simple enough, fixing the clock (temporal) branch lengths only appears to be possible for ultrametric trees.

What is the current observed behaviour?

For every fossil tip, I get a warning like this one:

      Node (Asilisaurus_kongwe) is not at the same depth as some other tip taking calibration into account.

followed by:

      Fixed branch lengths do not satisfy clock      Error in command "Prset"
      There was an error on at least one processor
      The error occurred when reading char. 36-36 on line 193
         in the file '/Users/David/Downloads/FBD_test/FBDtest_fixed_topology_and_brlens.nex'

   Returning execution to command line ...

   Error in command "Execute"

This is despite the fact that the branch lengths in the user tree do satisfy all the tip calibrations – I checked.

It is of course still possible to fix node times by specifying propset NodesliderClock(V)$prob = 0;, but as far as I can tell, this does not fix them to the values from the user-supplied tree.

What is the expected/wanted behaviour?

As long as myTree satisfies all the tip calibrations, it should be possible to use the prset brlenspr=clock:fixed(myTree); command to run an FBD analysis with fixed node times.

How may we reproduce this bug?

Execute this Nexus file.

Would you be able to compile and run MrBayes to test fixes to this bug?

What is the environment that you run MrBayes in?

Version:   3.2.7a
Features:  MPI
Host type: arm-apple-darwin23.5.0 (CPU: arm)
Compiler:  clang 15.0.0
zhangchicool commented 2 months ago

Hi David,

I think I came across this error before. The reason is that mrbayes has very strict checking of the times, making it hard to satisfy the criterion. I was able to do it by using 10 decimals ( see the attached example ). But otherwise I would just comment out the checking code and recompile, if you are confident about the input tree.

In the long run, it would be nice if someone could refine the checking code so that people would not struggle with fixing the tree.