{"id":135,"date":"2015-09-04T19:17:56","date_gmt":"2015-09-04T17:17:56","guid":{"rendered":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/?p=135"},"modified":"2015-09-07T20:11:20","modified_gmt":"2015-09-07T18:11:20","slug":"trees-nex2phy-one-liner","status":"publish","type":"post","link":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/2015\/09\/04\/trees-nex2phy-one-liner\/","title":{"rendered":"Trees Nex2Phy one-liner"},"content":{"rendered":"<p><strong>Tree file format conversion for the efficient<\/strong><\/p>\n<p>Today, I needed to convert a series of phylogenetic trees, which were stored in the common <em>nexus<\/em> format, into <em>newick<\/em> format. In order to do this efficiently, I wrote the following one-liner.<\/p>\n<p>Change into a directory containing your <em>nexus<\/em>-formatted tree files, then enter in your bash shell:<\/p>\n<p style=\"padding-left: 30px\"><code>R -e 'require(ape); for (f in list.files(path=\".\", pattern=\"*.trees\")) {write.tree(read.nexus(f), paste(f, \"phy\", sep=\".\"))}'<\/code><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2306,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57598,57600],"tags":[],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-bioinformatics","category-one-liners"],"_links":{"self":[{"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/users\/2306"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/comments?post=135"}],"version-history":[{"count":6,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"predecessor-version":[{"id":144,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/posts\/135\/revisions\/144"}],"wp:attachment":[{"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.fu-berlin.de\/gruenstaeudl\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}