Question: treefix tree output format conversion
0
gravatar for arunprasanna83
2.6 years ago by
arunprasanna8330 wrote:

Hello,

I have trees from treefix. The format in tree is a kind of stacked version of newick format. Like this:

                        (
                          Taxon_A,
                          Taxon_B
                         );

How to convert this into normal newick format ? (Taxon_A,Taxon_B);. Is there any existing method?

Thanks in Advance,

AP

newick tree-format • 788 views
ADD COMMENTlink modified 2.6 years ago by Brice Sarver2.6k • written 2.6 years ago by arunprasanna8330

ete3 can read newick files even if there are new lines and spaces in it. use tree.write() to export back in a clean newick string.

ADD REPLYlink modified 2.6 years ago • written 2.6 years ago by jhc2.8k
1
gravatar for Brice Sarver
2.6 years ago by
Brice Sarver2.6k
United States
Brice Sarver2.6k wrote:

This is simple: replace all newlines with nothing. Something like this using sed.

ADD COMMENTlink written 2.6 years ago by Brice Sarver2.6k

I forgot to mention that, there are ~12k files !

ADD REPLYlink written 2.6 years ago by arunprasanna8330

Not a problem! Loop, remove newlines, and combine with >>.

ADD REPLYlink written 2.6 years ago by Brice Sarver2.6k
0
gravatar for dago
2.6 years ago by
dago2.5k
Germany
dago2.5k wrote:

Did you give it a try here?

ADD COMMENTlink written 2.6 years ago by dago2.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1115 users visited in the last hour