YuLab-SMU / treeio

:seedling: Base Classes and Functions for Phylogenetic Tree Input and Output
https://yulab-smu.top/treedata-book/
94 stars 24 forks source link

Reading RAxML-ng trees - coerce phyla to data.frame #35

Closed heather340 closed 4 years ago

heather340 commented 4 years ago

Hi! I recently shifted from raxml to raxml-ng, so now I am having issues with the code I built previously with these great packages.

I am reading trees using read.tree instead of read.raxml as was suggested in another post, but I get the following issue (file included below as a .txt)

nex <- ("raxml_UCE_75p_mem_names.raxml.supportFBP") tree <- read.tree(nex) tree$node.label [1] "" "50" "57" "88" "43" "72" "47" "100" "100" "56" "100" "100" "100" "100" "100" (etc) tree$tip.label [1] "Ireland_I46" "Norway_N117" "Norway_N97" "Norway_N4"
[5] "Ireland_I111" "Alaska_AL28" "Alaska_AL16" (etc) ggtree(tree) Error in as.data.frame.default(value, stringsAsFactors = FALSE) : cannot coerce class ‘"phylo"’ to a data.frame

raxml_UCE_50p_names.raxml.supportFBP.txt

Any suggestions would be appreciated!

Thanks, Heather

GuangchuangYu commented 4 years ago

can't reproduce your issue

brj1 commented 4 years ago

You probably need to update your R packages. Try

update.packages(ask=FALSE)
BiocManager::install("ggtree")
heather340 commented 4 years ago

Looks like that is likely it. I was able to figure out a workaround with another package, but this will be good to have fixed moving forward :)

Thanks for the help!