1 # This is -*-Perl-*- code
2 ## Bioperl Test Harness Script for Modules
3 # Before `./Build install' is performed this script should be runnable with
4 # `./Build test --test_files test.t'. After `./Build install' it should work as `perl test.t'
13 use_ok('Bio::Root::IO');
14 use_ok('Bio::Tools::Run::Phylo::Raxml');
15 use_ok('Bio::AlignIO');
18 END { unlink glob "RAxML_*.*"; }
20 ok(my $raxml = Bio::Tools::Run::Phylo::Raxml->new(-p => 100, -quiet => 1, -d => 1), "Make the object");
21 isa_ok( $raxml, 'Bio::Tools::Run::Phylo::Raxml');
25 -requires_executable => $raxml,
29 # The input could be an alignment file in phylip format
30 my $alignfile = test_input_file("testaln.phylip");
31 my $tree = $raxml->run($alignfile);
32 ok( defined($tree), "Tree is defined" );
34 # The working directory could be different, i.e. -w set
35 $raxml->w($raxml->tempdir);
36 $tree = $raxml->run($alignfile);
37 ok( defined($tree), "Tree is defined" );
38 my $out = $raxml->w . '/RAxML_bestTree.' . $raxml->outfile_name;
39 ok( -e $out, "File containing best tree exists in tempdir" );
41 # Test RAxML's rapid bootstrap option ( -f a )
42 $raxml = Bio::Tools::Run::Phylo::Raxml->new(-N => 100, -p => 12345, -quiet => 1, -f => 'a', -x => 1);
43 $tree = $raxml->run($alignfile);
44 ok( defined($tree), "Tree is defined" );
46 # The input could be a SimpleAlign object
47 my $alignio = Bio::AlignIO->new(
49 -file => test_input_file('testaln.phylip')
51 my $alnobj = $alignio->next_aln;
53 $raxml = Bio::Tools::Run::Phylo::Raxml->new(-p => 100, -quiet => 1, -d => 1);
54 $tree = $raxml->run($alnobj);
55 ok( defined($tree), "Tree is defined" );
56 my @nodes = $tree->get_nodes;
57 is($#nodes,5, "Number of nodes is correct");
59 # Input is protein sequence alignment
60 $alignio = Bio::AlignIO->new(
62 -file => test_input_file('cysprot.msf')
64 $alnobj = $alignio->next_aln;
66 $raxml = Bio::Tools::Run::Phylo::Raxml->new(-quiet => 1, -p => 100);
67 my $ptree = $raxml->run($alnobj);
68 ok( defined($ptree), "Tree is defined" );