Trying to follow the instructions here:
https://bioconductor.org/packages/devel/bioc/vignettes/treeio/inst/doc/Importer.html#need-helps
I want to read in my phylogenetic tree with the 'treeio' package. And get all the values associated with the nodes. Or any other package for that matter.
After having installed 'ips' and 'treeio' and the 'ape' package, and I have set a path to my working directory.
I tried this:
phyA <- read.beast("bk98_01_11_A7.tre", digits = NULL)
But this did not work.
It returned this error:
Error in (i2 + 1):end : argument of length 0
I then tried installing the "OutbreakTools" package.
And I then tried this:
phyA <- read.annotated.nexus("bk98_01_11_A7.tre")
this worked fine. But when I then examining a node (e.g. node number 69 ) in my tree object:
phy <- phyA
phy$annotations[[69]]$length_95%_HPD
I get :
[[1]]
[1] 29.06452
[[2]]
[1] 53.19834
But looking at this value at this node (69) in FigTree I can see the values should be :
3.813 and 18.423
I also had a look here:
https://groups.google.com/forum/#!topic/beast-users/Wpq2CU2Y5BQ
But could not get any of the suggested approaches to work.
The tree I am using can be reached here.
https://www.dropbox.com/s/ywtachr6gsd4wcd/bk98_01_11_A7.tre?dl=0
My input tree might be wrong. But I have no idea to how the file should be instead. Thanks in advance for any help on this.
the last issue is from outbreaktools and/or figtree, you need to open the file with text editor and verify it manually to check whether these program parse the file correctly.
From your msg, treeio fails to parse your file. You can send me the file via email (guangchuangyu AT gmail) and I will look into it.
thanks for sending the file.
I have no problem to read the file using
treeio
package.pls make sure you are using the latest release version.
Brilliant. Yes. This did it. I was running R v3.5.1. But your instructions in your reply worked. My next problem was to get all the node information in to a data frame. I had never before heard of tibbles. Once I looked up tibble on the internet I could easily prepare a data frame , that I am more familiar with.
To get the tibble turned into a data frame I did this:
Thanks again