1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
##
my $error;
use strict;
BEGIN {
# to handle systems with no installed Test module
# we include the t dir (where a copy of Test.pm is located)
# as a fallback
$error = 0;
eval { require Test; };
if( $@ ) {
use lib 't';
}
use Test;
plan tests => 4;
}
use Bio::Tree::RandomFactory;
use Bio::TreeIO;
use Bio::Tree::Statistics;
ok(1);
use vars qw($FILE1);
$FILE1 = 'out.tre';
END { unlink $FILE1; }
my $ssize = 10;
my $factory = new Bio::Tree::RandomFactory(-sample_size => $ssize);
my $tree = $factory->next_tree;
ok($tree->get_nodes, ($ssize * 2 - 1));
my $treeio = new Bio::TreeIO(-format => 'newick', -file => ">$FILE1");
$treeio->write_tree($tree);
undef $treeio;
ok(-s $FILE1);
my $mutcount = 100;
$factory->add_Mutations($tree, $mutcount);
my $stats = new Bio::Tree::Statistics();
my $D = $stats->fu_and_li_D($tree);
ok($D);
|