We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It could be interesting to add an interface for drawing trees with ETE Toolkit especially for documentation purpose
The text was updated successfully, but these errors were encountered:
Simple POC for partition hierarchy
def hierarchy_to_ete_tree(tree, altitudes=None, **attributes): ete_tree = ete.Tree() stack = [(tree.root(), ete_tree)] if altitudes is not None: altitudes = altitudes[tree.parents()] - altitudes while len(stack) != 0: node, ete_node = stack.pop() [ete_node.name](http://ete_node.name/) = str(node) if altitudes is not None: ete_node.dist = altitudes[node] attr = {name:values[node] for (name,values) in attributes.items()} ete_node.add_features(**attr) for c in tree.children(node): stack.append((c, ete_node.add_child())) return ete_tree tree = hg.Tree((7, 7, 8, 8, 8, 9, 9, 11, 10, 10, 11, 11)) altitudes = hg.attribute_regular_altitudes(tree) t = hierarchy_to_ete_tree(tree, altitudes) print(t) t.render("img.png") t.show()
Sorry, something went wrong.
No branches or pull requests
It could be interesting to add an interface for drawing trees with ETE Toolkit especially for documentation purpose
The text was updated successfully, but these errors were encountered: