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

Incorrect summary values for IgrBrlens_rate parameter for fossil tips in total evidence dating #132

Closed ghost closed 4 years ago

ghost commented 5 years ago

Incorrect summary values for IgrBrlens_rate parameter for fossil tips in total evidence dating

Dear contributors, In the new developers version of Mr. Bayes 3.2.7, I could notice that you corrected for one particular bug that affected some of my analysis: summary trees and vstat files would assign a “-nan” character to clock rate values across tree branches (IgrBrlens_rate) when those values were very small up to version 3.2.6. I could notice that this was most frequent in fossil tips with very short branches in total evidence dating. In Mr. Bayes 3.2.7, although this seems to have been corrected for the mean, variance, lower and upper ranges values, it was not corrected for the median values. No median values instead of showing “-nan” in such cases, they simply output “1.0” values for all such branches. This is an important issue for some of my currently ongoing projects with total evidence dating and any light on this issue would be extremely welcome! Thanks in advance!

How may we reproduce this bug?

I can provide my own data set if necessary. However, I observed his behavior in analyses including at least ~50 fossil and extant tips, with his behavior appearing at the fossil tips.

Steps to reproduce the bug:

  1. Run a data set using extant and fossil tips using the FBD tree mode.
    1. The issue happened using different data sets, some with both tip and node calibrations, others with tip only the calibrations; some with morphological data only, others with morphological and molecular data. All tested data set combinations showed this bug.
  2. Check consensus tree (either half or allcompat) and vstat file for IgrBrlens_rate median values = 1.0, although the mean, variance, lower and upper ranges values make it clear the median should be very different from exactly 1.0

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

What is the environment that you run MrBayes in?

Windows 10; also in University cluster Mr. Bayes 3.2.7

zhangchicool commented 4 years ago

This is kind of a feature. If a fossil is an ancestral fossil, the branch length is zero and the rate is absent. But absent value is not supported when summarizing trees in MrBayes and would produce nan as you have noticed in previous versions. In order to avoid nan summaries, the rate values for ancestral fossils are fixed to 1.0. As a result, if a fossil has a high chance (probability) of being ancestral, the median rate will be 1.0.

If you are in particular interest of the rate summaries for that fossil being only as tip, you need to post process the MCMC samples (.t files) using other programs, such as R.

Close for now. but feel free to propose a better way to deal with this.