How to use the newick.parse_node function in newick

To help you get started, we’ve selected a few newick examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github glottobank / python-newick / tests / test_newick.py View on Github external
def test_clone():
    """
    This test illustrates how a tree can be assembled programmatically.
    """
    newick = '(A,B,(C,D)E)F'
    tree1 = parse_node(newick)

    def clone_node(n):
        c = Node(name=n.name)
        for nn in n.descendants:
            c.add_descendant(clone_node(nn))
        return c

    assert clone_node(tree1).newick == newick

newick

A python module to read and write the Newick format

Apache-2.0
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages