Back to index

python-biopython  1.60
Public Member Functions
test_Phylo_depend.UtilTests Class Reference

List of all members.

Public Member Functions

def test_draw
def test_draw_ascii
def test_to_networkx

Detailed Description

Tests for various utility functions.

Definition at line 50 of file test_Phylo_depend.py.


Member Function Documentation

Run the tree layout algorithm, but don't display it.

Definition at line 53 of file test_Phylo_depend.py.

00053 
00054     def test_draw(self):
00055         """Run the tree layout algorithm, but don't display it."""
00056         pyplot.ioff()   # Turn off interactive display
00057         dollo = Phylo.read(EX_DOLLO, 'phyloxml')
00058         apaf = Phylo.read(EX_APAF, 'phyloxml')
00059         Phylo.draw(dollo, do_show=False)
00060         Phylo.draw(apaf, do_show=False)
00061         # Fancier options
00062         Phylo.draw(apaf, do_show=False, branch_labels={apaf.root: 'Root'})
00063         Phylo.draw(apaf, do_show=False, branch_labels=lambda c: c.branch_length)

Tree to Graph conversion, if networkx is available.

Definition at line 64 of file test_Phylo_depend.py.

00064 
00065     def test_draw_ascii(self):
00066         """Tree to Graph conversion, if networkx is available."""
00067         handle = StringIO()
00068         tree = Phylo.read(EX_APAF, 'phyloxml')
00069         Phylo.draw_ascii(tree, file=handle)
00070         Phylo.draw_ascii(tree, file=handle, column_width=120)
00071         handle.close()

Tree to Graph conversion, if networkx is available.

Definition at line 72 of file test_Phylo_depend.py.

00072 
00073     def test_to_networkx(self):
00074         """Tree to Graph conversion, if networkx is available."""
00075         tree = Phylo.read(EX_DOLLO, 'phyloxml')
00076         G = Phylo.to_networkx(tree)
00077         self.assertEqual(len(G.nodes()), 659)
00078 
00079 
00080 # ---------------------------------------------------------


The documentation for this class was generated from the following file: