File: PhylipDist.t

package info (click to toggle)
bioperl 1.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 20,336 kB
  • ctags: 8,476
  • sloc: perl: 119,890; xml: 6,001; lisp: 121; makefile: 57
file content (69 lines) | stat: -rw-r--r-- 1,607 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -*-Perl-*-
## Bioperl Test Harness Script for Modules


use strict;
BEGIN {
    eval { require Test; };
    if( $@ ) {
        use lib 't';
    }
    use Test;
    use vars qw($NTESTS);
    $NTESTS = 19;
    plan tests => $NTESTS;
}
use Bio::Matrix::PhylipDist;

END {
    for ( $Test::ntest..$NTESTS ) {
        skip("Error in PhylipDist.pm",1);
    }
}
use Bio::Tools::Phylo::Phylip::ProtDist;

my $inputfilename= Bio::Root::IO->catfile("t","data","phylipdist.out");
my $parser = Bio::Tools::Phylo::Phylip::ProtDist->new(-program => 'phylipdist',
						      -file => $inputfilename);

my $phy = $parser->next_matrix;
ok $phy->program, 'phylipdist';
ok $phy->get_entry('Alpha','Beta'), '4.23419';
ok $phy->get_entry('Gamma','Alpha'),'3.63330';
my @column =  $phy->get_column('Alpha');
ok $column[0] = '0.00000';
ok $column[1] = '4.23419';
ok $column[2] = '3.63330';
ok $column[3] = '6.20865';
ok $column[4] = '3.45431';

my @row    = $phy->get_row('Gamma');
ok $row[0] = '3.63330';
ok $row[1] = '3.49289';
ok $row[2] = '0.00000';
ok $row[3] = '3.68733';
ok $row[4] = '5.84929';

my @diag   = $phy->get_diagonal;


ok $diag[0] = '0.00000';
ok $diag[1] = '0.00000';
ok $diag[2] = '0.00000';
ok $diag[3] = '0.00000';
ok $diag[4] = '0.00000';

my $matrix =<<END;
    5
Alpha          0.00000  4.23419  3.63330  6.20865  3.45431
Beta           4.23419  0.00000  3.49289  3.36540  4.29179
Gamma          3.63330  3.49289  0.00000  3.68733  5.84929
Delta          6.20865  3.36540  3.68733  0.00000  4.43345
Epsilon        3.45431  4.29179  5.84929  4.43345  0.00000
END
;
ok $phy->print_matrix , $matrix;