How to use the newick.write 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_read_write(tmpdir):
    trees = read(pathlib.Path(__file__).parent / 'fixtures' / 'tree-glottolog-newick.txt')
    descs = [len(tree.descendants) for tree in trees]
    # The bookkeeping family has 391 languages
    assert descs[0] == 391
    tmp = str(tmpdir.join('test.txt'))
    write(trees, tmp)
    assert pathlib.Path(tmp).exists()
    assert [len(tree.descendants) for tree in read(tmp)] == descs

newick

A python module to read and write the Newick format

Apache-2.0
Latest version published 2 years ago

Package Health Score

54 / 100
Full package analysis

Similar packages