Skip to content

Commit

Permalink
Phylo: added get_nonterminals() to TreeMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
etal committed Apr 10, 2010
1 parent f2a48cc commit de024f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Bio/Phylo/BaseTree.py
Expand Up @@ -324,6 +324,10 @@ def check_in_path(v):
return None
return path[-2::-1]

def get_nonterminals(self, order='preorder'):
"""Get a list of all of this tree's nonterminal (internal) nodes."""
return list(self.find_clades(terminal=False, order=order))

def get_terminals(self, order='preorder'):
"""Get a list of all of this tree's terminal (leaf) nodes."""
return list(self.find_clades(terminal=True, order=order))
Expand Down

0 comments on commit de024f7

Please sign in to comment.