Tree file format conversion for the efficient
Today, I needed to convert a series of phylogenetic trees, which were stored in the common nexus format, into newick format. In order to do this efficiently, I wrote the following one-liner.
Change into a directory containing your nexus-formatted tree files, then enter in your bash shell:
R -e 'require(ape); for (f in list.files(path=".", pattern="*.trees")) {write.tree(read.nexus(f), paste(f, "phy", sep="."))}'
Am 25. December 2016 um 22:34 Uhr
You’ve really imsrseped me with that answer!