You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a tree file and a data frame that I use to create a phylogenetic tree with customized labels.
Here is my tree in Newick format with here node support:
I´m using this line of code to generate the tree, everything is good except for the node support.
# Node colors
colors = ['red' if ((i) == '100.0') else 'grey' for i in tre.get_node_values('support', 1, 0)]
sizes = [10 if i else 0 for i in tre.get_node_values('support', 1, 0)]
#### Now, drawing the new version of the tree
tre2.draw(
tip_labels_align=True,
node_sizes=sizes,
node_colors=colors,
tip_labels=newNodnames,
tip_labels_colors=newColors,
width=1200, height=2000,
node_labels='support',
edge_style={
"stroke": "darkgrey",
"stroke-width": 3,
},
);
Here is a part of the tree where every node has a value of zero, I don´t understand why.
Any suggestion to fix that?
The text was updated successfully, but these errors were encountered:
This has to do with the unusual formatting of the newick string. It lists the support values as fractions (e.g., '99/100') instead the more common representation as a digit or decimal (e.g., 99 or 0.99). The toytree.tree parsing function recognizes that these values are not numeric and thus interprets and stores them as internal node names rather than supports.
Do you mind if I ask what software was used to generate the newick string?
Here is a hack that should work for now. The default newick parsing function will store the support values as 'name's, and then you can extract the info from names and store it as 'support' attributes on nodes using a custom function.
I have a tree file and a data frame that I use to create a phylogenetic tree with customized labels.
Here is my tree in Newick format with here node support:
Here the data frame (only a part of the df):
I´m using this line of code to generate the tree, everything is good except for the node support.
Here is a part of the tree where every node has a value of zero, I don´t understand why.
Any suggestion to fix that?
The text was updated successfully, but these errors were encountered: