~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to t/PhylipDist.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*-Perl-*-
2
 
## Bioperl Test Harness Script for Modules
3
 
 
4
 
 
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;
15
 
}
16
 
use Bio::Matrix::PhylipDist;
17
 
 
18
 
END {
19
 
    for ( $Test::ntest..$NTESTS ) {
20
 
        skip("Error in PhylipDist.pm",1);
21
 
    }
22
 
}
23
 
use Bio::Tools::Phylo::Phylip::ProtDist;
24
 
 
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);
28
 
 
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';
39
 
 
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';
46
 
 
47
 
my @diag   = $phy->get_diagonal;
48
 
 
49
 
 
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';
55
 
 
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
64
 
;
65
 
ok $phy->print_matrix , $matrix;
66
 
 
67
 
 
68
 
 
69