Text::Tradition::StemmaUtil - standalone utilities for stemma graph display and distance tree calculations


This package contains a set of utilities for displaying arbitrary stemmata and running phylogenetic analysis on text collations.


read_graph( $dotstr) {

Parses the graph specification on the filehandle in $dotstr and returns a Graph object. This subroutine works around some deficiencies in Graph::Reader::Dot.

display_graph( $graph, $opts )

Returns a dot specification intended for display, according to the logical attributes of the witnesses.

editable_graph( $graph, $opts )

Returns a dot specification of a stemma graph with logical witness features, intended for editing the stemma definition.

character_input( $tradition, $opts )

Returns a character matrix string suitable for Phylip programs, which corresponds to the given alignment table. See Text::Tradition::Collation for a description of the alignment table format. Options include:

  • exclude_layer - Exclude layered witnesses from the character input, using only the 'main' text of the witnesses in the tradition.

  • collapse - A reference to an array of relationship names that should be treated as equivalent for the purposes of generating the character matrix.

phylip_pars( $character_matrix )

Runs Phylip Pars on the given character matrix. Returns results in Newick format.

parse_newick( $newick_string )

Parses the given Newick tree(s) into one or more Stemma objects with undirected graphs.

newick_to_svg( $newick_string )

Uses the FigTree utility (if installed) to transform the given Newick tree(s) into a graph visualization.


This package is free software and is provided "as is" without express or implied warranty. You can redistribute it and/or modify it under the same terms as Perl itself.


Tara L Andrews <>