Bio.Phylo.NeXMLIO module

I/O function wrappers for the NeXML file format.

See: http://www.nexml.org

Bio.Phylo.NeXMLIO.qUri(s)

Given a prefixed URI, return the full URI.

Bio.Phylo.NeXMLIO.cdao_to_obo(s)

Optionally converts a CDAO-prefixed URI into an OBO-prefixed URI.

Bio.Phylo.NeXMLIO.matches(s)

Check for matches in both CDAO and OBO namespaces.

exception Bio.Phylo.NeXMLIO.NeXMLError

Bases: Exception

Exception raised when NeXML object construction cannot continue.

Bio.Phylo.NeXMLIO.parse(handle, **kwargs)

Iterate over the trees in a NeXML file handle.

Returns:

generator of Bio.Phylo.NeXML.Tree objects.

Bio.Phylo.NeXMLIO.write(trees, handle, plain=False, **kwargs)

Write a trees in NeXML format to the given file handle.

Returns:

number of trees written.

class Bio.Phylo.NeXMLIO.Parser(handle)

Bases: object

Parse a NeXML tree given a file handle.

Based on the parser in Bio.Nexus.Trees.

__init__(handle)

Initialize parameters for NeXML file parser.

classmethod from_string(treetext)

Convert file handle to StringIO object.

add_annotation(node_dict, meta_node)

Add annotations for the NeXML parser.

parse(values_are_confidence=False, rooted=False)

Parse the text stream this object was initialized with.

class Bio.Phylo.NeXMLIO.Writer(trees)

Bases: object

Based on the writer in Bio.Nexus.Trees (str, to_string).

__init__(trees)

Initialize parameters for NeXML writer.

new_label(obj_type)

Create new labels for the NeXML writer.

write(handle, cdao_to_obo=True, **kwargs)

Write this instance’s trees to a file handle.