don't call executable()
[bioperl-run.git] / t / MAFFT.t
blob294f7e9ff0063afd9fb2f9fc265de509c7c2b80a
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
3 ## $Id$
5 use strict;
6 use vars qw($DEBUG);
7 $DEBUG = test_debug();
8 BEGIN {
9     use Bio::Root::Test;
10     test_begin(-tests => 17);
11         use_ok(' Bio::Tools::Run::Alignment::MAFFT');
12         use_ok(' Bio::AlignIO');
13         use_ok(' Bio::SeqIO');  
16 END { unlink qw(cysprot.dnd cysprot1a.dnd) }
18 my @params = (-verbose => $DEBUG, 'quiet' => 1);
19 my  $factory = Bio::Tools::Run::Alignment::MAFFT->new(@params);
21 isa_ok $factory,'Bio::Tools::Run::Alignment::MAFFT';
23 my $inputfilename = test_input_file("cysprot.fa");
24 my $aln;
26 SKIP: {
27         test_skip(-requires_executable => $factory,
28                           -tests => 13);
29         
30         $factory->executable($factory->method);
32         test_skip(-requires_executable => $factory,
33                           -tests => 13);
34         
35         my $version = $factory->version;
36         ok($version);
37         $aln = $factory->align($inputfilename);
38         ok($aln);
39         is( $aln->num_sequences, 7);
40         
41         my $str = Bio::SeqIO->new('-file' => 
42                                   test_input_file("cysprot.fa"), 
43                                   '-format' => 'Fasta');
44         my @seq_array =();
45         
46         while ( my $seq = $str->next_seq() ) {
47                 push (@seq_array, $seq) ;
48         }
49         
50         my $seq_array_ref = \@seq_array;
51         
52         $aln = $factory->align($seq_array_ref);
53         is $aln->num_sequences, 7;
54         my $s1_perid = $aln->average_percentage_identity;
55         cmp_ok(int($s1_perid), '>=', 42, '42 or 43 expected');
56         
57         for my $method ( grep { !/rough/ } $factory->methods ) {
58                 $factory->method($method);
59                 $aln = $factory->align($inputfilename);
60                 is $aln->num_sequences, 7;
61                 my $s1_perid = $aln->average_percentage_identity;
62                 ok($s1_perid);
63         }