2 ## Bioperl Test Harness Script for Modules
5 # Before `make install' is performed this script should be runnable with
6 # `make test'. After `make install' it should work as `perl test.t'
12 # to handle systems with no installed Test module
13 # we include the t dir (where a copy of Test.pm is located)
15 eval { require Test; };
30 use Bio::Align::DNAStatistics;
31 use Bio::Align::ProteinStatistics;
32 use Bio::Align::Utilities qw(:all);
35 use Bio::Tree::DistanceFactory;
38 my $in = new Bio::AlignIO(-format => 'clustalw',
39 -file => Bio::Root::IO->catfile('t', 'data',
41 my $aln = $in->next_aln();
43 my $pstats = new Bio::Align::ProteinStatistics(-verbose => $debug);
44 my $matrix = $pstats->distance(-method => 'Kimura',
48 my $treebuilder = Bio::Tree::DistanceFactory->new(-method => 'NJ');
49 my $tree = $treebuilder->make_tree($matrix);
52 my ($cn) = $tree->find_node('183.m01790');
54 # brlens checked against tree generated by PHYLIP NJ
55 ok($tree->find_node('AN2438.1')->branch_length, '0.28221');
56 ok($tree->find_node('FG05298.1')->branch_length, '0.20593');
58 # simple topology test - make sure these 2 are sister
59 ok($tree->find_node('YOR262W')->ancestor->id,
60 $tree->find_node('Smik_Contig1103.1')->ancestor->id);
67 my $replicates = &bootstrap_replicates($aln,10);
68 ok(scalar @$replicates, 10);