xflouris / libpll

Phylogenetic Likelihood Library
GNU Affero General Public License v3.0
26 stars 6 forks source link

Add format string and callback to pll_newick_export #131

Closed xflouris closed 7 years ago

xflouris commented 7 years ago

Add two additional parameters to the pll_newick_export function:

  1. A format string denoting how nodes will be printed
  2. A callback function that extract the necessary node information from the node->data field and passes them, along with the format string, to asprintf.

Also write some standard callbacks, e.g. for printing only branch lengths.

xflouris commented 7 years ago

finished.

pll_{r,u}tree_export_newick now accepts a callback for printing arbitrary data elements. If NULL is passed instead of a callback, the behaviour remains as before, i.e. only branch lengths are printed. newick-export is an example demonstrating the new functionality.