Skip to content

Instantly share code, notes, and snippets.

@jergosh
Last active October 13, 2016 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jergosh/04247d499b0f0946e05f88e3594b591c to your computer and use it in GitHub Desktop.
Save jergosh/04247d499b0f0946e05f88e3594b591c to your computer and use it in GitHub Desktop.
def make_layout(ann_dict):
def layout(node):
if node.is_leaf():
labelFace = ete3.faces.TextFace(str(ann_dict[node.name]))
ete3.faces.add_face_to_node(labelFace, node, column=2, position="aligned")
esnFace = ete3.faces.RectFace(height=100*ann_dict[node.name],
width=10,
fgcolor="white",
bgcolor="red")
esnFace.margin_top = 5
esnFace.margin_bottom = 5
ete3.faces.add_face_to_node(esnFace, node, column=1, position="aligned")
return layout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment