[Biopython] parsing newick trees in memory

Michael Thon mike.thon at gmail.com
Sun Oct 10 17:22:43 UTC 2010


On Oct 10, 2010, at 12:15 PM, Frank Kauff wrote:

> If you don't want to use StringIO, then Nexus.Trees should be able to handle this:

I could not get StringIO to work in this case... that is, until I learned that I have to ensure that I can read from the beginning of the buffer:

    out_h = StringIO.StringIO()
    out_h.write(tree_text)
    out_h.seek(0)
    tree = Phylo.read(out_h, 'newick')
    print tree






More information about the Biopython mailing list