rename tip label by a mapping table for multiphylo tree
Dear ete3 team, Thanks for your such amazing work. My issue is that, Suppose I have a newick file A, and a list of old and new names mapping table B, how do I replace these names at once and keep remains still?
- A.newick
(a:0.2,b,c,d);
(a:0.3,b,c,d);
- B.csv
old,new
a,A
c,C
d,D
The result should be like:
(A:0.2,b,C,D);
(A:0.3,b,C,D);
Thanks a lot!
Something like:
for leaf in tree: if leaf.name != 'b': leaf.name = leaf.name.upper()
On Sat, 14 May 2022 at 15:37, neptuneyt @.***> wrote:
Dear ete3 team, Thanks for your such amazing work. My issue is that, Suppose I have a newick file A, and a list of old and new names mapping table B, how do I replace these names at once and keep remains still?
- A.newick
(a:0.2,b,c,d); (a:0.3,b,c,d);
- B.csv
old,new a,A c,C d,D
The result should be like:
(A:0.2,b,C,D); (A:0.3,b,C,D);
Thanks a lot!
— Reply to this email directly, view it on GitHub https://github.com/etetoolkit/ete/issues/630, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABH6STAE43VCZLEGJMJRFDVJ6UA5ANCNFSM5V5ST4MA . You are receiving this because you are subscribed to this thread.Message ID: @.***>