xavierdidelot / BactDating

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

Error in if (log(runif(1)) < l2 - l + dgamma(mu2, shape = 0.001, scale = 1000, : missing value where TRUE/FALSE needed #62

Closed appliedmicrobiologyresearch closed 1 year ago

appliedmicrobiologyresearch commented 1 year ago

Hi Xavier! I have a new issue with BactDating. I have installed the newest version (1.1.1), and I am running on a tree with 18 tips and a beautiful regression. But I get the above error always after: bactBurk5m_arc=bactdate(tree = Burkrooted,date = d,useRec=T,nbIts=5e6,showProgress=T) I was looking through older issues, and my Burkrooted$unrec are also all nice numbers 0.93-1.00. The data set is from 2003 onwards. Thanks, Helena

xavierdidelot commented 1 year ago

Hi Helena, does it work if you leave out the useRec=T? If so it's a problem specifically with the recombination element. Is your data loaded using loadCFML or loadGubbins?

appliedmicrobiologyresearch commented 1 year ago

Thanks for the fast reply. loadgubbins. Aha, useRec=F and something is happening. Is that the right option then?

xavierdidelot commented 1 year ago

Do you mean that it is running fine with useRec=F? If so then the problem is indeed with recombination but it should be possible to run with useRec=T if that's what you want. Did you do anything between loadGubbins and bactdate, maybe to root the tree?

appliedmicrobiologyresearch commented 1 year ago

Yes.... Burkrooted=initRoot(tBurkGub,d) r=roottotip(Burkrooted,d) ...

appliedmicrobiologyresearch commented 1 year ago

It's still failing with useRec=T though...

xavierdidelot commented 1 year ago

Could you try again with Burkrooted=initRoot(tBurkGub,d,useRec=T)

appliedmicrobiologyresearch commented 1 year ago

Excellent, thanks, that seems to have fixed it :-)

xavierdidelot commented 1 year ago

Great. For the record, you also had the option to run bactdate directly on the unrooted tree rather than use initRoot(...,useRec=T) and the effect would be exactly the same.