Last active
December 24, 2015 20:59
-
-
Save armanbilge/6861858 to your computer and use it in GitHub Desktop.
Converts trees from Nexus format to Newick format. Depends on Dendropy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
from dendropy import TreeList | |
NEWICK = 'newick' | |
NEXUS = 'nexus' | |
try: | |
stream = sys.argv[1] | |
except: | |
stream = sys.stdin | |
TreeList.get_from_path(stream, NEXUS).write(sys.stdout, NEWICK) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment