Closed fredericQC closed 2 years ago
Hello Frederic,
This looks like a nice dataset on which BactDating should work well.
Your problem is that you have multifurcations in the tree which is not allowed.
So before you run the bactdate command you would need to replace these with binary nodes, using:
rm_rt=multi2di(rm_rt)
Best wishes, Xavier
It solved the problem! Thanks!
I am also getting this error message. My data also has many multifurcations, but this solution doesn't seem to help. But the roottotip is giving a nice signal, so I'd love to get BactDating running. Can you help and what information would you need? Thanks! Helena
Hi Helena,
Do you mean you get this error message even after using multi2di? If so there must be something else in your tree that is not acceptable for BactDating, maybe a branch of negative length for example?
Best wishes, Xavier
Thanks Xavier, this is the tree: (((((ZIB9084:10.215211,(ZIB8559:7.418663,(ZIB9080:4.698386,(ZIB8551:7.57946,ZIB8536:8.13356):3.171639):4.497993):0.000123):1.77989,(((ZIB8528:5.495356,(ZIB8545:1.752863,(((ZIB8565:11.310996,ZIB8570:0.000123):3.540978,((ZIB8572:10.561228,ZIB9076:1.234011):6.216047,ZIB8525:0.000123):1.755952):0.000123,(((ZIB8538:5.47764,(ZIB8544:5.200626,((ZIB8511:0.000123,ZIB8502:3.457654):1.730641,(((ZIB8546:1.863315,((ZIB9095:1.80742,ZIB8560:1.725934):1.714019,((ZIB9059:5.331406,ZIB8542:0.000123):3.531173,((ZIB8562:3.512913,ZIB8569:0.000123):1.662098,((ZIB9065:13.389436,ZIB9056:0.000123):3.515738,ZIB9055:0.000123):3.596584):1.739652):0.000123):1.778895):1.806307,((ZIB8524:3.383465,(ZIB8520:6.91435,(((((ZIB8508:8.661039,(((((ZIB8552:8.438435,ZIB8556:0.000123):1.605677,ZIB8555:0.000123):3.398699,ZIB9068:1.696822):3.429344,(ZIB9090:0.000123,ZIB9094:3.882909):0.000123):3.321362,ZIB9085:1.653697):0.000123):3.436398,(ZIB8516:5.347928,((ZIB9049:7.305974,((ZIB8558:7.418573,((ZIB9089:3.750213,ZIB8547:1.96391):1.754389,(ZIB8522:3.622208,((ZIB8537:12.602034,ZIB9067:3.449689):1.988168,(ZIB8514:7.292768,ZIB8526:0.000123):1.735797):1.831931):0.000123):0.000123):1.78268,ZIB8554:0.000123):0.000123):1.827639,ZIB8500:5.644176):1.694359):0.000123):1.725867,ZIB8509:0.000123):1.680008,((ZIB8513:5.181476,(((ZIB9070:0.000123,ZIB9088:5.300639):3.33318,ZIB8507:0.000123):1.644829,((ZIB8550:3.604687,ZIB8517:1.874589):3.538267,ZIB9074:5.173912):0.000123):0.000123):1.669057,ZIB8510:0.000123):0.000123):1.679951,ZIB8534:0.000123):1.680874):0.000123):1.725032,((ZIB8539:7.026978,ZIB8531:0.000123):3.478508,ZIB8519:0.000123):0.000123):1.783252):1.766322,ZIB8518:0.000123):1.738299):0.000123):1.652032):1.881334,(((ZIB9077:1.802125,ZIB8566:7.280289):1.772585,(((ZIB8527:0.000123,ZIB8530:9.780227):1.97138,ZIB8532:3.796662):1.73164,(((ZIB8577:6.08061,ZIB8563:0.000123):7.320205,ZIB8515:0.000123):1.807267,ZIB9086:3.649018):0.000123):3.684854):1.809135,ZIB8561:0.000123):0.000123):0.000123,((ZIB8529:3.834555,ZIB8573:3.807819):1.665055,((ZIB8568:3.575752,ZIB9069:1.741389):1.739525,ZIB8567:0.000123):3.677617):1.733747):7.419116):0.000123):1.911579):1.568109,ZIB8503:1.817627):3.595802,ZIB8523:3.531688):0.000123):3.577473,ZIB8505:3.416388):0.000123,(ZIB8506:1.858531,ZIB8501:5.259804):1.584795):2.376368,((ZIB8543:7.966907,ZIB9079:1.676918):1.756774,(ZIB8553:3.534481,(ZIB8548:0.000123,(((ZIB9048:1.807364,(ZIB9075:3.954625,ZIB9050:5.603428):1.489329):1.693696,ZIB9057:5.281991):0.000123,((ZIB8535:9.381135,ZIB8540:10.959709):0.000123,(ZIB9092:0.000123,(((ZIB8557:9.230419,ZIB9005:3.392617):2.158717,(ZIB9022:0.000123,ZIB9030:0.000123):0.000123):1.716845,(ZIB9027:3.584503,((ZIB9029:3.577916,(ZIB9007:6.035613,ZIB8512:0.000123):3.490993):3.610029,(ZIB9006:0.000123,((((ZIB9032:3.390037,(ZIB9018:0.000123,(ZIB9012:9.60873,ZIB9021:3.511783):7.583807):1.751557):1.566972,ZIB9023:3.450344):1.802503,(ZIB9043:5.273805,((ZIB9004:3.826974,ZIB9016:3.49855):4.125312,(((((ZIB9054:9.789342,(ZIB9072:6.732906,(ZIB9064:0.000123,ZIB9053:10.930529):5.560166):5.042449):0.000123,ZIB9051:2.22508):2.878528,ZIB9010:6.012818):1.901306,(ZIB9001:6.30488,(ZIB9009:6.160383,(ZIB9008:13.41917,ZIB9003:2.080081):0.000123):2.03167):8.088038):2.394248,ZIB9078:17.420065):0.000123):3.636723):0.000123):0.000123,(ZIB9046:4.037602,ZIB9063:3.442571):1.729443):6.888832):1.688743):1.681314):1.677395):3.543775):1.635865):5.31918):1.704982):1.667829):2.002505):1.237334):0.0;
It seems to work fine with this tree on my side. Could you try:
library(ape)
library(BactDating)
t=read.tree('tree.nwk')
d=runif(Ntip(t),2010,2020)
bactdate(t,d,showProgress = T)
If this works with made up dates on line 4 but not with the actual dates then maybe there is something wrong with your dates.
Aha! Cunning. Yes, there WAS something wrong with my dates. I'm now getting nice consistent results :-) THANKS!
Hi!
I used BactDating with some data and it worked well, but I'm having an issue with the tree I'm currently working on.
Here's some info about how I built the tree:
I wanted a tree based on core SNP, without recombinant regions. I have a reference genome and about 70 samples.
Workflow:
tree from FastTree:
Then I ran the following command in R to get the rooted, outgroup-removed, dated tree with BactDating.:
But I get the following when I try to run bactdate:
Do you know what's happening here?
Thanks!