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

Class Parser

source code

object --+

Methods for parsing all phyloXML nodes from an XML stream.

To minimize memory use, the tree of ElementTree parsing events is cleared after completing each phylogeny, clade, and top-level 'other' element. Elements below the clade level are kept in memory until parsing of the current clade is finished -- this shouldn't be a problem because clade is the only recursive element, and non-clade nodes below this level are of bounded size.

Instance Methods [hide private]
__init__(self, file)
Initialize the class.
source code
Parse the phyloXML file and create a single Phyloxml object.
source code
Parse the phyloXML file incrementally and return each phylogeny.
source code
_parse_phylogeny(self, parent)
Parse a single phylogeny within the phyloXML tree (PRIVATE).
source code
_parse_clade(self, parent)
Parse a Clade node and its children, recursively (PRIVATE).
source code
_parse_sequence(self, parent) source code
_parse_taxonomy(self, parent) source code
other(self, elem, namespace, localtag) source code
accession(self, elem) source code
annotation(self, elem) source code
binary_characters(self, elem) source code
clade_relation(self, elem) source code
color(self, elem) source code
confidence(self, elem) source code
date(self, elem) source code
distribution(self, elem) source code
domain(self, elem) source code
domain_architecture(self, elem) source code
events(self, elem) source code
id(self, elem) source code
mol_seq(self, elem) source code
point(self, elem) source code
polygon(self, elem) source code
property(self, elem) source code
reference(self, elem) source code
sequence_relation(self, elem) source code
uri(self, elem) source code

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

Class Variables [hide private]
  _clade_complex_types = ['color', 'events', 'binary_characters'...
  _clade_list_types = {'confidence': 'confidences', 'distributio...
  _clade_tracked_tags = set(['binary_characters', 'branch_length...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, file)

source code 
Initialize the class.
Overrides: object.__init__

_parse_phylogeny(self, parent)

source code 

Parse a single phylogeny within the phyloXML tree (PRIVATE).

Recursively builds a phylogenetic tree with help from parse_clade, then clears the XML event history for the phylogeny element and returns control to the top-level parsing function.

Class Variable Details [hide private]


['color', 'events', 'binary_characters', 'date']


{'confidence': 'confidences',
 'distribution': 'distributions',
 'property': 'properties',
 'reference': 'references'}