2 ## Bioperl Test Harness Script for Modules
9 test_begin(-tests => 18);
10 use_ok('Bio::Tools::Run::Alignment::DBA');
11 use_ok('Bio::SimpleAlign');
12 use_ok('Bio::AlignIO');
17 my @params = ('matchA' => 0.75, 'matchB' => '0.55','dymem'=>'linear');
18 my $factory = Bio::Tools::Run::Alignment::DBA->new(@params);
21 test_skip(-requires_executable => $factory,
24 isa_ok $factory,'Bio::Tools::Run::Alignment::DBA';
26 $factory->quiet($bequiet); # Suppress clustal messages to terminal
28 #test with one file with 2 sequences
29 my $inputfilename_1a = test_input_file("dba1a.fa");
30 my $inputfilename_1b = test_input_file("dba1b.fa");
31 my $inputfilename2 = test_input_file("dba2.fa");
33 my @hsps = $factory->align($inputfilename2);
34 isa_ok($hsps[0],"Bio::Search::HSP::GenericHSP");
35 is($hsps[0]->query->start,4);
36 is($hsps[0]->query->end,209);
39 #test with 2 files of 1 sequence each
40 my @files = ($inputfilename_1a,$inputfilename_1b);
41 @hsps = $factory->align(\@files);
42 is($hsps[0]->query->start,3);
43 is($hsps[0]->query->end,88);
45 is($hsps[1]->hit->start,90);
46 is($hsps[1]->hit->end,195);
49 #test with an array of 2 PrimarySeqI objects
51 my $str = Bio::SeqIO->new(-file=> test_input_file("dba2.fa"), '-format' => 'Fasta');
54 while ( my $seq = $str->next_seq() ) {
55 push (@seq_array, $seq) ;
57 @hsps = $factory->align(\@seq_array);
58 is($hsps[0]->query->start,4);
59 is($hsps[0]->query->end,209);