Package Bio :: Package Phylo :: Module CDAOIO :: Class Parser
[hide private]
[frames] | no frames]

Class Parser

source code

object --+
         |
        Parser

Parse a CDAO tree given a file handle.
Instance Methods [hide private]
 
__init__(self, handle=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
parse(self, **kwargs)
Parse the text stream this object was initialized with.
source code
 
parse_handle_to_graph(self, rooted=False, parse_format='turtle', context=None, **kwargs)
Parse self.handle into RDF model self.model.
source code
 
parse_graph(self, graph=None, context=None)
Generator that yields CDAO.Tree instances from an RDF model.
source code
 
new_clade(self, node)
Returns a CDAO.Clade object for a given named node.
source code
 
get_node_info(self, graph, context=None)
Creates a dictionary containing information about all nodes in the tree.
source code
 
parse_children(self, node)
Traverse the tree to create a nested clade structure.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
from_string(cls, treetext) source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, handle=None)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

parse_children(self, node)

source code 

Traverse the tree to create a nested clade structure.

Return a CDAO.Clade, and calls itself recursively for each child, traversing the entire tree and creating a nested structure of CDAO.Clade objects.