1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 13);
11 for my $mod ( qw(Bio::Align::DNAStatistics
12 Bio::Align::ProteinStatistics
15 Bio::Tree::DistanceFactory
21 my $debug = test_debug();
23 use Bio::Align::Utilities qw(:all);
25 my $in = Bio::AlignIO->new(-format => 'clustalw',
26 -file => test_input_file('pep-266.aln'));
27 my $aln = $in->next_aln();
28 isa_ok($aln, 'Bio::SimpleAlign','SimpleAlign object parsed out');
29 my $pstats = Bio::Align::ProteinStatistics->new(-verbose => $debug);
30 my $matrix = $pstats->distance(-method => 'Kimura',
32 isa_ok($matrix,'Bio::Matrix::MatrixI','Protein distance matrix retrieved');
34 my $treebuilder = Bio::Tree::DistanceFactory->new(-method => 'NJ');
35 my $tree = $treebuilder->make_tree($matrix);
36 isa_ok($tree,'Bio::Tree::TreeI', 'Tree object gotten back');
38 my ($cn) = $tree->find_node('183.m01790');
40 # brlens checked against tree generated by PHYLIP NJ
41 is($tree->find_node('AN2438.1')->branch_length, '0.28221','NJ calculated Branch length');
42 is($tree->find_node('FG05298.1')->branch_length, '0.20593','NJ calculated Branch length');
44 # simple topology test - make sure these 2 are sister
45 is($tree->find_node('YOR262W')->ancestor->id,
46 $tree->find_node('Smik_Contig1103.1')->ancestor->id, 'Make sure two nodes are sister');
53 my $replicates = &bootstrap_replicates($aln,10);
54 is(scalar @$replicates, 10,'10 replicates formulated');