fast2phy: Convert aligned FASTA to interleaved PHYLIP

Where I work, many of our users are involved in bioinformatics and recently one user was concerned with the time it took to convert an aligned FASTA file into an interleaved PHYLIP file for phylogenetic analysis. Using BioPython took a very long time and not to mention its in memory representation was many times larger then the actual file itself and this added to the difficulties the user was facing.

So I thought I could help out. Luckily an existing project existed, pyfasta. This great tool uses Numpy’s mmap to access a fasta file without having to read it completely into memory and then with some loops, I was able to convert to the phylip format. I’m also happy to report that the user is very satisfied with this program.

fast2phy can be found on github


2 thoughts on “fast2phy: Convert aligned FASTA to interleaved PHYLIP

  1. Hi David,
    I just tried using your fast2phy program, but I doesn’t work for me. Unfortunately I am no computer wizard, so I have no idea what this error is that I am getting:
    Traceback (most recent call last):
    File “/Library/Frameworks/Python.framework/Versions/2.7/bin/fast2phy”, line 9, in
    load_entry_point(‘fast2phy==1.0’, ‘console_scripts’, ‘fast2phy’)()
    File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/”, line 339, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
    File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/”, line 2470, in load_entry_point
    return ep.load()
    File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/”, line 2184, in load
    File “build/bdist.macosx-10.6-intel/egg/fast2phy/”, line 1, in
    ImportError: cannot import name zip_longest

    Any help would be much appreciated, as I really need to convert fasta to phylip interleaved format.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s