xavierdidelot / BactDating

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

export to figtree #30

Closed fengyuchengdu closed 4 years ago

fengyuchengdu commented 4 years ago

Hi Xavier,

I followed your reply in https://github.com/xavierdidelot/BactDating/issues/21#issuecomment-555908896 to export BactDating result.

library(treeio) l=as.treedata.resBactDating(e6_mixed) obj=methods::new('treedata',phylo=l[[1]],data=dplyr::tbl_df(as.data.frame(l[[2]]))) write.beast(obj,'e6_mixed.nex')

No matter how I chose to display in "Node Bars" of figtree (height_0.95_HP or length_0.95_HP), the interval bars were detached from their corresponding node (images at the bottom).

Thanks for your help,

Yu

plot in R image

open in figtree Screenshot from 2020-06-18 11-19-03

xavierdidelot commented 4 years ago

That's annoying and I'm not sure why it's happening in your case but not others. Maybe you could try in FigTree on the lefthand side to click "Time scale" and then change the "Offset by" factor to realign the bars to the nodes. If that does not help I would need a RData file containing the object e6_mixed to investigate further.

fengyuchengdu commented 4 years ago

Adjusting "Time scale" and "Offset by" in FigTree had no effect on node bars. However, I repeated the analysis on the same data but with modified strain names (made it simpler to e.g. strain1) and the problem disappeared.

I'm gonna run a few more tests and get back to you soon, Thanks.

fengyuchengdu commented 4 years ago

Sorry, I figured it out. It somehow passed the tip-date-name-mismatch-checker and ran through without throwing out an error, but there was a single mismatch between a date-tip pair. The problem went away after amending accordingly. Thanks for the help.

xavierdidelot commented 4 years ago

I'm pleased it is now working for you, thanks for letting me know!

fengyuchengdu commented 4 years ago

Sorry to reopen this, but the problem came again. RData.zip I've uploaded the Rdata file and thanks much.

xavierdidelot commented 4 years ago

I have just submitted a new version 1.0.12 which should solve your problem.

fengyuchengdu commented 4 years ago

It works now, thanks !