1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 47);
11 use_ok('Bio::Tools::Phylo::Phylip::ProtDist');
14 my $inputfilename= test_input_file('phylipdist.out');
15 my $tool= Bio::Tools::Phylo::Phylip::ProtDist->new(-file => $inputfilename);
16 my $phy = $tool->next_matrix;
17 is(@{$phy->names}, 5);
18 is $phy->get_entry('Alpha','Beta'), '4.23419';
19 is $phy->get_entry('Gamma','Alpha'),'3.63330';
20 my @column = $phy->get_column('Alpha');
21 is $column[0], '0.00000';
22 is $column[1], '4.23419';
23 is $column[2], '3.63330';
24 is $column[3], '6.20865';
25 is $column[4], '3.45431';
27 my @row = $phy->get_row('Gamma');
28 is $row[0], '3.63330';
29 is $row[1], '3.49289';
30 is $row[2], '0.00000';
31 is $row[3], '3.68733';
32 is $row[4], '5.84929';
34 my @diag = $phy->get_diagonal;
37 is $diag[0], '0.00000';
38 is $diag[1], '0.00000';
39 is $diag[2], '0.00000';
40 is $diag[3], '0.00000';
41 is $diag[4], '0.00000';
45 Alpha 0.00000 4.23419 3.63330 6.20865 3.45431
46 Beta 4.23419 0.00000 3.49289 3.36540 4.29179
47 Gamma 3.63330 3.49289 0.00000 3.68733 5.84929
48 Delta 6.20865 3.36540 3.68733 0.00000 4.43345
49 Epsilon 3.45431 4.29179 5.84929 4.43345 0.00000
52 is $phy->print_matrix , $matrix;
54 # now parse Phylip 3.6 output
56 $inputfilename= test_input_file('phylipdist-36.out');
57 $tool= Bio::Tools::Phylo::Phylip::ProtDist->new(-file => $inputfilename);
58 $phy = $tool->next_matrix;
60 is(@{$phy->names}, 39);
61 is $phy->get_entry('CBG01299','CBG00435'), '4.7793';
62 is $phy->get_entry('CBG22788','CBG22521'),'5.3195';
63 is $phy->get_entry('CBG01466', 'CBG01473'), '3.3944';
65 @row = $phy->get_row('CBG01473');
67 @column = $phy->get_column('CBG01300');
68 is $column[0], '0.0817';
69 is $column[1], '0.0000';
70 is $column[2], '0.0950';
71 is $column[3], '0.3111';
72 is $column[37], '4.7190';
73 is $column[38], '4.7592';
75 @row = $phy->get_row('CBG17433');
85 @diag = $phy->get_diagonal;
87 is $diag[0], '0.0000';
88 is $diag[1], '0.0000';
89 is $diag[2], '0.0000';
90 is $diag[3], '0.0000';
91 is $diag[4], '0.0000';
92 is $diag[5], '0.0000';
93 is $diag[37], '0.0000';
94 is $diag[38], '0.0000';