use Graph::Reader::Dot;
use IPC::Run qw/ run binary /;
use Text::Tradition::Error;
-@EXPORT_OK = qw/ make_character_matrix character_input phylip_pars
- parse_newick newick_to_svg /;
+@EXPORT_OK = qw/ character_input phylip_pars parse_newick newick_to_svg /;
=head1 NAME
=head1 SUBROUTINES
+=head2 character_input( $alignment_table )
+
+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.
+
=cut
+sub character_input {
+ my $table = shift;
+ my $character_matrix = _make_character_matrix( $table );
+ my $input = '';
+ my $rows = scalar @{$character_matrix};
+ my $columns = scalar @{$character_matrix->[0]} - 1;
+ $input .= "\t$rows\t$columns\n";
+ foreach my $row ( @{$character_matrix} ) {
+ $input .= join( '', @$row ) . "\n";
+ }
+ return $input;
+}
+
sub _make_character_matrix {
my( $table ) = @_;
# Push the names of the witnesses to initialize the rows of the matrix.
return @chars;
}
-=head2 character_input( $alignment_table )
-
-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.
-
-=cut
-
-sub character_input {
- my $table = shift;
- my $character_matrix = _make_character_matrix( $table );
- my $input = '';
- my $rows = scalar @{$character_matrix};
- my $columns = scalar @{$character_matrix->[0]} - 1;
- $input .= "\t$rows\t$columns\n";
- foreach my $row ( @{$character_matrix} ) {
- $input .= join( '', @$row ) . "\n";
- }
- return $input;
-}
-
=head2 phylip_pars( $character_matrix )
Runs Phylip Pars on the given character matrix. Returns results in Newick format.