Updating my Newick parser

Back in 2003 I wrote a small parser for the Newick tree format.  It is pretty straightforward Python code, and basically just something I hacked up because I needed to manipulate some trees for a project.

Figuring that others might also find it useful I put it on my webpage and that’s about it for the story of my Newick parser. I’ve used it in a few other projects, but haven’t really developed it further from the initial code, and haven’t really received much feedback on it.

Except for this weekend where I got three emails about it.  I might have received one email a year until now.

It was a few bug reports and some questions, and because of the bug reports I’ve now made a new release, version 1.3.

I also have a Newick parser for C++.  Actually, I have more than one, since there are two different parsers in QDist and SplitDist, but the one I have in mind is more stand-alone and can probably be used by others.

It is a recursive decent parser I wrote in Boost.Spirit as an exercise to learn the Spirit language.

I think I will clean it up a bit and put it up on the web…

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: , , ,

6 Responses to “Updating my Newick parser”

  1. Reed A. Cartwright Says:

    Ooh, a Spirit-based newick parser. I could use that for when I redo Dawg.

  2. Thomas Mailund Says:

    Let me just clean up the code and I’ll put it on the web. I just need to remove some bits and pieces from other projects, that do not really belong with the parser.

  3. Mailund on the Internet » Blog Archive » Newick C++ parser in Boost.Spirit Says:

    [...] the Newick parser for C++ I mentioned in a previous post.  It is written in Boost.Spirit, so it is a recursive decend parser.  This might give you [...]

  4. Alan Rogers Says:

    I just had a look at your newick parser in python. Looks like it might be just what
    I need. Can you tell me how to use it?

    Thanks, Alan

  5. Thomas Mailund Says:

    Alan: I’d love to, but let me know what your problem is first. I thought I explained that on the web page, but if there are any problems I need to update the description there, so your help in letting me know where I am unclear would be much appreciated!

  6. Michael Kuhn Says:

    Hi Thomas,

    I added support for internal node labels to your parser, but probably broke support for bootstraps (which I don’t need at the moment). See:

    http://blog.mckuhn.de/2010/01/newick-parser-for-python-supporting.html
    http://bitbucket.org/mkuhn/newick/

    best wishes, Michael

Leave a Reply