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
224 stars 78 forks source link

Clock analyses keep unlinking topology and branch lengths #300

Closed seraklop closed 3 weeks ago

seraklop commented 1 month ago

When trying to run a clock analysis (I tried both IGR and strict), MrBayes unlinks the topology and branch lengths of partition 1 versus the rest - without being asked to do so. It shows accordingly in the "showmodel" command, and I cannot reverse it using the "link" command.

I am attaching here our input files (data and MB commands in NEXUS format) to reproduce the issue.

And yes, I can compile on our cluster from git if needed.

Thanks for the help! Seraina

run_MrBayes.nex.txt Data_MorphMolec_240523.nex.txt

zhangchicool commented 3 weeks ago

Hi Seraina, I had a quick look at the files, and it appears that the constraints are to blame. I think the first one should be constraint root_node hard = 2-.; (assuming the first taxon is an outgroup) and the third one is not compatible with the first one -- if you disable the second one and keeping the first and the third, mrbayes gives an error). The program runs fine with the first two constraints: constraint root_node hard = 2-.; constraint extant_Xoridinae partial = extant_XOR : extant_INGR;

It is strange mrbayes doesn't report an error on this. Perhaps Fredrik knows what happened exactly. Chi

seraklop commented 3 weeks ago

Dear Chi,

good to see you are still working on the MrBayes source!

About your comments: the root constraints was correct with how it is included in the original file: 'constraint root_node hard = 1-.;' It is supposed to include all the taxa, and I only invoke it because I then want to place an age prior on the entire tree. The actual "rooting constraint" would be the combination of the two partial constraints that follow. And they should both be correct.

I tried with removing one topology constraint at the time, and it in fact is the root constraint (including all taxa) that creates the problem (the two partial constraints don't seem to matter). However, as far as I recall, we need such a constraint and associated age prior to make the uniform tree prior proper, right?

Best, Seraina

zhangchicool commented 3 weeks ago

Glad to know it works with the two partial constraints. There is no need to use 1-.; simply use prset treeagepr=offsetexp(108,300); to set the tree age prior :)

To see it works, check

 80 --  Parameter  = V{all}
               Type       = Branch lengths
               Prior      = Clock:Fossilization
                            Node depths are constrained by the following age constraints:
                            -- ...
                            -- Tree age has a xxx distribution
seraklop commented 3 weeks ago

Great, that solves it - thanks!