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 # The input could be a SimpleAlign object
42 my $alignio = Bio::AlignIO->new(
44 -file => test_input_file('testaln.phylip')
46 my $alnobj = $alignio->next_aln;
48 $raxml = Bio::Tools::Run::Phylo::Raxml->new(-p => 100, -quiet => 1, -d => 1);
49 $tree = $raxml->run($alnobj);
50 ok( defined($tree), "Tree is defined" );
51 my @nodes = $tree->get_nodes;
52 is($#nodes,5, "Number of nodes is correct");
54 # Input is protein sequence alignment
55 $alignio = Bio::AlignIO->new(
57 -file => test_input_file('cysprot.msf')
59 $alnobj = $alignio->next_aln;
61 $raxml = Bio::Tools::Run::Phylo::Raxml->new(-quiet => 1, -p => 100);
62 my $ptree = $raxml->run($alnobj);
63 ok( defined($ptree), "Tree is defined" );