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::FastTree');
15 use_ok('Bio::AlignIO');
18 ok (my $ft = Bio::Tools::Run::Phylo::FastTree->new( -quiet => 1 ),"Make the object");
22 -requires_executable => $ft,
26 # The input could be a SimpleAlign object
27 my $alignio = Bio::AlignIO->new(
29 -file => test_input_file('219877.cdna.fasta')
31 my $alnobj = $alignio->next_aln;
33 my $tree = $ft->run($alnobj);
34 ok( defined($tree), "Tree is defined" );
35 my @nodes = $tree->get_nodes;
36 is($#nodes,3,"Number of nodes is correct");
38 # The input could be an alignment file (fasta or phylip interleaved)
39 my $alignfile = test_input_file("sample_dataset_1_aligned.fa");
40 my $fastft = Bio::Tools::Run::Phylo::FastTree->new( -quiet => 1, -fastest => 1 );
41 $tree = $fastft->run($alignfile);
42 ok( defined($tree), "Tree is defined" );
44 my $slowft = Bio::Tools::Run::Phylo::FastTree->new(
50 $tree = $slowft->run($alignfile);
51 ok( defined($tree), "Tree is defined" );
53 # Input is protein sequence alignment
54 $alignio = Bio::AlignIO->new(
56 -file => test_input_file('cysprot.msf')
58 $alnobj = $alignio->next_aln;
60 my $ptree = $ft->run($alnobj);
61 ok( defined($tree), "Tree is defined" );