Ejemplo n.º 1
0
# Lists the object's attributes
print(tree.__dict__)
# Lists an object's functions
# for ele in dir(tree):
#    if (callable(getattr(tree,ele))):
#        print(ele)

# a---b---c
#     |---d
# edge (b,c) b is tail, c is head   tail----head  internal---tip
# Only heads are TIPS

# EDGES
internal_counter = 0
#for edge in tree.level_order_edge_iter():
for edge in tree.postorder_edge_iter():
    #print "edge:" + str(edge) + "--"
    tail = edge.tail_node
    head = edge.head_node
    if (not head.is_leaf()):
        internal_counter += 1
    else:
        print(head.taxon)





#print node
#print node.taxon
#print node.parent_node