ivy.chars.cy_tree package

Submodules

ivy.chars.cy_tree.cy_tree module

class ivy.chars.cy_tree.cy_tree.Node

Bases: object

Node in a rooted, potentially multifurcating tree.

add_child()
bft()

breadth-first traversal of descendants

children
isleaf
isroot
iterchildren()
iternodes()

iterate (preorder) over nodes descendant from self - including self

label
leaves
left
leftchild
leftsib
length
nchildren
ni
parent
postiter()

iterate (postorder) over nodes descendant from self - including self

prune()
right
rightsib
treename
class ivy.chars.cy_tree.cy_tree.Tree

Bases: object

Convenience class for creating/storing node relationships and values as arrays.

index()

call on __cinit__, or when topology changes but no. nodes is the same

label
leftchild
length
nchildren
nleaves
nnodes
parent
postorder
rightsib
root
rootpathlen()
ivy.chars.cy_tree.cy_tree.cladesizes1()
ivy.chars.cy_tree.cy_tree.cladesizes2()
ivy.chars.cy_tree.cy_tree.cladesizes3()
ivy.chars.cy_tree.cy_tree.cladesizes4()
ivy.chars.cy_tree.cy_tree.tree_from_ivy()

Convert ivy Node to cython Tree

ivy.chars.cy_tree.newick module

Parse newick strings.

The function of interest is parse, which returns the root node of the parsed tree.

class ivy.chars.cy_tree.newick.Tokenizer(infile)[source]

Bases: shlex.shlex

Provides tokens for parsing newick strings.

parse_embedded_comment()[source]
ivy.chars.cy_tree.newick.add_label_chars(chars)[source]
ivy.chars.cy_tree.newick.nexus_iter(infile)[source]
ivy.chars.cy_tree.newick.parse(data, ttable=None, treename=None)[source]

Parse a newick string.

data is any file-like object that can be coerced into shlex, or a string (converted to StringIO)

ttable is a dictionary mapping node labels in the newick string
to other values.

Returns: the root node.

ivy.chars.cy_tree.newick.parse_ampersand_comment(s)[source]
ivy.chars.cy_tree.newick.test_parse_comment()[source]

ivy.chars.cy_tree.nexus module

class ivy.chars.cy_tree.nexus.Newick(parse_results=None, ttable={})[source]

Bases: object

convenience class for storing the results of a newick tree record from a nexus file, as parsed by newick.nexus_iter

parse(newick=<module 'ivy.chars.cy_tree.newick' from '/home/cziegler/mypy/local/lib/python2.7/site-packages/ivy/chars/cy_tree/newick.pyc'>)[source]
populate(parse_results, ttable={})[source]
ivy.chars.cy_tree.nexus.fetchaln(fname)[source]
ivy.chars.cy_tree.nexus.parse_treesblock(infile)[source]
ivy.chars.cy_tree.nexus.split_blocks(infile)[source]

ivy.chars.cy_tree.setup module

ivy.chars.cy_tree.test module

Module contents