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