New INSTALL.WIN doc (from wiki)
[bioperl-live.git] / t / PhylipDist.t
blob20ab40a971ce66693c337201402a026d084d0b33
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
5 use strict;
6 BEGIN {
7     eval { require Test; };
8     if( $@ ) {
9         use lib 't';
10     }
11     use Test;
12     use vars qw($NTESTS);
13     $NTESTS = 19;
14     plan tests => $NTESTS;
16 use Bio::Matrix::PhylipDist;
18 END {
19     for ( $Test::ntest..$NTESTS ) {
20         skip("Error in PhylipDist.pm",1);
21     }
23 use Bio::Tools::Phylo::Phylip::ProtDist;
25 my $inputfilename= Bio::Root::IO->catfile("t","data","phylipdist.out");
26 my $parser = Bio::Tools::Phylo::Phylip::ProtDist->new(-program => 'phylipdist',
27                                                       -file => $inputfilename);
29 my $phy = $parser->next_matrix;
30 ok $phy->program, 'phylipdist';
31 ok $phy->get_entry('Alpha','Beta'), '4.23419';
32 ok $phy->get_entry('Gamma','Alpha'),'3.63330';
33 my @column =  $phy->get_column('Alpha');
34 ok $column[0] = '0.00000';
35 ok $column[1] = '4.23419';
36 ok $column[2] = '3.63330';
37 ok $column[3] = '6.20865';
38 ok $column[4] = '3.45431';
40 my @row    = $phy->get_row('Gamma');
41 ok $row[0] = '3.63330';
42 ok $row[1] = '3.49289';
43 ok $row[2] = '0.00000';
44 ok $row[3] = '3.68733';
45 ok $row[4] = '5.84929';
47 my @diag   = $phy->get_diagonal;
50 ok $diag[0] = '0.00000';
51 ok $diag[1] = '0.00000';
52 ok $diag[2] = '0.00000';
53 ok $diag[3] = '0.00000';
54 ok $diag[4] = '0.00000';
56 my $matrix =<<END;
57     5
58 Alpha          0.00000  4.23419  3.63330  6.20865  3.45431
59 Beta           4.23419  0.00000  3.49289  3.36540  4.29179
60 Gamma          3.63330  3.49289  0.00000  3.68733  5.84929
61 Delta          6.20865  3.36540  3.68733  0.00000  4.43345
62 Epsilon        3.45431  4.29179  5.84929  4.43345  0.00000
63 END
65 ok $phy->print_matrix , $matrix;