Question: plotting trees in R: node labels from nexus tree files
0
gravatar for jmah
15 days ago by
jmah10
jmah10 wrote:

Hi,

I am trying to plot a phylogeny from RevBayes in R.

The trees are in nexus format. For some reason, node labels do not import when I use ape::read.nexus(). When checking the phylo object, it shows that branch lengths have been imported, but no node labels. I am able to see the node labels in Figtree. I've tried exporting to Newick format in Figtree, but then node labels are lost.

Here's the phylo object:

Phylogenetic tree with 46 tips and 45 internal nodes.

Tip labels: Tadh_1, Tadh_20, Tadh_25, Tadh_26, Tadh_27, Tadh_18, ...

Rooted; includes branch lengths.

Here's a fragment of the tree in my nexus file:

Begin trees; tree TREE1 = [&R](((((((((Tadh_1[&index=13]:0.315435,Tadh_20[&index=8]:0.315435)[&index=47,posterior=0.052038,age_95%_HPD={0.229588,0.415859}]:0.028293,Tadh_25[&index=11]:0.343728)[&index=48,posterior=0.017375,age_95%_HPD={0.26249,0.436248}]:0.040193, ... etc.

thanks for any help!

R revbayes nexus ggtree ape • 91 views
ADD COMMENTlink modified 12 days ago by Guangchuang Yu2.4k • written 15 days ago by jmah10

To clarify, the node labels I am after are the posterior probabilities ("posterior").

ADD REPLYlink written 15 days ago by jmah10
0
gravatar for Guangchuang Yu
12 days ago by
Guangchuang Yu2.4k
China/Guangzhou/Southern Medical University
Guangchuang Yu2.4k wrote:

The read.beast() function in the treeio package should be able to parse the file and then you can use the ggtree package to visualize the tree with or without associated data (e.g. posterior values).

ADD COMMENTlink written 12 days ago by Guangchuang Yu2.4k

Thank you! I'll give that a try. Also, thanks for making ggtree! I love that package.

ADD REPLYlink written 11 days ago by jmah10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1285 users visited in the last hour