1 # This is -*-Perl-*- code
2 ## Bioperl Test Harness Script for Modules
6 # Before `make install' is performed this script should be runnable with
7 # `make test'. After `make install' it should work as `perl test.t'
10 use vars qw($NUMTESTS $error);
13 # to handle systems with no installed Test module
14 # we include the t dir (where a copy of Test.pm is located)
16 eval { require Test; };
24 plan tests => $NUMTESTS;
25 eval { require IO::String;
26 require Bio::Tools::Phylo::Molphy;};
28 warn "No IO::String installed\n";
34 foreach ( $Test::ntest .. $NUMTESTS ) {
35 skip("Unable to run the Molphy tests",1);
45 ## End of black magic.
47 ## Insert additional test code below but remember to change
48 ## the print "1..x\n" in the BEGIN block to reflect the
49 ## total number of tests that will be run.
51 my $inmolphy = new Bio::Tools::Phylo::Molphy(-file => 't/data/lysozyme6.simple.protml');
53 my $r = $inmolphy->next_result;
56 ok($r->search_space,50);
58 while( my $t = $r->next_tree ) {
62 $inmolphy = new Bio::Tools::Phylo::Molphy(-file => 't/data/lysozyme6.protml');
64 $r = $inmolphy->next_result;
66 ok($r->search_space,50);
68 while( my $t = $r->next_tree ) {
73 ok($trees[0]->score, -1047.8);
74 ok($trees[-1]->id, 9);
76 my $tpm = $r->transition_probability_matrix;
77 ok($tpm->{'Val'}->{'Val'}, -122884);
78 ok($tpm->{'Ala'}->{'Arg'}, 2710);
80 my $sub_mat = $r->substitution_matrix;
81 ok($sub_mat->{'Val'}->{'Tyr'}, 50);
82 ok($sub_mat->{'Arg'}->{'Ile'}, 72);
83 ok($sub_mat->{'Met'}->{'Met'}, '');
85 my %fmat = $r->residue_frequencies();
86 ok($fmat{'D'}->[0], 0.052);