Rename nodes in a Newick tree.
Input:
- A Newick tree file.
Notes:
- For nodes with names, use
--node. - For unnamed internal nodes, use
--lcawith two comma-separated names. - The total number of
--nodeand--lcaarguments must equal the number of--rename(-r) arguments. - Matching order: the first N
--renamevalues are applied to the N--nodearguments in order, and the remaining--renamevalues are applied to the--lcaarguments in order. The order in which--node,--lca, and--renamearguments appear on the command line does not affect this matching. - This command is designed for small edits, not batch replacement. For batch replacement, use
necom nwk replaceor external tools such assedorperl.
Examples:
-
Rename a named node
necom nwk rename tree.nwk --node Homo --rename Human -
Rename an internal node via LCA
necom nwk rename tree.nwk --lca Homo,Pan --rename CladeX -
Rename multiple nodes
necom nwk rename tree.nwk \ --node Homo --rename Human \ --lca Homo,Pan --rename CladeX