~ubuntu-branches/ubuntu/wily/bioperl-run/wily-proposed

« back to all changes in this revision

Viewing changes to t/QuickTree.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-09-03 11:00:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090903110003-11of27rxner5vnl9
Tags: 1.6.1-1
* New upstream release.
* debian/patches/10-wrong-path-for-interpreter.patch: removed
  (fixed upstream).
* debian/watch updated (bioperl -> BioPerl).
* debian/rules refreshed with dh-make-perl 0.53.
  - Disabled installation of examples (removed upstream).
  - Removed the correction of file permission of Pise documentation
    (removed upstream).
  - Removed patching facilities (no patches anymore).
  - Disabled tests as I experience failures with t/Eponine.t despite
    this program is not installed.
* debian/copyright:
  - Removed vanity lines about debianization and debian copyright.
  - Incremented years to 2009.
  - Updated to latest experimentation of the machine-readable license summary.
* debian/control:
  - Incremented Standards-Version to reflect conformance on new Policy
    (dropped versionned build-dependancy on Perl).
  - Removed build-dependancy on quilt (no patches anymore).
  - Depend and Build-Depend on bioperl versions superior or equal to 1.6.0.
  - Build-depends on, and Recommdnes libalgorithm-diff-perl, libipc-run-perl,
    libio-string-perl and libxml-twig-perl, that are listed in DEPENDANCIES.
  - Build-depends on libarray-compare-perl and libtree-dagnode-perl
    (otherwise tests fail). 
  - Depend on amap-align instead of amap (Closes: #541274).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*-
 
2
## Bioperl Test Harness Script for Modules
 
3
 
 
4
use strict;
 
5
 
 
6
BEGIN {
 
7
    use Bio::Root::Test;
 
8
    test_begin(-tests => 13);
 
9
    use_ok('Bio::Tools::Run::Phylo::QuickTree');
 
10
    use_ok('Bio::AlignIO');
 
11
}
 
12
 
 
13
 
 
14
# setup input files etc
 
15
my $inputfilename = test_input_file('cysprot.stockholm');
 
16
ok (-e $inputfilename, 'Found input file');
 
17
 
 
18
my $factory = Bio::Tools::Run::Phylo::QuickTree->new();
 
19
isa_ok($factory, 'Bio::Tools::Run::Phylo::QuickTree');
 
20
 
 
21
# test default factory values
 
22
is ($factory->program_dir, $ENV{'QUICKTREEDIR'}, 'program_dir returned correct default');
 
23
is ($factory->program_name(), 'quicktree', 'Correct exe default name');
 
24
 
 
25
# test the program itself
 
26
SKIP: {
 
27
    test_skip(-requires_executable => $factory,
 
28
              -tests => 7);
 
29
    
 
30
    # using filename input
 
31
    my $tree = $factory->run($inputfilename);
 
32
    isa_ok($tree, 'Bio::Tree::Tree');
 
33
    my @leaves = $tree->get_leaf_nodes;
 
34
    is (@leaves, 7, 'Result tree from filename input had correct number of leaves');
 
35
    
 
36
    # using align input
 
37
    my $alignio = Bio::AlignIO->new(-file => $inputfilename);
 
38
    my $aln = $alignio->next_aln;
 
39
    $tree = $factory->run($aln);
 
40
    @leaves = $tree->get_leaf_nodes;
 
41
    is (@leaves, 7, 'Result tree from SimpleAlign input had correct number of leaves');
 
42
    
 
43
    # do simple checks on possible options
 
44
    is ($factory->upgma(1), 1, 'UPGMA could be set');
 
45
    is ($factory->kimura(1), 1, 'kimura could be set');
 
46
    is ($factory->boot(100), 100, 'boot could be set');
 
47
    $tree = $factory->run($inputfilename);
 
48
    
 
49
    my @nodes = $tree->get_nodes;
 
50
    my %non_internal = map { $_ => 1 } ($tree->get_leaf_nodes, $tree->get_root_node);
 
51
    my @bootstraps;
 
52
    foreach my $node (@nodes) {
 
53
        next if exists $non_internal{$node};
 
54
        push(@bootstraps, $node->bootstrap);
 
55
    }
 
56
    is_deeply([sort { $a <=> $b } @bootstraps], [qw(74 84 100 100 100)], 'bootstraps were correct');
 
57
}