xavierdidelot / BactDating

Bayesian inference of ancestral dates on bacterial phylogenetic trees
https://xavierdidelot.github.io/BactDating
MIT License
81 stars 15 forks source link

Strength of temporal signal! #18

Closed nbawe closed 4 years ago

nbawe commented 4 years ago

Before running the main bactdate analysis, it is also a good idea to assess the strength of the temporal signal using a root-to-tip linear regression

How would you assess it with p-value?

Is it significant with results as follows:

Rate=3.77e+01,MRCA=1973.70,R2=0.15,p<1.00e-04

Screenshot 2019-11-09 at 02 13 05

Additional info: I am using RAxML bipartition tree with branch labels as input rescaled using total lenght of 130 recombination free core alignment approx 1.2Mbp (eg 1200000) sites and then rooted as described in vinegettes.

nbawe commented 4 years ago

Also ran CFML and BactDating with following result to root to tip:

Rate=1.52e+01,MRCA=1969.24,R2=0.10,p<2.10e-03

Screenshot 2019-11-09 at 13 02 52

Could you help which is better?

xavierdidelot commented 4 years ago

Hello,

So it seems that you get a better correlation (both R2 and p-value) before correcting for recombination which a bit disappointing. On the other hand, the rate before correction is 37.7 substitutions per year which seems too high, depending on which bacterial species you're working on. The rate after correction is 15.2 substitutions per year which is more reasonable (again it depends on the species you are working on, you should check in the literature if previously published estimates of the clock rate are in agreement).

One thing you should check is whether your tree is correctly rooted (both before and after recombination analysis). If not, the roottotip output is meaningless. You can use the initRoot function to find the best location of the root in both case.

The other thing to do is to run bactdate and see what happens, since the roottotip analysis is only a rough way to test for the temporal signal (because tips are not actually independent, and the molecular clock might be relaxed)

Best wishes, Xavier

nbawe commented 4 years ago

Before analysis I ran initRoot and used this tree to generate roottotip. What do you mean by after recombination analysis?

xavierdidelot commented 4 years ago

By "after recombination analysis" I mean using the ClonalFrameML tree. By "before recombination analysis" I mean using the raxml tree. It's fine if you say you used initRoot before running roottotip, I just wanted to check. I think you should now try bactdate and see what happens!

nbawe commented 4 years ago

So I shoud use RAxML tree for root to tip or ClonalFrameML tree?

xavierdidelot commented 4 years ago

You should use the CFML tree for everything, unless you have good reasons to believe that CFML did not work well.

nbawe commented 4 years ago

Is there some kind of package or values to check to assess CFML results like in BactDating using the coda library?

xavierdidelot commented 4 years ago

No, the question for CFML is not whether it converged or not, but whether the results are biologically meaningful or not.

nbawe commented 4 years ago

Thank you!